FFmpeg
Data Structures | Macros | Functions | Variables
vf_midequalizer.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "framesync.h"

Go to the source code of this file.

Data Structures

struct  MidEqualizerContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (midequalizer)
 
static int query_formats (AVFilterContext *ctx)
 
static int process_frame (FFFrameSync *fs)
 
static void compute_histogram8 (const uint8_t *src, ptrdiff_t linesize, int w, int h, float *histogram, size_t hsize)
 
static void compute_histogram16 (const uint16_t *src, ptrdiff_t linesize, int w, int h, float *histogram, size_t hsize)
 
static void compute_contrast_change (float *histogram1, float *histogram2, unsigned *cchange, size_t hsize)
 
static void midequalizer8 (const uint8_t *in0, const uint8_t *in1, uint8_t *dst, ptrdiff_t linesize1, ptrdiff_t linesize2, ptrdiff_t dlinesize, int w0, int h0, int w1, int h1, float *histogram1, float *histogram2, unsigned *cchange, size_t hsize)
 
static void midequalizer16 (const uint8_t *in0, const uint8_t *in1, uint8_t *dst, ptrdiff_t linesize1, ptrdiff_t linesize2, ptrdiff_t dlinesize, int w0, int h0, int w1, int h1, float *histogram1, float *histogram2, unsigned *cchange, size_t hsize)
 
static int config_input0 (AVFilterLink *inlink)
 
static int config_input1 (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption midequalizer_options []
 
static const AVFilterPad midequalizer_inputs []
 
static const AVFilterPad midequalizer_outputs []
 
const AVFilter ff_vf_midequalizer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 50 of file vf_midequalizer.c.

◆ FLAGS

Definition at line 51 of file vf_midequalizer.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( midequalizer  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 60 of file vf_midequalizer.c.

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 89 of file vf_midequalizer.c.

Referenced by config_output().

◆ compute_histogram8()

static void compute_histogram8 ( const uint8_t *  src,
ptrdiff_t  linesize,
int  w,
int  h,
float *  histogram,
size_t  hsize 
)
static

Definition at line 135 of file vf_midequalizer.c.

Referenced by midequalizer8().

◆ compute_histogram16()

static void compute_histogram16 ( const uint16_t *  src,
ptrdiff_t  linesize,
int  w,
int  h,
float *  histogram,
size_t  hsize 
)
static

Definition at line 156 of file vf_midequalizer.c.

Referenced by midequalizer16().

◆ compute_contrast_change()

static void compute_contrast_change ( float *  histogram1,
float *  histogram2,
unsigned *  cchange,
size_t  hsize 
)
static

Definition at line 177 of file vf_midequalizer.c.

Referenced by midequalizer16(), and midequalizer8().

◆ midequalizer8()

static void midequalizer8 ( const uint8_t *  in0,
const uint8_t *  in1,
uint8_t *  dst,
ptrdiff_t  linesize1,
ptrdiff_t  linesize2,
ptrdiff_t  dlinesize,
int  w0,
int  h0,
int  w1,
int  h1,
float *  histogram1,
float *  histogram2,
unsigned *  cchange,
size_t  hsize 
)
static

Definition at line 191 of file vf_midequalizer.c.

Referenced by config_input0().

◆ midequalizer16()

static void midequalizer16 ( const uint8_t *  in0,
const uint8_t *  in1,
uint8_t *  dst,
ptrdiff_t  linesize1,
ptrdiff_t  linesize2,
ptrdiff_t  dlinesize,
int  w0,
int  h0,
int  w1,
int  h1,
float *  histogram1,
float *  histogram2,
unsigned *  cchange,
size_t  hsize 
)
static

Definition at line 217 of file vf_midequalizer.c.

Referenced by config_input0().

◆ config_input0()

static int config_input0 ( AVFilterLink inlink)
static

Definition at line 245 of file vf_midequalizer.c.

◆ config_input1()

static int config_input1 ( AVFilterLink inlink)
static

Definition at line 279 of file vf_midequalizer.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 299 of file vf_midequalizer.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 339 of file vf_midequalizer.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 345 of file vf_midequalizer.c.

Variable Documentation

◆ midequalizer_options

const AVOption midequalizer_options[]
static
Initial value:
= {
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ NULL }
}

Definition at line 53 of file vf_midequalizer.c.

◆ midequalizer_inputs

const AVFilterPad midequalizer_inputs[]
static
Initial value:
= {
{
.name = "in0",
.config_props = config_input0,
},
{
.name = "in1",
.config_props = config_input1,
},
{ NULL }
}

Definition at line 355 of file vf_midequalizer.c.

◆ midequalizer_outputs

const AVFilterPad midequalizer_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}

Definition at line 369 of file vf_midequalizer.c.

◆ ff_vf_midequalizer

const AVFilter ff_vf_midequalizer
Initial value:
= {
.name = "midequalizer",
.description = NULL_IF_CONFIG_SMALL("Apply Midway Equalization."),
.priv_size = sizeof(MidEqualizerContext),
.priv_class = &midequalizer_class,
}

Definition at line 378 of file vf_midequalizer.c.

config_input1
static int config_input1(AVFilterLink *inlink)
Definition: vf_midequalizer.c:279
OFFSET
#define OFFSET(x)
Definition: vf_midequalizer.c:50
midequalizer_inputs
static const AVFilterPad midequalizer_inputs[]
Definition: vf_midequalizer.c:355
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_midequalizer.c:60
activate
static int activate(AVFilterContext *ctx)
Definition: vf_midequalizer.c:339
MidEqualizerContext
Definition: vf_midequalizer.c:30
inputs
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
Definition: filter_design.txt:243
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_midequalizer.c:299
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
FLAGS
#define FLAGS
Definition: vf_midequalizer.c:51
NULL
#define NULL
Definition: coverity.c:32
midequalizer_outputs
static const AVFilterPad midequalizer_outputs[]
Definition: vf_midequalizer.c:369
config_input0
static int config_input0(AVFilterLink *inlink)
Definition: vf_midequalizer.c:245
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:117
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_midequalizer.c:345
planes
static const struct @322 planes[]
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:134
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561