FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_sr.c File Reference

Filter implementing image super-resolution using deep convolutional networks. More...

#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "libavutil/opt.h"
#include "libavformat/avio.h"
#include "libswscale/swscale.h"
#include "dnn_interface.h"

Go to the source code of this file.

Data Structures

struct  SRContext
 

Macros

#define OFFSET(x)   offsetof(SRContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (sr)
 
static av_cold int init (AVFilterContext *context)
 
static int query_formats (AVFilterContext *context)
 
static int config_props (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *context)
 

Variables

static const AVOption sr_options []
 
static const AVFilterPad sr_inputs []
 
static const AVFilterPad sr_outputs []
 
AVFilter ff_vf_sr
 

Detailed Description

Filter implementing image super-resolution using deep convolutional networks.

https://arxiv.org/abs/1501.00092 https://arxiv.org/abs/1609.05158

Definition in file vf_sr.c.

Macro Definition Documentation

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

Definition at line 49 of file vf_sr.c.

Definition at line 50 of file vf_sr.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( sr  )
static av_cold int init ( AVFilterContext context)
static

Definition at line 64 of file vf_sr.c.

static int query_formats ( AVFilterContext context)
static

Definition at line 97 of file vf_sr.c.

static int config_props ( AVFilterLink inlink)
static

Definition at line 113 of file vf_sr.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 214 of file vf_sr.c.

static av_cold void uninit ( AVFilterContext context)
static

Definition at line 265 of file vf_sr.c.

Variable Documentation

const AVOption sr_options[]
static
Initial value:
= {
{ "dnn_backend", "DNN backend used for model execution", OFFSET(backend_type), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
{ "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },
{ "scale_factor", "scale factor for SRCNN model", OFFSET(scale_factor), AV_OPT_TYPE_INT, { .i64 = 2 }, 2, 4, FLAGS },
{ "model", "path to model file specifying network architecture and its parameters", OFFSET(model_filename), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: vf_sr.c:50
#define OFFSET(x)
Definition: vf_sr.c:49

Definition at line 51 of file vf_sr.c.

const AVFilterPad sr_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_sr.c:214
static int config_props(AVFilterLink *inlink)
Definition: vf_sr.c:113

Definition at line 282 of file vf_sr.c.

const AVFilterPad sr_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 292 of file vf_sr.c.

AVFilter ff_vf_sr
Initial value:
= {
.name = "sr",
.description = NULL_IF_CONFIG_SMALL("Apply DNN-based image super resolution to the input."),
.priv_size = sizeof(SRContext),
.init = init,
.priv_class = &sr_class,
}
static const AVFilterPad sr_inputs[]
Definition: vf_sr.c:282
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static int query_formats(AVFilterContext *context)
Definition: vf_sr.c:97
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static av_cold void uninit(AVFilterContext *context)
Definition: vf_sr.c:265
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
#define flags(name, subs,...)
Definition: cbs_av1.c:596
static av_cold int init(AVFilterContext *context)
Definition: vf_sr.c:64
static const AVFilterPad sr_outputs[]
Definition: vf_sr.c:292

Definition at line 300 of file vf_sr.c.