vf_yadif.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2010 Michael Niedermayer <michaelni@gmx.at>
3  * 2010 James Darnley <james.darnley@gmail.com>
4  *
5  * This file is part of Libav.
6  *
7  * Libav is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * Libav 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
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with Libav; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #include "libavutil/cpu.h"
23 #include "libavutil/common.h"
24 #include "libavutil/pixdesc.h"
25 #include "avfilter.h"
26 #include "yadif.h"
27 
28 #undef NDEBUG
29 #include <assert.h>
30 
31 typedef struct {
38  int mode;
39 
45  int parity;
46 
48 
54 
59  void (*filter_line)(uint8_t *dst,
60  uint8_t *prev, uint8_t *cur, uint8_t *next,
61  int w, int prefs, int mrefs, int parity, int mode);
62 
64 } YADIFContext;
65 
66 #define CHECK(j)\
67  { int score = FFABS(cur[mrefs-1+(j)] - cur[prefs-1-(j)])\
68  + FFABS(cur[mrefs +(j)] - cur[prefs -(j)])\
69  + FFABS(cur[mrefs+1+(j)] - cur[prefs+1-(j)]);\
70  if (score < spatial_score) {\
71  spatial_score= score;\
72  spatial_pred= (cur[mrefs +(j)] + cur[prefs -(j)])>>1;\
73 
74 #define FILTER \
75  for (x = 0; x < w; x++) { \
76  int c = cur[mrefs]; \
77  int d = (prev2[0] + next2[0])>>1; \
78  int e = cur[prefs]; \
79  int temporal_diff0 = FFABS(prev2[0] - next2[0]); \
80  int temporal_diff1 =(FFABS(prev[mrefs] - c) + FFABS(prev[prefs] - e) )>>1; \
81  int temporal_diff2 =(FFABS(next[mrefs] - c) + FFABS(next[prefs] - e) )>>1; \
82  int diff = FFMAX3(temporal_diff0>>1, temporal_diff1, temporal_diff2); \
83  int spatial_pred = (c+e)>>1; \
84  int spatial_score = FFABS(cur[mrefs-1] - cur[prefs-1]) + FFABS(c-e) \
85  + FFABS(cur[mrefs+1] - cur[prefs+1]) - 1; \
86  \
87  CHECK(-1) CHECK(-2) }} }} \
88  CHECK( 1) CHECK( 2) }} }} \
89  \
90  if (mode < 2) { \
91  int b = (prev2[2*mrefs] + next2[2*mrefs])>>1; \
92  int f = (prev2[2*prefs] + next2[2*prefs])>>1; \
93  int max = FFMAX3(d-e, d-c, FFMIN(b-c, f-e)); \
94  int min = FFMIN3(d-e, d-c, FFMAX(b-c, f-e)); \
95  \
96  diff = FFMAX3(diff, min, -max); \
97  } \
98  \
99  if (spatial_pred > d + diff) \
100  spatial_pred = d + diff; \
101  else if (spatial_pred < d - diff) \
102  spatial_pred = d - diff; \
103  \
104  dst[0] = spatial_pred; \
105  \
106  dst++; \
107  cur++; \
108  prev++; \
109  next++; \
110  prev2++; \
111  next2++; \
112  }
113 
114 static void filter_line_c(uint8_t *dst,
115  uint8_t *prev, uint8_t *cur, uint8_t *next,
116  int w, int prefs, int mrefs, int parity, int mode)
117 {
118  int x;
119  uint8_t *prev2 = parity ? prev : cur ;
120  uint8_t *next2 = parity ? cur : next;
121 
122  FILTER
123 }
124 
125 static void filter_line_c_16bit(uint16_t *dst,
126  uint16_t *prev, uint16_t *cur, uint16_t *next,
127  int w, int prefs, int mrefs, int parity, int mode)
128 {
129  int x;
130  uint16_t *prev2 = parity ? prev : cur ;
131  uint16_t *next2 = parity ? cur : next;
132  mrefs /= 2;
133  prefs /= 2;
134 
135  FILTER
136 }
137 
138 static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic,
139  int parity, int tff)
140 {
141  YADIFContext *yadif = ctx->priv;
142  int y, i;
143 
144  for (i = 0; i < yadif->csp->nb_components; i++) {
145  int w = dstpic->video->w;
146  int h = dstpic->video->h;
147  int refs = yadif->cur->linesize[i];
148  int df = (yadif->csp->comp[i].depth_minus1 + 8) / 8;
149 
150  if (i == 1 || i == 2) {
151  /* Why is this not part of the per-plane description thing? */
152  w >>= yadif->csp->log2_chroma_w;
153  h >>= yadif->csp->log2_chroma_h;
154  }
155 
156  for (y = 0; y < h; y++) {
157  if ((y ^ parity) & 1) {
158  uint8_t *prev = &yadif->prev->data[i][y*refs];
159  uint8_t *cur = &yadif->cur ->data[i][y*refs];
160  uint8_t *next = &yadif->next->data[i][y*refs];
161  uint8_t *dst = &dstpic->data[i][y*dstpic->linesize[i]];
162  int mode = y==1 || y+2==h ? 2 : yadif->mode;
163  yadif->filter_line(dst, prev, cur, next, w, y+1<h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);
164  } else {
165  memcpy(&dstpic->data[i][y*dstpic->linesize[i]],
166  &yadif->cur->data[i][y*refs], w*df);
167  }
168  }
169  }
170 #if HAVE_MMX
171  __asm__ volatile("emms \n\t" : : : "memory");
172 #endif
173 }
174 
175 static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, int w, int h)
176 {
177  AVFilterBufferRef *picref;
178  int width = FFALIGN(w, 32);
179  int height= FFALIGN(h+2, 32);
180  int i;
181 
182  picref = avfilter_default_get_video_buffer(link, perms, width, height);
183 
184  picref->video->w = w;
185  picref->video->h = h;
186 
187  for (i = 0; i < 3; i++)
188  picref->data[i] += picref->linesize[i];
189 
190  return picref;
191 }
192 
193 static void return_frame(AVFilterContext *ctx, int is_second)
194 {
195  YADIFContext *yadif = ctx->priv;
196  AVFilterLink *link= ctx->outputs[0];
197  int tff;
198 
199  if (yadif->parity == -1) {
200  tff = yadif->cur->video->interlaced ?
201  yadif->cur->video->top_field_first : 1;
202  } else {
203  tff = yadif->parity^1;
204  }
205 
206  if (is_second) {
208  AV_PERM_REUSE, link->w, link->h);
209  avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
210  yadif->out->video->interlaced = 0;
211  }
212 
213  if (!yadif->csp)
214  yadif->csp = &av_pix_fmt_descriptors[link->format];
215  if (yadif->csp->comp[0].depth_minus1 / 8 == 1)
217 
218  filter(ctx, yadif->out, tff ^ !is_second, tff);
219 
220  if (is_second) {
221  if (yadif->next->pts != AV_NOPTS_VALUE &&
222  yadif->cur->pts != AV_NOPTS_VALUE) {
223  yadif->out->pts =
224  (yadif->next->pts&yadif->cur->pts) +
225  ((yadif->next->pts^yadif->cur->pts)>>1);
226  } else {
227  yadif->out->pts = AV_NOPTS_VALUE;
228  }
229  avfilter_start_frame(ctx->outputs[0], yadif->out);
230  }
231  avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1);
232  avfilter_end_frame(ctx->outputs[0]);
233 
234  yadif->frame_pending = (yadif->mode&1) && !is_second;
235 }
236 
237 static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
238 {
239  AVFilterContext *ctx = link->dst;
240  YADIFContext *yadif = ctx->priv;
241 
242  if (yadif->frame_pending)
243  return_frame(ctx, 1);
244 
245  if (yadif->prev)
246  avfilter_unref_buffer(yadif->prev);
247  yadif->prev = yadif->cur;
248  yadif->cur = yadif->next;
249  yadif->next = picref;
250 
251  if (!yadif->cur)
252  return;
253 
254  if (yadif->auto_enable && !yadif->cur->video->interlaced) {
255  yadif->out = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
256  avfilter_unref_buffer(yadif->prev);
257  yadif->prev = NULL;
258  avfilter_start_frame(ctx->outputs[0], yadif->out);
259  return;
260  }
261 
262  if (!yadif->prev)
263  yadif->prev = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
264 
266  AV_PERM_REUSE, link->w, link->h);
267 
268  avfilter_copy_buffer_ref_props(yadif->out, yadif->cur);
269  yadif->out->video->interlaced = 0;
270  avfilter_start_frame(ctx->outputs[0], yadif->out);
271 }
272 
273 static void end_frame(AVFilterLink *link)
274 {
275  AVFilterContext *ctx = link->dst;
276  YADIFContext *yadif = ctx->priv;
277 
278  if (!yadif->out)
279  return;
280 
281  if (yadif->auto_enable && !yadif->cur->video->interlaced) {
282  avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1);
283  avfilter_end_frame(ctx->outputs[0]);
284  return;
285  }
286 
287  return_frame(ctx, 0);
288 }
289 
290 static int request_frame(AVFilterLink *link)
291 {
292  AVFilterContext *ctx = link->src;
293  YADIFContext *yadif = ctx->priv;
294 
295  if (yadif->frame_pending) {
296  return_frame(ctx, 1);
297  return 0;
298  }
299 
300  do {
301  int ret;
302 
303  if ((ret = avfilter_request_frame(link->src->inputs[0])))
304  return ret;
305  } while (!yadif->cur);
306 
307  return 0;
308 }
309 
310 static int poll_frame(AVFilterLink *link)
311 {
312  YADIFContext *yadif = link->src->priv;
313  int ret, val;
314 
315  if (yadif->frame_pending)
316  return 1;
317 
318  val = avfilter_poll_frame(link->src->inputs[0]);
319 
320  if (val==1 && !yadif->next) { //FIXME change API to not requre this red tape
321  if ((ret = avfilter_request_frame(link->src->inputs[0])) < 0)
322  return ret;
323  val = avfilter_poll_frame(link->src->inputs[0]);
324  }
325  assert(yadif->next || !val);
326 
327  if (yadif->auto_enable && yadif->next && !yadif->next->video->interlaced)
328  return val;
329 
330  return val * ((yadif->mode&1)+1);
331 }
332 
333 static av_cold void uninit(AVFilterContext *ctx)
334 {
335  YADIFContext *yadif = ctx->priv;
336 
337  if (yadif->prev) avfilter_unref_buffer(yadif->prev);
338  if (yadif->cur ) avfilter_unref_buffer(yadif->cur );
339  if (yadif->next) avfilter_unref_buffer(yadif->next);
340 }
341 
343 {
344  static const enum PixelFormat pix_fmts[] = {
365  };
366 
368 
369  return 0;
370 }
371 
372 static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
373 {
374  YADIFContext *yadif = ctx->priv;
376 
377  yadif->mode = 0;
378  yadif->parity = -1;
379  yadif->auto_enable = 0;
380  yadif->csp = NULL;
381 
382  if (args) sscanf(args, "%d:%d:%d", &yadif->mode, &yadif->parity, &yadif->auto_enable);
383 
384  yadif->filter_line = filter_line_c;
385  if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3)
387  else if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
389  else if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX)
391 
392  av_log(ctx, AV_LOG_INFO, "mode:%d parity:%d auto_enable:%d\n", yadif->mode, yadif->parity, yadif->auto_enable);
393 
394  return 0;
395 }
396 
397 static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
398 
400  .name = "yadif",
401  .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image"),
402 
403  .priv_size = sizeof(YADIFContext),
404  .init = init,
405  .uninit = uninit,
407 
408  .inputs = (AVFilterPad[]) {{ .name = "default",
409  .type = AVMEDIA_TYPE_VIDEO,
410  .start_frame = start_frame,
411  .get_video_buffer = get_video_buffer,
412  .draw_slice = null_draw_slice,
413  .end_frame = end_frame, },
414  { .name = NULL}},
415 
416  .outputs = (AVFilterPad[]) {{ .name = "default",
417  .type = AVMEDIA_TYPE_VIDEO,
418  .poll_frame = poll_frame,
419  .request_frame = request_frame, },
420  { .name = NULL}},
421 };
void ff_yadif_filter_line_mmx(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:68
AVFilterBufferRef * avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: avfilter.c:289
static void filter_line_c_16bit(uint16_t *dst, uint16_t *prev, uint16_t *cur, uint16_t *next, int w, int prefs, int mrefs, int parity, int mode)
Definition: vf_yadif.c:125
static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic, int parity, int tff)
Definition: vf_yadif.c:138
static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Definition: vf_yadif.c:397
AVFilterBufferRefVideoProps * video
video buffer specific properties
Definition: avfilter.h:141
int linesize[8]
number of bytes per line
Definition: avfilter.h:127
static void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
Copy properties of src to dst, without copying the actual data.
Definition: avfilter.h:148
Y , 16bpp, big-endian.
Definition: pixfmt.h:97
#define AV_PERM_REUSE
can output the buffer multiple times, with the same contents each time
Definition: avfilter.h:84
int frame_pending
Definition: vf_yadif.c:47
int width
Definition: rotozoom.c:164
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
Definition: pixfmt.h:77
AVFilterBufferRef * cur
Definition: vf_yadif.c:55
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
Definition: vf_yadif.c:372
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:125
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:71
#define HAVE_SSE
Definition: config.h:48
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:66
#define FFALIGN(x, a)
Definition: common.h:60
#define AV_PERM_READ
can read from the buffer
Definition: avfilter.h:81
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:127
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:78
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:547
planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:124
static int request_frame(AVFilterLink *link)
Definition: vf_yadif.c:290
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:83
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:64
#define av_cold
Definition: attributes.h:71
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:70
int top_field_first
field order
Definition: avfilter.h:111
#define AV_NE(be, le)
Definition: common.h:43
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
Definition: avfilter.c:430
void(* filter_line)(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode)
Definition: vf_yadif.c:59
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
Definition: pixfmt.h:76
#define next2
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:149
AVFilterBufferRef * out
Definition: vf_yadif.c:58
int64_t pts
presentation timestamp.
Definition: avfilter.h:135
A filter pad used for either input or output.
Definition: avfilter.h:312
Y , 16bpp, little-endian.
Definition: pixfmt.h:98
uint16_t depth_minus1
number of bits in the component minus 1
Definition: pixdesc.h:43
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: defaults.c:234
#define AV_CPU_FLAG_SSSE3
Conroe SSSE3 functions.
Definition: cpu.h:36
int h
image height
Definition: avfilter.h:108
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:75
AVFilterBufferRef * prev
Definition: vf_yadif.c:57
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:191
void * priv
private data for use by the filter
Definition: avfilter.h:553
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
Definition: pixfmt.h:142
AVFilterBufferRef * avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
default handler for get_video_buffer() for video inputs
Definition: defaults.c:38
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:140
AVFilterFormats * avfilter_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:90
static void return_frame(AVFilterContext *ctx, int is_second)
Definition: vf_yadif.c:193
static int query_formats(AVFilterContext *ctx)
Definition: vf_yadif.c:342
const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB]
The array of all the pixel format descriptors.
Definition: pixdesc.c:119
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:69
int auto_enable
0: deinterlace all frames 1: only deinterlace frames marked as interlaced
Definition: vf_yadif.c:53
int avfilter_poll_frame(AVFilterLink *link)
Poll a frame from the filter chain.
Definition: avfilter.c:380
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:57
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
Definition: pixfmt.h:144
planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:126
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range ...
Definition: pixfmt.h:100
#define HAVE_MMX
Definition: config.h:44
static void filter_line_c(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode)
Definition: vf_yadif.c:114
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
Definition: avfilter.c:447
static int cpu_flags
Definition: dct-test.c:85
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:128
void ff_yadif_filter_line_ssse3(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode)
#define FILTER
Definition: vf_yadif.c:74
void avfilter_unref_buffer(AVFilterBufferRef *ref)
Remove a reference to a buffer.
Definition: avfilter.c:73
static int poll_frame(AVFilterLink *link)
Definition: vf_yadif.c:310
A reference to an AVFilterBuffer.
Definition: avfilter.h:124
NULL
Definition: eval.c:50
static void end_frame(AVFilterLink *link)
Definition: vf_yadif.c:273
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:55
#define AV_CPU_FLAG_MMX
standard MMX
Definition: cpu.h:27
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
Filter definition.
Definition: avfilter.h:497
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
Add a new reference to a buffer.
Definition: avfilter.c:47
void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
Notify the next filter of the start of a frame.
Definition: avfilter.c:400
AVFilter avfilter_vf_yadif
Definition: vf_yadif.c:399
int avfilter_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition: avfilter.c:369
int parity
0: top field first 1: bottom field first -1: auto-detection
Definition: vf_yadif.c:45
const char * name
filter name
Definition: avfilter.h:498
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:22
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:551
#define prev2
#define AV_PERM_PRESERVE
nobody else can overwrite the buffer
Definition: avfilter.h:83
const AVPixFmtDescriptor * csp
Definition: vf_yadif.c:63
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:148
int height
Definition: gxfenc.c:73
static AVFilterBufferRef * get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Definition: vf_yadif.c:175
PixelFormat
Pixel format.
Definition: pixfmt.h:62
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:143
int interlaced
is frame interlaced
Definition: avfilter.h:110
common internal and external API header
AVFilterBufferRef * next
Definition: vf_yadif.c:56
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:145
#define AV_PERM_WRITE
can write to the buffer
Definition: avfilter.h:82
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_yadif.c:333
void ff_yadif_filter_line_sse2(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode)
static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
Definition: vf_yadif.c:237
uint8_t * data[8]
picture/audio data for each plane
Definition: avfilter.h:126
#define HAVE_SSSE3
Definition: config.h:49
An instance of a filter.
Definition: avfilter.h:538
#define AV_CPU_FLAG_SSE2
PIV SSE2 functions.
Definition: cpu.h:31
#define AV_LOG_INFO
Definition: log.h:119
Y , 8bpp.
Definition: pixfmt.h:72
int mode
0: send 1 frame for each frame 1: send 1 frame for each field 2: like 0 but skips spatial interlacing...
Definition: vf_yadif.c:38
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:271
#define av_unused
Definition: attributes.h:95
planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
Definition: pixfmt.h:129
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101