FFmpeg
Data Structures | Macros | Functions | Variables
vf_derain.c File Reference
#include "libavutil/opt.h"
#include "avfilter.h"
#include "dnn_filter_common.h"
#include "filters.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  DRContext
 

Macros

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

Functions

 AVFILTER_DNN_DEFINE_CLASS (derain, DNN_TF)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption derain_options []
 
static const AVFilterPad derain_inputs []
 
const AVFilter ff_vf_derain
 

Detailed Description

Filter implementing image derain filter using deep convolutional networks. http://openaccess.thecvf.com/content_ECCV_2018/html/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.html

Definition in file vf_derain.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 39 of file vf_derain.c.

◆ FLAGS

Definition at line 40 of file vf_derain.c.

Function Documentation

◆ AVFILTER_DNN_DEFINE_CLASS()

AVFILTER_DNN_DEFINE_CLASS ( derain  ,
DNN_TF   
)

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 54 of file vf_derain.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 89 of file vf_derain.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 95 of file vf_derain.c.

Variable Documentation

◆ derain_options

const AVOption derain_options[]
static
Initial value:
= {
{ "filter_type", "filter type(derain/dehaze)", OFFSET(filter_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, .unit = "type" },
{ "derain", "derain filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, .unit = "type" },
{ "dehaze", "dehaze filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, .unit = "type" },
{ "dnn_backend", "DNN backend", OFFSET(dnnctx.backend_type), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, .unit = "backend" },
{ NULL }
}

Definition at line 41 of file vf_derain.c.

◆ derain_inputs

const AVFilterPad derain_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}

Definition at line 101 of file vf_derain.c.

◆ ff_vf_derain

const AVFilter ff_vf_derain
Initial value:
= {
.name = "derain",
.description = NULL_IF_CONFIG_SMALL("Apply derain filter to the input."),
.priv_size = sizeof(DRContext),
.init = init,
.priv_class = &derain_class,
}

Definition at line 109 of file vf_derain.c.

FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
DRContext
Definition: vf_derain.c:33
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_derain.c:89
preinit
static av_cold int preinit(AVFilterContext *ctx)
Definition: af_aresample.c:48
ff_dnn_filter_init_child_class
int ff_dnn_filter_init_child_class(AVFilterContext *filter)
Definition: dnn_filter_common.c:61
derain_inputs
static const AVFilterPad derain_inputs[]
Definition: vf_derain.c:101
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_derain.c:54
FLAGS
#define FLAGS
Definition: vf_derain.c:40
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#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:182
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
OFFSET
#define OFFSET(x)
Definition: vf_derain.c:39
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_derain.c:95
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:252