FFmpeg  4.0
vf_interlace.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com>
3  * Copyright (c) 2010 Baptiste Coudurier
4  * Copyright (c) 2011 Stefano Sabatini
5  * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara@gmail.com>
6  * Copyright (c) 2017 Thomas Mundt <tmundt75@gmail.com>
7  *
8  * This file is part of FFmpeg.
9  *
10  * FFmpeg is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * FFmpeg is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 /**
26  * @file
27  * progressive to interlaced content filter, inspired by heavy debugging of tinterlace filter
28  */
29 
30 #include "libavutil/common.h"
31 #include "libavutil/opt.h"
32 #include "libavutil/imgutils.h"
33 #include "libavutil/avassert.h"
34 
35 #include "formats.h"
36 #include "avfilter.h"
37 #include "interlace.h"
38 #include "internal.h"
39 #include "video.h"
40 
41 #define OFFSET(x) offsetof(InterlaceContext, x)
42 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
43 static const AVOption interlace_options[] = {
44  { "scan", "scanning mode", OFFSET(scan),
45  AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = FLAGS, .unit = "scan" },
46  { "tff", "top field first", 0,
47  AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" },
48  { "bff", "bottom field first", 0,
49  AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" },
50  { "lowpass", "set vertical low-pass filter", OFFSET(lowpass),
51  AV_OPT_TYPE_INT, {.i64 = VLPF_LIN }, 0, 2, .flags = FLAGS, .unit = "lowpass" },
52  { "off", "disable vertical low-pass filter", 0,
53  AV_OPT_TYPE_CONST, {.i64 = VLPF_OFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" },
54  { "linear", "linear vertical low-pass filter", 0,
55  AV_OPT_TYPE_CONST, {.i64 = VLPF_LIN }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" },
56  { "complex", "complex vertical low-pass filter", 0,
57  AV_OPT_TYPE_CONST, {.i64 = VLPF_CMP }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" },
58  { NULL }
59 };
60 
61 AVFILTER_DEFINE_CLASS(interlace);
62 
63 static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
64  const uint8_t *srcp, ptrdiff_t mref,
65  ptrdiff_t pref, int clip_max)
66 {
67  const uint8_t *srcp_above = srcp + mref;
68  const uint8_t *srcp_below = srcp + pref;
69  int i;
70  for (i = 0; i < linesize; i++) {
71  // this calculation is an integer representation of
72  // '0.5 * current + 0.25 * above + 0.25 * below'
73  // '1 +' is for rounding.
74  dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2;
75  }
76 }
77 
78 static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize,
79  const uint8_t *src8, ptrdiff_t mref,
80  ptrdiff_t pref, int clip_max)
81 {
82  uint16_t *dstp = (uint16_t *)dst8;
83  const uint16_t *srcp = (const uint16_t *)src8;
84  const uint16_t *srcp_above = srcp + mref / 2;
85  const uint16_t *srcp_below = srcp + pref / 2;
86  int i, src_x;
87  for (i = 0; i < linesize; i++) {
88  // this calculation is an integer representation of
89  // '0.5 * current + 0.25 * above + 0.25 * below'
90  // '1 +' is for rounding.
91  src_x = av_le2ne16(srcp[i]) << 1;
92  dstp[i] = av_le2ne16((1 + src_x + av_le2ne16(srcp_above[i])
93  + av_le2ne16(srcp_below[i])) >> 2);
94  }
95 }
96 
97 static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t linesize,
98  const uint8_t *srcp, ptrdiff_t mref,
99  ptrdiff_t pref, int clip_max)
100 {
101  const uint8_t *srcp_above = srcp + mref;
102  const uint8_t *srcp_below = srcp + pref;
103  const uint8_t *srcp_above2 = srcp + mref * 2;
104  const uint8_t *srcp_below2 = srcp + pref * 2;
105  int i, src_x, src_ab;
106  for (i = 0; i < linesize; i++) {
107  // this calculation is an integer representation of
108  // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2'
109  // '4 +' is for rounding.
110  src_x = srcp[i] << 1;
111  src_ab = srcp_above[i] + srcp_below[i];
112  dstp[i] = av_clip_uint8((4 + ((srcp[i] + src_x + src_ab) << 1)
113  - srcp_above2[i] - srcp_below2[i]) >> 3);
114  // Prevent over-sharpening:
115  // dst must not exceed src when the average of above and below
116  // is less than src. And the other way around.
117  if (src_ab > src_x) {
118  if (dstp[i] < srcp[i])
119  dstp[i] = srcp[i];
120  } else if (dstp[i] > srcp[i])
121  dstp[i] = srcp[i];
122  }
123 }
124 
125 static void lowpass_line_complex_c_16(uint8_t *dst8, ptrdiff_t linesize,
126  const uint8_t *src8, ptrdiff_t mref,
127  ptrdiff_t pref, int clip_max)
128 {
129  uint16_t *dstp = (uint16_t *)dst8;
130  const uint16_t *srcp = (const uint16_t *)src8;
131  const uint16_t *srcp_above = srcp + mref / 2;
132  const uint16_t *srcp_below = srcp + pref / 2;
133  const uint16_t *srcp_above2 = srcp + mref;
134  const uint16_t *srcp_below2 = srcp + pref;
135  int i, dst_le, src_le, src_x, src_ab;
136  for (i = 0; i < linesize; i++) {
137  // this calculation is an integer representation of
138  // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2'
139  // '4 +' is for rounding.
140  src_le = av_le2ne16(srcp[i]);
141  src_x = src_le << 1;
142  src_ab = av_le2ne16(srcp_above[i]) + av_le2ne16(srcp_below[i]);
143  dst_le = av_clip((4 + ((src_le + src_x + src_ab) << 1)
144  - av_le2ne16(srcp_above2[i])
145  - av_le2ne16(srcp_below2[i])) >> 3, 0, clip_max);
146  // Prevent over-sharpening:
147  // dst must not exceed src when the average of above and below
148  // is less than src. And the other way around.
149  if (src_ab > src_x) {
150  if (dst_le < src_le)
151  dstp[i] = av_le2ne16(src_le);
152  else
153  dstp[i] = av_le2ne16(dst_le);
154  } else if (dst_le > src_le) {
155  dstp[i] = av_le2ne16(src_le);
156  } else
157  dstp[i] = av_le2ne16(dst_le);
158  }
159 }
160 
161 static const enum AVPixelFormat formats_supported[] = {
170 };
171 
173 {
175  if (!fmts_list)
176  return AVERROR(ENOMEM);
177  return ff_set_common_formats(ctx, fmts_list);
178 }
179 
181 {
182  InterlaceContext *s = ctx->priv;
183 
184  av_frame_free(&s->cur);
185  av_frame_free(&s->next);
186 }
187 
189 {
190  if (s->lowpass) {
191  if (s->lowpass == VLPF_LIN) {
192  if (depth > 8)
194  else
196  } else if (s->lowpass == VLPF_CMP) {
197  if (depth > 8)
199  else
201  }
202  if (ARCH_X86)
203  ff_interlace_init_x86(s, depth);
204  }
205 }
206 
207 static int config_out_props(AVFilterLink *outlink)
208 {
209  AVFilterContext *ctx = outlink->src;
210  AVFilterLink *inlink = outlink->src->inputs[0];
211  InterlaceContext *s = ctx->priv;
212 
213  if (inlink->h < 2) {
214  av_log(ctx, AV_LOG_ERROR, "input video height is too small\n");
215  return AVERROR_INVALIDDATA;
216  }
217 
218  if (!s->lowpass)
219  av_log(ctx, AV_LOG_WARNING, "Lowpass filter is disabled, "
220  "the resulting video will be aliased rather than interlaced.\n");
221 
222  // same input size
223  outlink->w = inlink->w;
224  outlink->h = inlink->h;
225  outlink->time_base = inlink->time_base;
226  outlink->frame_rate = inlink->frame_rate;
227  // half framerate
228  outlink->time_base.num *= 2;
229  outlink->frame_rate.den *= 2;
230 
231  s->csp = av_pix_fmt_desc_get(outlink->format);
232  ff_interlace_init(s, s->csp->comp[0].depth);
233 
234  av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n",
235  s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" : "without");
236 
237  return 0;
238 }
239 
241  AVFrame *src_frame, AVFrame *dst_frame,
242  AVFilterLink *inlink, enum FieldType field_type,
243  int lowpass)
244 {
246  int hsub = desc->log2_chroma_w;
247  int vsub = desc->log2_chroma_h;
248  int plane, j;
249 
250  for (plane = 0; plane < desc->nb_components; plane++) {
251  int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub : inlink->w;
252  int lines = (plane == 1 || plane == 2) ? AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h;
253  uint8_t *dstp = dst_frame->data[plane];
254  const uint8_t *srcp = src_frame->data[plane];
255  int srcp_linesize = src_frame->linesize[plane] * 2;
256  int dstp_linesize = dst_frame->linesize[plane] * 2;
257  int clip_max = (1 << s->csp->comp[plane].depth) - 1;
258 
259  av_assert0(cols >= 0 || lines >= 0);
260 
261  lines = (lines + (field_type == FIELD_UPPER)) / 2;
262  if (field_type == FIELD_LOWER) {
263  srcp += src_frame->linesize[plane];
264  dstp += dst_frame->linesize[plane];
265  }
266  if (lowpass) {
267  int x = 0;
268  if (lowpass == VLPF_CMP)
269  x = 1;
270  for (j = lines; j > 0; j--) {
271  ptrdiff_t pref = src_frame->linesize[plane];
272  ptrdiff_t mref = -pref;
273  if (j >= (lines - x))
274  mref = 0;
275  else if (j <= (1 + x))
276  pref = 0;
277  s->lowpass_line(dstp, cols, srcp, mref, pref, clip_max);
278  dstp += dstp_linesize;
279  srcp += srcp_linesize;
280  }
281  } else {
282  if (s->csp->comp[plane].depth > 8)
283  cols *= 2;
284  av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines);
285  }
286  }
287 }
288 
289 static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
290 {
291  AVFilterContext *ctx = inlink->dst;
292  AVFilterLink *outlink = ctx->outputs[0];
293  InterlaceContext *s = ctx->priv;
294  AVFrame *out;
295  int tff, ret;
296 
297  av_frame_free(&s->cur);
298  s->cur = s->next;
299  s->next = buf;
300 
301  /* we need at least two frames */
302  if (!s->cur || !s->next)
303  return 0;
304 
305  if (s->cur->interlaced_frame) {
306  av_log(ctx, AV_LOG_WARNING,
307  "video is already interlaced, adjusting framerate only\n");
308  out = av_frame_clone(s->cur);
309  if (!out)
310  return AVERROR(ENOMEM);
311  out->pts /= 2; // adjust pts to new framerate
312  ret = ff_filter_frame(outlink, out);
313  return ret;
314  }
315 
316  tff = (s->scan == MODE_TFF);
317  out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
318  if (!out)
319  return AVERROR(ENOMEM);
320 
321  av_frame_copy_props(out, s->cur);
322  out->interlaced_frame = 1;
323  out->top_field_first = tff;
324  out->pts /= 2; // adjust pts to new framerate
325 
326  /* copy upper/lower field from cur */
327  copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass);
328  av_frame_free(&s->cur);
329 
330  /* copy lower/upper field from next */
331  copy_picture_field(s, s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER, s->lowpass);
332  av_frame_free(&s->next);
333 
334  ret = ff_filter_frame(outlink, out);
335 
336  return ret;
337 }
338 
339 static const AVFilterPad inputs[] = {
340  {
341  .name = "default",
342  .type = AVMEDIA_TYPE_VIDEO,
343  .filter_frame = filter_frame,
344  },
345  { NULL }
346 };
347 
348 static const AVFilterPad outputs[] = {
349  {
350  .name = "default",
351  .type = AVMEDIA_TYPE_VIDEO,
352  .config_props = config_out_props,
353  },
354  { NULL }
355 };
356 
358  .name = "interlace",
359  .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."),
360  .uninit = uninit,
361  .priv_class = &interlace_class,
362  .priv_size = sizeof(InterlaceContext),
364  .inputs = inputs,
365  .outputs = outputs,
366 };
int plane
Definition: avisynth_c.h:422
#define NULL
Definition: coverity.c:32
const char * s
Definition: avisynth_c.h:768
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2363
This structure describes decoded (raw) audio or video data.
Definition: frame.h:218
AVOption.
Definition: opt.h:246
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:155
static const AVFilterPad inputs[]
Definition: vf_interlace.c:339
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
misc image utilities
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
Main libavfilter public API header.
const char * desc
Definition: nvenc.c:65
int num
Numerator.
Definition: rational.h:59
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
Definition: pixfmt.h:185
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:99
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:92
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:283
static enum AVPixelFormat formats_supported[]
Definition: vf_interlace.c:161
static int query_formats(AVFilterContext *ctx)
Definition: vf_interlace.c:172
BYTE int const BYTE * srcp
Definition: avisynth_c.h:813
const char * name
Pad name.
Definition: internal.h:60
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:346
static int config_out_props(AVFilterLink *outlink)
Definition: vf_interlace.c:207
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1080
static const AVFilterPad outputs[]
Definition: vf_interlace.c:348
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:97
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:117
uint8_t
#define av_cold
Definition: attributes.h:82
AVOptions.
planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:247
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:311
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:96
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:75
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:192
int interlaced_frame
The content of the picture is interlaced.
Definition: frame.h:365
#define av_log(a,...)
A filter pad used for either input or output.
Definition: internal.h:54
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
Definition: pixfmt.h:161
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:172
FieldType
Definition: interlace.h:44
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
void(* lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp, ptrdiff_t mref, ptrdiff_t pref, int clip_max)
Definition: interlace.h:61
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:568
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:101
#define ARCH_X86
Definition: config.h:38
BYTE * dstp
Definition: avisynth_c.h:813
#define AVERROR(e)
Definition: error.h:43
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:202
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
void * priv
private data for use by the filter
Definition: avfilter.h:353
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:157
AVFilter ff_vf_interlace
Definition: vf_interlace.c:357
simple assert() macros that are a bit more flexible than ISO C assert().
AVFrame * next
Definition: interlace.h:59
#define OFFSET(x)
Definition: vf_interlace.c:41
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
uint8_t nb_components
The number of components each pixel has, (1-4)
Definition: pixdesc.h:83
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:74
#define FLAGS
Definition: vf_interlace.c:42
AVFormatContext * ctx
Definition: movenc.c:48
progressive to interlaced content filter, inspired by heavy debugging of tinterlace filter...
planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
Definition: pixfmt.h:239
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition: frame.c:538
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_interlace.c:180
#define av_le2ne16(x)
Definition: bswap.h:95
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:249
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:173
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
AVFILTER_DEFINE_CLASS(interlace)
void * buf
Definition: avisynth_c.h:690
static void copy_picture_field(InterlaceContext *s, AVFrame *src_frame, AVFrame *dst_frame, AVFilterLink *inlink, enum FieldType field_type, int lowpass)
Definition: vf_interlace.c:240
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:68
static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp, ptrdiff_t mref, ptrdiff_t pref, int clip_max)
Definition: vf_interlace.c:63
Filter definition.
Definition: avfilter.h:144
const char * name
Filter name.
Definition: avfilter.h:148
static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp, ptrdiff_t mref, ptrdiff_t pref, int clip_max)
Definition: vf_interlace.c:97
void ff_interlace_init_x86(InterlaceContext *interlace, int depth)
AVFrame * cur
Definition: interlace.h:59
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:350
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
Definition: pixfmt.h:183
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:232
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
Definition: pixfmt.h:243
Y , 8bpp.
Definition: pixfmt.h:70
static const AVOption interlace_options[]
Definition: vf_interlace.c:43
common internal and external API header
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:76
enum ScanMode scan
Definition: interlace.h:57
static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize, const uint8_t *src8, ptrdiff_t mref, ptrdiff_t pref, int clip_max)
Definition: vf_interlace.c:78
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:69
int den
Denominator.
Definition: rational.h:60
planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
Definition: pixfmt.h:181
int top_field_first
If the content is interlaced, is top field displayed first.
Definition: frame.h:370
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: vf_interlace.c:289
A list of supported formats for one end of a filter link.
Definition: formats.h:64
An instance of a filter.
Definition: avfilter.h:338
static void lowpass_line_complex_c_16(uint8_t *dst8, ptrdiff_t linesize, const uint8_t *src8, ptrdiff_t mref, ptrdiff_t pref, int clip_max)
Definition: vf_interlace.c:125
FILE * out
Definition: movenc.c:54
void ff_interlace_init(InterlaceContext *s, int depth)
Definition: vf_interlace.c:188
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
Definition: imgutils.c:338
internal API functions
int depth
Number of bits in the component.
Definition: pixdesc.h:58
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60
const AVPixFmtDescriptor * csp
Definition: interlace.h:60
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:652
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58