FFmpeg
Loading...
Searching...
No Matches
vf_pad_opencl.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
20#include "libavutil/eval.h"
21#include "libavutil/opt.h"
22#include "libavutil/pixdesc.h"
23#include "avfilter.h"
24#include "drawutils.h"
25#include "filters.h"
26#include "opencl.h"
27#include "opencl_source.h"
28#include "video.h"
29
30static const char *const var_names[] = {
31 "in_w", "iw",
32 "in_h", "ih",
33 "out_w", "ow",
34 "out_h", "oh",
35 "x",
36 "y",
37 "a",
38 "sar",
39 "dar",
40 NULL
41};
42
55
56typedef struct PadOpenCLContext {
59 int is_rgb;
61 int hsub, vsub;
62
63 char *w_expr;
64 char *h_expr;
65 char *x_expr;
66 char *y_expr;
68
69 cl_command_queue command_queue;
70 cl_kernel kernel_pad;
71
72 int w, h;
73 int x, y;
74 uint8_t pad_rgba[4];
75 uint8_t pad_color[4];
76 cl_float4 pad_color_float;
77 cl_int2 pad_pos;
79
80static int pad_opencl_init(AVFilterContext *avctx, AVFrame *input_frame)
81{
82 PadOpenCLContext *ctx = avctx->priv;
83 AVHWFramesContext *input_frames_ctx = (AVHWFramesContext *)input_frame->hw_frames_ctx->data;
84 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(input_frames_ctx->sw_format);
85 uint8_t rgba_map[4];
86 cl_int cle;
87 int err;
88
89 ff_fill_rgba_map(rgba_map, input_frames_ctx->sw_format);
90 ctx->is_rgb = !!(desc->flags & AV_PIX_FMT_FLAG_RGB);
91 ctx->is_packed = !(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
92 ctx->hsub = desc->log2_chroma_w;
93 ctx->vsub = desc->log2_chroma_h;
94
96 if (err < 0)
97 goto fail;
98
99 ctx->command_queue = clCreateCommandQueue(
100 ctx->ocf.hwctx->context,
101 ctx->ocf.hwctx->device_id,
102 0,
103 &cle
104 );
105
106 if (ctx->is_rgb) {
107 ctx->pad_color[rgba_map[0]] = ctx->pad_rgba[0];
108 ctx->pad_color[rgba_map[1]] = ctx->pad_rgba[1];
109 ctx->pad_color[rgba_map[2]] = ctx->pad_rgba[2];
110 ctx->pad_color[rgba_map[3]] = ctx->pad_rgba[3];
111 } else {
112 ctx->pad_color[0] = RGB_TO_Y_BT709(ctx->pad_rgba[0], ctx->pad_rgba[1], ctx->pad_rgba[2]);
113 ctx->pad_color[1] = RGB_TO_U_BT709(ctx->pad_rgba[0], ctx->pad_rgba[1], ctx->pad_rgba[2], 0);
114 ctx->pad_color[2] = RGB_TO_V_BT709(ctx->pad_rgba[0], ctx->pad_rgba[1], ctx->pad_rgba[2], 0);
115 ctx->pad_color[3] = ctx->pad_rgba[3];
116 }
117
118 CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create OpenCL command queue %d.\n", cle);
119
120 ctx->kernel_pad = clCreateKernel(ctx->ocf.program, "pad", &cle);
121 CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create pad kernel: %d.\n", cle);
122
123 for (int i = 0; i < 4; ++i) {
124 ctx->pad_color_float.s[i] = (float)ctx->pad_color[i] / 255.0;
125 }
126
127 ctx->pad_pos.s[0] = ctx->x;
128 ctx->pad_pos.s[1] = ctx->y;
129
130 ctx->initialized = 1;
131 return 0;
132
133fail:
134 if (ctx->command_queue)
135 clReleaseCommandQueue(ctx->command_queue);
136 if (ctx->kernel_pad)
137 clReleaseKernel(ctx->kernel_pad);
138 return err;
139}
140
141static int filter_frame(AVFilterLink *link, AVFrame *input_frame)
142{
143 AVFilterContext *avctx = link->dst;
144 AVFilterLink *outlink = avctx->outputs[0];
145 PadOpenCLContext *pad_ctx = avctx->priv;
147 int err;
148 cl_int cle;
149 size_t global_work[2];
150 cl_mem src, dst;
151
152 if (!input_frame->hw_frames_ctx)
153 return AVERROR(EINVAL);
154
155 if (!pad_ctx->initialized) {
156 err = pad_opencl_init(avctx, input_frame);
157 if (err < 0)
158 goto fail;
159 }
160
161 output_frame = ff_get_video_buffer(outlink, outlink->w, outlink->h);
162 if (!output_frame) {
163 err = AVERROR(ENOMEM);
164 goto fail;
165 }
166
167 for (int p = 0; p < FF_ARRAY_ELEMS(output_frame->data); p++) {
168 cl_float4 pad_color_float;
169 cl_int2 pad_pos;
170
171 if (pad_ctx->is_packed) {
172 pad_color_float = pad_ctx->pad_color_float;
173 } else {
174 pad_color_float.s[0] = pad_ctx->pad_color_float.s[p];
175 pad_color_float.s[1] = pad_ctx->pad_color_float.s[2];
176 }
177
178 if (p > 0 && p < 3) {
179 pad_pos.s[0] = pad_ctx->pad_pos.s[0] >> pad_ctx->hsub;
180 pad_pos.s[1] = pad_ctx->pad_pos.s[1] >> pad_ctx->vsub;
181 } else {
182 pad_pos.s[0] = pad_ctx->pad_pos.s[0];
183 pad_pos.s[1] = pad_ctx->pad_pos.s[1];
184 }
185
186 src = (cl_mem)input_frame->data[p];
187 dst = (cl_mem)output_frame->data[p];
188
189 if (!dst)
190 break;
191
192 CL_SET_KERNEL_ARG(pad_ctx->kernel_pad, 0, cl_mem, &src);
193 CL_SET_KERNEL_ARG(pad_ctx->kernel_pad, 1, cl_mem, &dst);
194 CL_SET_KERNEL_ARG(pad_ctx->kernel_pad, 2, cl_float4, &pad_color_float);
195 CL_SET_KERNEL_ARG(pad_ctx->kernel_pad, 3, cl_int2, &pad_pos);
196
197 err = ff_opencl_filter_work_size_from_image(avctx, global_work, output_frame, p, 16);
198 if (err < 0)
199 goto fail;
200
201 cle = clEnqueueNDRangeKernel(pad_ctx->command_queue, pad_ctx->kernel_pad, 2, NULL,
202 global_work, NULL, 0, NULL, NULL);
203
204 CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to enqueue pad kernel: %d.\n", cle);
205 }
206
207 // Run queued kernel
208 cle = clFinish(pad_ctx->command_queue);
209 CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to finish command queue: %d.\n", cle);
210
211 err = av_frame_copy_props(output_frame, input_frame);
212 if (err < 0)
213 goto fail;
214
215 av_frame_free(&input_frame);
216
217 return ff_filter_frame(outlink, output_frame);
218
219fail:
220 clFinish(pad_ctx->command_queue);
221 av_frame_free(&input_frame);
223 return err;
224}
225
227{
228 PadOpenCLContext *ctx = avctx->priv;
229 cl_int cle;
230
231 if (ctx->kernel_pad) {
232 cle = clReleaseKernel(ctx->kernel_pad);
233 if (cle != CL_SUCCESS)
234 av_log(avctx, AV_LOG_ERROR, "Failed to release "
235 "kernel: %d.\n", cle);
236 }
237
238 if (ctx->command_queue) {
239 cle = clReleaseCommandQueue(ctx->command_queue);
240 if (cle != CL_SUCCESS)
241 av_log(avctx, AV_LOG_ERROR, "Failed to release "
242 "command queue: %d.\n", cle);
243 }
244
246}
247
249{
250 AVFilterContext *avctx = outlink->src;
251 AVFilterLink *inlink = avctx->inputs[0];
252 PadOpenCLContext *ctx = avctx->priv;
253 AVRational adjusted_aspect = ctx->aspect;
254 double var_values[VARS_NB], res;
255 int err, ret;
256 char *expr;
257
258 var_values[VAR_IN_W] = var_values[VAR_IW] = inlink->w;
259 var_values[VAR_IN_H] = var_values[VAR_IH] = inlink->h;
260 var_values[VAR_OUT_W] = var_values[VAR_OW] = NAN;
261 var_values[VAR_OUT_H] = var_values[VAR_OH] = NAN;
262 var_values[VAR_A] = (double) inlink->w / inlink->h;
263 var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ?
264 (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1;
265 var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR];
266
267 av_expr_parse_and_eval(&res, (expr = ctx->w_expr),
268 var_names, var_values,
269 NULL, NULL, NULL, NULL, NULL, 0, ctx);
270 ctx->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
271 if ((ret = av_expr_parse_and_eval(&res, (expr = ctx->h_expr),
272 var_names, var_values,
273 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
274 return ret;
275 ctx->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
276 if (!ctx->h)
277 var_values[VAR_OUT_H] = var_values[VAR_OH] = ctx->h = inlink->h;
278
279 /* evaluate the width again, as it may depend on the evaluated output height */
280 if ((ret = av_expr_parse_and_eval(&res, (expr = ctx->w_expr),
281 var_names, var_values,
282 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
283 return ret;
284 ctx->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
285 if (!ctx->w)
286 var_values[VAR_OUT_W] = var_values[VAR_OW] = ctx->w = inlink->w;
287
288 if (adjusted_aspect.num && adjusted_aspect.den) {
289 adjusted_aspect = av_div_q(adjusted_aspect, inlink->sample_aspect_ratio);
290 if (ctx->h < av_rescale(ctx->w, adjusted_aspect.den, adjusted_aspect.num)) {
291 ctx->h = var_values[VAR_OUT_H] = var_values[VAR_OH] = av_rescale(ctx->w, adjusted_aspect.den, adjusted_aspect.num);
292 } else {
293 ctx->w = var_values[VAR_OUT_W] = var_values[VAR_OW] = av_rescale(ctx->h, adjusted_aspect.num, adjusted_aspect.den);
294 }
295 }
296
297 /* evaluate x and y */
298 av_expr_parse_and_eval(&res, (expr = ctx->x_expr),
299 var_names, var_values,
300 NULL, NULL, NULL, NULL, NULL, 0, ctx);
301 ctx->x = var_values[VAR_X] = res;
302 if ((ret = av_expr_parse_and_eval(&res, (expr = ctx->y_expr),
303 var_names, var_values,
304 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
305 return ret;
306 ctx->y = var_values[VAR_Y] = res;
307 /* evaluate x again, as it may depend on the evaluated y value */
308 if ((ret = av_expr_parse_and_eval(&res, (expr = ctx->x_expr),
309 var_names, var_values,
310 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
311 return ret;
312 ctx->x = var_values[VAR_X] = res;
313
314 if (ctx->x < 0 || ctx->x + inlink->w > ctx->w)
315 ctx->x = var_values[VAR_X] = (ctx->w - inlink->w) / 2;
316 if (ctx->y < 0 || ctx->y + inlink->h > ctx->h)
317 ctx->y = var_values[VAR_Y] = (ctx->h - inlink->h) / 2;
318
319 /* sanity check params */
320 if (ctx->w < inlink->w || ctx->h < inlink->h) {
321 av_log(ctx, AV_LOG_ERROR, "Padded dimensions cannot be smaller than input dimensions.\n");
322 return AVERROR(EINVAL);
323 }
324
325 if (ctx->w > avctx->inputs[0]->w) {
326 ctx->ocf.output_width = ctx->w;
327 } else {
328 ctx->ocf.output_width = avctx->inputs[0]->w;
329 }
330
331 if (ctx->h > avctx->inputs[0]->h) {
332 ctx->ocf.output_height = ctx->h;
333 } else {
334 ctx->ocf.output_height = avctx->inputs[0]->h;
335 }
336
337 if (ctx->x + avctx->inputs[0]->w > ctx->ocf.output_width ||
338 ctx->y + avctx->inputs[0]->h > ctx->ocf.output_height) {
339 return AVERROR(EINVAL);
340 }
341
342 err = ff_opencl_filter_config_output(outlink);
343 if (err < 0)
344 return err;
345
346 return 0;
347}
348
350 {
351 .name = "default",
352 .type = AVMEDIA_TYPE_VIDEO,
353 .filter_frame = filter_frame,
354 .config_props = &ff_opencl_filter_config_input,
355 },
356};
357
359 {
360 .name = "default",
361 .type = AVMEDIA_TYPE_VIDEO,
362 .config_props = &pad_opencl_config_output,
363 },
364};
365
366#define OFFSET(x) offsetof(PadOpenCLContext, x)
367#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
368
369static const AVOption pad_opencl_options[] = {
370 { "width", "set the pad area width", OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, 0, 0, FLAGS },
371 { "w", "set the pad area width", OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, 0, 0, FLAGS },
372 { "height", "set the pad area height", OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, 0, 0, FLAGS },
373 { "h", "set the pad area height", OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, 0, 0, FLAGS },
374 { "x", "set the x offset for the input image position", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "0"}, 0, INT16_MAX, FLAGS },
375 { "y", "set the y offset for the input image position", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "0"}, 0, INT16_MAX, FLAGS },
376 { "color", "set the color of the padded area border", OFFSET(pad_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS },
377 { "aspect", "pad to fit an aspect instead of a resolution", OFFSET(aspect), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, INT16_MAX, FLAGS },
378 { NULL }
379};
380
382
384 .p.name = "pad_opencl",
385 .p.description = NULL_IF_CONFIG_SMALL("Pad the input video."),
386 .p.priv_class = &pad_opencl_class,
387 .p.flags = AVFILTER_FLAG_HWDEVICE,
388 .priv_size = sizeof(PadOpenCLContext),
394 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
395};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
const FFFilter ff_vf_pad_opencl
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
Main libavfilter public API header.
@ VARS_NB
Definition boxblur.c:43
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
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
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Definition eval.c:839
simple arithmetic expression evaluator
@ VAR_IW
Definition f_select.c:147
@ VAR_IH
Definition f_select.c:146
#define fail
Definition test.h:479
@ AV_OPT_TYPE_RATIONAL
Underlying C type is AVRational.
Definition opt.h:279
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition opt.h:322
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition avfilter.h:187
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition frame.c:599
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
Definition rational.c:88
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
Definition h264dec.c:860
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition filters.h:208
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition filters.h:254
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
@ VAR_X
Definition vf_blend.c:55
@ VAR_Y
Definition vf_blend.c:55
#define av_cold
Definition attributes.h:117
Various defines for YUV<->RGB conversion.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
const char * desc
Definition libsvtav1.c:83
#define NAN
var_name
Definition noise.c:46
static const char *const var_names[]
Definition noise.c:30
void ff_opencl_filter_uninit(AVFilterContext *avctx)
Uninitialise an OpenCL filter context.
Definition opencl.c:144
int ff_opencl_filter_load_program(AVFilterContext *avctx, const char **program_source_array, int nb_strings)
Load a new OpenCL program from strings in memory.
Definition opencl.c:159
int ff_opencl_filter_config_input(AVFilterLink *inlink)
Check that the input link contains a suitable hardware frames context and extract the device from it.
Definition opencl.c:46
int ff_opencl_filter_init(AVFilterContext *avctx)
Initialise an OpenCL filter context.
Definition opencl.c:135
int ff_opencl_filter_work_size_from_image(AVFilterContext *avctx, size_t *work_size, AVFrame *frame, int plane, int block_alignment)
Find the work size needed needed for a given plane of an image.
Definition opencl.c:266
int ff_opencl_filter_config_output(AVFilterLink *outlink)
Create a suitable hardware frames context for the output.
Definition opencl.c:83
#define CL_SET_KERNEL_ARG(kernel, arg_num, type, arg)
set argument to specific Kernel.
Definition opencl.h:61
#define CL_FAIL_ON_ERROR(errcode,...)
A helper macro to handle OpenCL errors.
Definition opencl.h:74
const char * ff_source_pad_cl
AVOptions.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
Definition pixdesc.h:136
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
Definition pixdesc.h:132
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition pixfmt.h:358
@ VAR_OUT_H
Definition scale_eval.c:47
@ VAR_SAR
Definition scale_eval.c:49
@ VAR_OH
Definition scale_eval.c:47
@ VAR_IN_W
Definition scale_eval.c:44
@ VAR_OW
Definition scale_eval.c:46
@ VAR_A
Definition scale_eval.c:48
@ VAR_OUT_W
Definition scale_eval.c:46
@ VAR_IN_H
Definition scale_eval.c:45
@ VAR_DAR
Definition scale_eval.c:50
#define FF_ARRAY_ELEMS(a)
uint8_t * data
The data buffer.
Definition buffer.h:90
An instance of a filter.
Definition avfilter.h:273
AVFilterLink ** inputs
array of pointers to input links
Definition avfilter.h:281
void * priv
private data for use by the filter
Definition avfilter.h:288
AVFilterLink ** outputs
array of pointers to output links
Definition avfilter.h:285
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
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame.
Definition frame.h:769
This struct describes a set or pool of "hardware" frames (i.e.
Definition hwcontext.h:118
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Definition hwcontext.h:213
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
Rational number (pair of numerator and denominator).
Definition rational.h:58
int num
Numerator.
Definition rational.h:59
int den
Denominator.
Definition rational.h:60
uint8_t pad_color[4]
uint8_t pad_rgba[4]
OpenCLFilterContext ocf
AVRational aspect
cl_kernel kernel_pad
cl_command_queue command_queue
cl_float4 pad_color_float
#define av_log(a,...)
#define src
Definition vp8dsp.c:248
static AVFormatContext * ctx
Definition movenc.c:49
static av_cold void pad_opencl_uninit(AVFilterContext *avctx)
static const AVOption pad_opencl_options[]
static const AVFilterPad pad_opencl_inputs[]
static int pad_opencl_config_output(AVFilterLink *outlink)
static int filter_frame(AVFilterLink *link, AVFrame *input_frame)
static int pad_opencl_init(AVFilterContext *avctx, AVFrame *input_frame)
static const AVFilterPad pad_opencl_outputs[]
#define OFFSET(x)
#define RGB_TO_Y_BT709(r, g, b)
#define RGB_TO_U_BT709(r1, g1, b1, max)
#define RGB_TO_V_BT709(r1, g1, b1, max)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition video.c:89