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

video quantizer filter based on ELBG More...

#include "libavcodec/elbg.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/random_seed.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ELBGContext
 

Macros

#define OFFSET(x)   offsetof(ELBGContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define NB_COMPONENTS   3
 
#define R   0
 
#define G   1
 
#define B   2
 

Functions

 AVFILTER_DEFINE_CLASS (elbg)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption elbg_options []
 
static const AVFilterPad elbg_inputs []
 
static const AVFilterPad elbg_outputs []
 
AVFilter ff_vf_elbg
 

Detailed Description

video quantizer filter based on ELBG

Definition in file vf_elbg.c.

Macro Definition Documentation

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

Definition at line 50 of file vf_elbg.c.

Definition at line 51 of file vf_elbg.c.

#define NB_COMPONENTS   3

Definition at line 89 of file vf_elbg.c.

Referenced by config_input(), and filter_frame().

#define R   0

Definition at line 119 of file vf_elbg.c.

Referenced by filter_frame().

#define G   1

Definition at line 120 of file vf_elbg.c.

Referenced by filter_frame().

#define B   2

Definition at line 121 of file vf_elbg.c.

Referenced by filter_frame().

Function Documentation

AVFILTER_DEFINE_CLASS ( elbg  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 65 of file vf_elbg.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 76 of file vf_elbg.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 91 of file vf_elbg.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 123 of file vf_elbg.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 174 of file vf_elbg.c.

Variable Documentation

const AVOption elbg_options[]
static
Initial value:
= {
{ "codebook_length", "set codebook length", OFFSET(codebook_length), AV_OPT_TYPE_INT, { .i64 = 256 }, 1, INT_MAX, FLAGS },
{ "l", "set codebook length", OFFSET(codebook_length), AV_OPT_TYPE_INT, { .i64 = 256 }, 1, INT_MAX, FLAGS },
{ "nb_steps", "set max number of steps used to compute the mapping", OFFSET(max_steps_nb), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "n", "set max number of steps used to compute the mapping", OFFSET(max_steps_nb), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "seed", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
{ "s", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT32_MAX, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_elbg.c:50
#define FLAGS
Definition: vf_elbg.c:51

Definition at line 53 of file vf_elbg.c.

const AVFilterPad elbg_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
.needs_writable = 1,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: vf_elbg.c:91
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_elbg.c:123

Definition at line 183 of file vf_elbg.c.

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

Definition at line 194 of file vf_elbg.c.

AVFilter ff_vf_elbg
Initial value:
= {
.name = "elbg",
.description = NULL_IF_CONFIG_SMALL("Apply posterize effect, using the ELBG algorithm."),
.priv_size = sizeof(ELBGContext),
.priv_class = &elbg_class,
.init = init,
}
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_elbg.c:174
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:248
static const AVFilterPad elbg_inputs[]
Definition: vf_elbg.c:183
static int query_formats(AVFilterContext *ctx)
Definition: vf_elbg.c:76
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static const AVFilterPad elbg_outputs[]
Definition: vf_elbg.c:194
static av_cold int init(AVFilterContext *ctx)
Definition: vf_elbg.c:65
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:239

Definition at line 202 of file vf_elbg.c.