Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -26,19 +26,19 @@ · 25 unmodified lines | ||
| 26 | 26 | #define CLAMP_TO_EDGE(x, w) ((x) < 0 ? 0 : ((x) >= (w) ? (w - 1) : (x))) |
| 27 | 27 | |
| 28 | 28 | //struct to pass parameters |
| 29 | −typedef struct thread_common_param{ | |
| 29 | +typedef struct ThreadCommonParam{ | |
| 30 | 30 | DnnOperand *operands; |
| 31 | 31 | const int32_t *input_operand_indexes; |
| 32 | 32 | int32_t output_operand_index; |
| 33 | 33 | const void *parameters; |
| 34 | 34 | NativeContext *ctx; |
| 35 | 35 | float *output_data; |
| 36 | −} thread_common_param; | |
| 36 | +} ThreadCommonParam; | |
| 37 | 37 | |
| 38 | −typedef struct thread_param{ | |
| 39 | − thread_common_param *thread_common_param; | |
| 38 | +typedef struct ThreadParam{ | |
| 39 | + ThreadCommonParam *thread_common_param; | |
| 40 | 40 | int thread_start, thread_end; |
| 41 | −} thread_param; | |
| 41 | +} ThreadParam; | |
| 42 | 42 | |
| 43 | 43 | int dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num) |
| 44 | 44 | { |
| @@ -108,8 +108,8 @@ int dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int fil · 63 unmodified lines | ||
| 108 | 108 | static void * dnn_execute_layer_conv2d_thread(void *threadarg) |
| 109 | 109 | { |
| 110 | 110 | //pass parameters |
| 111 | − thread_param *thread_param = (struct thread_param *)threadarg; | |
| 112 | − thread_common_param *thread_common_param = thread_param->thread_common_param; | |
| 111 | + ThreadParam *thread_param = threadarg; | |
| 112 | + ThreadCommonParam *thread_common_param = thread_param->thread_common_param; | |
| 113 | 113 | DnnOperand *operands = thread_common_param->operands; |
| 114 | 114 | int32_t input_operand_index = thread_common_param->input_operand_indexes[0]; |
| 115 | 115 | int height = operands[input_operand_index].dims[1]; |
| @@ -190,8 +190,8 @@ int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_ · 74 unmodified lines | ||
| 190 | 190 | pthread_t *thread_id = av_malloc(thread_num * sizeof(pthread_t)); |
| 191 | 191 | int thread_stride; |
| 192 | 192 | #endif |
| 193 | − thread_param **thread_param = av_malloc(thread_num * sizeof(*thread_param)); | |
| 194 | − thread_common_param thread_common_param; | |
| 193 | + ThreadParam **thread_param = av_malloc(thread_num * sizeof(*thread_param)); | |
| 194 | + ThreadCommonParam thread_common_param; | |
| 195 | 195 | const ConvolutionalParams *conv_params = (const ConvolutionalParams *)(parameters); |
| 196 | 196 | int height = operands[input_operand_indexes[0]].dims[1]; |
| 197 | 197 | int width = operands[input_operand_indexes[0]].dims[2]; |