FFmpeg
Loading...
Searching...
No Matches
vf_huesaturation.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "libavutil/opt.h"
20#include "libavutil/pixdesc.h"
21#include "avfilter.h"
22#include "drawutils.h"
23#include "filters.h"
24#include "video.h"
25
26#define R 0
27#define G 1
28#define B 2
29
30#define REDS 0
31#define YELLOWS 1
32#define GREENS 2
33#define CYANS 3
34#define BLUES 4
35#define MAGENTAS 5
36
37#define RED (1 << REDS)
38#define YELLOW (1 << YELLOWS)
39#define GREEN (1 << GREENS)
40#define CYAN (1 << CYANS)
41#define BLUE (1 << BLUES)
42#define MAGENTA (1 << MAGENTAS)
43#define ALL 0x3F
44
45typedef struct HueSaturationContext {
46 const AVClass *class;
47
48 float hue;
50 float intensity;
51 float strength;
52 float rlw, glw, blw;
54 int colors;
55
56 int depth;
57 int planewidth[4];
59
60 float matrix[4][4];
62
63 int bpp;
64 int step;
65 uint8_t rgba_map[4];
66
67 int (*do_slice[2])(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
69
70#define DENOM 0x10000
71
72static inline void get_triplet(int64_t m[4][4], int *r, int *g, int *b)
73{
74 const int ir = *r, ig = *g, ib = *b;
75
76 *r = (ir * m[0][0] + ig * m[1][0] + ib * m[2][0] /*+ m[3][0]*/) >> 16;
77 *g = (ir * m[0][1] + ig * m[1][1] + ib * m[2][1] /*+ m[3][1]*/) >> 16;
78 *b = (ir * m[0][2] + ig * m[1][2] + ib * m[2][2] /*+ m[3][2]*/) >> 16;
79}
80
81#define FAST_DIV255(x) ((((x) + 128) * 257) >> 16)
82
83static inline int lerpi8(int v0, int v1, int f, int max)
84{
85 return v0 + FAST_DIV255((v1 - v0) * f);
86}
87
88static inline int lerpi16(int v0, int v1, int f, int max)
89{
90 return v0 + (v1 - v0) * (int64_t)f / max;
91}
92
93#define HUESATURATION(name, type, clip, xall) \
94static int do_slice_##name##_##xall(AVFilterContext *ctx, \
95 void *arg, \
96 int jobnr, int nb_jobs) \
97{ \
98 HueSaturationContext *s = ctx->priv; \
99 AVFrame *frame = arg; \
100 const int imax = (1 << name) - 1; \
101 const float strength = s->strength; \
102 const int colors = s->colors; \
103 const int step = s->step; \
104 const int width = frame->width; \
105 const int process_h = frame->height; \
106 const int slice_start = ff_slice_pos(process_h, jobnr, nb_jobs); \
107 const int slice_end = ff_slice_pos(process_h, jobnr + 1, nb_jobs); \
108 const ptrdiff_t linesize = frame->linesize[0] / sizeof(type); \
109 type *row = (type *)frame->data[0] + linesize * slice_start; \
110 const uint8_t offset_r = s->rgba_map[R]; \
111 const uint8_t offset_g = s->rgba_map[G]; \
112 const uint8_t offset_b = s->rgba_map[B]; \
113 type *dst_r = row + offset_r; \
114 type *dst_g = row + offset_g; \
115 type *dst_b = row + offset_b; \
116 \
117 for (int y = slice_start; y < slice_end; y++) { \
118 for (int x = 0; x < width * step; x += step) { \
119 int ir, ig, ib, ro, go, bo; \
120 \
121 ir = ro = dst_r[x]; \
122 ig = go = dst_g[x]; \
123 ib = bo = dst_b[x]; \
124 \
125 if (xall) { \
126 get_triplet(s->imatrix, &ir, &ig, &ib); \
127 } else { \
128 const int min = FFMIN3(ir, ig, ib); \
129 const int max = FFMAX3(ir, ig, ib); \
130 const int flags = (ir == max) << REDS \
131 | (ir == min) << CYANS \
132 | (ig == max) << GREENS \
133 | (ig == min) << MAGENTAS \
134 | (ib == max) << BLUES \
135 | (ib == min) << YELLOWS; \
136 if (colors & flags) { \
137 int f = 0; \
138 \
139 if (colors & RED) \
140 f = FFMAX(f, ir - FFMAX(ig, ib)); \
141 if (colors & YELLOW) \
142 f = FFMAX(f, FFMIN(ir, ig) - ib); \
143 if (colors & GREEN) \
144 f = FFMAX(f, ig - FFMAX(ir, ib)); \
145 if (colors & CYAN) \
146 f = FFMAX(f, FFMIN(ig, ib) - ir); \
147 if (colors & BLUE) \
148 f = FFMAX(f, ib - FFMAX(ir, ig)); \
149 if (colors & MAGENTA) \
150 f = FFMAX(f, FFMIN(ir, ib) - ig); \
151 f = FFMIN(f * strength, imax); \
152 get_triplet(s->imatrix, &ir, &ig, &ib); \
153 ir = lerpi##name(ro, ir, f, imax); \
154 ig = lerpi##name(go, ig, f, imax); \
155 ib = lerpi##name(bo, ib, f, imax); \
156 } \
157 } \
158 \
159 dst_r[x] = clip(ir); \
160 dst_g[x] = clip(ig); \
161 dst_b[x] = clip(ib); \
162 } \
163 \
164 dst_r += linesize; \
165 dst_g += linesize; \
166 dst_b += linesize; \
167 } \
168 \
169 return 0; \
170}
171
172HUESATURATION(8, uint8_t, av_clip_uint8, 0)
173HUESATURATION(16, uint16_t, av_clip_uint16, 0)
174
175HUESATURATION(8, uint8_t, av_clip_uint8, 1)
176HUESATURATION(16, uint16_t, av_clip_uint16, 1)
177
178static void identity_matrix(float matrix[4][4])
179{
180 for (int y = 0; y < 4; y++)
181 for (int x = 0; x < 4; x++)
182 matrix[y][x] = y == x;
183}
184
185static void matrix_multiply(float a[4][4], float b[4][4], float c[4][4])
186{
187 float temp[4][4];
188
189 for (int y = 0; y < 4; y++) {
190 for (int x = 0; x < 4; x++) {
191 temp[y][x] = b[y][0] * a[0][x]
192 + b[y][1] * a[1][x]
193 + b[y][2] * a[2][x]
194 + b[y][3] * a[3][x];
195 }
196 }
197
198 for (int y = 0; y < 4; y++) {
199 for (int x = 0; x < 4; x++)
200 c[y][x] = temp[y][x];
201 }
202}
203
204static void colorscale_matrix(float matrix[4][4], float r, float g, float b)
205{
206 float temp[4][4];
207
208 temp[0][0] = r; temp[0][1] = 0.f; temp[0][2] = 0.f; temp[0][3] = 0.f;
209 temp[1][0] = 0.f; temp[1][1] = g; temp[1][2] = 0.f; temp[1][3] = 0.f;
210 temp[2][0] = 0.f; temp[2][1] = 0.f; temp[2][2] = b; temp[2][3] = 0.f;
211 temp[3][0] = 0.f; temp[3][1] = 0.f; temp[3][2] = 0.f; temp[3][3] = 1.f;
212
214}
215
216static void saturation_matrix(float matrix[4][4], float saturation,
217 float rlw, float glw, float blw)
218{
219 float s = 1.f - saturation;
220 float a = s * rlw + saturation;
221 float b = s * rlw;
222 float c = s * rlw;
223 float d = s * glw;
224 float e = s * glw + saturation;
225 float f = s * glw;
226 float g = s * blw;
227 float h = s * blw;
228 float i = s * blw + saturation;
229 float m[4][4];
230
231 m[0][0] = a; m[0][1] = b; m[0][2] = c; m[0][3] = 0.f;
232 m[1][0] = d; m[1][1] = e; m[1][2] = f; m[1][3] = 0.f;
233 m[2][0] = g; m[2][1] = h; m[2][2] = i; m[2][3] = 0.f;
234 m[3][0] = 0.f; m[3][1] = 0.f; m[3][2] = 0.f; m[3][3] = 1.f;
235
237}
238
239static void matrix2imatrix(float matrix[4][4], int64_t imatrix[4][4])
240{
241 for (int y = 0; y < 4; y++)
242 for (int x = 0; x < 4; x++)
243 imatrix[y][x] = lrintf(matrix[y][x] * DENOM);
244}
245
246static void x_rotate_matrix(float matrix[4][4], float rs, float rc)
247{
248 float m[4][4];
249
250 m[0][0] = 1.f; m[0][1] = 0.f; m[0][2] = 0.f; m[0][3] = 0.f;
251 m[1][0] = 0.f; m[1][1] = rc; m[1][2] = rs; m[1][3] = 0.f;
252 m[2][0] = 0.f; m[2][1] = -rs; m[2][2] = rc; m[2][3] = 0.f;
253 m[3][0] = 0.f; m[3][1] = 0.f; m[3][2] = 0.f; m[3][3] = 1.f;
254
256}
257
258static void y_rotate_matrix(float matrix[4][4], float rs, float rc)
259{
260 float m[4][4];
261
262 m[0][0] = rc; m[0][1] = 0.f; m[0][2] = -rs; m[0][3] = 0.f;
263 m[1][0] = 0.f; m[1][1] = 1.f; m[1][2] = 0.f; m[1][3] = 0.f;
264 m[2][0] = rs; m[2][1] = 0.f; m[2][2] = rc; m[2][3] = 0.f;
265 m[3][0] = 0.f; m[3][1] = 0.f; m[3][2] = 0.f; m[3][3] = 1.f;
266
268}
269
270static void z_rotate_matrix(float matrix[4][4], float rs, float rc)
271{
272 float m[4][4];
273
274 m[0][0] = rc; m[0][1] = rs; m[0][2] = 0.f; m[0][3] = 0.f;
275 m[1][0] = -rs; m[1][1] = rc; m[1][2] = 0.f; m[1][3] = 0.f;
276 m[2][0] = 0.f; m[2][1] = 0.f; m[2][2] = 1.f; m[2][3] = 0.f;
277 m[3][0] = 0.f; m[3][1] = 0.f; m[3][2] = 0.f; m[3][3] = 1.f;
278
280}
281
282static void z_shear_matrix(float matrix[4][4], float dx, float dy)
283{
284 float m[4][4];
285
286 m[0][0] = 1.f; m[0][1] = 0.f; m[0][2] = dx; m[0][3] = 0.f;
287 m[1][0] = 0.f; m[1][1] = 1.f; m[1][2] = dy; m[1][3] = 0.f;
288 m[2][0] = 0.f; m[2][1] = 0.f; m[2][2] = 1.f; m[2][3] = 0.f;
289 m[3][0] = 0.f; m[3][1] = 0.f; m[3][2] = 0.f; m[3][3] = 1.f;
290
292}
293
294static void transform_point(float matrix[4][4],
295 float x, float y, float z,
296 float *tx, float *ty, float *tz)
297{
298 x = y;
299 *tx = x * matrix[0][0] + y * matrix[1][0] + z * matrix[2][0] + matrix[3][0];
300 *ty = x * matrix[0][1] + y * matrix[1][1] + z * matrix[2][1] + matrix[3][1];
301 *tz = x * matrix[0][2] + y * matrix[1][2] + z * matrix[2][2] + matrix[3][2];
302}
303
304static void hue_rotate_matrix(float matrix[4][4], float rotation,
305 float rlw, float glw, float blw)
306{
307 float mag, lx, ly, lz;
308 float xrs, xrc;
309 float yrs, yrc;
310 float zrs, zrc;
311 float zsx, zsy;
312
313 mag = M_SQRT2;
314 xrs = 1.f / mag;
315 xrc = 1.f / mag;
316 x_rotate_matrix(matrix, xrs, xrc);
317
318 mag = sqrtf(3.f);
319 yrs = -1.f / mag;
320 yrc = M_SQRT2 / mag;
321 y_rotate_matrix(matrix, yrs, yrc);
322
323 transform_point(matrix, rlw, glw, blw, &lx, &ly, &lz);
324 zsx = lx / lz;
325 zsy = ly / lz;
326 z_shear_matrix(matrix, zsx, zsy);
327
328 zrs = sinf(rotation * M_PI / 180.f);
329 zrc = cosf(rotation * M_PI / 180.f);
330 z_rotate_matrix(matrix, zrs, zrc);
331
332 z_shear_matrix(matrix, -zsx, -zsy);
333
334 y_rotate_matrix(matrix, -yrs, yrc);
335 x_rotate_matrix(matrix, -xrs, xrc);
336}
337
338static void shue_rotate_matrix(float m[4][4], float rotation)
339{
340 float xrs, xrc, yrs, yrc, zrs, zrc, mag;
341
342 mag = M_SQRT2;
343 xrs = 1.f / mag;
344 xrc = 1.f / mag;
345 x_rotate_matrix(m, xrs, xrc);
346
347 mag = sqrtf(3.f);
348 yrs = -1.f / mag;
349 yrc = M_SQRT2 / mag;
350 y_rotate_matrix(m, yrs, yrc);
351
352 zrs = sinf(rotation * M_PI / 180.f);
353 zrc = cosf(rotation * M_PI / 180.f);
354 z_rotate_matrix(m, zrs, zrc);
355
356 y_rotate_matrix(m, -yrs, yrc);
357 x_rotate_matrix(m, -xrs, xrc);
358}
359
361{
362 float i = 1.f + s->intensity;
363 float saturation = 1.f + s->saturation;
364 float hue = s->hue;
365
366 identity_matrix(s->matrix);
367 colorscale_matrix(s->matrix, i, i, i);
369 s->rlw, s->glw, s->blw);
370
371 if (s->lightness)
372 hue_rotate_matrix(s->matrix, hue,
373 s->rlw, s->glw, s->blw);
374 else
375 shue_rotate_matrix(s->matrix, hue);
376
377 matrix2imatrix(s->matrix, s->imatrix);
378}
379
381{
382 AVFilterContext *ctx = inlink->dst;
383 HueSaturationContext *s = ctx->priv;
384
385 init_matrix(s);
386
387 ff_filter_execute(ctx, s->do_slice[(s->strength >= 99.f) && (s->colors == ALL)], frame, NULL,
388 FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
389
390 return ff_filter_frame(ctx->outputs[0], frame);
391}
392
403
405{
406 AVFilterContext *ctx = inlink->dst;
407 HueSaturationContext *s = ctx->priv;
409
410 s->depth = desc->comp[0].depth;
411 s->bpp = s->depth >> 3;
412 s->step = av_get_padded_bits_per_pixel(desc) >> (3 + (s->bpp == 2));
413 ff_fill_rgba_map(s->rgba_map, inlink->format);
414
415 s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
416 s->planewidth[0] = s->planewidth[3] = inlink->w;
417 s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
418 s->planeheight[0] = s->planeheight[3] = inlink->h;
419
420 s->do_slice[0] = s->depth <= 8 ? do_slice_8_0 : do_slice_16_0;
421 s->do_slice[1] = s->depth <= 8 ? do_slice_8_1 : do_slice_16_1;
422
423 return 0;
424}
425
427 {
428 .name = "default",
429 .type = AVMEDIA_TYPE_VIDEO,
431 .filter_frame = filter_frame,
432 .config_props = config_input,
433 },
434};
435
436#define OFFSET(x) offsetof(HueSaturationContext, x)
437#define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
438
440 { "hue", "set the hue shift", OFFSET(hue), AV_OPT_TYPE_FLOAT, {.dbl=0},-180, 180, VF },
441 { "saturation", "set the saturation shift", OFFSET(saturation), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
442 { "intensity", "set the intensity shift", OFFSET(intensity), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
443 { "colors", "set colors range", OFFSET(colors), AV_OPT_TYPE_FLAGS, {.i64=ALL}, 0,ALL,VF, .unit = "colors" },
444 { "r", "set reds", 0, AV_OPT_TYPE_CONST, {.i64=RED}, 0, 0, VF, .unit = "colors" },
445 { "y", "set yellows", 0, AV_OPT_TYPE_CONST, {.i64=YELLOW}, 0, 0, VF, .unit = "colors" },
446 { "g", "set greens", 0, AV_OPT_TYPE_CONST, {.i64=GREEN}, 0, 0, VF, .unit = "colors" },
447 { "c", "set cyans", 0, AV_OPT_TYPE_CONST, {.i64=CYAN}, 0, 0, VF, .unit = "colors" },
448 { "b", "set blues", 0, AV_OPT_TYPE_CONST, {.i64=BLUE}, 0, 0, VF, .unit = "colors" },
449 { "m", "set magentas", 0, AV_OPT_TYPE_CONST, {.i64=MAGENTA}, 0, 0, VF, .unit = "colors" },
450 { "a", "set all colors", 0, AV_OPT_TYPE_CONST, {.i64=ALL}, 0, 0, VF, .unit = "colors" },
451 { "strength", "set the filtering strength", OFFSET(strength), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0,100,VF },
452 { "rw", "set the red weight", OFFSET(rlw), AV_OPT_TYPE_FLOAT, {.dbl=.333}, 0, 1, VF },
453 { "gw", "set the green weight", OFFSET(glw), AV_OPT_TYPE_FLOAT, {.dbl=.334}, 0, 1, VF },
454 { "bw", "set the blue weight", OFFSET(blw), AV_OPT_TYPE_FLOAT, {.dbl=.333}, 0, 1, VF },
455 { "lightness", "set the preserve lightness", OFFSET(lightness), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, VF },
456 { NULL }
457};
458
460
462 .p.name = "huesaturation",
463 .p.description = NULL_IF_CONFIG_SMALL("Apply hue-saturation-intensity adjustments."),
464 .p.priv_class = &huesaturation_class,
466 .priv_size = sizeof(HueSaturationContext),
470 .process_command = ff_filter_process_command,
471};
static int config_input(AVFilterLink *inlink)
const FFFilter ff_vf_huesaturation
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition avfilter.c:906
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition avfilter.c:1696
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition avfilter.c:846
Main libavfilter public API header.
#define ib(width, name)
Definition cbs_h264.c:65
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define f(width, name)
Definition cbs_vp8.c:236
#define s(width, name)
Definition cbs_vp9.c:198
static IPT saturation(const CmsCtx *ctx, IPT ipt)
Definition cms.c:559
#define AV_CEIL_RSHIFT(a, b)
Definition common.h:60
#define av_clip_uint8
Definition common.h:106
#define av_clip_uint16
Definition common.h:112
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static __device__ float sqrtf(float a)
#define max(a, b)
static AVFrame * frame
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
Definition drawutils.c:80
misc drawing utilities
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_FLAGS
Underlying C type is unsigned int.
Definition opt.h:254
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition opt.h:270
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
#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:196
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int a
#define r
Definition input.c:42
#define b
Definition input.c:43
const char * arg
Definition jacosubdec.c:65
#define VF
Definition af_afir.c:731
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition filters.h:59
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
#define sinf(x)
Definition libm.h:421
#define cosf(x)
Definition libm.h:80
#define lrintf(x)
Definition libm_mips.h:72
const char * desc
Definition libsvtav1.c:83
#define FFMIN(a, b)
Definition macros.h:49
#define M_SQRT2
#define M_PI
Definition mathematics.h:67
AVOptions.
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
Definition pixdesc.c:3425
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
#define AV_PIX_FMT_BGR48
Definition pixfmt.h:536
#define AV_PIX_FMT_RGBA64
Definition pixfmt.h:535
#define AV_PIX_FMT_RGB48
Definition pixfmt.h:531
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition pixfmt.h:75
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition pixfmt.h:265
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition pixfmt.h:99
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition pixfmt.h:101
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition pixfmt.h:264
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition pixfmt.h:263
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition pixfmt.h:262
#define AV_PIX_FMT_BGRA64
Definition pixfmt.h:540
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
AVOption.
Definition opt.h:428
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
int(* do_slice[2])(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static AVFormatContext * ctx
Definition movenc.c:49
static enum AVPixelFormat pixel_fmts[]
Definition vf_amplify.c:52
const char * g
Definition vf_curves.c:128
static void hue_rotate_matrix(float matrix[4][4], float rotation, float rlw, float glw, float blw)
static const AVFilterPad huesaturation_inputs[]
#define ALL
static void shue_rotate_matrix(float m[4][4], float rotation)
#define HUESATURATION(name, type, clip, xall)
#define FAST_DIV255(x)
static void get_triplet(int64_t m[4][4], int *r, int *g, int *b)
static void x_rotate_matrix(float matrix[4][4], float rs, float rc)
static const AVOption huesaturation_options[]
static void matrix2imatrix(float matrix[4][4], int64_t imatrix[4][4])
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static void identity_matrix(float matrix[4][4])
#define MAGENTA
static void init_matrix(HueSaturationContext *s)
#define BLUE
#define RED
static av_cold int config_input(AVFilterLink *inlink)
static void transform_point(float matrix[4][4], float x, float y, float z, float *tx, float *ty, float *tz)
static void saturation_matrix(float matrix[4][4], float saturation, float rlw, float glw, float blw)
static void matrix_multiply(float a[4][4], float b[4][4], float c[4][4])
static int lerpi8(int v0, int v1, int f, int max)
#define YELLOW
#define GREEN
#define OFFSET(x)
#define CYAN
static void z_shear_matrix(float matrix[4][4], float dx, float dy)
static void z_rotate_matrix(float matrix[4][4], float rs, float rc)
static int lerpi16(int v0, int v1, int f, int max)
static void colorscale_matrix(float matrix[4][4], float r, float g, float b)
static void y_rotate_matrix(float matrix[4][4], float rs, float rc)
#define DENOM
else temp
Definition vf_mcdeint.c:275
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
static double c[64]