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

Filter implementing image derain filter using deep convolutional networks. More...

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

Go to the source code of this file.

Data Structures

struct  DRContext
 

Macros

#define CLIP(x, min, max)   (x < min ? min : (x > max ? max : x))
 
#define OFFSET(x)   offsetof(DRContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (derain)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_inputs (AVFilterLink *inlink)
 
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 []
 
static const AVFilterPad derain_outputs []
 
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

#define CLIP (   x,
  min,
  max 
)    (x < min ? min : (x > max ? max : x))

Definition at line 46 of file vf_derain.c.

Referenced by filter_frame().

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

Definition at line 47 of file vf_derain.c.

Definition at line 48 of file vf_derain.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( derain  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 64 of file vf_derain.c.

static int config_inputs ( AVFilterLink inlink)
static

Definition at line 77 of file vf_derain.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 97 of file vf_derain.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 149 of file vf_derain.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 177 of file vf_derain.c.

Variable Documentation

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, "type" },
{ "derain", "derain filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "type" },
{ "dehaze", "dehaze filter flag", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "type" },
{ "dnn_backend", "DNN backend", OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
{ "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },
{ "model", "path to model file", OFFSET(model_filename), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_derain.c:47
#define FLAGS
Definition: vf_derain.c:48

Definition at line 49 of file vf_derain.c.

const AVFilterPad derain_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_inputs,
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_inputs(AVFilterLink *inlink)
Definition: vf_derain.c:77
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_derain.c:97

Definition at line 187 of file vf_derain.c.

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

Definition at line 197 of file vf_derain.c.

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,
}
#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
static av_cold int init(AVFilterContext *ctx)
Definition: vf_derain.c:149
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_derain.c:177
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static const AVFilterPad derain_inputs[]
Definition: vf_derain.c:187
static int query_formats(AVFilterContext *ctx)
Definition: vf_derain.c:64
static const AVFilterPad derain_outputs[]
Definition: vf_derain.c:197

Definition at line 205 of file vf_derain.c.