FFmpeg
Data Structures | Macros | Functions | Variables
vf_tmidequalizer.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"

Go to the source code of this file.

Data Structures

struct  TMidEqualizerContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (tmidequalizer)
 
static int query_formats (AVFilterContext *ctx)
 
static void compute_contrast_function (const float *const histograms[256], const float *const kernel, int nb_frames, int radius, int hsize, float *f, int idx)
 
static void apply_contrast_change8 (const uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h, float *change, float *orig)
 
static void apply_contrast_change16 (const uint8_t *ssrc, ptrdiff_t src_linesize, uint8_t *ddst, ptrdiff_t dst_linesize, int w, int h, float *change, float *orig)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
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 uint8_t *ssrc, ptrdiff_t linesize, int w, int h, float *histogram, size_t hsize)
 
static int config_input (AVFilterLink *inlink)
 
static int request_frame (AVFilterLink *outlink)
 
static void free_histograms (AVFilterContext *ctx, int x, int nb_frames)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption tmidequalizer_options []
 
static const AVFilterPad tmidequalizer_inputs []
 
static const AVFilterPad tmidequalizer_outputs []
 
const AVFilter ff_vf_tmidequalizer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 58 of file vf_tmidequalizer.c.

◆ FLAGS

Definition at line 59 of file vf_tmidequalizer.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( tmidequalizer  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 70 of file vf_tmidequalizer.c.

◆ compute_contrast_function()

static void compute_contrast_function ( const float *const  histograms[256],
const float *const  kernel,
int  nb_frames,
int  radius,
int  hsize,
float *  f,
int  idx 
)
static

Definition at line 99 of file vf_tmidequalizer.c.

Referenced by filter_frame().

◆ apply_contrast_change8()

static void apply_contrast_change8 ( const uint8_t *  src,
ptrdiff_t  src_linesize,
uint8_t *  dst,
ptrdiff_t  dst_linesize,
int  w,
int  h,
float *  change,
float *  orig 
)
static

Definition at line 141 of file vf_tmidequalizer.c.

Referenced by config_input().

◆ apply_contrast_change16()

static void apply_contrast_change16 ( const uint8_t *  ssrc,
ptrdiff_t  src_linesize,
uint8_t *  ddst,
ptrdiff_t  dst_linesize,
int  w,
int  h,
float *  change,
float *  orig 
)
static

Definition at line 154 of file vf_tmidequalizer.c.

Referenced by config_input().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 170 of file vf_tmidequalizer.c.

Referenced by request_frame().

◆ 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 288 of file vf_tmidequalizer.c.

Referenced by config_input().

◆ compute_histogram16()

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

Definition at line 306 of file vf_tmidequalizer.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 326 of file vf_tmidequalizer.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 374 of file vf_tmidequalizer.c.

◆ free_histograms()

static void free_histograms ( AVFilterContext ctx,
int  x,
int  nb_frames 
)
static

Definition at line 388 of file vf_tmidequalizer.c.

Referenced by uninit().

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 397 of file vf_tmidequalizer.c.

Variable Documentation

◆ tmidequalizer_options

const AVOption tmidequalizer_options[]
static
Initial value:
= {
{ "radius", "set radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=5}, 1, 127, FLAGS },
{ "sigma", "set sigma", OFFSET(sigma), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, FLAGS },
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ NULL }
}

Definition at line 61 of file vf_tmidequalizer.c.

◆ tmidequalizer_inputs

const AVFilterPad tmidequalizer_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 411 of file vf_tmidequalizer.c.

◆ tmidequalizer_outputs

const AVFilterPad tmidequalizer_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
},
{ NULL }
}

Definition at line 421 of file vf_tmidequalizer.c.

◆ ff_vf_tmidequalizer

const AVFilter ff_vf_tmidequalizer
Initial value:
= {
.name = "tmidequalizer",
.description = NULL_IF_CONFIG_SMALL("Apply Temporal Midway Equalization."),
.priv_size = sizeof(TMidEqualizerContext),
.priv_class = &tmidequalizer_class,
}

Definition at line 430 of file vf_tmidequalizer.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_tmidequalizer.c:70
TMidEqualizerContext
Definition: vf_tmidequalizer.c:29
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_tmidequalizer.c:326
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
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
tmidequalizer_inputs
static const AVFilterPad tmidequalizer_inputs[]
Definition: vf_tmidequalizer.c:411
OFFSET
#define OFFSET(x)
Definition: vf_tmidequalizer.c:58
NULL
#define NULL
Definition: coverity.c:32
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
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_tmidequalizer.c:374
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_tmidequalizer.c:170
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_tmidequalizer.c:397
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
FLAGS
#define FLAGS
Definition: vf_tmidequalizer.c:59
tmidequalizer_outputs
static const AVFilterPad tmidequalizer_outputs[]
Definition: vf_tmidequalizer.c:421