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
109 for (int i = 0; i < y->csp->nb_components; i++) {
110 int pixel_size, channels;
111 const AVComponentDescriptor *comp = &y->csp->comp[i];
112 CVMetalTextureRef prev, cur, next, dest;
113 id<MTLTexture> tex_prev, tex_cur, tex_next, tex_dest;
114 MTLPixelFormat format;
115
116 if (comp->plane < i) {
117 // We process planes as a whole, so don't reprocess
118 // them for additional components
119 continue;
120 }
121
122 pixel_size = (comp->depth + comp->shift) / 8;
123 channels = comp->step / pixel_size;
124 if (pixel_size > 2 || channels > 2) {
125 av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", y->csp->name);
126 return;
127 }
128 switch (pixel_size) {
129 case 1:
130 format = channels == 1 ? MTLPixelFormatR8Unorm : MTLPixelFormatRG8Unorm;
131 break;
132 case 2:
133 format = channels == 1 ? MTLPixelFormatR16Unorm : MTLPixelFormatRG16Unorm;
134 break;
135 default:
136 av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n", y->csp->name);
137 return;
138 }
140 "Deinterlacing plane %d: pixel_size: %d channels: %d\n",
141 comp->plane, pixel_size, channels);
142
143 prev = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)y->prev->data[3], i, format);
144 cur = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)y->cur->data[3], i, format);
145 next = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)y->next->data[3], i, format);
146 dest = ff_metal_texture_from_pixbuf(ctx, s->textureCache, (CVPixelBufferRef)dst->data[3], i, format);
147
148 if (!prev || !cur || !next || !dest) {
149 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal texture for plane %d\n", i);
150 if (prev) CFRelease(prev);
151 if (cur) CFRelease(cur);
152 if (next) CFRelease(next);
153 if (dest) CFRelease(dest);
154 return;
155 }
156
157 tex_prev = CVMetalTextureGetTexture(prev);
158 tex_cur = CVMetalTextureGetTexture(cur);
159 tex_next = CVMetalTextureGetTexture(next);
160 tex_dest = CVMetalTextureGetTexture(dest);
161
162 call_kernel(ctx, tex_dest, tex_prev, tex_cur, tex_next,
163 channels, parity, tff);
164
165 CFRelease(prev);
166 CFRelease(cur);
167 CFRelease(next);
168 CFRelease(dest);
169 }
170
171 CVBufferPropagateAttachments((CVPixelBufferRef)y->cur->data[3], (CVPixelBufferRef)dst->data[3]);
172
173 if (y->current_field == YADIF_FIELD_END) {
175 }
176}
177
178static av_cold void do_uninit(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios(8.0))
179{
180 YADIFVTContext *s = ctx->priv;
181
183
184 av_buffer_unref(&s->device_ref);
185 av_buffer_unref(&s->input_frames_ref);
186 s->input_frames = NULL;
187
188 ff_objc_release(&s->mtlParamsBuffer);
189 ff_objc_release(&s->mtlFunction);
190 ff_objc_release(&s->mtlPipeline);
191 ff_objc_release(&s->mtlQueue);
192 ff_objc_release(&s->mtlLibrary);
193 ff_objc_release(&s->mtlDevice);
194
195 if (s->textureCache) {
196 CFRelease(s->textureCache);
197 s->textureCache = NULL;
198 }
199}
200
201
202static av_cold void yadif_videotoolbox_uninit(AVFilterContext *ctx)
203{
204 if (@available(macOS 10.11, iOS 8.0, *)) {
205 do_uninit(ctx);
206 }
207}
208
209static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios(8.0))
210{
211 YADIFVTContext *s = ctx->priv;
212 NSError *err = nil;
213 CVReturn ret;
214
215 s->mtlDevice = MTLCreateSystemDefaultDevice();
216 if (!s->mtlDevice) {
217 av_log(ctx, AV_LOG_ERROR, "Unable to find Metal device\n");
218 goto fail;
219 }
220
221 av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
222
223 dispatch_data_t libData = dispatch_data_create(
226 nil,
227 nil);
228 s->mtlLibrary = [s->mtlDevice newLibraryWithData:libData error:&err];
229 dispatch_release(libData);
230 libData = nil;
231 if (err) {
232 av_log(ctx, AV_LOG_ERROR, "Failed to load Metal library: %s\n", err.description.UTF8String);
233 goto fail;
234 }
235
236 s->mtlFunction = [s->mtlLibrary newFunctionWithName:@"deint"];
237 if (!s->mtlFunction) {
238 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal function!\n");
239 goto fail;
240 }
241
242 s->mtlQueue = s->mtlDevice.newCommandQueue;
243 if (!s->mtlQueue) {
244 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal command queue!\n");
245 goto fail;
246 }
247
248 s->mtlPipeline = [s->mtlDevice
249 newComputePipelineStateWithFunction:s->mtlFunction
250 error:&err];
251 if (err) {
252 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal compute pipeline: %s\n", err.description.UTF8String);
253 goto fail;
254 }
255
256 s->mtlParamsBuffer = [s->mtlDevice
257 newBufferWithLength:sizeof(struct mtlYadifParams)
258 options:MTLResourceStorageModeShared];
259 if (!s->mtlParamsBuffer) {
260 av_log(ctx, AV_LOG_ERROR, "Failed to create Metal buffer for parameters\n");
261 goto fail;
262 }
263
264 ret = CVMetalTextureCacheCreate(
265 NULL,
266 NULL,
267 s->mtlDevice,
268 NULL,
269 &s->textureCache
270 );
271 if (ret != kCVReturnSuccess) {
272 av_log(ctx, AV_LOG_ERROR, "Failed to create CVMetalTextureCache: %d\n", ret);
273 goto fail;
274 }
275
276 return 0;
277fail:
278 yadif_videotoolbox_uninit(ctx);
279 return AVERROR_EXTERNAL;
280}
281
282static av_cold int yadif_videotoolbox_init(AVFilterContext *ctx)
283{
284 if (@available(macOS 10.11, iOS 8.0, *)) {
285 // Ensure we calculated YADIF_VT_CTX_SIZE correctly
286 static_assert(YADIF_VT_CTX_SIZE == sizeof(YADIFVTContext), "Incorrect YADIF_VT_CTX_SIZE value!");
287 return do_init(ctx);
288 } else {
289 av_log(ctx, AV_LOG_ERROR, "Metal is not available on this OS version\n");
290 return AVERROR(ENOSYS);
291 }
292}
293
294static int do_config_input(AVFilterLink *inlink) API_AVAILABLE(macos(10.11), ios(8.0))
295{
296 FilterLink *l = ff_filter_link(inlink);
297 AVFilterContext *ctx = inlink->dst;
298 YADIFVTContext *s = ctx->priv;
299
300 if (!l->hw_frames_ctx) {
301 av_log(ctx, AV_LOG_ERROR, "A hardware frames reference is "
302 "required to associate the processing device.\n");
303 return AVERROR(EINVAL);
304 }
305
306 s->input_frames_ref = av_buffer_ref(l->hw_frames_ctx);
307 if (!s->input_frames_ref) {
308 av_log(ctx, AV_LOG_ERROR, "A input frames reference create "
309 "failed.\n");
310 return AVERROR(ENOMEM);
311 }
312 s->input_frames = (AVHWFramesContext*)s->input_frames_ref->data;
313
314 return 0;
315}
316
317static int config_input(AVFilterLink *inlink)
318{
319 AVFilterContext *ctx = inlink->dst;
320 if (@available(macOS 10.11, iOS 8.0, *)) {
321 return do_config_input(inlink);
322 } else {
323 av_log(ctx, AV_LOG_ERROR, "Metal is not available on this OS version\n");
324 return AVERROR(ENOSYS);
325 }
326}
327
328static int do_config_output(AVFilterLink *link) API_AVAILABLE(macos(10.11), ios(8.0))
329{
330 FilterLink *l = ff_filter_link(link);
331 FilterLink *il = ff_filter_link(link->src->inputs[0]);
332 AVHWFramesContext *output_frames, *input_frames;
333 AVFilterContext *ctx = link->src;
334 YADIFVTContext *s = ctx->priv;
335 YADIFContext *y = &s->yadif;
336 int ret = 0;
337
338 av_assert0(s->input_frames);
339 s->device_ref = av_buffer_ref(s->input_frames->device_ref);
340 if (!s->device_ref) {
341 av_log(ctx, AV_LOG_ERROR, "A device reference create "
342 "failed.\n");
343 return AVERROR(ENOMEM);
344 }
345
346 l->hw_frames_ctx = av_hwframe_ctx_alloc(s->device_ref);
347 if (!l->hw_frames_ctx) {
348 av_log(ctx, AV_LOG_ERROR, "Failed to create HW frame context "
349 "for output.\n");
350 ret = AVERROR(ENOMEM);
351 goto exit;
352 }
353
354 input_frames = (AVHWFramesContext*)il->hw_frames_ctx->data;
355 output_frames = (AVHWFramesContext*)l->hw_frames_ctx->data;
356
357 output_frames->format = AV_PIX_FMT_VIDEOTOOLBOX;
358 output_frames->sw_format = s->input_frames->sw_format;
359 output_frames->width = ctx->inputs[0]->w;
360 output_frames->height = ctx->inputs[0]->h;
361 ((AVVTFramesContext *)output_frames->hwctx)->color_range = ((AVVTFramesContext *)input_frames->hwctx)->color_range;
362
363 ret = ff_filter_init_hw_frames(ctx, link, 10);
364 if (ret < 0)
365 goto exit;
366
368 if (ret < 0) {
369 av_log(ctx, AV_LOG_ERROR, "Failed to initialise VideoToolbox frame "
370 "context for output: %d\n", ret);
371 goto exit;
372 }
373
375 if (ret < 0)
376 goto exit;
377
378 y->csp = av_pix_fmt_desc_get(output_frames->sw_format);
379 y->filter = filter;
380
381exit:
382 return ret;
383}
384
385static int config_output(AVFilterLink *link)
386{
387 AVFilterContext *ctx = link->src;
388 if (@available(macOS 10.11, iOS 8.0, *)) {
389 return do_config_output(link);
390 } else {
391 av_log(ctx, AV_LOG_ERROR, "Metal is not available on this OS version\n");
392 return AVERROR(ENOSYS);
393 }
394}
395
396#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
397#define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
398
399static const AVOption yadif_videotoolbox_options[] = {
400 #define OFFSET(x) offsetof(YADIFContext, x)
401 { "mode", "specify the interlacing mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=YADIF_MODE_SEND_FRAME}, 0, 3, FLAGS, .unit = "mode"},
402 CONST("send_frame", "send one frame for each frame", YADIF_MODE_SEND_FRAME, "mode"),
403 CONST("send_field", "send one frame for each field", YADIF_MODE_SEND_FIELD, "mode"),
404 CONST("send_frame_nospatial", "send one frame for each frame, but skip spatial interlacing check", YADIF_MODE_SEND_FRAME_NOSPATIAL, "mode"),
405 CONST("send_field_nospatial", "send one frame for each field, but skip spatial interlacing check", YADIF_MODE_SEND_FIELD_NOSPATIAL, "mode"),
406
407 { "parity", "specify the assumed picture field parity", OFFSET(parity), AV_OPT_TYPE_INT, {.i64=YADIF_PARITY_AUTO}, -1, 1, FLAGS, .unit = "parity" },
408 CONST("tff", "assume top field first", YADIF_PARITY_TFF, "parity"),
409 CONST("bff", "assume bottom field first", YADIF_PARITY_BFF, "parity"),
410 CONST("auto", "auto detect parity", YADIF_PARITY_AUTO, "parity"),
411
412 { "deint", "specify which frames to deinterlace", OFFSET(deint), AV_OPT_TYPE_INT, {.i64=YADIF_DEINT_ALL}, 0, 1, FLAGS, .unit = "deint" },
413 CONST("all", "deinterlace all frames", YADIF_DEINT_ALL, "deint"),
414 CONST("interlaced", "only deinterlace frames marked as interlaced", YADIF_DEINT_INTERLACED, "deint"),
415 #undef OFFSET
416
417 { NULL }
418};
419
420AVFILTER_DEFINE_CLASS(yadif_videotoolbox);
421
422static const AVFilterPad yadif_videotoolbox_inputs[] = {
423 {
424 .name = "default",
425 .type = AVMEDIA_TYPE_VIDEO,
426 .filter_frame = ff_yadif_filter_frame,
427 .config_props = config_input,
428 },
429};
430
431static const AVFilterPad yadif_videotoolbox_outputs[] = {
432 {
433 .name = "default",
434 .type = AVMEDIA_TYPE_VIDEO,
435 .request_frame = ff_yadif_request_frame,
436 .config_props = config_output,
437 },
438};
439
441 .p.name = "yadif_videotoolbox",
442 .p.description = NULL_IF_CONFIG_SMALL("YADIF for VideoToolbox frames using Metal compute"),
443 .p.priv_class = &yadif_videotoolbox_class,
445 .priv_size = YADIF_VT_CTX_SIZE,
446 .init = yadif_videotoolbox_init,
447 .uninit = yadif_videotoolbox_uninit,
449 FILTER_INPUTS(yadif_videotoolbox_inputs),
450 FILTER_OUTPUTS(yadif_videotoolbox_outputs),
451 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
452};
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:445
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:596
#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:97
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)