]> git.sesse.net Git - ffmpeg/commitdiff
dnn: Add ff_ prefix to unnamespaced globals
authorMark Thompson <sw@jkqxz.net>
Thu, 21 Jan 2021 21:39:55 +0000 (21:39 +0000)
committerGuo, Yejun <yejun.guo@intel.com>
Fri, 22 Jan 2021 07:03:09 +0000 (15:03 +0800)
Reviewed-By: Guo, Yejun <yejun.guo@intel.com>
20 files changed:
libavfilter/dnn/dnn_backend_native.c
libavfilter/dnn/dnn_backend_native.h
libavfilter/dnn/dnn_backend_native_layer_avgpool.c
libavfilter/dnn/dnn_backend_native_layer_avgpool.h
libavfilter/dnn/dnn_backend_native_layer_conv2d.c
libavfilter/dnn/dnn_backend_native_layer_conv2d.h
libavfilter/dnn/dnn_backend_native_layer_dense.c
libavfilter/dnn/dnn_backend_native_layer_dense.h
libavfilter/dnn/dnn_backend_native_layer_depth2space.c
libavfilter/dnn/dnn_backend_native_layer_depth2space.h
libavfilter/dnn/dnn_backend_native_layer_mathbinary.c
libavfilter/dnn/dnn_backend_native_layer_mathbinary.h
libavfilter/dnn/dnn_backend_native_layer_mathunary.c
libavfilter/dnn/dnn_backend_native_layer_mathunary.h
libavfilter/dnn/dnn_backend_native_layer_maximum.c
libavfilter/dnn/dnn_backend_native_layer_maximum.h
libavfilter/dnn/dnn_backend_native_layer_pad.c
libavfilter/dnn/dnn_backend_native_layer_pad.h
libavfilter/dnn/dnn_backend_native_layers.c
libavfilter/dnn/dnn_backend_native_layers.h

index be43081170dc0b357b22e4c4ae7a9c344974276c..1f89ee4110df46c79ce75538d1b20d8ba3272aa0 100644 (file)
@@ -208,7 +208,7 @@ DNNModel *ff_dnn_load_model_native(const char *model_filename, const char *optio
         }
 
         native_model->layers[layer].type = layer_type;
-        parsed_size = layer_funcs[layer_type].pf_load(&native_model->layers[layer], model_file_context, file_size, native_model->operands_num);
+        parsed_size = ff_layer_funcs[layer_type].pf_load(&native_model->layers[layer], model_file_context, file_size, native_model->operands_num);
         if (!parsed_size) {
             goto fail;
         }
@@ -300,7 +300,7 @@ static DNNReturnType execute_model_native(const DNNModel *model, const char *inp
     oprd->dims[2] = in_frame->width;
 
     av_freep(&oprd->data);
-    oprd->length = calculate_operand_data_length(oprd);
+    oprd->length = ff_calculate_operand_data_length(oprd);
     if (oprd->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The input data length overflow\n");
         return DNN_ERROR;
@@ -333,7 +333,7 @@ static DNNReturnType execute_model_native(const DNNModel *model, const char *inp
 
     for (layer = 0; layer < native_model->layers_num; ++layer){
         DNNLayerType layer_type = native_model->layers[layer].type;
-        if (layer_funcs[layer_type].pf_exec(native_model->operands,
+        if (ff_layer_funcs[layer_type].pf_exec(native_model->operands,
                                             native_model->layers[layer].input_operand_indexes,
                                             native_model->layers[layer].output_operand_index,
                                             native_model->layers[layer].params,
@@ -398,7 +398,7 @@ DNNReturnType ff_dnn_execute_model_native(const DNNModel *model, const char *inp
     return execute_model_native(model, input_name, in_frame, output_names, nb_output, out_frame, 1);
 }
 
-int32_t calculate_operand_dims_count(const DnnOperand *oprd)
+int32_t ff_calculate_operand_dims_count(const DnnOperand *oprd)
 {
     int32_t result = 1;
     for (int i = 0; i < 4; ++i)
@@ -407,7 +407,7 @@ int32_t calculate_operand_dims_count(const DnnOperand *oprd)
     return result;
 }
 
-int32_t calculate_operand_data_length(const DnnOperand* oprd)
+int32_t ff_calculate_operand_data_length(const DnnOperand* oprd)
 {
     // currently, we just support DNN_FLOAT
     uint64_t len = sizeof(float);
index 5acdbe0da7d3442d02575a76c19ced60e87fef6e..5c8ce82b35a0dd0f415910c32e6627180b5820c2 100644 (file)
@@ -137,6 +137,6 @@ void ff_dnn_free_model_native(DNNModel **model);
 
 // NOTE: User must check for error (return value <= 0) to handle
 // case like integer overflow.
-int32_t calculate_operand_data_length(const DnnOperand *oprd);
-int32_t calculate_operand_dims_count(const DnnOperand *oprd);
+int32_t ff_calculate_operand_data_length(const DnnOperand *oprd);
+int32_t ff_calculate_operand_dims_count(const DnnOperand *oprd);
 #endif
index 989006d797bbe7b4d079d9fd51dacc4c9fde3250..8164bb45a6ce19b13b47ee3e328444cb73a047ac 100644 (file)
@@ -26,7 +26,7 @@
 #include "libavutil/avassert.h"
 #include "dnn_backend_native_layer_avgpool.h"
 
-int dnn_load_layer_avg_pool(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_avg_pool(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     AvgPoolParams *avgpool_params;
     int dnn_size = 0;
@@ -55,8 +55,8 @@ int dnn_load_layer_avg_pool(Layer *layer, AVIOContext *model_file_context, int f
     return dnn_size;
 }
 
-int dnn_execute_layer_avg_pool(DnnOperand *operands, const int32_t *input_operand_indexes,
-                             int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_avg_pool(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                  int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     float *output;
     int height_end, width_end, height_radius, width_radius, output_height, output_width, kernel_area;
@@ -106,7 +106,7 @@ int dnn_execute_layer_avg_pool(DnnOperand *operands, const int32_t *input_operan
     // not support pooling in channel dimension now
     output_operand->dims[3] = channel;
     output_operand->data_type = operands[input_operand_index].data_type;
-    output_operand->length = calculate_operand_data_length(output_operand);
+    output_operand->length = ff_calculate_operand_data_length(output_operand);
     if (output_operand->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
index 543370ff3bb737d92426bc4f6a7f87a72b52449c..75d9eb187b49d9ba67a0269dfcd634cca11bcf2a 100644 (file)
@@ -33,8 +33,8 @@ typedef struct AvgPoolParams{
     DNNPaddingParam padding_method;
 } AvgPoolParams;
 
-int dnn_load_layer_avg_pool(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_avg_pool(DnnOperand *operands, const int32_t *input_operand_indexes,
-                             int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_avg_pool(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_avg_pool(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                  int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 
 #endif
index 9dc50b7cbe8ec778b3891beac376bb1483a0dd86..210db7c77e96e5c05ad7e70f31c48ee9786b8588 100644 (file)
@@ -40,7 +40,7 @@ typedef struct ThreadParam{
     int thread_start, thread_end;
 } ThreadParam;
 
-int dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     ConvolutionalParams *conv_params;
     int kernel_size;
@@ -181,8 +181,8 @@ static void * dnn_execute_layer_conv2d_thread(void *threadarg)
 }
 
 
-int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_indexes,
-                             int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     int thread_num = (ctx->options.conv2d_threads <= 0 || ctx->options.conv2d_threads > av_cpu_count())
         ? (av_cpu_count() + 1) : (ctx->options.conv2d_threads);
@@ -203,7 +203,7 @@ int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_
     output_operand->dims[2] = width - pad_size * 2;
     output_operand->dims[3] = conv_params->output_num;
     output_operand->data_type = operands[input_operand_indexes[0]].data_type;
-    output_operand->length = calculate_operand_data_length(output_operand);
+    output_operand->length = ff_calculate_operand_data_length(output_operand);
     if (output_operand->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
index 1295028c469047877012e4c8b84ab0726d213134..03ca795c6181b00239b9b8f805fcf40c2727fdb2 100644 (file)
@@ -34,7 +34,7 @@ typedef struct ConvolutionalParams{
     float *biases;
 } ConvolutionalParams;
 
-int dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_indexes,
-                             int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 #endif
index 1029137792626cfd7703008d0d31623e013c1a67..8629b52cfb27f3381e9a56796f7a555954b20650 100644 (file)
@@ -21,7 +21,7 @@
 #include "libavutil/avassert.h"
 #include "dnn_backend_native_layer_dense.h"
 
-int dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     DenseParams *dense_params;
     int kernel_size;
@@ -82,8 +82,8 @@ int dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file
     return dnn_size;
 }
 
-int dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes,
-                             int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes,
+                               int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     float *output;
     int32_t input_operand_index = input_operand_indexes[0];
@@ -101,7 +101,7 @@ int dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_i
     output_operand->dims[2] = width;
     output_operand->dims[3] = dense_params->output_num;
     output_operand->data_type = operands[input_operand_index].data_type;
-    output_operand->length = calculate_operand_data_length(output_operand);
+    output_operand->length = ff_calculate_operand_data_length(output_operand);
     if (output_operand->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
index f98284b15483446faa063d8568eb474a465386a6..86248856ae7b6da2904f5a1e9fda5a1b39bda435 100644 (file)
@@ -31,7 +31,7 @@ typedef struct DenseParams{
     float *biases;
 } DenseParams;
 
-int dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes,
-                             int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes,
+                               int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 #endif
index 4107ee6caeca3f5b7787de93e956fa4755f3b4c7..26942eb3ab5b1719c523f8f2a6f05c4ece592601 100644 (file)
@@ -27,7 +27,7 @@
 #include "libavutil/avassert.h"
 #include "dnn_backend_native_layer_depth2space.h"
 
-int dnn_load_layer_depth2space(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_depth2space(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     DepthToSpaceParams *params;
     int dnn_size = 0;
@@ -49,8 +49,8 @@ int dnn_load_layer_depth2space(Layer *layer, AVIOContext *model_file_context, in
     return dnn_size;
 }
 
-int dnn_execute_layer_depth2space(DnnOperand *operands, const int32_t *input_operand_indexes,
-                                  int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_depth2space(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                     int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     float *output;
     const DepthToSpaceParams *params = (const DepthToSpaceParams *)parameters;
@@ -74,7 +74,7 @@ int dnn_execute_layer_depth2space(DnnOperand *operands, const int32_t *input_ope
     output_operand->dims[2] = width * block_size;
     output_operand->dims[3] = new_channels;
     output_operand->data_type = operands[input_operand_index].data_type;
-    output_operand->length = calculate_operand_data_length(output_operand);
+    output_operand->length = ff_calculate_operand_data_length(output_operand);
     if (output_operand->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
index 648a927f2dffeda0d96ee27a3ba03155e507cea2..ef5939444372f5ca3085ce68dac2039c74ac0c2c 100644 (file)
@@ -34,8 +34,8 @@ typedef struct DepthToSpaceParams{
     int block_size;
 } DepthToSpaceParams;
 
-int dnn_load_layer_depth2space(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_depth2space(DnnOperand *operands, const int32_t *input_operand_indexes,
-                                  int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_depth2space(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_depth2space(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                     int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 
 #endif
index fc48242093916e155179743789acc15ffc8b9254..2a23bfaa7762ced174de9b15bdca104b27a5930f 100644 (file)
@@ -59,7 +59,7 @@ static void math_binary_commutative(FunType pfun, const DnnLayerMathBinaryParams
     int dims_count;
     const float *src;
     float *dst;
-    dims_count = calculate_operand_dims_count(output);
+    dims_count = ff_calculate_operand_dims_count(output);
     src = input->data;
     dst = output->data;
     if (params->input0_broadcast || params->input1_broadcast) {
@@ -79,7 +79,7 @@ static void math_binary_not_commutative(FunType pfun, const DnnLayerMathBinaryPa
     int dims_count;
     const float *src;
     float *dst;
-    dims_count = calculate_operand_dims_count(output);
+    dims_count = ff_calculate_operand_dims_count(output);
     src = input->data;
     dst = output->data;
     if (params->input0_broadcast) {
@@ -98,7 +98,7 @@ static void math_binary_not_commutative(FunType pfun, const DnnLayerMathBinaryPa
         }
     }
 }
-int dnn_load_layer_math_binary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_math_binary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     DnnLayerMathBinaryParams *params;
     int dnn_size = 0;
@@ -147,8 +147,8 @@ int dnn_load_layer_math_binary(Layer *layer, AVIOContext *model_file_context, in
     return dnn_size;
 }
 
-int dnn_execute_layer_math_binary(DnnOperand *operands, const int32_t *input_operand_indexes,
-                                 int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_math_binary(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                     int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     const DnnOperand *input = &operands[input_operand_indexes[0]];
     DnnOperand *output = &operands[output_operand_index];
@@ -158,7 +158,7 @@ int dnn_execute_layer_math_binary(DnnOperand *operands, const int32_t *input_ope
         output->dims[i] = input->dims[i];
 
     output->data_type = input->data_type;
-    output->length = calculate_operand_data_length(output);
+    output->length = ff_calculate_operand_data_length(output);
     if (output->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
index bb97ba2dcae9609b00f537b710b305a9b012e214..eee294b00f91d98f0381d9df1ba0957691175aa7 100644 (file)
@@ -47,8 +47,8 @@ typedef struct DnnLayerMathBinaryParams{
     float v;
 } DnnLayerMathBinaryParams;
 
-int dnn_load_layer_math_binary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_math_binary(DnnOperand *operands, const int32_t *input_operand_indexes,
-                                 int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_math_binary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_math_binary(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                     int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 
 #endif
index ae5d4daae90bfa6985cf7b3ca51a3a178f80ac5d..77e36c6ed3b89fcee3b307e585366dc094347580 100644 (file)
@@ -29,7 +29,7 @@
 #include "libavutil/avassert.h"
 #include "dnn_backend_native_layer_mathunary.h"
 
-int dnn_load_layer_math_unary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_math_unary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     DnnLayerMathUnaryParams *params;
     int dnn_size = 0;
@@ -52,8 +52,8 @@ int dnn_load_layer_math_unary(Layer *layer, AVIOContext *model_file_context, int
 
 }
 
-int dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_operand_indexes,
-                                int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                    int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     const DnnOperand *input = &operands[input_operand_indexes[0]];
     DnnOperand *output = &operands[output_operand_index];
@@ -66,7 +66,7 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_oper
         output->dims[i] = input->dims[i];
 
     output->data_type = input->data_type;
-    output->length = calculate_operand_data_length(output);
+    output->length = ff_calculate_operand_data_length(output);
     if (output->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
@@ -77,7 +77,7 @@ int dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_oper
         return DNN_ERROR;
     }
 
-    dims_count = calculate_operand_dims_count(output);
+    dims_count = ff_calculate_operand_dims_count(output);
     src = input->data;
     dst = output->data;
 
index 301d02e5fb450b370a4830339dbf1e13af8156a4..2199931e6e895763fd61cfc05b4243924ff8798d 100644 (file)
@@ -53,8 +53,8 @@ typedef struct DnnLayerMathUnaryParams{
     DNNMathUnaryOperation un_op;
 } DnnLayerMathUnaryParams;
 
-int dnn_load_layer_math_unary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_operand_indexes,
-                                int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_math_unary(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_math_unary(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                    int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 
 #endif
index 7ad5a22969898d8a9241d8b2311ad7fbf90dffe2..baae889755e0f69680d835d4167027920408ab5b 100644 (file)
@@ -27,7 +27,7 @@
 #include "libavutil/avassert.h"
 #include "dnn_backend_native_layer_maximum.h"
 
-int dnn_load_layer_maximum(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_maximum(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     DnnLayerMaximumParams *params;
     int dnn_size = 0;
@@ -49,8 +49,8 @@ int dnn_load_layer_maximum(Layer *layer, AVIOContext *model_file_context, int fi
     return dnn_size;
 }
 
-int dnn_execute_layer_maximum(DnnOperand *operands, const int32_t *input_operand_indexes,
-                              int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_maximum(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                 int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     const DnnOperand *input = &operands[input_operand_indexes[0]];
     DnnOperand *output = &operands[output_operand_index];
@@ -63,7 +63,7 @@ int dnn_execute_layer_maximum(DnnOperand *operands, const int32_t *input_operand
         output->dims[i] = input->dims[i];
 
     output->data_type = input->data_type;
-    output->length = calculate_operand_data_length(output);
+    output->length = ff_calculate_operand_data_length(output);
     if (output->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
@@ -74,7 +74,7 @@ int dnn_execute_layer_maximum(DnnOperand *operands, const int32_t *input_operand
         return DNN_ERROR;
     }
 
-    dims_count = calculate_operand_dims_count(output);
+    dims_count = ff_calculate_operand_dims_count(output);
     src = input->data;
     dst = output->data;
     for (int i = 0; i < dims_count; ++i)
index be63a3ab5b0256d4e640964150ddd9b3391c2fbc..523acbe05fc0a36cdf8e8f7a256fe9e53571bdc4 100644 (file)
@@ -37,8 +37,8 @@ typedef struct DnnLayerMaximumParams{
     }val;
 } DnnLayerMaximumParams;
 
-int dnn_load_layer_maximum(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_maximum(DnnOperand *operands, const int32_t *input_operand_indexes,
-                              int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_maximum(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_maximum(DnnOperand *operands, const int32_t *input_operand_indexes,
+                                 int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 
 #endif
index 05892d43f4f012ceaaff7100848cf80af50abdba..8d5d47883af83504367ebac63975069060d7ea1a 100644 (file)
@@ -22,7 +22,7 @@
 #include "libavutil/avassert.h"
 #include "dnn_backend_native_layer_pad.h"
 
-int dnn_load_layer_pad(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
+int ff_dnn_load_layer_pad(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num)
 {
     LayerPadParams *params;
     int dnn_size = 0;
@@ -75,8 +75,8 @@ static int after_get_buddy(int given, int border, LayerPadModeParam mode)
     }
 }
 
-int dnn_execute_layer_pad(DnnOperand *operands, const int32_t *input_operand_indexes,
-                          int32_t output_operand_index, const void *parameters, NativeContext *ctx)
+int ff_dnn_execute_layer_pad(DnnOperand *operands, const int32_t *input_operand_indexes,
+                             int32_t output_operand_index, const void *parameters, NativeContext *ctx)
 {
     int32_t before_paddings;
     int32_t after_paddings;
@@ -110,7 +110,7 @@ int dnn_execute_layer_pad(DnnOperand *operands, const int32_t *input_operand_ind
     output_operand->dims[2] = new_width;
     output_operand->dims[3] = new_channel;
     output_operand->data_type = operands[input_operand_index].data_type;
-    output_operand->length = calculate_operand_data_length(output_operand);
+    output_operand->length = ff_calculate_operand_data_length(output_operand);
     if (output_operand->length <= 0) {
         av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n");
         return DNN_ERROR;
index 6c69211824fcc96d90f34c48244fe89e8ba06792..4f76c67c3f62e48e0e515079af15b28d8188f7b8 100644 (file)
@@ -36,8 +36,8 @@ typedef struct LayerPadParams{
     float constant_values;
 } LayerPadParams;
 
-int dnn_load_layer_pad(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
-int dnn_execute_layer_pad(DnnOperand *operands, const int32_t *input_operand_indexes,
-                          int32_t output_operand_index, const void *parameters, NativeContext *ctx);
+int ff_dnn_load_layer_pad(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num);
+int ff_dnn_execute_layer_pad(DnnOperand *operands, const int32_t *input_operand_indexes,
+                             int32_t output_operand_index, const void *parameters, NativeContext *ctx);
 
 #endif
index a23b34f823616d32853f67a30a0f6ea036ca99c5..492939fd366a4ad697883a19e969ed2cf6ad6748 100644 (file)
 #include "dnn_backend_native_layer_avgpool.h"
 #include "dnn_backend_native_layer_dense.h"
 
-const LayerFunc layer_funcs[DLT_COUNT] = {
+const LayerFunc ff_layer_funcs[DLT_COUNT] = {
     {NULL, NULL},
-    {dnn_execute_layer_conv2d,      dnn_load_layer_conv2d},
-    {dnn_execute_layer_depth2space, dnn_load_layer_depth2space},
-    {dnn_execute_layer_pad,         dnn_load_layer_pad},
-    {dnn_execute_layer_maximum,     dnn_load_layer_maximum},
-    {dnn_execute_layer_math_binary, dnn_load_layer_math_binary},
-    {dnn_execute_layer_math_unary,  dnn_load_layer_math_unary},
-    {dnn_execute_layer_avg_pool,  dnn_load_layer_avg_pool},
-    {dnn_execute_layer_dense,  dnn_load_layer_dense},
+    {ff_dnn_execute_layer_conv2d,      ff_dnn_load_layer_conv2d},
+    {ff_dnn_execute_layer_depth2space, ff_dnn_load_layer_depth2space},
+    {ff_dnn_execute_layer_pad,         ff_dnn_load_layer_pad},
+    {ff_dnn_execute_layer_maximum,     ff_dnn_load_layer_maximum},
+    {ff_dnn_execute_layer_math_binary, ff_dnn_load_layer_math_binary},
+    {ff_dnn_execute_layer_math_unary,  ff_dnn_load_layer_math_unary},
+    {ff_dnn_execute_layer_avg_pool,    ff_dnn_load_layer_avg_pool},
+    {ff_dnn_execute_layer_dense,       ff_dnn_load_layer_dense},
 };
index b9e8a131d52e8486c89389f4a44330b898dd092f..bbd02927c2a94c2d1f761d3bb07d2051d372ff0f 100644 (file)
@@ -33,6 +33,6 @@ typedef struct LayerFunc {
     LAYER_LOAD_FUNC pf_load;
 }LayerFunc;
 
-extern const LayerFunc layer_funcs[DLT_COUNT];
+extern const LayerFunc ff_layer_funcs[DLT_COUNT];
 
 #endif