diff mbox series

[FFmpeg-devel,4/5] dnn: Add ff_ prefix to unnamespaced globals

Message ID 20210121213956.991629-4-sw@jkqxz.net
State Accepted
Headers show
Series [FFmpeg-devel,1/5] dnn: Delete unused global variable
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate fail Make fate failed
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

Mark Thompson Jan. 21, 2021, 9:39 p.m. UTC
---
 libavfilter/dnn/dnn_backend_native.c           | 10 +++++-----
 libavfilter/dnn/dnn_backend_native.h           |  4 ++--
 .../dnn/dnn_backend_native_layer_avgpool.c     |  8 ++++----
 .../dnn/dnn_backend_native_layer_avgpool.h     |  6 +++---
 .../dnn/dnn_backend_native_layer_conv2d.c      |  8 ++++----
 .../dnn/dnn_backend_native_layer_conv2d.h      |  6 +++---
 .../dnn/dnn_backend_native_layer_dense.c       |  8 ++++----
 .../dnn/dnn_backend_native_layer_dense.h       |  6 +++---
 .../dnn/dnn_backend_native_layer_depth2space.c |  8 ++++----
 .../dnn/dnn_backend_native_layer_depth2space.h |  6 +++---
 .../dnn/dnn_backend_native_layer_mathbinary.c  | 12 ++++++------
 .../dnn/dnn_backend_native_layer_mathbinary.h  |  6 +++---
 .../dnn/dnn_backend_native_layer_mathunary.c   | 10 +++++-----
 .../dnn/dnn_backend_native_layer_mathunary.h   |  6 +++---
 .../dnn/dnn_backend_native_layer_maximum.c     | 10 +++++-----
 .../dnn/dnn_backend_native_layer_maximum.h     |  6 +++---
 libavfilter/dnn/dnn_backend_native_layer_pad.c |  8 ++++----
 libavfilter/dnn/dnn_backend_native_layer_pad.h |  6 +++---
 libavfilter/dnn/dnn_backend_native_layers.c    | 18 +++++++++---------
 libavfilter/dnn/dnn_backend_native_layers.h    |  2 +-
 20 files changed, 77 insertions(+), 77 deletions(-)

Comments

Guo, Yejun Jan. 22, 2021, 7:04 a.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Mark
> Thompson
> Sent: 2021年1月22日 5:40
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH 4/5] dnn: Add ff_ prefix to unnamespaced
> globals
> 
> ---
>  libavfilter/dnn/dnn_backend_native.c           | 10 +++++-----
>  libavfilter/dnn/dnn_backend_native.h           |  4 ++--
>  .../dnn/dnn_backend_native_layer_avgpool.c     |  8 ++++----
>  .../dnn/dnn_backend_native_layer_avgpool.h     |  6 +++---
>  .../dnn/dnn_backend_native_layer_conv2d.c      |  8 ++++----
>  .../dnn/dnn_backend_native_layer_conv2d.h      |  6 +++---
>  .../dnn/dnn_backend_native_layer_dense.c       |  8 ++++----
>  .../dnn/dnn_backend_native_layer_dense.h       |  6 +++---
>  .../dnn/dnn_backend_native_layer_depth2space.c |  8
> ++++----  .../dnn/dnn_backend_native_layer_depth2space.h |  6
> +++---  .../dnn/dnn_backend_native_layer_mathbinary.c  | 12
> ++++++------  .../dnn/dnn_backend_native_layer_mathbinary.h  |  6 +++---
>  .../dnn/dnn_backend_native_layer_mathunary.c   | 10 +++++-----
>  .../dnn/dnn_backend_native_layer_mathunary.h   |  6 +++---
>  .../dnn/dnn_backend_native_layer_maximum.c     | 10 +++++-----
>  .../dnn/dnn_backend_native_layer_maximum.h     |  6 +++---
>  libavfilter/dnn/dnn_backend_native_layer_pad.c |  8 ++++----
> libavfilter/dnn/dnn_backend_native_layer_pad.h |  6 +++---
>  libavfilter/dnn/dnn_backend_native_layers.c    | 18 +++++++++---------
>  libavfilter/dnn/dnn_backend_native_layers.h    |  2 +-
>  20 files changed, 77 insertions(+), 77 deletions(-)
> 
> diff --git a/libavfilter/dnn/dnn_backend_native.c
> b/libavfilter/dnn/dnn_backend_native.c
> index 0094ec5444..924f5a44ad 100644
> --- a/libavfilter/dnn/dnn_backend_native.c
> +++ b/libavfilter/dnn/dnn_backend_native.c

missed change in file tests/dnn/dnn-layer-*-test.c, will help to rebase, update test files, and push soon.
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_backend_native.c b/libavfilter/dnn/dnn_backend_native.c
index 0094ec5444..924f5a44ad 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -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);
diff --git a/libavfilter/dnn/dnn_backend_native.h b/libavfilter/dnn/dnn_backend_native.h
index 5acdbe0da7..5c8ce82b35 100644
--- a/libavfilter/dnn/dnn_backend_native.h
+++ b/libavfilter/dnn/dnn_backend_native.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_avgpool.c b/libavfilter/dnn/dnn_backend_native_layer_avgpool.c
index 989006d797..8164bb45a6 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_avgpool.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_avgpool.c
@@ -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;
diff --git a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h
index 543370ff3b..75d9eb187b 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_avgpool.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
index 0fb968a1fc..549984df49 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c
@@ -40,7 +40,7 @@  typedef struct thread_param{
     int thread_start, thread_end;
 } thread_param;
 
-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;
diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h
index 1295028c46..03ca795c61 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.c b/libavfilter/dnn/dnn_backend_native_layer_dense.c
index 1029137792..8629b52cfb 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_dense.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_dense.c
@@ -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;
diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h
index f98284b154..86248856ae 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_dense.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_dense.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_depth2space.c b/libavfilter/dnn/dnn_backend_native_layer_depth2space.c
index 4107ee6cae..26942eb3ab 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_depth2space.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_depth2space.c
@@ -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;
diff --git a/libavfilter/dnn/dnn_backend_native_layer_depth2space.h b/libavfilter/dnn/dnn_backend_native_layer_depth2space.h
index 648a927f2d..ef59394443 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_depth2space.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_depth2space.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c
index fc48242093..2a23bfaa77 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.c
@@ -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;
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h
index bb97ba2dca..eee294b00f 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathbinary.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
index ae5d4daae9..77e36c6ed3 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.c
@@ -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;
 
diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
index 301d02e5fb..2199931e6e 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_mathunary.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_maximum.c b/libavfilter/dnn/dnn_backend_native_layer_maximum.c
index 7ad5a22969..baae889755 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_maximum.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_maximum.c
@@ -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)
diff --git a/libavfilter/dnn/dnn_backend_native_layer_maximum.h b/libavfilter/dnn/dnn_backend_native_layer_maximum.h
index be63a3ab5b..523acbe05f 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_maximum.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_maximum.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layer_pad.c b/libavfilter/dnn/dnn_backend_native_layer_pad.c
index 05892d43f4..8d5d47883a 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_pad.c
+++ b/libavfilter/dnn/dnn_backend_native_layer_pad.c
@@ -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;
diff --git a/libavfilter/dnn/dnn_backend_native_layer_pad.h b/libavfilter/dnn/dnn_backend_native_layer_pad.h
index 6c69211824..4f76c67c3f 100644
--- a/libavfilter/dnn/dnn_backend_native_layer_pad.h
+++ b/libavfilter/dnn/dnn_backend_native_layer_pad.h
@@ -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
diff --git a/libavfilter/dnn/dnn_backend_native_layers.c b/libavfilter/dnn/dnn_backend_native_layers.c
index a23b34f823..492939fd36 100644
--- a/libavfilter/dnn/dnn_backend_native_layers.c
+++ b/libavfilter/dnn/dnn_backend_native_layers.c
@@ -29,14 +29,14 @@ 
 #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},
 };
diff --git a/libavfilter/dnn/dnn_backend_native_layers.h b/libavfilter/dnn/dnn_backend_native_layers.h
index b9e8a131d5..bbd02927c2 100644
--- a/libavfilter/dnn/dnn_backend_native_layers.h
+++ b/libavfilter/dnn/dnn_backend_native_layers.h
@@ -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