FFmpeg
Macros | Functions | Variables
dnn_backend_native.c File Reference

DNN native backend implementation. More...

#include "dnn_backend_native.h"
#include "libavutil/avassert.h"
#include "dnn_backend_native_layer_conv2d.h"
#include "dnn_backend_native_layers.h"
#include "dnn_io_proc.h"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(NativeContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static DNNReturnType execute_model_native (const DNNModel *model, const char *input_name, AVFrame *in_frame, const char **output_names, uint32_t nb_output, AVFrame *out_frame, int do_ioproc)
 
static DNNReturnType get_input_native (void *model, DNNData *input, const char *input_name)
 
static DNNReturnType get_output_native (void *model, const char *input_name, int input_width, int input_height, const char *output_name, int *output_width, int *output_height)
 
DNNModelff_dnn_load_model_native (const char *model_filename, const char *options, void *userdata)
 
DNNReturnType ff_dnn_execute_model_native (const DNNModel *model, const char *input_name, AVFrame *in_frame, const char **output_names, uint32_t nb_output, AVFrame *out_frame)
 
int32_t calculate_operand_dims_count (const DnnOperand *oprd)
 
int32_t calculate_operand_data_length (const DnnOperand *oprd)
 
void ff_dnn_free_model_native (DNNModel **model)
 

Variables

static const AVOption dnn_native_options []
 
const AVClass dnn_native_class
 

Detailed Description

DNN native backend implementation.

Definition in file dnn_backend_native.c.

Macro Definition Documentation

#define OFFSET (   x)    offsetof(NativeContext, x)

Definition at line 32 of file dnn_backend_native.c.

#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM

Definition at line 33 of file dnn_backend_native.c.

Function Documentation

static DNNReturnType execute_model_native ( const DNNModel model,
const char *  input_name,
AVFrame in_frame,
const char **  output_names,
uint32_t  nb_output,
AVFrame out_frame,
int  do_ioproc 
)
static

Definition at line 268 of file dnn_backend_native.c.

Referenced by ff_dnn_execute_model_native(), and get_output_native().

static DNNReturnType get_input_native ( void model,
DNNData input,
const char *  input_name 
)
static

Definition at line 51 of file dnn_backend_native.c.

Referenced by ff_dnn_load_model_native().

static DNNReturnType get_output_native ( void model,
const char *  input_name,
int  input_width,
int  input_height,
const char *  output_name,
int output_width,
int output_height 
)
static

Definition at line 77 of file dnn_backend_native.c.

Referenced by ff_dnn_load_model_native().

DNNModel* ff_dnn_load_model_native ( const char *  model_filename,
const char *  options,
void userdata 
)

check file header with string and version

Definition at line 115 of file dnn_backend_native.c.

Referenced by ff_get_dnn_module(), and load_native_model().

DNNReturnType ff_dnn_execute_model_native ( const DNNModel model,
const char *  input_name,
AVFrame in_frame,
const char **  output_names,
uint32_t  nb_output,
AVFrame out_frame 
)

Definition at line 382 of file dnn_backend_native.c.

Referenced by ff_get_dnn_module().

int32_t calculate_operand_dims_count ( const DnnOperand oprd)
int32_t calculate_operand_data_length ( const DnnOperand oprd)
void ff_dnn_free_model_native ( DNNModel **  model)

Variable Documentation

const AVOption dnn_native_options[]
static
Initial value:
= {
{ "conv2d_threads", "threads num for conv2d layer", OFFSET(options.conv2d_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
#define FLAGS
const OptionDef options[]
Definition: ffmpeg_opt.c:3393

Definition at line 34 of file dnn_backend_native.c.

const AVClass dnn_native_class
Initial value:
= {
.class_name = "dnn_native",
.item_name = av_default_item_name,
.option = dnn_native_options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
static const AVOption dnn_native_options[]

Definition at line 39 of file dnn_backend_native.c.

Referenced by ff_dnn_load_model_native(), test_with_same_dilate(), and test_with_valid().