FFmpeg
Data Structures | Macros | Functions | Variables
dnn_backend_openvino.c File Reference

DNN OpenVINO backend implementation. More...

#include "dnn_backend_openvino.h"
#include "dnn_io_proc.h"
#include "libavformat/avio.h"
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
#include "../internal.h"
#include <c_api/ie_c_api.h>

Go to the source code of this file.

Data Structures

struct  OVOptions
 
struct  OVContext
 
struct  OVModel
 

Macros

#define APPEND_STRING(generated_string, iterate_string)
 
#define OFFSET(x)   offsetof(OVContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (dnn_openvino)
 
static DNNReturnType execute_model_ov (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 DNNDataType precision_to_datatype (precision_e precision)
 
static DNNReturnType get_input_ov (void *model, DNNData *input, const char *input_name)
 
static DNNReturnType get_output_ov (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_ov (const char *model_filename, const char *options, void *userdata)
 
DNNReturnType ff_dnn_execute_model_ov (const DNNModel *model, const char *input_name, AVFrame *in_frame, const char **output_names, uint32_t nb_output, AVFrame *out_frame)
 
void ff_dnn_free_model_ov (DNNModel **model)
 

Variables

static const AVOption dnn_openvino_options []
 

Detailed Description

DNN OpenVINO backend implementation.

Definition in file dnn_backend_openvino.c.

Macro Definition Documentation

#define APPEND_STRING (   generated_string,
  iterate_string 
)
Value:
generated_string = generated_string ? av_asprintf("%s %s", generated_string, iterate_string) : \
av_asprintf("%s", iterate_string);
char * av_asprintf(const char *fmt,...)
Definition: avstring.c:113

Definition at line 53 of file dnn_backend_openvino.c.

Referenced by execute_model_ov(), ff_dnn_load_model_ov(), and get_input_ov().

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

Definition at line 57 of file dnn_backend_openvino.c.

#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM

Definition at line 58 of file dnn_backend_openvino.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( dnn_openvino  )
static DNNReturnType execute_model_ov ( 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 252 of file dnn_backend_openvino.c.

Referenced by ff_dnn_execute_model_ov(), and get_output_ov().

static DNNDataType precision_to_datatype ( precision_e  precision)
static

Definition at line 70 of file dnn_backend_openvino.c.

Referenced by execute_model_ov(), and get_input_ov().

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

Definition at line 82 of file dnn_backend_openvino.c.

Referenced by ff_dnn_load_model_ov().

static DNNReturnType get_output_ov ( 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 139 of file dnn_backend_openvino.c.

Referenced by ff_dnn_load_model_ov().

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

Definition at line 170 of file dnn_backend_openvino.c.

Referenced by ff_get_dnn_module().

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

Definition at line 366 of file dnn_backend_openvino.c.

Referenced by ff_get_dnn_module().

void ff_dnn_free_model_ov ( DNNModel **  model)

Definition at line 385 of file dnn_backend_openvino.c.

Referenced by ff_get_dnn_module().

Variable Documentation

const AVOption dnn_openvino_options[]
static
Initial value:
= {
{ "device", "device to run model", OFFSET(options.device_type), AV_OPT_TYPE_STRING, { .str = "CPU" }, 0, 0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)
const OptionDef options[]
Definition: ffmpeg_opt.c:3400

Definition at line 59 of file dnn_backend_openvino.c.