FFmpeg
vf_mcdeint.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (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
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 /**
22  * @file
23  * Motion Compensation Deinterlacer
24  * Ported from MPlayer libmpcodecs/vf_mcdeint.c.
25  *
26  * Known Issues:
27  *
28  * The motion estimation is somewhat at the mercy of the input, if the
29  * input frames are created purely based on spatial interpolation then
30  * for example a thin black line or another random and not
31  * interpolateable pattern will cause problems.
32  * Note: completely ignoring the "unavailable" lines during motion
33  * estimation did not look any better, so the most obvious solution
34  * would be to improve tfields or penalize problematic motion vectors.
35  *
36  * If non iterative ME is used then snow currently ignores the OBMC
37  * window and as a result sometimes creates artifacts.
38  *
39  * Only past frames are used, we should ideally use future frames too,
40  * something like filtering the whole movie in forward and then
41  * backward direction seems like an interesting idea but the current
42  * filter framework is FAR from supporting such things.
43  *
44  * Combining the motion compensated image with the input image also is
45  * not as trivial as it seems, simple blindly taking even lines from
46  * one and odd ones from the other does not work at all as ME/MC
47  * sometimes has nothing in the previous frames which matches the
48  * current. The current algorithm has been found by trial and error
49  * and almost certainly can be improved...
50  */
51 
52 #include "libavutil/opt.h"
53 #include "libavcodec/avcodec.h"
54 #include "libavutil/pixdesc.h"
55 #include "avfilter.h"
56 #include "filters.h"
57 #include "video.h"
58 
60  MODE_FAST = 0,
65 };
66 
68  PARITY_TFF = 0, ///< top field first
69  PARITY_BFF = 1, ///< bottom field first
70 };
71 
72 typedef struct MCDeintContext {
73  const AVClass *class;
74  int mode; ///< MCDeintMode
75  int parity; ///< MCDeintParity
76  int qp;
81 
82 #define OFFSET(x) offsetof(MCDeintContext, x)
83 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
84 #define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, .unit = u }
85 
86 static const AVOption mcdeint_options[] = {
87  { "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_FAST}, 0, MODE_NB-1, FLAGS, .unit="mode" },
88  CONST("fast", NULL, MODE_FAST, "mode"),
89  CONST("medium", NULL, MODE_MEDIUM, "mode"),
90  CONST("slow", NULL, MODE_SLOW, "mode"),
91  CONST("extra_slow", NULL, MODE_EXTRA_SLOW, "mode"),
92 
93  { "parity", "set the assumed picture field parity", OFFSET(parity), AV_OPT_TYPE_INT, {.i64=PARITY_BFF}, -1, 1, FLAGS, .unit = "parity" },
94  CONST("tff", "assume top field first", PARITY_TFF, "parity"),
95  CONST("bff", "assume bottom field first", PARITY_BFF, "parity"),
96 
97  { "qp", "set qp", OFFSET(qp), AV_OPT_TYPE_INT, {.i64=1}, INT_MIN, INT_MAX, FLAGS },
98  { NULL }
99 };
100 
101 AVFILTER_DEFINE_CLASS(mcdeint);
102 
104 {
105  AVFilterContext *ctx = inlink->dst;
106  MCDeintContext *mcdeint = ctx->priv;
107  const AVCodec *enc;
108  AVCodecContext *enc_ctx;
110  int ret;
111 
112  if (!(enc = avcodec_find_encoder(AV_CODEC_ID_SNOW))) {
113  av_log(ctx, AV_LOG_ERROR, "Snow encoder is not enabled in libavcodec\n");
114  return AVERROR(EINVAL);
115  }
116 
117  mcdeint->pkt = av_packet_alloc();
118  if (!mcdeint->pkt)
119  return AVERROR(ENOMEM);
120  mcdeint->frame_dec = av_frame_alloc();
121  if (!mcdeint->frame_dec)
122  return AVERROR(ENOMEM);
123  mcdeint->enc_ctx = avcodec_alloc_context3(enc);
124  if (!mcdeint->enc_ctx)
125  return AVERROR(ENOMEM);
126  enc_ctx = mcdeint->enc_ctx;
127  enc_ctx->width = inlink->w;
128  enc_ctx->height = inlink->h;
129  enc_ctx->time_base = (AVRational){1,25}; // meaningless
130  enc_ctx->gop_size = INT_MAX;
131  enc_ctx->max_b_frames = 0;
132  enc_ctx->pix_fmt = inlink->format;
135  enc_ctx->global_quality = 1;
136  enc_ctx->me_cmp = enc_ctx->me_sub_cmp = FF_CMP_SAD;
137  enc_ctx->mb_cmp = FF_CMP_SSE;
138  av_dict_set(&opts, "memc_only", "1", 0);
139  av_dict_set(&opts, "no_bitstream", "1", 0);
140 
141  switch (mcdeint->mode) {
142  case MODE_EXTRA_SLOW:
143  enc_ctx->refs = 3;
144  case MODE_SLOW:
145  av_dict_set(&opts, "motion_est", "iter", 0);
146  case MODE_MEDIUM:
147  enc_ctx->flags |= AV_CODEC_FLAG_4MV;
148  enc_ctx->dia_size = 2;
149  case MODE_FAST:
150  enc_ctx->flags |= AV_CODEC_FLAG_QPEL;
151  }
152 
153  ret = avcodec_open2(enc_ctx, enc, &opts);
154  av_dict_free(&opts);
155  if (ret < 0)
156  return ret;
157 
158  return 0;
159 }
160 
162 {
163  MCDeintContext *mcdeint = ctx->priv;
164 
165  av_packet_free(&mcdeint->pkt);
166  avcodec_free_context(&mcdeint->enc_ctx);
167  av_frame_free(&mcdeint->frame_dec);
168 }
169 
171 {
172  MCDeintContext *mcdeint = inlink->dst->priv;
173  AVFilterLink *outlink = inlink->dst->outputs[0];
174  AVFrame *outpic, *frame_dec = mcdeint->frame_dec;
175  AVPacket *pkt = mcdeint->pkt;
176  const AVPixFmtDescriptor *pix_fmt_desc = av_pix_fmt_desc_get(inlink->format);
177  int x, y, i, ret;
178 
179  outpic = ff_get_video_buffer(outlink, outlink->w, outlink->h);
180  if (!outpic) {
182  return AVERROR(ENOMEM);
183  }
184  av_frame_copy_props(outpic, inpic);
185  inpic->quality = mcdeint->qp * FF_QP2LAMBDA;
186 
187  ret = avcodec_send_frame(mcdeint->enc_ctx, inpic);
188  if (ret < 0) {
189  av_log(mcdeint->enc_ctx, AV_LOG_ERROR, "Error sending a frame for encoding\n");
190  goto end;
191  }
192  ret = avcodec_receive_packet(mcdeint->enc_ctx, pkt);
193  if (ret < 0) {
194  av_log(mcdeint->enc_ctx, AV_LOG_ERROR, "Error receiving a packet from encoding\n");
195  goto end;
196  }
198  ret = avcodec_receive_frame(mcdeint->enc_ctx, frame_dec);
199  if (ret < 0) {
200  av_log(mcdeint->enc_ctx, AV_LOG_ERROR, "Error receiving a frame from encoding\n");
201  goto end;
202  }
203 
204  for (i = 0; i < 3; i++) {
205  int is_chroma = !!i;
206  int w, h;
207  if (is_chroma) {
208  w = AV_CEIL_RSHIFT(inlink->w, pix_fmt_desc->log2_chroma_w);
209  h = AV_CEIL_RSHIFT(inlink->h, pix_fmt_desc->log2_chroma_h);
210  } else {
211  w = inlink->w;
212  h = inlink->h;
213  }
214  int fils = frame_dec->linesize[i];
215  int srcs = inpic ->linesize[i];
216  int dsts = outpic ->linesize[i];
217 
218  for (y = 0; y < h; y++) {
219  if ((y ^ mcdeint->parity) & 1) {
220  for (x = 0; x < w; x++) {
221  uint8_t *filp = &frame_dec->data[i][x + y*fils];
222  uint8_t *srcp = &inpic ->data[i][x + y*srcs];
223  uint8_t *dstp = &outpic ->data[i][x + y*dsts];
224 
225  if (y > 0 && y < h-1){
226  int is_edge = x < 3 || x > w-4;
227  int diff0 = filp[-fils] - srcp[-srcs];
228  int diff1 = filp[+fils] - srcp[+srcs];
229  int temp = filp[0];
230 
231 #define DELTA(j) av_clip(j, -x, w-1-x)
232 
233 #define GET_SCORE_EDGE(j)\
234  FFABS(srcp[-srcs+DELTA(-1+(j))] - srcp[+srcs+DELTA(-1-(j))])+\
235  FFABS(srcp[-srcs+DELTA(j) ] - srcp[+srcs+DELTA( -(j))])+\
236  FFABS(srcp[-srcs+DELTA(1+(j)) ] - srcp[+srcs+DELTA( 1-(j))])
237 
238 #define GET_SCORE(j)\
239  FFABS(srcp[-srcs-1+(j)] - srcp[+srcs-1-(j)])+\
240  FFABS(srcp[-srcs +(j)] - srcp[+srcs -(j)])+\
241  FFABS(srcp[-srcs+1+(j)] - srcp[+srcs+1-(j)])
242 
243 #define CHECK_EDGE(j)\
244  { int score = GET_SCORE_EDGE(j);\
245  if (score < spatial_score){\
246  spatial_score = score;\
247  diff0 = filp[-fils+DELTA(j)] - srcp[-srcs+DELTA(j)];\
248  diff1 = filp[+fils+DELTA(-(j))] - srcp[+srcs+DELTA(-(j))];\
249 
250 #define CHECK(j)\
251  { int score = GET_SCORE(j);\
252  if (score < spatial_score){\
253  spatial_score= score;\
254  diff0 = filp[-fils+(j)] - srcp[-srcs+(j)];\
255  diff1 = filp[+fils-(j)] - srcp[+srcs-(j)];\
256 
257  if (is_edge) {
258  int spatial_score = GET_SCORE_EDGE(0) - 1;
259  CHECK_EDGE(-1) CHECK_EDGE(-2) }} }}
260  CHECK_EDGE( 1) CHECK_EDGE( 2) }} }}
261  } else {
262  int spatial_score = GET_SCORE(0) - 1;
263  CHECK(-1) CHECK(-2) }} }}
264  CHECK( 1) CHECK( 2) }} }}
265  }
266 
267 
268  if (diff0 + diff1 > 0)
269  temp -= (diff0 + diff1 - FFABS(FFABS(diff0) - FFABS(diff1)) / 2) / 2;
270  else
271  temp -= (diff0 + diff1 + FFABS(FFABS(diff0) - FFABS(diff1)) / 2) / 2;
272  *filp = *dstp = temp > 255U ? ~(temp>>31) : temp;
273  } else {
274  *dstp = *filp;
275  }
276  }
277  }
278  }
279 
280  for (y = 0; y < h; y++) {
281  if (!((y ^ mcdeint->parity) & 1)) {
282  for (x = 0; x < w; x++) {
283  frame_dec->data[i][x + y*fils] =
284  outpic ->data[i][x + y*dsts] = inpic->data[i][x + y*srcs];
285  }
286  }
287  }
288  }
289  mcdeint->parity ^= 1;
290 
291 end:
294  if (ret < 0) {
295  av_frame_free(&outpic);
296  return ret;
297  }
298  return ff_filter_frame(outlink, outpic);
299 }
300 
301 static const AVFilterPad mcdeint_inputs[] = {
302  {
303  .name = "default",
304  .type = AVMEDIA_TYPE_VIDEO,
305  .filter_frame = filter_frame,
306  .config_props = config_props,
307  },
308 };
309 
311  .p.name = "mcdeint",
312  .p.description = NULL_IF_CONFIG_SMALL("Apply motion compensating deinterlacing."),
313  .p.priv_class = &mcdeint_class,
314  .priv_size = sizeof(MCDeintContext),
315  .uninit = uninit,
319 };
ff_get_video_buffer
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:116
av_packet_unref
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition: packet.c:430
MCDeintContext::parity
int parity
MCDeintParity.
Definition: vf_mcdeint.c:75
AVCodec
AVCodec.
Definition: codec.h:172
avcodec_receive_packet
int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
Read encoded data from the encoder.
Definition: encode.c:526
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
MCDeintContext::pkt
AVPacket * pkt
Definition: vf_mcdeint.c:77
MODE_SLOW
@ MODE_SLOW
Definition: vf_mcdeint.c:62
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:3341
MODE_NB
@ MODE_NB
Definition: vf_mcdeint.c:64
MODE_MEDIUM
@ MODE_MEDIUM
Definition: vf_mcdeint.c:61
AV_CODEC_FLAG_QSCALE
#define AV_CODEC_FLAG_QSCALE
Use fixed qscale.
Definition: avcodec.h:213
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
MODE_FAST
@ MODE_FAST
Definition: vf_mcdeint.c:60
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:63
avcodec_find_encoder
const AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
Definition: allcodecs.c:1015
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
mode
Definition: swscale.c:56
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:410
pixdesc.h
w
uint8_t w
Definition: llviddspenc.c:38
AVOption
AVOption.
Definition: opt.h:429
FF_COMPLIANCE_EXPERIMENTAL
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
Definition: defs.h:62
AVDictionary
Definition: dict.c:32
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:215
video.h
PARITY_BFF
@ PARITY_BFF
bottom field first
Definition: vf_mcdeint.c:69
AV_CODEC_FLAG_4MV
#define AV_CODEC_FLAG_4MV
4 MV per MB allowed / advanced prediction for H.263.
Definition: avcodec.h:217
AVCodecContext::mb_cmp
int mb_cmp
macroblock comparison function (not supported yet)
Definition: avcodec.h:862
av_packet_free
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
Definition: packet.c:75
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:431
ff_filter_frame
return ff_filter_frame(outlink, outpic)
ff_vf_mcdeint
const FFFilter ff_vf_mcdeint
Definition: vf_mcdeint.c:310
CHECK_EDGE
#define CHECK_EDGE(j)
AVCodecContext::refs
int refs
number of reference frames
Definition: avcodec.h:689
AVCodecContext::flags
int flags
AV_CODEC_FLAG_*.
Definition: avcodec.h:488
AV_CODEC_FLAG_LOW_DELAY
#define AV_CODEC_FLAG_LOW_DELAY
Force low delay.
Definition: avcodec.h:314
FF_CMP_SSE
#define FF_CMP_SSE
Definition: avcodec.h:870
mcdeint_options
static const AVOption mcdeint_options[]
Definition: vf_mcdeint.c:86
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
av_frame_alloc
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:51
pkt
AVPacket * pkt
Definition: movenc.c:60
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
av_cold
#define av_cold
Definition: attributes.h:90
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
FFFilter
Definition: filters.h:265
else
else
Definition: vf_mcdeint.c:261
avcodec_alloc_context3
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
Definition: options.c:149
AVCodecContext::global_quality
int global_quality
Global quality for codecs which cannot change it per frame.
Definition: avcodec.h:1217
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:60
MCDeintParity
MCDeintParity
Definition: vf_mcdeint.c:67
avcodec_receive_frame
int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used...
Definition: avcodec.c:702
filters.h
ctx
AVFormatContext * ctx
Definition: movenc.c:49
AVPixFmtDescriptor::log2_chroma_w
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition: pixdesc.h:80
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:74
filp
* filp
Definition: vf_mcdeint.c:272
opts
AVDictionary * opts
Definition: movenc.c:51
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:597
inpic
av_frame_free & inpic
Definition: vf_mcdeint.c:293
CHECK
#define CHECK(j)
MCDeintContext
Definition: vf_mcdeint.c:72
avcodec_free_context
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Definition: options.c:164
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
avcodec_open2
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
Definition: avcodec.c:143
AVCodecContext::me_cmp
int me_cmp
motion estimation comparison function
Definition: avcodec.h:850
MODE_EXTRA_SLOW
@ MODE_EXTRA_SLOW
Definition: vf_mcdeint.c:63
AVCodecContext::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Definition: avcodec.h:535
AV_CODEC_FLAG_QPEL
#define AV_CODEC_FLAG_QPEL
Use qpel MC.
Definition: avcodec.h:225
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVCodecContext::gop_size
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
Definition: avcodec.h:1005
MCDeintMode
MCDeintMode
Definition: vf_mcdeint.c:59
parity
mcdeint parity
Definition: vf_mcdeint.c:289
MCDeintContext::enc_ctx
AVCodecContext * enc_ctx
Definition: vf_mcdeint.c:79
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(mcdeint)
PARITY_TFF
@ PARITY_TFF
top field first
Definition: vf_mcdeint.c:68
AVCodecContext::me_sub_cmp
int me_sub_cmp
subpixel motion estimation comparison function
Definition: avcodec.h:856
GET_SCORE_EDGE
#define GET_SCORE_EDGE(j)
av_packet_alloc
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
Definition: packet.c:64
av_dict_free
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
Definition: dict.c:233
config_props
static int config_props(AVFilterLink *inlink)
Definition: vf_mcdeint.c:103
FF_CMP_SAD
#define FF_CMP_SAD
Definition: avcodec.h:869
OFFSET
#define OFFSET(x)
Definition: vf_mcdeint.c:82
AV_CODEC_FLAG_RECON_FRAME
#define AV_CODEC_FLAG_RECON_FRAME
Request the encoder to output reconstructed frames, i.e. frames that would be produced by decoding th...
Definition: avcodec.h:244
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
MCDeintContext::frame_dec
AVFrame * frame_dec
Definition: vf_mcdeint.c:78
AVCodecContext::dia_size
int dia_size
ME diamond size & shape.
Definition: avcodec.h:892
MCDeintContext::mode
int mode
MCDeintMode.
Definition: vf_mcdeint.c:74
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
FILTER_PIXFMTS
#define FILTER_PIXFMTS(...)
Definition: filters.h:248
AVCodecContext::height
int height
Definition: avcodec.h:592
avcodec_send_frame
int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame)
Supply a raw video or audio frame to the encoder.
Definition: encode.c:493
AVCodecContext::pix_fmt
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:631
GET_SCORE
#define GET_SCORE(j)
MCDeintContext::qp
int qp
Definition: vf_mcdeint.c:76
avcodec.h
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
Definition: vf_mcdeint.c:170
FLAGS
#define FLAGS
Definition: vf_mcdeint.c:83
if
if(ret< 0)
Definition: vf_mcdeint.c:294
ret
ret
Definition: filter_design.txt:187
AVCodecContext::strict_std_compliance
int strict_std_compliance
strictly follow the standard (MPEG-4, ...).
Definition: avcodec.h:1357
mcdeint_inputs
static const AVFilterPad mcdeint_inputs[]
Definition: vf_mcdeint.c:301
U
#define U(x)
Definition: vpx_arith.h:37
AVCodecContext
main external API structure.
Definition: avcodec.h:431
AV_CODEC_ID_SNOW
@ AV_CODEC_ID_SNOW
Definition: codec_id.h:267
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
avfilter.h
CONST
#define CONST(name, help, val, u)
Definition: vf_mcdeint.c:84
temp
else temp
Definition: vf_mcdeint.c:271
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVFilterContext
An instance of a filter.
Definition: avfilter.h:269
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_mcdeint.c:161
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
FFFilter::p
AVFilter p
The public AVFilter.
Definition: filters.h:269
AVCodecContext::max_b_frames
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
Definition: avcodec.h:769
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
AVPacket
This structure stores compressed data.
Definition: packet.h:512
av_dict_set
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:86
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:592
AVFrame::linesize
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:455
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
h
h
Definition: vp9dsp_template.c:2070
FF_QP2LAMBDA
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
Definition: avutil.h:226
AVPixFmtDescriptor::log2_chroma_h
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition: pixdesc.h:89