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

Go to the source code of this file.

Macros

#define DNN_FILTER_CHILD_CLASS_ITERATE(name, backend_mask)
 
#define AVFILTER_DNN_DEFINE_CLASS_EXT(name, desc, options)
 
#define AVFILTER_DNN_DEFINE_CLASS(fname, backend_mask)
 

Functions

void * ff_dnn_filter_child_next (void *obj, void *prev)
 
int ff_dnn_filter_init_child_class (AVFilterContext *filter)
 
int ff_dnn_init (DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx)
 
int ff_dnn_set_frame_proc (DnnContext *ctx, FramePrePostProc pre_proc, FramePrePostProc post_proc)
 
int ff_dnn_set_detect_post_proc (DnnContext *ctx, DetectPostProc post_proc)
 
int ff_dnn_set_classify_post_proc (DnnContext *ctx, ClassifyPostProc post_proc)
 
int ff_dnn_get_input (DnnContext *ctx, DNNData *input)
 
int ff_dnn_get_output (DnnContext *ctx, int input_width, int input_height, int *output_width, int *output_height)
 
int ff_dnn_execute_model (DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame)
 
int ff_dnn_execute_model_classification (DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame, const char *target)
 
DNNAsyncStatusType ff_dnn_get_result (DnnContext *ctx, AVFrame **in_frame, AVFrame **out_frame)
 
int 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_FILTER_CHILD_CLASS_ITERATE

#define DNN_FILTER_CHILD_CLASS_ITERATE (   name,
  backend_mask 
)
Value:
static const AVClass *name##_child_class_iterate(void **iter) \
{ \
return ff_dnn_child_class_iterate_with_mask(iter, (backend_mask)); \
}

Definition at line 29 of file dnn_filter_common.h.

◆ AVFILTER_DNN_DEFINE_CLASS_EXT

#define AVFILTER_DNN_DEFINE_CLASS_EXT (   name,
  desc,
  options 
)
Value:
static const AVClass name##_class = { \
.class_name = desc, \
.item_name = av_default_item_name, \
.option = options, \
.version = LIBAVUTIL_VERSION_INT, \
.category = AV_CLASS_CATEGORY_FILTER, \
.child_next = ff_dnn_filter_child_next, \
.child_class_iterate = name##_child_class_iterate, \
}

Definition at line 35 of file dnn_filter_common.h.

◆ AVFILTER_DNN_DEFINE_CLASS

#define AVFILTER_DNN_DEFINE_CLASS (   fname,
  backend_mask 
)
Value:
DNN_FILTER_CHILD_CLASS_ITERATE(fname, backend_mask) \
AVFILTER_DNN_DEFINE_CLASS_EXT(fname, #fname, fname##_options)

Definition at line 46 of file dnn_filter_common.h.

Function Documentation

◆ ff_dnn_filter_child_next()

void* ff_dnn_filter_child_next ( void *  obj,
void *  prev 
)

Definition at line 67 of file dnn_filter_common.c.

◆ ff_dnn_filter_init_child_class()

int ff_dnn_filter_init_child_class ( AVFilterContext filter)

Definition at line 61 of file dnn_filter_common.c.

◆ ff_dnn_init()

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

Definition at line 73 of file dnn_filter_common.c.

Referenced by dnn_classify_init(), dnn_detect_init(), and init().

◆ ff_dnn_set_frame_proc()

int ff_dnn_set_frame_proc ( DnnContext ctx,
FramePrePostProc  pre_proc,
FramePrePostProc  post_proc 
)

Definition at line 139 of file dnn_filter_common.c.

◆ ff_dnn_set_detect_post_proc()

int ff_dnn_set_detect_post_proc ( DnnContext ctx,
DetectPostProc  post_proc 
)

Definition at line 146 of file dnn_filter_common.c.

Referenced by dnn_detect_init().

◆ ff_dnn_set_classify_post_proc()

int ff_dnn_set_classify_post_proc ( DnnContext ctx,
ClassifyPostProc  post_proc 
)

Definition at line 152 of file dnn_filter_common.c.

Referenced by dnn_classify_init().

◆ ff_dnn_get_input()

int ff_dnn_get_input ( DnnContext ctx,
DNNData input 
)

Definition at line 158 of file dnn_filter_common.c.

Referenced by config_input().

◆ ff_dnn_get_output()

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

Definition at line 163 of file dnn_filter_common.c.

Referenced by config_output().

◆ ff_dnn_execute_model()

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

Definition at line 171 of file dnn_filter_common.c.

Referenced by activate(), dnn_detect_activate(), and filter_frame().

◆ ff_dnn_execute_model_classification()

int ff_dnn_execute_model_classification ( DnnContext ctx,
AVFrame in_frame,
AVFrame out_frame,
const char *  target 
)

Definition at line 183 of file dnn_filter_common.c.

Referenced by dnn_classify_activate().

◆ ff_dnn_get_result()

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

◆ ff_dnn_flush()

int ff_dnn_flush ( DnnContext ctx)

◆ ff_dnn_uninit()

void ff_dnn_uninit ( DnnContext ctx)

Definition at line 208 of file dnn_filter_common.c.

Referenced by dnn_classify_uninit(), dnn_detect_uninit(), and uninit().

name
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 name
Definition: writing_filters.txt:88
ff_dnn_filter_child_next
void * ff_dnn_filter_child_next(void *obj, void *prev)
Definition: dnn_filter_common.c:67
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_CLASS_CATEGORY_FILTER
@ AV_CLASS_CATEGORY_FILTER
Definition: log.h:36
options
const OptionDef options[]
ff_dnn_child_class_iterate_with_mask
const AVClass * ff_dnn_child_class_iterate_with_mask(void **iter, uint32_t backend_mask)
Definition: dnn_interface.c:124
desc
const char * desc
Definition: libsvtav1.c:79
DNN_FILTER_CHILD_CLASS_ITERATE
#define DNN_FILTER_CHILD_CLASS_ITERATE(name, backend_mask)
Definition: dnn_filter_common.h:29