FFmpeg
Loading...
Searching...
No Matches
vf_yadif_videotoolbox.m
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Philip Langdale <philipl@overt.org>
3 * 2020 Aman Karmani <aman@tmm1.net>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include "filters.h"
23#include "metal/utils.h"
24#include "yadif.h"
25#include "libavutil/avassert.h"
26#include "libavutil/hwcontext.h"
28#include "libavutil/objc.h"
29
30#include <assert.h>
31
34
35typedef struct API_AVAILABLE(macos(10.11), ios(8.0)) YADIFVTContext {
36 YADIFContext yadif;
37
38 AVBufferRef *device_ref;
39 AVBufferRef *input_frames_ref;
40 AVHWFramesContext *input_frames;
41
42 id<MTLDevice> mtlDevice;
43 id<MTLLibrary> mtlLibrary;
44 id<MTLCommandQueue> mtlQueue;
46 id<MTLFunction> mtlFunction;
47 id<MTLBuffer> mtlParamsBuffer;
48
49 CVMetalTextureCacheRef textureCache;
50} YADIFVTContext API_AVAILABLE(macos(10.11), ios(8.0));
51
52// Using sizeof(YADIFVTContext) outside of an availability check will error
53// if we're targeting an older OS version, so we need to calculate the size ourselves
54// (we'll statically verify it's correct in yadif_videotoolbox_init behind a check)
55#define YADIF_VT_CTX_SIZE (sizeof(YADIFContext) + sizeof(void*) * 10)
56
57struct mtlYadifParams {
58 uint channels;
59 uint parity;
60 uint tff;
61 bool is_second_field;
62 bool skip_spatial_check;
63 int field_mode;
64};
65
68 id<MTLTexture> prev,
70 id<MTLTexture> next,
71 int channels,
72 int parity,
73 int tff) API_AVAILABLE(macos(10.11), ios(8.0))
74{
75 YADIFVTContext *s = ctx->priv;
76 id<MTLCommandBuffer> buffer = s->mtlQueue.commandBuffer;
77 id<MTLComputeCommandEncoder> encoder = buffer.computeCommandEncoder;
78 struct mtlYadifParams *params = (struct mtlYadifParams *)s->mtlParamsBuffer.contents;
79 *params = (struct mtlYadifParams){
80 .channels = channels,
81 .parity = parity,
82 .tff = tff,
83 .is_second_field = !(parity ^ tff),
84 .skip_spatial_check = s->yadif.mode&2,
85 .field_mode = s->yadif.current_field
86 };
87
88 [encoder setTexture:dst atIndex:0];
89 [encoder setTexture:prev atIndex:1];
90 [encoder setTexture:cur atIndex:2];
91 [encoder setTexture:next atIndex:3];
92 [encoder setBuffer:s->mtlParamsBuffer offset:0 atIndex:4];
93 ff_metal_compute_encoder_dispatch(s->mtlDevice, s->mtlPipeline, encoder, dst.width, dst.height);
94 [encoder endEncoding];
95
96 [buffer commit];
97 [buffer waitUntilCompleted];
98
99 ff_objc_release(&encoder);
101}
102
103static void filter(AVFilterContext *ctx, AVFrame *dst,
104 int parity, int tff) API_AVAILABLE(macos(10.11), ios(8.0))
105{
106 YADIFVTContext *s = ctx->priv;
107 YADIFContext *y = &s->yadif;
108 int i;
109
110 for (i = 0; i < y->csp->nb_components; i++) {
111 int pixel_size, channels;
112 const AVComponentDescriptor *comp = &y->csp->comp[i];
113 CVMetalTextureRef prev, cur, next, dest;
114 id<MTLTexture> tex_prev, tex_cur, tex_next, tex_dest;
115 MTLPixelFormat format;
116
117 if (comp->plane < i) {
118 // We process planes as a whole, so don't reprocess
119 // them for additional components
120 continue;
121 }
122
123 pixel_size = (comp->depth + comp->shift) / 8;
124 channels = comp->step / pixel_size;
125 if (pixel_size > 2 || channels > 2) {
126 av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", y->csp->name);
127 goto exit;
128 }
129 switch (pixel_size) {
130 case 1:
131 format = channels == 1 ? MTLPixelFormatR8Unorm : MTLPixelFormatRG8Unorm;
132 break;
133 case 2:
134 format = channels == 1 ? MTLPixelFormatR16Unorm : MTLPixelFormatRG16Unorm;
135 break;
136 default:
137 av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", y->csp->name);
138 goto exit;
139 }
141 "Deinterlacing plane %d: pixel_size: %d channels: %d\n",
142 comp->plane, pixel_size, channels);
143
144 prev = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)y->prev->data[3], i, format);
145 cur = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)y->cur->data[3], i, format);
146 next = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)y->next->data[3], i, format);
147 dest = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)dst->data[3], i, format);
148
149 tex_prev = CVMetalTextureGetTexture(prev);
150 tex_cur = CVMetalTextureGetTexture(cur);
151 tex_next = CVMetalTextureGetTexture(next);
152 tex_dest = CVMetalTextureGetTexture(dest);
153
154 call_kernel(ctx, tex_dest, tex_prev, tex_cur, tex_next,
155 channels, parity, tff);
156
157 CFRelease(prev);
158 CFRelease(cur);
159 CFRelease(next);
160 CFRelease(dest);
161 }
162
163 CVBufferPropagateAttachments((CVPixelBufferRef)y->cur->data[3], (CVPixelBufferRef)dst->data[3]);
164
165 if (y->current_field == YADIF_FIELD_END) {
167 }
168
169exit:
170 return;
171}
172
173static av_cold void do_uninit(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios(8.0))
174{
175 YADIFVTContext *s = ctx->priv;
176
178
179 av_buffer_unref(&s->device_ref);
180 av_buffer_unref(&s->input_frames_ref);
181 s->input_frames = NULL;
182
183 ff_objc_release(&s->mtlParamsBuffer);
184 ff_objc_release(&s->mtlFunction);
185 ff_objc_release(&s->mtlPipeline);
186 ff_objc_release(&s->mtlQueue);
187 ff_objc_release(&s->mtlLibrary);
188 ff_objc_release(&s->mtlDevice);
189
190 if (s->textureCache) {
191 CFRelease(s->textureCache);
192 s->textureCache = NULL;
193 }
194}
195
196
197static av_cold void yadif_videotoolbox_uninit(AVFilterContext *ctx)
198{
199 if (@available(macOS 10.11, iOS 8.0, *)) {
200 do_uninit(ctx);
201 }
202}
203
204static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios(8.0))
205{
206 YADIFVTContext *s = ctx->priv;
207 NSError *err = nil;
208 CVReturn ret;
209
210 s->mtlDevice = MTLCreateSystemDefaultDevice();
211 if (!s->mtlDevice) {
212 av_log(ctx, AV_LOG_ERROR, "Unable to find Metal device\n");
213 goto fail;
214 }
215
216 av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
217
218 dispatch_data_t libData = dispatch_data_create(
221 nil,
222 nil);
223 s->mtlLibrary = [s->mtlDevice newLibraryWithData:libData error:&err];
224 dispatch_release(libData);
225 libData = nil;
226 if (err) {
227 av_log(ctx, AV_LOG_ERROR, "Failed to load Metal library: %s\n", err.description.UTF8String);
228 goto fail;
229 }
230
231 s->mtlFunction = [s->mtlLibrary newFunctionWithName:@"deint"];
232 if (!s->mtlFunction) {
233 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal function!\n");
234 goto fail;
235 }
236
237 s->mtlQueue = s->mtlDevice.newCommandQueue;
238 if (!s->mtlQueue) {
239 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal command queue!\n");
240 goto fail;
241 }
242
243 s->mtlPipeline = [s->mtlDevice
244 newComputePipelineStateWithFunction:s->mtlFunction
245 error:&err];
246 if (err) {
247 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal compute pipeline: %s\n", err.description.UTF8String);
248 goto fail;
249 }
250
251 s->mtlParamsBuffer = [s->mtlDevice
252 newBufferWithLength:sizeof(struct mtlYadifParams)
253 options:MTLResourceStorageModeShared];
254 if (!s->mtlParamsBuffer) {
255 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal buffer for parameters\n");
256 goto fail;
257 }
258
259 ret = CVMetalTextureCacheCreate(
260 NULL,
261 NULL,
262 s->mtlDevice,
263 NULL,
264 &s->textureCache
265 );
266 if (ret != kCVReturnSuccess) {
267 av_log(ctx, AV_LOG_ERROR, "Failed to create CVMetalTextureCache: %d\n", ret);
268 goto fail;
269 }
270
271 return 0;
272fail:
273 yadif_videotoolbox_uninit(ctx);
274 return AVERROR_EXTERNAL;
275}
276
277static av_cold int yadif_videotoolbox_init(AVFilterContext *ctx)
278{
279 if (@available(macOS 10.11, iOS 8.0, *)) {
280 // Ensure we calculated YADIF_VT_CTX_SIZE correctly
281 static_assert(YADIF_VT_CTX_SIZE == sizeof(YADIFVTContext), "Incorrect YADIF_VT_CTX_SIZE value!");
282 return do_init(ctx);
283 } else {
284 av_log(ctx, AV_LOG_ERROR, "Metal is not available on this OS version\n");
285 return AVERROR(ENOSYS);
286 }
287}
288
289static int do_config_input(AVFilterLink *inlink) API_AVAILABLE(macos(10.11), ios(8.0))
290{
291 FilterLink *l = ff_filter_link(inlink);
292 AVFilterContext *ctx = inlink->dst;
293 YADIFVTContext *s = ctx->priv;
294
295 if (!l->hw_frames_ctx) {
296 av_log(ctx, AV_LOG_ERROR, "A hardware frames reference is "
297 "required to associate the processing device.\n");
298 return AVERROR(EINVAL);
299 }
300
301 s->input_frames_ref = av_buffer_ref(l->hw_frames_ctx);
302 if (!s->input_frames_ref) {
303 av_log(ctx, AV_LOG_ERROR, "A input frames reference create "
304 "failed.\n");
305 return AVERROR(ENOMEM);
306 }
307 s->input_frames = (AVHWFramesContext*)s->input_frames_ref->data;
308
309 return 0;
310}
311
312static int config_input(AVFilterLink *inlink)
313{
314 AVFilterContext *ctx = inlink->dst;
315 if (@available(macOS 10.11, iOS 8.0, *)) {
316 return do_config_input(inlink);
317 } else {
318 av_log(ctx, AV_LOG_ERROR, "Metal is not available on this OS version\n");
319 return AVERROR(ENOSYS);
320 }
321}
322
323static int do_config_output(AVFilterLink *link) API_AVAILABLE(macos(10.11), ios(8.0))
324{
325 FilterLink *l = ff_filter_link(link);
326 FilterLink *il = ff_filter_link(link->src->inputs[0]);
327 AVHWFramesContext *output_frames, *input_frames;
328 AVFilterContext *ctx = link->src;
329 YADIFVTContext *s = ctx->priv;
330 YADIFContext *y = &s->yadif;
331 int ret = 0;
332
333 av_assert0(s->input_frames);
334 s->device_ref = av_buffer_ref(s->input_frames->device_ref);
335 if (!s->device_ref) {
336 av_log(ctx, AV_LOG_ERROR, "A device reference create "
337 "failed.\n");
338 return AVERROR(ENOMEM);
339 }
340
341 l->hw_frames_ctx = av_hwframe_ctx_alloc(s->device_ref);
342 if (!l->hw_frames_ctx) {
343 av_log(ctx, AV_LOG_ERROR, "Failed to create HW frame context "
344 "for output.\n");
345 ret = AVERROR(ENOMEM);
346 goto exit;
347 }
348
349 input_frames = (AVHWFramesContext*)il->hw_frames_ctx->data;
350 output_frames = (AVHWFramesContext*)l->hw_frames_ctx->data;
351
352 output_frames->format = AV_PIX_FMT_VIDEOTOOLBOX;
353 output_frames->sw_format = s->input_frames->sw_format;
354 output_frames->width = ctx->inputs[0]->w;
355 output_frames->height = ctx->inputs[0]->h;
356 ((AVVTFramesContext *)output_frames->hwctx)->color_range = ((AVVTFramesContext *)input_frames->hwctx)->color_range;
357
358 ret = ff_filter_init_hw_frames(ctx, link, 10);
359 if (ret < 0)
360 goto exit;
361
363 if (ret < 0) {
364 av_log(ctx, AV_LOG_ERROR, "Failed to initialise VideoToolbox frame "
365 "context for output: %d\n", ret);
366 goto exit;
367 }
368
370 if (ret < 0)
371 goto exit;
372
373 y->csp = av_pix_fmt_desc_get(output_frames->sw_format);
374 y->filter = filter;
375
376exit:
377 return ret;
378}
379
380static int config_output(AVFilterLink *link)
381{
382 AVFilterContext *ctx = link->src;
383 if (@available(macOS 10.11, iOS 8.0, *)) {
384 return do_config_output(link);
385 } else {
386 av_log(ctx, AV_LOG_ERROR, "Metal is not available on this OS version\n");
387 return AVERROR(ENOSYS);
388 }
389}
390
391#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
392#define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
393
394static const AVOption yadif_videotoolbox_options[] = {
395 #define OFFSET(x) offsetof(YADIFContext, x)
396 { "mode", "specify the interlacing mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=YADIF_MODE_SEND_FRAME}, 0, 3, FLAGS, .unit = "mode"},
397 CONST("send_frame", "send one frame for each frame", YADIF_MODE_SEND_FRAME, "mode"),
398 CONST("send_field", "send one frame for each field", YADIF_MODE_SEND_FIELD, "mode"),
399 CONST("send_frame_nospatial", "send one frame for each frame, but skip spatial interlacing check", YADIF_MODE_SEND_FRAME_NOSPATIAL, "mode"),
400 CONST("send_field_nospatial", "send one frame for each field, but skip spatial interlacing check", YADIF_MODE_SEND_FIELD_NOSPATIAL, "mode"),
401
402 { "parity", "specify the assumed picture field parity", OFFSET(parity), AV_OPT_TYPE_INT, {.i64=YADIF_PARITY_AUTO}, -1, 1, FLAGS, .unit = "parity" },
403 CONST("tff", "assume top field first", YADIF_PARITY_TFF, "parity"),
404 CONST("bff", "assume bottom field first", YADIF_PARITY_BFF, "parity"),
405 CONST("auto", "auto detect parity", YADIF_PARITY_AUTO, "parity"),
406
407 { "deint", "specify which frames to deinterlace", OFFSET(deint), AV_OPT_TYPE_INT, {.i64=YADIF_DEINT_ALL}, 0, 1, FLAGS, .unit = "deint" },
408 CONST("all", "deinterlace all frames", YADIF_DEINT_ALL, "deint"),
409 CONST("interlaced", "only deinterlace frames marked as interlaced", YADIF_DEINT_INTERLACED, "deint"),
410 #undef OFFSET
411
412 { NULL }
413};
414
415AVFILTER_DEFINE_CLASS(yadif_videotoolbox);
416
417static const AVFilterPad yadif_videotoolbox_inputs[] = {
418 {
419 .name = "default",
420 .type = AVMEDIA_TYPE_VIDEO,
421 .filter_frame = ff_yadif_filter_frame,
422 .config_props = config_input,
423 },
424};
425
426static const AVFilterPad yadif_videotoolbox_outputs[] = {
427 {
428 .name = "default",
429 .type = AVMEDIA_TYPE_VIDEO,
430 .request_frame = ff_yadif_request_frame,
431 .config_props = config_output,
432 },
433};
434
436 .p.name = "yadif_videotoolbox",
437 .p.description = NULL_IF_CONFIG_SMALL("YADIF for VideoToolbox frames using Metal compute"),
438 .p.priv_class = &yadif_videotoolbox_class,
440 .priv_size = YADIF_VT_CTX_SIZE,
441 .init = yadif_videotoolbox_init,
442 .uninit = yadif_videotoolbox_uninit,
444 FILTER_INPUTS(yadif_videotoolbox_inputs),
445 FILTER_OUTPUTS(yadif_videotoolbox_outputs),
446 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
447};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
SwsAArch64OpImplParams params
Definition ops.c:51
static int config_input(AVFilterLink *inlink)
static const char *const format[]
Definition af_aiir.c:444
const FFFilter ff_vf_yadif_videotoolbox
static AVFormatContext * ctx
channels
Definition aptx.h:31
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition avassert.h:42
int ff_filter_init_hw_frames(AVFilterContext *avctx, AVFilterLink *link, int default_pool_size)
Perform any additional setup required for hardware frames.
Definition avfilter.c:1668
#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
#define NULL
Definition coverity.c:32
enum AVCodecID id
Definition dts2pts.c:607
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
Definition eamad.c:79
#define fail
Definition test.h:479
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition avfilter.h:204
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_EXTERNAL
Generic error in an external library.
Definition error.h:59
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition log.h:236
#define AV_LOG_INFO
Standard information.
Definition log.h:221
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
if(svq3)
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
An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX.
static int config_output(AVBitStreamFilterLink *outlink)
#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 AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
void ff_metal_compute_encoder_dispatch(id< MTLDevice > device, id< MTLComputePipelineState > pipeline, id< MTLComputeCommandEncoder > encoder, NSUInteger width, NSUInteger height) API_AVAILABLE(macos(10.11)
void ios(8.0))
CVMetalTextureRef ff_metal_texture_from_pixbuf(void *avclass, CVMetalTextureCacheRef textureCache, CVPixelBufferRef pixbuf, int plane, MTLPixelFormat format) API_AVAILABLE(macos(10.11)
#define CONST(name, help, val, u)
Definition vf_bwdif.c:189
#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
static void ff_objc_release(NSObject **obj)
Definition objc.h:24
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
Definition pixfmt.h:305
uint8_t * data
The data buffer.
Definition buffer.h:90
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
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
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
void * hwctx
The format-specific data, allocated and freed automatically along with this context.
Definition hwcontext.h:153
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
AVOption.
Definition opt.h:428
const char * name
Definition pixdesc.h:70
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition pixdesc.h:105
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition pixdesc.h:71
AVFrame * prev
Definition yadif.h:62
AVFrame * cur
Definition yadif.h:60
AVFrame * next
Definition yadif.h:61
void(* filter)(AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff)
Definition yadif.h:65
int current_field
YADIFCurrentField.
Definition yadif.h:88
const AVPixFmtDescriptor * csp
Definition yadif.h:76
Definition swscale.c:71
#define av_log(a,...)
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
Definition h263dsp.c:29
static char buffer[20]
Definition seek.c:32
static CUresult call_kernel(AVFilterContext *ctx, CUfunction func, CUdeviceptr prev, CUdeviceptr cur, CUdeviceptr next, CUarray_format format, int channels, int src_width, int src_height, int src_pitch, CUdeviceptr dst, int dst_width, int dst_height, int dst_pitch, int parity, int tff, int clip_max)
mcdeint parity
Definition vf_mcdeint.c:293
#define CONST(name, help, val, unit)
char ff_vf_yadif_videotoolbox_metallib_data[]
unsigned int ff_vf_yadif_videotoolbox_metallib_len
#define OFFSET(x)
#define YADIF_VT_CTX_SIZE
@ YADIF_DEINT_INTERLACED
only deinterlace frames marked as interlaced
Definition yadif.h:42
@ YADIF_DEINT_ALL
deinterlace all frames
Definition yadif.h:41
@ YADIF_PARITY_TFF
top field first
Definition yadif.h:35
@ YADIF_PARITY_BFF
bottom field first
Definition yadif.h:36
@ YADIF_PARITY_AUTO
auto detection
Definition yadif.h:37
@ YADIF_FIELD_NORMAL
A normal field in the middle of a sequence.
Definition yadif.h:48
@ YADIF_FIELD_END
The first or last field in a sequence.
Definition yadif.h:47
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame)
@ YADIF_MODE_SEND_FIELD_NOSPATIAL
send 1 frame for each field but skips spatial interlacing check
Definition yadif.h:31
@ YADIF_MODE_SEND_FIELD
send 1 frame for each field
Definition yadif.h:29
@ YADIF_MODE_SEND_FRAME_NOSPATIAL
send 1 frame for each frame but skips spatial interlacing check
Definition yadif.h:30
@ YADIF_MODE_SEND_FRAME
send 1 frame for each frame
Definition yadif.h:28
int ff_yadif_request_frame(AVFilterLink *link)
void ff_yadif_uninit(AVFilterContext *ctx)
int ff_yadif_config_output_common(AVFilterLink *outlink)