FFmpeg
Loading...
Searching...
No Matches
vf_chromakey_cuda.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Mohamed Khaled <Mohamed_Khaled_Kamal@outlook.com>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <float.h>
22#include <stdio.h>
23
24#include "libavutil/common.h"
25#include "libavutil/hwcontext.h"
28#include "libavutil/internal.h"
29#include "libavutil/opt.h"
30#include "libavutil/pixdesc.h"
31
32#include "avfilter.h"
33#include "filters.h"
34#include "cuda/load_helper.h"
35#include "video.h"
36
42
43#define DIV_UP(a, b) (((a) + (b)-1) / (b))
44#define BLOCKX 32
45#define BLOCKY 16
46#define CHECK_CU(x) FF_CUDA_CHECK_DL(ctx, s->hwctx->internal->cuda_dl, x)
47
48typedef struct ChromakeyCUDAContext {
49 const AVClass *class;
50
52
53 enum AVPixelFormat in_fmt, out_fmt;
58
59 uint8_t chromakey_rgba[4];
60 uint16_t chromakey_uv[2];
61 int is_yuv;
63 float blend;
64
65 CUcontext cu_ctx;
66 CUmodule cu_module;
67 CUfunction cu_func;
68 CUfunction cu_func_uv;
69 CUstream cu_stream;
71
73{
74 ChromakeyCUDAContext *s = ctx->priv;
75
76 if (s->hwctx && s->cu_module)
77 {
78 CudaFunctions *cu = s->hwctx->internal->cuda_dl;
79 CUcontext context;
80
81 CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
82 CHECK_CU(cu->cuModuleUnload(s->cu_module));
83 s->cu_module = NULL;
84 CHECK_CU(cu->cuCtxPopCurrent(&context));
85 }
86}
87
89{
90 FilterLink *outl = ff_filter_link(ctx->outputs[0]);
91 ChromakeyCUDAContext *s = ctx->priv;
92 AVBufferRef *out_ref = NULL;
93 AVHWFramesContext *out_ctx;
94 int ret;
95
96 out_ref = av_hwframe_ctx_alloc(device_ctx);
97 if (!out_ref)
98 return AVERROR(ENOMEM);
99 out_ctx = (AVHWFramesContext *)out_ref->data;
100
101 out_ctx->format = AV_PIX_FMT_CUDA;
102 out_ctx->sw_format = s->out_fmt;
103 out_ctx->width = width;
104 out_ctx->height = height;
105
106 ret = av_hwframe_ctx_init(out_ref);
107 if (ret < 0)
108 goto fail;
109
110 outl->hw_frames_ctx = out_ref;
111
112 return 0;
113fail:
114 av_buffer_unref(&out_ref);
115 return ret;
116}
117
119{
120 int i;
121
122 for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++)
123 if (supported_formats[i] == fmt)
124 return 1;
125 return 0;
126}
127
128static av_cold void set_format_info(AVFilterContext *ctx, enum AVPixelFormat in_format, enum AVPixelFormat out_format)
129{
130 ChromakeyCUDAContext *s = ctx->priv;
131 int i, p, d;
132
133 s->in_fmt = in_format;
134 s->out_fmt = out_format;
135
136 s->in_desc = av_pix_fmt_desc_get(s->in_fmt);
137 s->out_desc = av_pix_fmt_desc_get(s->out_fmt);
138 s->in_planes = av_pix_fmt_count_planes(s->in_fmt);
139 s->out_planes = av_pix_fmt_count_planes(s->out_fmt);
140
141 // find maximum step of each component of each plane
142 // For our subset of formats, this should accurately tell us how many channels CUDA needs
143 // i.e. 1 for Y plane, 2 for UV plane of NV12, 4 for single plane of RGB0 formats
144
145 for (i = 0; i < s->in_desc->nb_components; i++)
146 {
147 d = (s->in_desc->comp[i].depth + 7) / 8;
148 p = s->in_desc->comp[i].plane;
149 s->in_plane_channels[p] = FFMAX(s->in_plane_channels[p], s->in_desc->comp[i].step / d);
150
151 s->in_plane_depths[p] = s->in_desc->comp[i].depth;
152 }
153}
154
156{
157 FilterLink *inl = ff_filter_link(ctx->inputs[0]);
158 ChromakeyCUDAContext *s = ctx->priv;
159 AVHWFramesContext *in_frames_ctx;
160 int ret;
161
162 /* check that we have a hw context */
163 if (!inl->hw_frames_ctx) {
164 av_log(ctx, AV_LOG_ERROR, "No hw context provided on input\n");
165 return AVERROR(EINVAL);
166 }
167 in_frames_ctx = (AVHWFramesContext *)inl->hw_frames_ctx->data;
168
169 if (!format_is_supported(in_frames_ctx->sw_format))
170 {
171 av_log(ctx, AV_LOG_ERROR, "Unsupported format: %s\n", av_get_pix_fmt_name(in_frames_ctx->sw_format));
172 return AVERROR(ENOSYS);
173 }
174
176
177 if (in_frames_ctx->sw_format == s->out_fmt) {
179 if (!ff_filter_link(ctx->outputs[0])->hw_frames_ctx)
180 return AVERROR(ENOMEM);
181 } else {
182 ret = init_hwframe_ctx(ctx, in_frames_ctx->device_ref, width, height);
183 if (ret < 0)
184 return ret;
185 }
186
187 return 0;
188}
189
191{
192 ChromakeyCUDAContext *s = ctx->priv;
193 CUcontext context, cuda_ctx = s->hwctx->cuda_ctx;
194 CudaFunctions *cu = s->hwctx->internal->cuda_dl;
195 int ret;
196
197 extern const unsigned char ff_vf_chromakey_cuda_ptx_data[];
198 extern const unsigned int ff_vf_chromakey_cuda_ptx_len;
199
200 ret = CHECK_CU(cu->cuCtxPushCurrent(cuda_ctx));
201 if (ret < 0)
202 return ret;
203
204 ret = ff_cuda_load_module(ctx, s->hwctx, &s->cu_module,
205 ff_vf_chromakey_cuda_ptx_data, ff_vf_chromakey_cuda_ptx_len);
206 if (ret < 0)
207 goto fail;
208
209 ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func, s->cu_module, "Process_uchar"));
210 if (ret < 0)
211 {
212 av_log(ctx, AV_LOG_FATAL, "Failed loading Process_uchar\n");
213 goto fail;
214 }
215
216 ret = CHECK_CU(cu->cuModuleGetFunction(&s->cu_func_uv, s->cu_module, "Process_uchar2"));
217 if (ret < 0)
218 {
219 av_log(ctx, AV_LOG_FATAL, "Failed loading Process_uchar2\n");
220 goto fail;
221 }
222
223fail:
224 CHECK_CU(cu->cuCtxPopCurrent(&context));
225
226 return ret;
227}
228
229#define FIXNUM(x) lrint((x) * (1 << 10))
230#define RGB_TO_U(rgb) (((-FIXNUM(0.16874) * rgb[0] - FIXNUM(0.33126) * rgb[1] + FIXNUM(0.50000) * rgb[2] + (1 << 9) - 1) >> 10) + 128)
231#define RGB_TO_V(rgb) (((FIXNUM(0.50000) * rgb[0] - FIXNUM(0.41869) * rgb[1] - FIXNUM(0.08131) * rgb[2] + (1 << 9) - 1) >> 10) + 128)
232
234{
235 AVFilterContext *ctx = outlink->src;
236 AVFilterLink *inlink = outlink->src->inputs[0];
237 FilterLink *inl = ff_filter_link(inlink);
238 ChromakeyCUDAContext *s = ctx->priv;
239 AVHWFramesContext *frames_ctx;
240 AVCUDADeviceContext *device_hwctx;
241 int ret;
242
243 if (s->is_yuv) {
244 s->chromakey_uv[0] = s->chromakey_rgba[1];
245 s->chromakey_uv[1] = s->chromakey_rgba[2];
246 } else {
247 s->chromakey_uv[0] = RGB_TO_U(s->chromakey_rgba);
248 s->chromakey_uv[1] = RGB_TO_V(s->chromakey_rgba);
249 }
250
251 ret = init_processing_chain(ctx, inlink->w, inlink->h);
252 if (ret < 0)
253 return ret;
254
255 frames_ctx = (AVHWFramesContext *)inl->hw_frames_ctx->data;
256 device_hwctx = frames_ctx->device_ctx->hwctx;
257
258 s->hwctx = device_hwctx;
259 s->cu_stream = s->hwctx->stream;
260
261 outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
263
265 if (ret < 0)
266 return ret;
267
268 return 0;
269}
270
271static int call_cuda_kernel(AVFilterContext *ctx, CUfunction func,
272 CUtexObject src_tex[3], AVFrame *out_frame,
273 int width, int height, int pitch,
274 int width_uv, int height_uv, int pitch_uv,
275 float u_key, float v_key, float similarity,
276 float blend)
277{
278 ChromakeyCUDAContext *s = ctx->priv;
279 CudaFunctions *cu = s->hwctx->internal->cuda_dl;
280
281 CUdeviceptr dst_devptr[4] = {
282 (CUdeviceptr)out_frame->data[0], (CUdeviceptr)out_frame->data[1],
283 (CUdeviceptr)out_frame->data[2], (CUdeviceptr)out_frame->data[3]
284 };
285
286 void *args_uchar[] = {
287 &src_tex[0], &src_tex[1], &src_tex[2],
288 &dst_devptr[0], &dst_devptr[1], &dst_devptr[2], &dst_devptr[3],
289 &width, &height, &pitch,
290 &width_uv, &height_uv, &pitch_uv,
291 &u_key, &v_key, &similarity, &blend
292 };
293
294 return CHECK_CU(cu->cuLaunchKernel(func,
296 BLOCKX, BLOCKY, 1, 0, s->cu_stream, args_uchar, NULL));
297}
298
300 AVFrame *out, AVFrame *in)
301{
302 ChromakeyCUDAContext *s = ctx->priv;
303 CudaFunctions *cu = s->hwctx->internal->cuda_dl;
304 CUcontext context, cuda_ctx = s->hwctx->cuda_ctx;
305 int i, ret;
306
307 CUtexObject tex[3] = {0, 0, 0};
308
309 ret = CHECK_CU(cu->cuCtxPushCurrent(cuda_ctx));
310 if (ret < 0)
311 return ret;
312
313 for (i = 0; i < s->in_planes; i++)
314 {
315 CUDA_TEXTURE_DESC tex_desc = {
316 .filterMode = CU_TR_FILTER_MODE_LINEAR,
317 .flags = 0, // CU_TRSF_READ_AS_INTEGER to get raw ints instead of normalized floats from tex2D
318 };
319
320 CUDA_RESOURCE_DESC res_desc = {
321 .resType = CU_RESOURCE_TYPE_PITCH2D,
322 .res.pitch2D.format = CU_AD_FORMAT_UNSIGNED_INT8,
323 .res.pitch2D.numChannels = s->in_plane_channels[i],
324 .res.pitch2D.pitchInBytes = in->linesize[i],
325 .res.pitch2D.devPtr = (CUdeviceptr)in->data[i],
326 };
327
328 if (i == 1 || i == 2)
329 {
330 res_desc.res.pitch2D.width = AV_CEIL_RSHIFT(in->width, s->in_desc->log2_chroma_w);
331 res_desc.res.pitch2D.height = AV_CEIL_RSHIFT(in->height, s->in_desc->log2_chroma_h);
332 }
333 else
334 {
335 res_desc.res.pitch2D.width = in->width;
336 res_desc.res.pitch2D.height = in->height;
337 }
338
339 ret = CHECK_CU(cu->cuTexObjectCreate(&tex[i], &res_desc, &tex_desc, NULL));
340 if (ret < 0)
341 goto exit;
342 }
343
344 ret = call_cuda_kernel(ctx, (s->in_plane_channels[1] > 1) ? s->cu_func_uv : s->cu_func,
345 tex, out,
346 out->width, out->height, out->linesize[0],
347 AV_CEIL_RSHIFT(out->width, s->out_desc->log2_chroma_w),
348 AV_CEIL_RSHIFT(out->height, s->out_desc->log2_chroma_h),
349 out->linesize[1],
350 s->chromakey_uv[0], s->chromakey_uv[1],
351 s->similarity, s->blend);
352 if (ret < 0)
353 goto exit;
354
355exit:
356 for (i = 0; i < s->in_planes; i++)
357 if (tex[i])
358 CHECK_CU(cu->cuTexObjectDestroy(tex[i]));
359
360 CHECK_CU(cu->cuCtxPopCurrent(&context));
361
362 return ret;
363}
364
366{
367 AVFilterContext *ctx = link->dst;
368 ChromakeyCUDAContext *s = ctx->priv;
369 AVFilterLink *outlink = ctx->outputs[0];
370 CudaFunctions *cu = s->hwctx->internal->cuda_dl;
371
372 AVFrame *out;
373 CUcontext context;
374 int ret = 0;
375
376 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
377 if (!out) {
378 ret = AVERROR(ENOMEM);
379 goto fail;
380 }
381
382 ret = CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
383 if (ret < 0)
384 goto fail;
385
387 if (ret < 0)
388 goto fail;
389
390 ret = av_frame_copy_props(out, in);
391 if (ret < 0)
392 goto fail;
393 out->alpha_mode = outlink->alpha_mode;
394
395 ret = CHECK_CU(cu->cuCtxPopCurrent(&context));
396 if (ret < 0)
397 goto fail;
398
399 av_frame_free(&in);
400 return ff_filter_frame(outlink, out);
401fail:
402 av_frame_free(&in);
404 return ret;
405}
406
407#define OFFSET(x) offsetof(ChromakeyCUDAContext, x)
408#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
409static const AVOption options[] = {
410 {"color", "set the chromakey key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, {.str = "black"}, 0, 0, FLAGS},
411 {"similarity", "set the chromakey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, {.dbl = 0.01}, 0.01, 1.0, FLAGS},
412 {"blend", "set the chromakey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, {.dbl = 0.0}, 0.0, 1.0, FLAGS},
413 {"yuv", "color parameter is in yuv instead of rgb", OFFSET(is_yuv), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS},
414 {NULL},
415};
416
418 .class_name = "cudachromakey",
419 .item_name = av_default_item_name,
420 .option = options,
421 .version = LIBAVUTIL_VERSION_INT,
422};
423
425 {
426 .name = "default",
427 .type = AVMEDIA_TYPE_VIDEO,
428 .filter_frame = cudachromakey_filter_frame,
429 },
430};
431
433 {
434 .name = "default",
435 .type = AVMEDIA_TYPE_VIDEO,
436 .config_props = cudachromakey_config_props,
437 },
438};
439
441 .p.name = "chromakey_cuda",
442 .p.description = NULL_IF_CONFIG_SMALL("GPU accelerated chromakey filter"),
443
444 .p.priv_class = &cudachromakey_class,
445 .uninit = cudachromakey_uninit,
446 .priv_size = sizeof(ChromakeyCUDAContext),
447
450
452
453 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
454};
const FFFilter ff_vf_chromakey_cuda
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.
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define FLAGS
Definition cmdutils.c:598
common internal and external API header
#define AV_CEIL_RSHIFT(a, b)
Definition common.h:60
#define NULL
Definition coverity.c:32
#define fail
Definition test.h:479
@ 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
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition opt.h:322
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition buffer.c:139
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition buffer.c:103
#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_FATAL
Something went wrong and recovery is not possible.
Definition log.h:204
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
Definition hwcontext.c:337
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
Definition hwcontext.c:263
FFmpeg internal API for CUDA.
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition jacosubdec.c:66
#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
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition filters.h:199
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition filters.h:254
#define av_cold
Definition attributes.h:117
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
int ff_cuda_load_module(void *avctx, AVCUDADeviceContext *hwctx, CUmodule *cu_module, const unsigned char *data, const unsigned int length)
Loads a CUDA module and applies any decompression, if necessary.
Definition load_helper.c:34
#define FFMAX(a, b)
Definition macros.h:47
AVOptions.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3500
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
Definition pixdesc.c:3380
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
@ AVALPHA_MODE_STRAIGHT
Alpha channel is independent of color values.
Definition pixfmt.h:819
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition pixfmt.h:96
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ 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_CUDA
HW acceleration through CUDA.
Definition pixfmt.h:260
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
Definition buffer.h:82
uint8_t * data
The data buffer.
Definition buffer.h:90
This struct is allocated as AVHWDeviceContext.hwctx.
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
AVFilterLink ** inputs
array of pointers to input links
Definition avfilter.h:281
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
int width
Definition frame.h:544
int height
Definition frame.h:544
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:517
void * hwctx
The format-specific data, allocated and freed by libavutil along with this context.
Definition hwcontext.h:88
This struct describes a set or pool of "hardware" frames (i.e.
Definition hwcontext.h:118
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
Definition hwcontext.h:200
AVBufferRef * device_ref
A reference to the parent AVHWDeviceContext.
Definition hwcontext.h:129
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Definition hwcontext.h:213
int width
The allocated dimensions of the frames in this pool.
Definition hwcontext.h:220
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
Definition hwcontext.h:137
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
AVCUDADeviceContext * hwctx
const AVPixFmtDescriptor * out_desc
enum AVPixelFormat in_fmt out_fmt
const AVPixFmtDescriptor * in_desc
#define av_log(a,...)
static FILE * out
Definition movenc.c:55
static AVFormatContext * ctx
Definition movenc.c:49
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
static enum AVPixelFormat supported_formats[]
#define DIV_UP(a, b)
#define BLOCKX
#define BLOCKY
static av_cold int cudachromakey_config_props(AVFilterLink *outlink)
static const AVFilterPad cudachromakey_inputs[]
#define RGB_TO_V(rgb)
#define DIV_UP(a, b)
static av_cold int cudachromakey_load_functions(AVFilterContext *ctx)
static int cudachromakey_process_internal(AVFilterContext *ctx, AVFrame *out, AVFrame *in)
static int format_is_supported(enum AVPixelFormat fmt)
static av_cold int init_hwframe_ctx(AVFilterContext *ctx, AVBufferRef *device_ctx, int width, int height)
#define CHECK_CU(x)
static av_cold void set_format_info(AVFilterContext *ctx, enum AVPixelFormat in_format, enum AVPixelFormat out_format)
static const AVClass cudachromakey_class
#define RGB_TO_U(rgb)
static int cudachromakey_filter_frame(AVFilterLink *link, AVFrame *in)
static int call_cuda_kernel(AVFilterContext *ctx, CUfunction func, CUtexObject src_tex[3], AVFrame *out_frame, int width, int height, int pitch, int width_uv, int height_uv, int pitch_uv, float u_key, float v_key, float similarity, float blend)
#define OFFSET(x)
static const AVFilterPad cudachromakey_outputs[]
static av_cold void cudachromakey_uninit(AVFilterContext *ctx)
static av_cold int init_processing_chain(AVFilterContext *ctx, int width, int height)
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