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