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/imgutils.h"
21 #include "avfilter.h"
22 #include "formats.h"
23 #include "internal.h"
24 #include "video.h"
25 
26 typedef struct ColorizeContext {
27  const AVClass *class;
28 
29  float hue;
30  float saturation;
31  float lightness;
32  float mix;
33 
34  int depth;
35  int c[3];
36  int planewidth[4];
37  int planeheight[4];
38 
40  int jobnr, int nb_jobs);
42 
43 static inline float lerpf(float v0, float v1, float f)
44 {
45  return v0 + (v1 - v0) * f;
46 }
47 
48 static int colorizey_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
49 {
50  ColorizeContext *s = ctx->priv;
51  AVFrame *frame = arg;
52  const int width = s->planewidth[0];
53  const int height = s->planeheight[0];
54  const int slice_start = (height * jobnr) / nb_jobs;
55  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
56  const int ylinesize = frame->linesize[0];
57  uint8_t *yptr = frame->data[0] + slice_start * ylinesize;
58  const int yv = s->c[0];
59  const float mix = s->mix;
60 
61  for (int y = slice_start; y < slice_end; y++) {
62  for (int x = 0; x < width; x++)
63  yptr[x] = lerpf(yv, yptr[x], mix);
64 
65  yptr += ylinesize;
66  }
67 
68  return 0;
69 }
70 
71 static int colorizey_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
72 {
73  ColorizeContext *s = ctx->priv;
74  AVFrame *frame = arg;
75  const int width = s->planewidth[0];
76  const int height = s->planeheight[0];
77  const int slice_start = (height * jobnr) / nb_jobs;
78  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
79  const int ylinesize = frame->linesize[0] / 2;
80  uint16_t *yptr = (uint16_t *)frame->data[0] + slice_start * ylinesize;
81  const int yv = s->c[0];
82  const float mix = s->mix;
83 
84  for (int y = slice_start; y < slice_end; y++) {
85  for (int x = 0; x < width; x++)
86  yptr[x] = lerpf(yv, yptr[x], mix);
87 
88  yptr += ylinesize;
89  }
90 
91  return 0;
92 }
93 
94 static int colorize_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
95 {
96  ColorizeContext *s = ctx->priv;
97  AVFrame *frame = arg;
98  const int width = s->planewidth[1];
99  const int height = s->planeheight[1];
100  const int slice_start = (height * jobnr) / nb_jobs;
101  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
102  const int ulinesize = frame->linesize[1];
103  const int vlinesize = frame->linesize[2];
104  uint8_t *uptr = frame->data[1] + slice_start * ulinesize;
105  uint8_t *vptr = frame->data[2] + slice_start * vlinesize;
106  const int u = s->c[1];
107  const int v = s->c[2];
108 
109  for (int y = slice_start; y < slice_end; y++) {
110  for (int x = 0; x < width; x++) {
111  uptr[x] = u;
112  vptr[x] = v;
113  }
114 
115  uptr += ulinesize;
116  vptr += vlinesize;
117  }
118 
119  return 0;
120 }
121 
122 static int colorize_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
123 {
124  ColorizeContext *s = ctx->priv;
125  AVFrame *frame = arg;
126  const int width = s->planewidth[1];
127  const int height = s->planeheight[1];
128  const int slice_start = (height * jobnr) / nb_jobs;
129  const int slice_end = (height * (jobnr + 1)) / nb_jobs;
130  const int ulinesize = frame->linesize[1] / 2;
131  const int vlinesize = frame->linesize[2] / 2;
132  uint16_t *uptr = (uint16_t *)frame->data[1] + slice_start * ulinesize;
133  uint16_t *vptr = (uint16_t *)frame->data[2] + slice_start * vlinesize;
134  const int u = s->c[1];
135  const int v = s->c[2];
136 
137  for (int y = slice_start; y < slice_end; y++) {
138  for (int x = 0; x < width; x++) {
139  uptr[x] = u;
140  vptr[x] = v;
141  }
142 
143  uptr += ulinesize;
144  vptr += vlinesize;
145  }
146 
147  return 0;
148 }
149 
150 static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
151 {
152  ColorizeContext *s = ctx->priv;
153 
154  s->do_plane_slice[0](ctx, arg, jobnr, nb_jobs);
155  s->do_plane_slice[1](ctx, arg, jobnr, nb_jobs);
156 
157  return 0;
158 }
159 
160 static float hue2rgb(float p, float q, float t)
161 {
162  if (t < 0.f) t += 1.f;
163  if (t > 1.f) t -= 1.f;
164  if (t < 1.f/6.f) return p + (q - p) * 6.f * t;
165  if (t < 1.f/2.f) return q;
166  if (t < 2.f/3.f) return p + (q - p) * (2.f/3.f - t) * 6.f;
167 
168  return p;
169 }
170 
171 static void hsl2rgb(float h, float s, float l, float *r, float *g, float *b)
172 {
173  h /= 360.f;
174 
175  if (s == 0.f) {
176  *r = *g = *b = l;
177  } else {
178  const float q = l < 0.5f ? l * (1.f + s) : l + s - l * s;
179  const float p = 2.f * l - q;
180 
181  *r = hue2rgb(p, q, h + 1.f / 3.f);
182  *g = hue2rgb(p, q, h);
183  *b = hue2rgb(p, q, h - 1.f / 3.f);
184  }
185 }
186 
187 static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth)
188 {
189  *y = ((0.21260*219.0/255.0) * r + (0.71520*219.0/255.0) * g +
190  (0.07220*219.0/255.0) * b) * ((1 << depth) - 1);
191  *u = (-(0.11457*224.0/255.0) * r - (0.38543*224.0/255.0) * g +
192  (0.50000*224.0/255.0) * b + 0.5) * ((1 << depth) - 1);
193  *v = ((0.50000*224.0/255.0) * r - (0.45415*224.0/255.0) * g -
194  (0.04585*224.0/255.0) * b + 0.5) * ((1 << depth) - 1);
195 }
196 
198 {
199  AVFilterContext *ctx = inlink->dst;
200  ColorizeContext *s = ctx->priv;
201  float c[3];
202 
203  hsl2rgb(s->hue, s->saturation, s->lightness, &c[0], &c[1], &c[2]);
204  rgb2yuv(c[0], c[1], c[2], &s->c[0], &s->c[1], &s->c[2], s->depth);
205 
206  ctx->internal->execute(ctx, do_slice, frame, NULL,
207  FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
208 
209  return ff_filter_frame(ctx->outputs[0], frame);
210 }
211 
213 {
214  static const enum AVPixelFormat pixel_fmts[] = {
233  };
234 
236 
237  formats = ff_make_format_list(pixel_fmts);
238  if (!formats)
239  return AVERROR(ENOMEM);
240 
242 }
243 
245 {
246  AVFilterContext *ctx = inlink->dst;
247  ColorizeContext *s = ctx->priv;
249  int depth;
250 
251  s->depth = depth = desc->comp[0].depth;
252 
253  s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
254  s->planewidth[0] = s->planewidth[3] = inlink->w;
255  s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
256  s->planeheight[0] = s->planeheight[3] = inlink->h;
257 
258  s->do_plane_slice[0] = depth <= 8 ? colorizey_slice8 : colorizey_slice16;
259  s->do_plane_slice[1] = depth <= 8 ? colorize_slice8 : colorize_slice16;
260 
261  return 0;
262 }
263 
264 static const AVFilterPad colorize_inputs[] = {
265  {
266  .name = "default",
267  .type = AVMEDIA_TYPE_VIDEO,
268  .needs_writable = 1,
269  .filter_frame = filter_frame,
270  .config_props = config_input,
271  },
272  { NULL }
273 };
274 
275 static const AVFilterPad colorize_outputs[] = {
276  {
277  .name = "default",
278  .type = AVMEDIA_TYPE_VIDEO,
279  },
280  { NULL }
281 };
282 
283 #define OFFSET(x) offsetof(ColorizeContext, x)
284 #define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
285 
286 static const AVOption colorize_options[] = {
287  { "hue", "set the hue", OFFSET(hue), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 360, VF },
288  { "saturation", "set the saturation", OFFSET(saturation), AV_OPT_TYPE_FLOAT, {.dbl=0.5},0, 1, VF },
289  { "lightness", "set the lightness", OFFSET(lightness), AV_OPT_TYPE_FLOAT, {.dbl=0.5},0, 1, VF },
290  { "mix", "set the mix of source lightness", OFFSET(mix), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, VF },
291  { NULL }
292 };
293 
294 AVFILTER_DEFINE_CLASS(colorize);
295 
297  .name = "colorize",
298  .description = NULL_IF_CONFIG_SMALL("Overlay a solid color on the video stream."),
299  .priv_size = sizeof(ColorizeContext),
300  .priv_class = &colorize_class,
306 };
formats
formats
Definition: signature.h:48
AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:442
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
mix
static int mix(int c0, int c1)
Definition: 4xm.c:715
r
const char * r
Definition: vf_curves.c:116
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
ff_make_format_list
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:286
VF
#define VF
Definition: vf_colorize.c:284
u
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:264
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1096
rgb2yuv
static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth)
Definition: vf_colorize.c:187
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2573
ColorizeContext::planewidth
int planewidth[4]
Definition: vf_colorize.c:36
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
colorize_outputs
static const AVFilterPad colorize_outputs[]
Definition: vf_colorize.c:275
AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:434
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:441
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:436
AVOption
AVOption.
Definition: opt.h:248
b
#define b
Definition: input.c:41
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:399
ColorizeContext::lightness
float lightness
Definition: vf_colorize.c:31
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
colorize_slice8
static int colorize_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:94
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:149
video.h
AVFormatContext::internal
AVFormatInternal * internal
An opaque field for libavformat internal usage.
Definition: avformat.h:1699
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:437
config_input
static av_cold int config_input(AVFilterLink *inlink)
Definition: vf_colorize.c:244
AVFilterFormats
A list of supported formats for one end of a filter link.
Definition: formats.h:65
formats.h
AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:433
v0
#define v0
Definition: regdef.h:26
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:443
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:397
ColorizeContext
Definition: vf_colorize.c:26
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:54
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:402
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:258
ff_vf_colorize
AVFilter ff_vf_colorize
Definition: vf_colorize.c:296
av_cold
#define av_cold
Definition: attributes.h:90
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:411
ff_set_common_formats
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:587
ColorizeContext::hue
float hue
Definition: vf_colorize.c:29
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:79
colorizey_slice16
static int colorizey_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:71
width
#define width
s
#define s(width, name)
Definition: cbs_vp9.c:257
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:101
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:412
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
hsl2rgb
static void hsl2rgb(float h, float s, float l, float *r, float *g, float *b)
Definition: vf_colorize.c:171
g
const char * g
Definition: vf_curves.c:117
slice_end
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
Definition: mpeg12dec.c:2033
query_formats
static av_cold int query_formats(AVFilterContext *ctx)
Definition: vf_colorize.c:212
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:440
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:396
hue2rgb
static float hue2rgb(float p, float q, float t)
Definition: vf_colorize.c:160
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:410
ctx
AVFormatContext * ctx
Definition: movenc.c:48
ColorizeContext::planeheight
int planeheight[4]
Definition: vf_colorize.c:37
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:66
f
#define f(width, name)
Definition: cbs_vp9.c:255
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:80
arg
const char * arg
Definition: jacosubdec.c:66
colorize_options
static const AVOption colorize_options[]
Definition: vf_colorize.c:286
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: vf_colorize.c:283
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:78
AV_PIX_FMT_YUV440P10
#define AV_PIX_FMT_YUV440P10
Definition: pixfmt.h:401
colorizey_slice8
static int colorizey_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:48
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:400
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
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
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
lerpf
static float lerpf(float v0, float v1, float f)
Definition: vf_colorize.c:43
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
colorize_slice16
static int colorize_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:122
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:336
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:404
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:406
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:882
height
#define height
FFMIN
#define FFMIN(a, b)
Definition: common.h:105
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:177
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_colorize.c:197
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:438
ColorizeContext::do_plane_slice
int(* do_plane_slice[2])(AVFilterContext *s, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:39
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:126
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
ff_filter_get_nb_threads
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:802
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:100
uint8_t
uint8_t
Definition: audio_convert.c:194
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:60
colorize_inputs
static const AVFilterPad colorize_inputs[]
Definition: vf_colorize.c:264
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:398
ColorizeContext::c
int c[3]
Definition: vf_colorize.c:35
AVFilter
Filter definition.
Definition: avfilter.h:145
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:435
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:403
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:408
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:439
avfilter.h
do_slice
static int do_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_colorize.c:150
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:71
AVFilterContext
An instance of a filter.
Definition: avfilter.h:341
ColorizeContext::depth
int depth
Definition: vf_colorize.c:34
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:117
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:70
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
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:73
ColorizeContext::mix
float mix
Definition: vf_colorize.c:32
imgutils.h
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
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:72
AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:405
h
h
Definition: vp9dsp_template.c:2038
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:409
int
int
Definition: ffmpeg_filter.c:170
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:176
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:407
ColorizeContext::saturation
float saturation
Definition: vf_colorize.c:30