FFmpeg
vf_colorize.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 "filters.h"
23 #include "video.h"
24 
25 typedef struct ColorizeContext {
26  const AVClass *class;
27 
28  float hue;
29  float saturation;
30  float lightness;
31  float mix;
32 
33  int depth;
34  int c[3];
35  int planewidth[4];
36  int planeheight[4];
37 
38  int (*do_plane_slice[2])(AVFilterContext *s, void *arg,
39  int jobnr, int nb_jobs);
41 
42 static inline float lerpf(float v0, float v1, float f)
43 {
44  return v0 + (v1 - v0) * f;
45 }
46 
47 static int colorizey_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
48 {
49  ColorizeContext *s = ctx->priv;
50  AVFrame *frame = arg;
51  const int width = s->planewidth[0];
52  const int height = s->planeheight[0];
53  const int slice_start = (height * jobnr) / nb_jobs;
54  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
55  const ptrdiff_t ylinesize = frame->linesize[0];
56  uint8_t *yptr = frame->data[0] + slice_start * ylinesize;
57  const int yv = s->c[0];
58  const float mix = s->mix;
59 
60  for (int y = slice_start; y < slice_end; y++) {
61  for (int x = 0; x < width; x++)
62  yptr[x] = lerpf(yv, yptr[x], mix);
63 
64  yptr += ylinesize;
65  }
66 
67  return 0;
68 }
69 
70 static int colorizey_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
71 {
72  ColorizeContext *s = ctx->priv;
73  AVFrame *frame = arg;
74  const int width = s->planewidth[0];
75  const int height = s->planeheight[0];
76  const int slice_start = (height * jobnr) / nb_jobs;
77  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
78  const ptrdiff_t ylinesize = frame->linesize[0] / 2;
79  uint16_t *yptr = (uint16_t *)frame->data[0] + slice_start * ylinesize;
80  const int yv = s->c[0];
81  const float mix = s->mix;
82 
83  for (int y = slice_start; y < slice_end; y++) {
84  for (int x = 0; x < width; x++)
85  yptr[x] = lerpf(yv, yptr[x], mix);
86 
87  yptr += ylinesize;
88  }
89 
90  return 0;
91 }
92 
93 static int colorize_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
94 {
95  ColorizeContext *s = ctx->priv;
96  AVFrame *frame = arg;
97  const int width = s->planewidth[1];
98  const int height = s->planeheight[1];
99  const int slice_start = (height * jobnr) / nb_jobs;
100  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
101  const ptrdiff_t ulinesize = frame->linesize[1];
102  const ptrdiff_t vlinesize = frame->linesize[2];
103  uint8_t *uptr = frame->data[1] + slice_start * ulinesize;
104  uint8_t *vptr = frame->data[2] + slice_start * vlinesize;
105  const int u = s->c[1];
106  const int v = s->c[2];
107 
108  for (int y = slice_start; y < slice_end; y++) {
109  for (int x = 0; x < width; x++) {
110  uptr[x] = u;
111  vptr[x] = v;
112  }
113 
114  uptr += ulinesize;
115  vptr += vlinesize;
116  }
117 
118  return 0;
119 }
120 
121 static int colorize_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
122 {
123  ColorizeContext *s = ctx->priv;
124  AVFrame *frame = arg;
125  const int width = s->planewidth[1];
126  const int height = s->planeheight[1];
127  const int slice_start = (height * jobnr) / nb_jobs;
128  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
129  const ptrdiff_t ulinesize = frame->linesize[1] / 2;
130  const ptrdiff_t vlinesize = frame->linesize[2] / 2;
131  uint16_t *uptr = (uint16_t *)frame->data[1] + slice_start * ulinesize;
132  uint16_t *vptr = (uint16_t *)frame->data[2] + slice_start * vlinesize;
133  const int u = s->c[1];
134  const int v = s->c[2];
135 
136  for (int y = slice_start; y < slice_end; y++) {
137  for (int x = 0; x < width; x++) {
138  uptr[x] = u;
139  vptr[x] = v;
140  }
141 
142  uptr += ulinesize;
143  vptr += vlinesize;
144  }
145 
146  return 0;
147 }
148 
149 static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
150 {
151  ColorizeContext *s = ctx->priv;
152 
153  s->do_plane_slice[0](ctx, arg, jobnr, nb_jobs);
154  s->do_plane_slice[1](ctx, arg, jobnr, nb_jobs);
155 
156  return 0;
157 }
158 
159 static float hue2rgb(float p, float q, float t)
160 {
161  if (t < 0.f) t += 1.f;
162  if (t > 1.f) t -= 1.f;
163  if (t < 1.f/6.f) return p + (q - p) * 6.f * t;
164  if (t < 1.f/2.f) return q;
165  if (t < 2.f/3.f) return p + (q - p) * (2.f/3.f - t) * 6.f;
166 
167  return p;
168 }
169 
170 static void hsl2rgb(float h, float s, float l, float *r, float *g, float *b)
171 {
172  h /= 360.f;
173 
174  if (s == 0.f) {
175  *r = *g = *b = l;
176  } else {
177  const float q = l < 0.5f ? l * (1.f + s) : l + s - l * s;
178  const float p = 2.f * l - q;
179 
180  *r = hue2rgb(p, q, h + 1.f / 3.f);
181  *g = hue2rgb(p, q, h);
182  *b = hue2rgb(p, q, h - 1.f / 3.f);
183  }
184 }
185 
186 static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth)
187 {
188  *y = ((0.21260*219.0/255.0) * r + (0.71520*219.0/255.0) * g +
189  (0.07220*219.0/255.0) * b) * ((1 << depth) - 1);
190  *u = (-(0.11457*224.0/255.0) * r - (0.38543*224.0/255.0) * g +
191  (0.50000*224.0/255.0) * b + 0.5) * ((1 << depth) - 1);
192  *v = ((0.50000*224.0/255.0) * r - (0.45415*224.0/255.0) * g -
193  (0.04585*224.0/255.0) * b + 0.5) * ((1 << depth) - 1);
194 }
195 
197 {
198  AVFilterContext *ctx = inlink->dst;
199  ColorizeContext *s = ctx->priv;
200  float c[3];
201 
202  hsl2rgb(s->hue, s->saturation, s->lightness, &c[0], &c[1], &c[2]);
203  rgb2yuv(c[0], c[1], c[2], &s->c[0], &s->c[1], &s->c[2], s->depth);
204 
206  FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
207 
208  return ff_filter_frame(ctx->outputs[0], frame);
209 }
210 
211 static const enum AVPixelFormat pixel_fmts[] = {
230 };
231 
233 {
234  AVFilterContext *ctx = inlink->dst;
235  ColorizeContext *s = ctx->priv;
237  int depth;
238 
239  s->depth = depth = desc->comp[0].depth;
240 
241  s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
242  s->planewidth[0] = s->planewidth[3] = inlink->w;
243  s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
244  s->planeheight[0] = s->planeheight[3] = inlink->h;
245 
246  s->do_plane_slice[0] = depth <= 8 ? colorizey_slice8 : colorizey_slice16;
247  s->do_plane_slice[1] = depth <= 8 ? colorize_slice8 : colorize_slice16;
248 
249  return 0;
250 }
251 
252 static const AVFilterPad colorize_inputs[] = {
253  {
254  .name = "default",
255  .type = AVMEDIA_TYPE_VIDEO,
257  .filter_frame = filter_frame,
258  .config_props = config_input,
259  },
260 };
261 
262 #define OFFSET(x) offsetof(ColorizeContext, x)
263 #define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
264 
265 static const AVOption colorize_options[] = {
266  { "hue", "set the hue", OFFSET(hue), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 360, VF },
267  { "saturation", "set the saturation", OFFSET(saturation), AV_OPT_TYPE_FLOAT, {.dbl=0.5},0, 1, VF },
268  { "lightness", "set the lightness", OFFSET(lightness), AV_OPT_TYPE_FLOAT, {.dbl=0.5},0, 1, VF },
269  { "mix", "set the mix of source lightness", OFFSET(mix), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, VF },
270  { NULL }
271 };
272 
273 AVFILTER_DEFINE_CLASS(colorize);
274 
276  .name = "colorize",
277  .description = NULL_IF_CONFIG_SMALL("Overlay a solid color on the video stream."),
278  .priv_size = sizeof(ColorizeContext),
279  .priv_class = &colorize_class,
284  .process_command = ff_filter_process_command,
285 };
AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:540
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
mix
static int mix(int c0, int c1)
Definition: 4xm.c:716
r
const char * r
Definition: vf_curves.c:127
opt.h
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: filters.h:242
VF
#define VF
Definition: vf_colorize.c:263
u
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:251
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1062
rgb2yuv
static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth)
Definition: vf_colorize.c:186
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3101
ColorizeContext::planewidth
int planewidth[4]
Definition: vf_colorize.c:35
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
AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:532
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
pixdesc.h
AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:539
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:534
AVOption
AVOption.
Definition: opt.h:429
b
#define b
Definition: input.c:41
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:496
ColorizeContext::lightness
float lightness
Definition: vf_colorize.c:30
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
colorize_slice8
static int colorize_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:93
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:205
video.h
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:535
config_input
static av_cold int config_input(AVFilterLink *inlink)
Definition: vf_colorize.c:232
AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:531
ff_vf_colorize
const AVFilter ff_vf_colorize
Definition: vf_colorize.c:275
slice_end
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
Definition: mpeg12dec.c:1719
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:541
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:494
ColorizeContext
Definition: vf_colorize.c:25
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:499
AV_PIX_FMT_YUVJ411P
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:283
av_cold
#define av_cold
Definition: attributes.h:90
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:508
ColorizeContext::hue
float hue
Definition: vf_colorize.c:28
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
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:86
colorizey_slice16
static int colorizey_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:70
s
#define s(width, name)
Definition: cbs_vp9.c:198
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
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:509
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:60
hsl2rgb
static void hsl2rgb(float h, float s, float l, float *r, float *g, float *b)
Definition: vf_colorize.c:170
g
const char * g
Definition: vf_curves.c:128
filters.h
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:538
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:493
hue2rgb
static float hue2rgb(float p, float q, float t)
Definition: vf_colorize.c:159
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:507
ctx
AVFormatContext * ctx
Definition: movenc.c:49
ColorizeContext::planeheight
int planeheight[4]
Definition: vf_colorize.c:36
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
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:87
arg
const char * arg
Definition: jacosubdec.c:67
colorize_options
static const AVOption colorize_options[]
Definition: vf_colorize.c:265
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: vf_colorize.c:262
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:85
AV_PIX_FMT_YUV440P10
#define AV_PIX_FMT_YUV440P10
Definition: pixfmt.h:498
colorizey_slice8
static int colorizey_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:47
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:497
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
AVFILTERPAD_FLAG_NEEDS_WRITABLE
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition: filters.h:57
f
f
Definition: af_crystalizer.c:122
lerpf
static float lerpf(float v0, float v1, float f)
Definition: vf_colorize.c:42
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:94
colorize_slice16
static int colorize_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:121
height
#define height
Definition: dsp.h:85
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:501
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:503
ff_filter_process_command
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:901
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
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_colorize.c:196
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:536
ColorizeContext::do_plane_slice
int(* do_plane_slice[2])(AVFilterContext *s, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:38
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:182
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition: opt.h:271
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:841
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:107
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
colorize_inputs
static const AVFilterPad colorize_inputs[]
Definition: vf_colorize.c:252
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:495
ColorizeContext::c
int c[3]
Definition: vf_colorize.c:34
slice_start
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
Definition: dec.c:737
AVFilter
Filter definition.
Definition: avfilter.h:201
frame
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:533
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:500
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:505
ff_filter_execute
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
Definition: avfilter.c:1667
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:537
avfilter.h
do_slice
static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:149
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:457
ColorizeContext::depth
int depth
Definition: vf_colorize.c:33
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:152
desc
const char * desc
Definition: libsvtav1.c:79
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
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(colorize)
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
ColorizeContext::mix
float mix
Definition: vf_colorize.c:31
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_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:502
h
h
Definition: vp9dsp_template.c:2070
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:506
width
#define width
Definition: dsp.h:85
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
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:504
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_colorize.c:211
ColorizeContext::saturation
float saturation
Definition: vf_colorize.c:29