FFmpeg
vf_eq.c
Go to the documentation of this file.
1 /*
2  * Original MPlayer filters by Richard Felker, Hampa Hug, Daniel Moreno,
3  * and Michael Niedermeyer.
4  *
5  * Copyright (c) 2014 James Darnley <james.darnley@gmail.com>
6  * Copyright (c) 2015 Arwa Arif <arwaarif1994@gmail.com>
7  *
8  * This file is part of FFmpeg.
9  *
10  * FFmpeg is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * FFmpeg is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 /**
26  * @file
27  * very simple video equalizer
28  */
29 
30 #include "libavutil/common.h"
31 #include "libavutil/imgutils.h"
32 #include "libavutil/opt.h"
33 #include "libavutil/pixdesc.h"
34 #include "internal.h"
35 #include "vf_eq.h"
36 #include "video.h"
37 
38 static void create_lut(EQParameters *param)
39 {
40  int i;
41  double g = 1.0 / param->gamma;
42  double lw = 1.0 - param->gamma_weight;
43 
44  for (i = 0; i < 256; i++) {
45  double v = i / 255.0;
46  v = param->contrast * (v - 0.5) + 0.5 + param->brightness;
47 
48  if (v <= 0.0) {
49  param->lut[i] = 0;
50  } else {
51  v = v * lw + pow(v, g) * param->gamma_weight;
52 
53  if (v >= 1.0)
54  param->lut[i] = 255;
55  else
56  param->lut[i] = 256.0 * v;
57  }
58  }
59 
60  param->lut_clean = 1;
61 }
62 
63 static void apply_lut(EQParameters *param, uint8_t *dst, int dst_stride,
64  const uint8_t *src, int src_stride, int w, int h)
65 {
66  int x, y;
67 
68  if (!param->lut_clean)
69  create_lut(param);
70 
71  for (y = 0; y < h; y++) {
72  for (x = 0; x < w; x++) {
73  dst[y * dst_stride + x] = param->lut[src[y * src_stride + x]];
74  }
75  }
76 }
77 
78 static void check_values(EQParameters *param, EQContext *eq)
79 {
80  if (param->contrast == 1.0 && param->brightness == 0.0 && param->gamma == 1.0)
81  param->adjust = NULL;
82  else if (param->gamma == 1.0 && fabs(param->contrast) < 7.9)
83  param->adjust = eq->process;
84  else
85  param->adjust = apply_lut;
86 }
87 
88 static void set_contrast(EQContext *eq)
89 {
90  eq->contrast = av_clipf(av_expr_eval(eq->contrast_pexpr, eq->var_values, eq), -1000.0, 1000.0);
91  eq->param[0].contrast = eq->contrast;
92  eq->param[0].lut_clean = 0;
93  check_values(&eq->param[0], eq);
94 }
95 
97 {
98  eq->brightness = av_clipf(av_expr_eval(eq->brightness_pexpr, eq->var_values, eq), -1.0, 1.0);
99  eq->param[0].brightness = eq->brightness;
100  eq->param[0].lut_clean = 0;
101  check_values(&eq->param[0], eq);
102 }
103 
104 static void set_gamma(EQContext *eq)
105 {
106  int i;
107 
108  eq->gamma = av_clipf(av_expr_eval(eq->gamma_pexpr, eq->var_values, eq), 0.1, 10.0);
109  eq->gamma_r = av_clipf(av_expr_eval(eq->gamma_r_pexpr, eq->var_values, eq), 0.1, 10.0);
110  eq->gamma_g = av_clipf(av_expr_eval(eq->gamma_g_pexpr, eq->var_values, eq), 0.1, 10.0);
111  eq->gamma_b = av_clipf(av_expr_eval(eq->gamma_b_pexpr, eq->var_values, eq), 0.1, 10.0);
112  eq->gamma_weight = av_clipf(av_expr_eval(eq->gamma_weight_pexpr, eq->var_values, eq), 0.0, 1.0);
113 
114  eq->param[0].gamma = eq->gamma * eq->gamma_g;
115  eq->param[1].gamma = sqrt(eq->gamma_b / eq->gamma_g);
116  eq->param[2].gamma = sqrt(eq->gamma_r / eq->gamma_g);
117 
118  for (i = 0; i < 3; i++) {
119  eq->param[i].gamma_weight = eq->gamma_weight;
120  eq->param[i].lut_clean = 0;
121  check_values(&eq->param[i], eq);
122  }
123 }
124 
126 {
127  int i;
128 
129  eq->saturation = av_clipf(av_expr_eval(eq->saturation_pexpr, eq->var_values, eq), 0.0, 3.0);
130 
131  for (i = 1; i < 3; i++) {
132  eq->param[i].contrast = eq->saturation;
133  eq->param[i].lut_clean = 0;
134  check_values(&eq->param[i], eq);
135  }
136 }
137 
138 static int set_expr(AVExpr **pexpr, const char *expr, const char *option, void *log_ctx)
139 {
140  int ret;
141  AVExpr *old = NULL;
142 
143  if (*pexpr)
144  old = *pexpr;
145  ret = av_expr_parse(pexpr, expr, var_names, NULL, NULL, NULL, NULL, 0, log_ctx);
146  if (ret < 0) {
147  av_log(log_ctx, AV_LOG_ERROR,
148  "Error when parsing the expression '%s' for %s\n",
149  expr, option);
150  *pexpr = old;
151  return ret;
152  }
153 
154  av_expr_free(old);
155  return 0;
156 }
157 
159 {
160  EQContext *eq = ctx->priv;
161  int ret;
162  ff_eq_init(eq);
163 
164  if ((ret = set_expr(&eq->contrast_pexpr, eq->contrast_expr, "contrast", ctx)) < 0 ||
165  (ret = set_expr(&eq->brightness_pexpr, eq->brightness_expr, "brightness", ctx)) < 0 ||
166  (ret = set_expr(&eq->saturation_pexpr, eq->saturation_expr, "saturation", ctx)) < 0 ||
167  (ret = set_expr(&eq->gamma_pexpr, eq->gamma_expr, "gamma", ctx)) < 0 ||
168  (ret = set_expr(&eq->gamma_r_pexpr, eq->gamma_r_expr, "gamma_r", ctx)) < 0 ||
169  (ret = set_expr(&eq->gamma_g_pexpr, eq->gamma_g_expr, "gamma_g", ctx)) < 0 ||
170  (ret = set_expr(&eq->gamma_b_pexpr, eq->gamma_b_expr, "gamma_b", ctx)) < 0 ||
171  (ret = set_expr(&eq->gamma_weight_pexpr, eq->gamma_weight_expr, "gamma_weight", ctx)) < 0 )
172  return ret;
173 
174  if (eq->eval_mode == EVAL_MODE_INIT) {
175  set_gamma(eq);
176  set_contrast(eq);
179  }
180 
181  return 0;
182 }
183 
185 {
186  EQContext *eq = ctx->priv;
187 
188  av_expr_free(eq->contrast_pexpr); eq->contrast_pexpr = NULL;
189  av_expr_free(eq->brightness_pexpr); eq->brightness_pexpr = NULL;
190  av_expr_free(eq->saturation_pexpr); eq->saturation_pexpr = NULL;
191  av_expr_free(eq->gamma_pexpr); eq->gamma_pexpr = NULL;
192  av_expr_free(eq->gamma_weight_pexpr); eq->gamma_weight_pexpr = NULL;
193  av_expr_free(eq->gamma_r_pexpr); eq->gamma_r_pexpr = NULL;
194  av_expr_free(eq->gamma_g_pexpr); eq->gamma_g_pexpr = NULL;
195  av_expr_free(eq->gamma_b_pexpr); eq->gamma_b_pexpr = NULL;
196 }
197 
199 {
200  EQContext *eq = inlink->dst->priv;
201 
202  eq->var_values[VAR_N] = 0;
203  eq->var_values[VAR_R] = inlink->frame_rate.num == 0 || inlink->frame_rate.den == 0 ?
204  NAN : av_q2d(inlink->frame_rate);
205 
206  return 0;
207 }
208 
209 static const enum AVPixelFormat pixel_fmts_eq[] = {
217 };
218 
220 {
221  AVFilterContext *ctx = inlink->dst;
222  AVFilterLink *outlink = inlink->dst->outputs[0];
223  EQContext *eq = ctx->priv;
224  AVFrame *out;
225  const AVPixFmtDescriptor *desc;
226  int i;
227 
228  out = ff_get_video_buffer(outlink, inlink->w, inlink->h);
229  if (!out) {
230  av_frame_free(&in);
231  return AVERROR(ENOMEM);
232  }
233 
235  desc = av_pix_fmt_desc_get(inlink->format);
236 
237  eq->var_values[VAR_N] = inlink->frame_count_out;
238 #if FF_API_FRAME_PKT
240  {
241  int64_t pos = in->pkt_pos;
242  eq->var_values[VAR_POS] = pos == -1 ? NAN : pos;
243  }
245 #endif
246  eq->var_values[VAR_T] = TS2T(in->pts, inlink->time_base);
247 
248  if (eq->eval_mode == EVAL_MODE_FRAME) {
249  set_gamma(eq);
250  set_contrast(eq);
253  }
254 
255  for (i = 0; i < desc->nb_components; i++) {
256  int w = inlink->w;
257  int h = inlink->h;
258 
259  if (i == 1 || i == 2) {
260  w = AV_CEIL_RSHIFT(w, desc->log2_chroma_w);
261  h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h);
262  }
263 
264  if (i == 3 || !eq->param[i].adjust)
265  av_image_copy_plane(out->data[i], out->linesize[i],
266  in->data[i], in->linesize[i], w, h);
267 
268  else
269  eq->param[i].adjust(&eq->param[i], out->data[i], out->linesize[i],
270  in->data[i], in->linesize[i], w, h);
271  }
272 
273  av_frame_free(&in);
274  return ff_filter_frame(outlink, out);
275 }
276 
277 static inline int set_param(AVExpr **pexpr, const char *args, const char *cmd,
278  void (*set_fn)(EQContext *eq), AVFilterContext *ctx)
279 {
280  EQContext *eq = ctx->priv;
281  int ret;
282  if ((ret = set_expr(pexpr, args, cmd, ctx)) < 0)
283  return ret;
284  if (eq->eval_mode == EVAL_MODE_INIT)
285  set_fn(eq);
286  return 0;
287 }
288 
289 static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
290  char *res, int res_len, int flags)
291 {
292  EQContext *eq = ctx->priv;
293 
294 #define SET_PARAM(param_name, set_fn_name) \
295  if (!strcmp(cmd, #param_name)) return set_param(&eq->param_name##_pexpr, args, cmd, set_##set_fn_name, ctx);
296 
297  SET_PARAM(contrast, contrast)
298  else SET_PARAM(brightness, brightness)
299  else SET_PARAM(saturation, saturation)
300  else SET_PARAM(gamma, gamma)
301  else SET_PARAM(gamma_r, gamma)
302  else SET_PARAM(gamma_g, gamma)
303  else SET_PARAM(gamma_b, gamma)
304  else SET_PARAM(gamma_weight, gamma)
305  else return AVERROR(ENOSYS);
306 }
307 
308 static const AVFilterPad eq_inputs[] = {
309  {
310  .name = "default",
311  .type = AVMEDIA_TYPE_VIDEO,
312  .filter_frame = filter_frame,
313  .config_props = config_props,
314  },
315 };
316 
317 #define OFFSET(x) offsetof(EQContext, x)
318 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
319 #define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
320 static const AVOption eq_options[] = {
321  { "contrast", "set the contrast adjustment, negative values give a negative image",
322  OFFSET(contrast_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
323  { "brightness", "set the brightness adjustment",
324  OFFSET(brightness_expr), AV_OPT_TYPE_STRING, {.str = "0.0"}, 0, 0, TFLAGS },
325  { "saturation", "set the saturation adjustment",
326  OFFSET(saturation_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
327  { "gamma", "set the initial gamma value",
328  OFFSET(gamma_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
329  { "gamma_r", "gamma value for red",
330  OFFSET(gamma_r_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
331  { "gamma_g", "gamma value for green",
332  OFFSET(gamma_g_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
333  { "gamma_b", "gamma value for blue",
334  OFFSET(gamma_b_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
335  { "gamma_weight", "set the gamma weight which reduces the effect of gamma on bright areas",
336  OFFSET(gamma_weight_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, 0, 0, TFLAGS },
337  { "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_INIT}, 0, EVAL_MODE_NB-1, FLAGS, .unit = "eval" },
338  { "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" },
339  { "frame", "eval expressions per-frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" },
340  { NULL }
341 };
342 
344 
346  .name = "eq",
347  .description = NULL_IF_CONFIG_SMALL("Adjust brightness, contrast, gamma, and saturation."),
348  .priv_size = sizeof(EQContext),
349  .priv_class = &eq_class,
353  .process_command = process_command,
354  .init = initialize,
355  .uninit = uninit,
357 };
EQParameters::gamma_weight
double gamma_weight
Definition: vf_eq.h:57
ff_get_video_buffer
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:112
FF_ENABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
Definition: internal.h:73
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
EQParameters::gamma
double gamma
Definition: vf_eq.h:57
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
out
FILE * out
Definition: movenc.c:54
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1018
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2962
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:162
int64_t
long long int64_t
Definition: coverity.c:34
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
set_saturation
static void set_saturation(EQContext *eq)
Definition: vf_eq.c:125
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:130
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:344
pixdesc.h
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:456
w
uint8_t w
Definition: llviddspenc.c:38
AVOption
AVOption.
Definition: opt.h:346
initialize
static int initialize(AVFilterContext *ctx)
Definition: vf_eq.c:158
apply_lut
static void apply_lut(EQParameters *param, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
Definition: vf_eq.c:63
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:170
video.h
set_expr
static int set_expr(AVExpr **pexpr, const char *expr, const char *option, void *log_ctx)
Definition: vf_eq.c:138
eq_inputs
static const AVFilterPad eq_inputs[]
Definition: vf_eq.c:308
ff_eq_init
static av_unused void ff_eq_init(EQContext *eq)
Definition: vf_eq.h:127
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:365
av_image_copy_plane
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
Definition: imgutils.c:374
av_expr_parse
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
Definition: eval.c:711
VAR_T
@ VAR_T
Definition: aeval.c:54
OFFSET
#define OFFSET(x)
Definition: vf_eq.c:317
av_expr_free
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
Definition: eval.c:359
set_brightness
static void set_brightness(EQContext *eq)
Definition: vf_eq.c:96
eq
#define eq(A, B)
Definition: vf_xbr.c:91
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:33
config_props
static int config_props(AVFilterLink *inlink)
Definition: vf_eq.c:198
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(eq)
TS2T
#define TS2T(ts, tb)
Definition: internal.h:259
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
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
ff_vf_eq
const AVFilter ff_vf_eq
Definition: vf_eq.c:345
VAR_R
@ VAR_R
Definition: vf_eq.h:46
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:108
var_names
static const char *const var_names[]
Definition: noise.c:30
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
g
const char * g
Definition: vf_curves.c:127
EQParameters
Definition: vf_eq.h:51
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
vf_eq.h
ctx
AVFormatContext * ctx
Definition: movenc.c:48
av_expr_eval
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
Definition: eval.c:793
AVExpr
Definition: eval.c:159
FLAGS
#define FLAGS
Definition: vf_eq.c:318
VAR_N
@ VAR_N
Definition: noise.c:47
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_eq.c:289
NAN
#define NAN
Definition: mathematics.h:115
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
option
option
Definition: libkvazaar.c:320
fabs
static __device__ float fabs(float a)
Definition: cuda_runtime.h:182
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:679
VAR_POS
@ VAR_POS
Definition: noise.c:55
eq_options
static const AVOption eq_options[]
Definition: vf_eq.c:320
check_values
static void check_values(EQParameters *param, EQContext *eq)
Definition: vf_eq.c:78
av_clipf
av_clipf
Definition: af_crystalizer.c:121
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
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:106
set_contrast
static void set_contrast(EQContext *eq)
Definition: vf_eq.c:88
EQContext
Definition: vf_eq.h:62
AVFrame::pkt_pos
attribute_deprecated int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
Definition: frame.h:654
EQParameters::contrast
double contrast
Definition: vf_eq.h:57
pixel_fmts_eq
static enum AVPixelFormat pixel_fmts_eq[]
Definition: vf_eq.c:209
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:174
set_param
static int set_param(AVExpr **pexpr, const char *args, const char *cmd, void(*set_fn)(EQContext *eq), AVFilterContext *ctx)
Definition: vf_eq.c:277
internal.h
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:147
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
common.h
EQParameters::adjust
void(* adjust)(struct EQParameters *eq, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
Definition: vf_eq.h:52
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:39
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_eq.c:219
AVFilter
Filter definition.
Definition: avfilter.h:166
TFLAGS
#define TFLAGS
Definition: vf_eq.c:319
ret
ret
Definition: filter_design.txt:187
EQParameters::brightness
double brightness
Definition: vf_eq.h:57
EQParameters::lut
uint8_t lut[256]
Definition: vf_eq.h:55
pos
unsigned int pos
Definition: spdifenc.c:413
create_lut
static void create_lut(EQParameters *param)
Definition: vf_eq.c:38
EVAL_MODE_NB
@ EVAL_MODE_NB
Definition: af_volume.h:42
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_eq.c:184
EVAL_MODE_FRAME
@ EVAL_MODE_FRAME
Definition: af_volume.h:41
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVFilterContext
An instance of a filter.
Definition: avfilter.h:407
FF_DISABLE_DEPRECATION_WARNINGS
#define FF_DISABLE_DEPRECATION_WARNINGS
Definition: internal.h:72
desc
const char * desc
Definition: libsvtav1.c:75
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
EQParameters::lut_clean
int lut_clean
Definition: vf_eq.h:58
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
EVAL_MODE_INIT
@ EVAL_MODE_INIT
Definition: vf_fftfilt.c:41
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:80
imgutils.h
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:389
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:79
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
h
h
Definition: vp9dsp_template.c:2038
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239
set_gamma
static void set_gamma(EQContext *eq)
Definition: vf_eq.c:104
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244
SET_PARAM
#define SET_PARAM(param_name, set_fn_name)
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:173