FFmpeg
Data Structures | Macros | Functions
dnn_filter_common.h File Reference
#include "dnn_interface.h"

Go to the source code of this file.

Data Structures

struct  DnnContext
 

Macros

#define DNN_COMMON_OPTIONS
 

Functions

int ff_dnn_init (DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx)
 
DNNReturnType ff_dnn_get_input (DnnContext *ctx, DNNData *input)
 
DNNReturnType ff_dnn_get_output (DnnContext *ctx, int input_width, int input_height, int *output_width, int *output_height)
 
DNNReturnType ff_dnn_execute_model (DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame)
 
DNNReturnType ff_dnn_execute_model_async (DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame)
 
DNNAsyncStatusType ff_dnn_get_async_result (DnnContext *ctx, AVFrame **in_frame, AVFrame **out_frame)
 
DNNReturnType ff_dnn_flush (DnnContext *ctx)
 
void ff_dnn_uninit (DnnContext *ctx)
 

Detailed Description

common functions for the dnn based filters

Definition in file dnn_filter_common.h.

Macro Definition Documentation

◆ DNN_COMMON_OPTIONS

#define DNN_COMMON_OPTIONS
Value:
{ "model", "path to model file", OFFSET(model_filename), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },\
{ "input", "input name of the model", OFFSET(model_inputname), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },\
{ "output", "output name of the model", OFFSET(model_outputname), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },\
{ "backend_configs", "backend configs", OFFSET(backend_options), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },\
{ "options", "backend configs", OFFSET(backend_options), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },\
{ "async", "use DNN async inference", OFFSET(async), AV_OPT_TYPE_BOOL, { .i64 = 1}, 0, 1, FLAGS},

Definition at line 41 of file dnn_filter_common.h.

Function Documentation

◆ ff_dnn_init()

int ff_dnn_init ( DnnContext ctx,
DNNFunctionType  func_type,
AVFilterContext filter_ctx 
)

Definition at line 21 of file dnn_filter_common.c.

Referenced by init().

◆ ff_dnn_get_input()

DNNReturnType ff_dnn_get_input ( DnnContext ctx,
DNNData input 
)

Definition at line 67 of file dnn_filter_common.c.

Referenced by config_input().

◆ ff_dnn_get_output()

DNNReturnType ff_dnn_get_output ( DnnContext ctx,
int  input_width,
int  input_height,
int output_width,
int output_height 
)

Definition at line 72 of file dnn_filter_common.c.

Referenced by config_output().

◆ ff_dnn_execute_model()

DNNReturnType ff_dnn_execute_model ( DnnContext ctx,
AVFrame in_frame,
AVFrame out_frame 
)

Definition at line 78 of file dnn_filter_common.c.

Referenced by filter_frame().

◆ ff_dnn_execute_model_async()

DNNReturnType ff_dnn_execute_model_async ( DnnContext ctx,
AVFrame in_frame,
AVFrame out_frame 
)

Definition at line 84 of file dnn_filter_common.c.

Referenced by activate_async().

◆ ff_dnn_get_async_result()

DNNAsyncStatusType ff_dnn_get_async_result ( DnnContext ctx,
AVFrame **  in_frame,
AVFrame **  out_frame 
)

Definition at line 90 of file dnn_filter_common.c.

Referenced by activate_async(), and flush_frame().

◆ ff_dnn_flush()

DNNReturnType ff_dnn_flush ( DnnContext ctx)

Definition at line 95 of file dnn_filter_common.c.

Referenced by flush_frame().

◆ ff_dnn_uninit()

void ff_dnn_uninit ( DnnContext ctx)

Definition at line 100 of file dnn_filter_common.c.

Referenced by uninit().

FLAGS
#define FLAGS
Definition: cmdutils.c:540
NULL
#define NULL
Definition: coverity.c:32
OFFSET
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your see the OFFSET() macro
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:242
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229