FFmpeg  4.3.6
vf_mestimate.c
Go to the documentation of this file.
1 /**
2  * Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<@gmail.com>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (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 GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "motion_estimation.h"
22 #include "libavcodec/mathops.h"
23 #include "libavutil/avassert.h"
24 #include "libavutil/common.h"
25 #include "libavutil/imgutils.h"
26 #include "libavutil/opt.h"
27 #include "libavutil/pixdesc.h"
29 #include "avfilter.h"
30 #include "formats.h"
31 #include "internal.h"
32 #include "video.h"
33 
34 typedef struct MEContext {
35  const AVClass *class;
37  int method; ///< motion estimation method
38 
39  int mb_size; ///< macroblock size
40  int search_param; ///< search parameter
43 
45 
46  int (*mv_table[3])[2][2]; ///< motion vectors of current & prev 2 frames
47 } MEContext;
48 
49 #define OFFSET(x) offsetof(MEContext, x)
50 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
51 #define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, unit }
52 
53 static const AVOption mestimate_options[] = {
54  { "method", "motion estimation method", OFFSET(method), AV_OPT_TYPE_INT, {.i64 = AV_ME_METHOD_ESA}, AV_ME_METHOD_ESA, AV_ME_METHOD_UMH, FLAGS, "method" },
55  CONST("esa", "exhaustive search", AV_ME_METHOD_ESA, "method"),
56  CONST("tss", "three step search", AV_ME_METHOD_TSS, "method"),
57  CONST("tdls", "two dimensional logarithmic search", AV_ME_METHOD_TDLS, "method"),
58  CONST("ntss", "new three step search", AV_ME_METHOD_NTSS, "method"),
59  CONST("fss", "four step search", AV_ME_METHOD_FSS, "method"),
60  CONST("ds", "diamond search", AV_ME_METHOD_DS, "method"),
61  CONST("hexbs", "hexagon-based search", AV_ME_METHOD_HEXBS, "method"),
62  CONST("epzs", "enhanced predictive zonal search", AV_ME_METHOD_EPZS, "method"),
63  CONST("umh", "uneven multi-hexagon search", AV_ME_METHOD_UMH, "method"),
64  { "mb_size", "macroblock size", OFFSET(mb_size), AV_OPT_TYPE_INT, {.i64 = 16}, 8, INT_MAX, FLAGS },
65  { "search_param", "search parameter", OFFSET(search_param), AV_OPT_TYPE_INT, {.i64 = 7}, 4, INT_MAX, FLAGS },
66  { NULL }
67 };
68 
69 AVFILTER_DEFINE_CLASS(mestimate);
70 
72 {
73  static const enum AVPixelFormat pix_fmts[] = {
83  };
84 
85  AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
86  if (!fmts_list)
87  return AVERROR(ENOMEM);
88  return ff_set_common_formats(ctx, fmts_list);
89 }
90 
91 static int config_input(AVFilterLink *inlink)
92 {
93  MEContext *s = inlink->dst->priv;
94  int i;
95 
97  s->mb_size = 1 << s->log2_mb_size;
98 
99  s->b_width = inlink->w >> s->log2_mb_size;
100  s->b_height = inlink->h >> s->log2_mb_size;
101  s->b_count = s->b_width * s->b_height;
102 
103  if (s->b_count == 0)
104  return AVERROR(EINVAL);
105 
106  for (i = 0; i < 3; i++) {
107  s->mv_table[i] = av_mallocz_array(s->b_count, sizeof(*s->mv_table[0]));
108  if (!s->mv_table[i])
109  return AVERROR(ENOMEM);
110  }
111 
112  ff_me_init_context(&s->me_ctx, s->mb_size, s->search_param, inlink->w, inlink->h, 0, (s->b_width - 1) << s->log2_mb_size, 0, (s->b_height - 1) << s->log2_mb_size);
113 
114  return 0;
115 }
116 
118  int x, int y, int x_mv, int y_mv, int dir)
119 {
120  mv->w = mb_size;
121  mv->h = mb_size;
122  mv->dst_x = x + (mb_size >> 1);
123  mv->dst_y = y + (mb_size >> 1);
124  mv->src_x = x_mv + (mb_size >> 1);
125  mv->src_y = y_mv + (mb_size >> 1);
126  mv->source = dir ? 1 : -1;
127  mv->flags = 0;
128 }
129 
130 #define SEARCH_MV(method)\
131  do {\
132  for (mb_y = 0; mb_y < s->b_height; mb_y++)\
133  for (mb_x = 0; mb_x < s->b_width; mb_x++) {\
134  const int x_mb = mb_x << s->log2_mb_size;\
135  const int y_mb = mb_y << s->log2_mb_size;\
136  int mv[2] = {x_mb, y_mb};\
137  ff_me_search_##method(me_ctx, x_mb, y_mb, mv);\
138  add_mv_data(((AVMotionVector *) sd->data) + mv_count++, me_ctx->mb_size, x_mb, y_mb, mv[0], mv[1], dir);\
139  }\
140  } while (0)
141 
142 #define ADD_PRED(preds, px, py)\
143  do {\
144  preds.mvs[preds.nb][0] = px;\
145  preds.mvs[preds.nb][1] = py;\
146  preds.nb++;\
147  } while(0)
148 
149 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
150 {
151  AVFilterContext *ctx = inlink->dst;
152  MEContext *s = ctx->priv;
154  AVFrameSideData *sd;
155  AVFrame *out;
156  int mb_x, mb_y, dir;
157  int32_t mv_count = 0;
158  int ret;
159 
160  if (frame->pts == AV_NOPTS_VALUE) {
161  ret = ff_filter_frame(ctx->outputs[0], frame);
162  return ret;
163  }
164 
165  av_frame_free(&s->prev);
166  s->prev = s->cur;
167  s->cur = s->next;
168  s->next = frame;
169 
170  s->mv_table[2] = memcpy(s->mv_table[2], s->mv_table[1], sizeof(*s->mv_table[1]) * s->b_count);
171  s->mv_table[1] = memcpy(s->mv_table[1], s->mv_table[0], sizeof(*s->mv_table[0]) * s->b_count);
172 
173  if (!s->cur) {
174  s->cur = av_frame_clone(frame);
175  if (!s->cur)
176  return AVERROR(ENOMEM);
177  }
178 
179  if (!s->prev)
180  return 0;
181 
182  out = av_frame_clone(s->cur);
183  if (!out)
184  return AVERROR(ENOMEM);
185 
187  if (!sd) {
188  av_frame_free(&out);
189  return AVERROR(ENOMEM);
190  }
191 
192  me_ctx->data_cur = s->cur->data[0];
193  me_ctx->linesize = s->cur->linesize[0];
194 
195  for (dir = 0; dir < 2; dir++) {
196  me_ctx->data_ref = (dir ? s->next : s->prev)->data[0];
197 
198  if (s->method == AV_ME_METHOD_DS)
199  SEARCH_MV(ds);
200  else if (s->method == AV_ME_METHOD_ESA)
201  SEARCH_MV(esa);
202  else if (s->method == AV_ME_METHOD_FSS)
203  SEARCH_MV(fss);
204  else if (s->method == AV_ME_METHOD_NTSS)
205  SEARCH_MV(ntss);
206  else if (s->method == AV_ME_METHOD_TDLS)
207  SEARCH_MV(tdls);
208  else if (s->method == AV_ME_METHOD_TSS)
209  SEARCH_MV(tss);
210  else if (s->method == AV_ME_METHOD_HEXBS)
211  SEARCH_MV(hexbs);
212  else if (s->method == AV_ME_METHOD_UMH) {
213  for (mb_y = 0; mb_y < s->b_height; mb_y++)
214  for (mb_x = 0; mb_x < s->b_width; mb_x++) {
215  const int mb_i = mb_x + mb_y * s->b_width;
216  const int x_mb = mb_x << s->log2_mb_size;
217  const int y_mb = mb_y << s->log2_mb_size;
218  int mv[2] = {x_mb, y_mb};
219 
220  AVMotionEstPredictor *preds = me_ctx->preds;
221  preds[0].nb = 0;
222 
223  ADD_PRED(preds[0], 0, 0);
224 
225  //left mb in current frame
226  if (mb_x > 0)
227  ADD_PRED(preds[0], s->mv_table[0][mb_i - 1][dir][0], s->mv_table[0][mb_i - 1][dir][1]);
228 
229  if (mb_y > 0) {
230  //top mb in current frame
231  ADD_PRED(preds[0], s->mv_table[0][mb_i - s->b_width][dir][0], s->mv_table[0][mb_i - s->b_width][dir][1]);
232 
233  //top-right mb in current frame
234  if (mb_x + 1 < s->b_width)
235  ADD_PRED(preds[0], s->mv_table[0][mb_i - s->b_width + 1][dir][0], s->mv_table[0][mb_i - s->b_width + 1][dir][1]);
236  //top-left mb in current frame
237  else if (mb_x > 0)
238  ADD_PRED(preds[0], s->mv_table[0][mb_i - s->b_width - 1][dir][0], s->mv_table[0][mb_i - s->b_width - 1][dir][1]);
239  }
240 
241  //median predictor
242  if (preds[0].nb == 4) {
243  me_ctx->pred_x = mid_pred(preds[0].mvs[1][0], preds[0].mvs[2][0], preds[0].mvs[3][0]);
244  me_ctx->pred_y = mid_pred(preds[0].mvs[1][1], preds[0].mvs[2][1], preds[0].mvs[3][1]);
245  } else if (preds[0].nb == 3) {
246  me_ctx->pred_x = mid_pred(0, preds[0].mvs[1][0], preds[0].mvs[2][0]);
247  me_ctx->pred_y = mid_pred(0, preds[0].mvs[1][1], preds[0].mvs[2][1]);
248  } else if (preds[0].nb == 2) {
249  me_ctx->pred_x = preds[0].mvs[1][0];
250  me_ctx->pred_y = preds[0].mvs[1][1];
251  } else {
252  me_ctx->pred_x = 0;
253  me_ctx->pred_y = 0;
254  }
255 
256  ff_me_search_umh(me_ctx, x_mb, y_mb, mv);
257 
258  s->mv_table[0][mb_i][dir][0] = mv[0] - x_mb;
259  s->mv_table[0][mb_i][dir][1] = mv[1] - y_mb;
260  add_mv_data(((AVMotionVector *) sd->data) + mv_count++, me_ctx->mb_size, x_mb, y_mb, mv[0], mv[1], dir);
261  }
262 
263  } else if (s->method == AV_ME_METHOD_EPZS) {
264 
265  for (mb_y = 0; mb_y < s->b_height; mb_y++)
266  for (mb_x = 0; mb_x < s->b_width; mb_x++) {
267  const int mb_i = mb_x + mb_y * s->b_width;
268  const int x_mb = mb_x << s->log2_mb_size;
269  const int y_mb = mb_y << s->log2_mb_size;
270  int mv[2] = {x_mb, y_mb};
271 
272  AVMotionEstPredictor *preds = me_ctx->preds;
273  preds[0].nb = 0;
274  preds[1].nb = 0;
275 
276  ADD_PRED(preds[0], 0, 0);
277 
278  //left mb in current frame
279  if (mb_x > 0)
280  ADD_PRED(preds[0], s->mv_table[0][mb_i - 1][dir][0], s->mv_table[0][mb_i - 1][dir][1]);
281 
282  //top mb in current frame
283  if (mb_y > 0)
284  ADD_PRED(preds[0], s->mv_table[0][mb_i - s->b_width][dir][0], s->mv_table[0][mb_i - s->b_width][dir][1]);
285 
286  //top-right mb in current frame
287  if (mb_y > 0 && mb_x + 1 < s->b_width)
288  ADD_PRED(preds[0], s->mv_table[0][mb_i - s->b_width + 1][dir][0], s->mv_table[0][mb_i - s->b_width + 1][dir][1]);
289 
290  //median predictor
291  if (preds[0].nb == 4) {
292  me_ctx->pred_x = mid_pred(preds[0].mvs[1][0], preds[0].mvs[2][0], preds[0].mvs[3][0]);
293  me_ctx->pred_y = mid_pred(preds[0].mvs[1][1], preds[0].mvs[2][1], preds[0].mvs[3][1]);
294  } else if (preds[0].nb == 3) {
295  me_ctx->pred_x = mid_pred(0, preds[0].mvs[1][0], preds[0].mvs[2][0]);
296  me_ctx->pred_y = mid_pred(0, preds[0].mvs[1][1], preds[0].mvs[2][1]);
297  } else if (preds[0].nb == 2) {
298  me_ctx->pred_x = preds[0].mvs[1][0];
299  me_ctx->pred_y = preds[0].mvs[1][1];
300  } else {
301  me_ctx->pred_x = 0;
302  me_ctx->pred_y = 0;
303  }
304 
305  //collocated mb in prev frame
306  ADD_PRED(preds[0], s->mv_table[1][mb_i][dir][0], s->mv_table[1][mb_i][dir][1]);
307 
308  //accelerator motion vector of collocated block in prev frame
309  ADD_PRED(preds[1], s->mv_table[1][mb_i][dir][0] + (s->mv_table[1][mb_i][dir][0] - s->mv_table[2][mb_i][dir][0]),
310  s->mv_table[1][mb_i][dir][1] + (s->mv_table[1][mb_i][dir][1] - s->mv_table[2][mb_i][dir][1]));
311 
312  //left mb in prev frame
313  if (mb_x > 0)
314  ADD_PRED(preds[1], s->mv_table[1][mb_i - 1][dir][0], s->mv_table[1][mb_i - 1][dir][1]);
315 
316  //top mb in prev frame
317  if (mb_y > 0)
318  ADD_PRED(preds[1], s->mv_table[1][mb_i - s->b_width][dir][0], s->mv_table[1][mb_i - s->b_width][dir][1]);
319 
320  //right mb in prev frame
321  if (mb_x + 1 < s->b_width)
322  ADD_PRED(preds[1], s->mv_table[1][mb_i + 1][dir][0], s->mv_table[1][mb_i + 1][dir][1]);
323 
324  //bottom mb in prev frame
325  if (mb_y + 1 < s->b_height)
326  ADD_PRED(preds[1], s->mv_table[1][mb_i + s->b_width][dir][0], s->mv_table[1][mb_i + s->b_width][dir][1]);
327 
328  ff_me_search_epzs(me_ctx, x_mb, y_mb, mv);
329 
330  s->mv_table[0][mb_i][dir][0] = mv[0] - x_mb;
331  s->mv_table[0][mb_i][dir][1] = mv[1] - y_mb;
332  add_mv_data(((AVMotionVector *) sd->data) + mv_count++, s->mb_size, x_mb, y_mb, mv[0], mv[1], dir);
333  }
334  }
335  }
336 
337  return ff_filter_frame(ctx->outputs[0], out);
338 }
339 
341 {
342  MEContext *s = ctx->priv;
343  int i;
344 
345  av_frame_free(&s->prev);
346  av_frame_free(&s->cur);
347  av_frame_free(&s->next);
348 
349  for (i = 0; i < 3; i++)
350  av_freep(&s->mv_table[i]);
351 }
352 
353 static const AVFilterPad mestimate_inputs[] = {
354  {
355  .name = "default",
356  .type = AVMEDIA_TYPE_VIDEO,
357  .filter_frame = filter_frame,
358  .config_props = config_input,
359  },
360  { NULL }
361 };
362 
363 static const AVFilterPad mestimate_outputs[] = {
364  {
365  .name = "default",
366  .type = AVMEDIA_TYPE_VIDEO,
367  },
368  { NULL }
369 };
370 
372  .name = "mestimate",
373  .description = NULL_IF_CONFIG_SMALL("Generate motion vectors."),
374  .priv_size = sizeof(MEContext),
375  .priv_class = &mestimate_class,
376  .uninit = uninit,
378  .inputs = mestimate_inputs,
379  .outputs = mestimate_outputs,
380 };
#define NULL
Definition: coverity.c:32
This structure describes decoded (raw) audio or video data.
Definition: frame.h:300
AVFrame * cur
Definition: vf_mestimate.c:44
AVOption.
Definition: opt.h:246
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
misc image utilities
int16_t src_x
Absolute source position.
Definition: motion_vector.h:38
Main libavfilter public API header.
int pred_y
median predictor y
static int config_input(AVFilterLink *inlink)
Definition: vf_mestimate.c:91
#define AV_ME_METHOD_TDLS
Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<.com>
Definition: vf_mestimate.c:34
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:300
AVMotionEstPredictor preds[2]
const char * name
Pad name.
Definition: internal.h:60
static void add_mv_data(AVMotionVector *mv, int mb_size, int x, int y, int x_mv, int y_mv, int dir)
Definition: vf_mestimate.c:117
#define AV_ME_METHOD_DS
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1075
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
#define AV_ME_METHOD_NTSS
#define av_cold
Definition: attributes.h:88
AVOptions.
int pred_x
median predictor x
int16_t dst_x
Absolute destination position.
Definition: motion_vector.h:42
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:393
#define AV_ME_METHOD_EPZS
uint64_t ff_me_search_umh(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
static AVFrame * frame
const char data[16]
Definition: mxf.c:91
Structure to hold side data for an AVFrame.
Definition: frame.h:206
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
Definition: pixfmt.h:100
int32_t source
Where the current macroblock comes from; negative value when it comes from the past, positive value when it comes from the future.
Definition: motion_vector.h:30
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AVFILTER_DEFINE_CLASS(mestimate)
#define CONST(name, help, val, unit)
Definition: vf_mestimate.c:51
#define AV_ME_METHOD_HEXBS
A filter pad used for either input or output.
Definition: internal.h:54
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:176
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
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:605
int mb_size
macroblock size
Definition: vf_mestimate.c:39
#define AVERROR(e)
Definition: error.h:43
#define SEARCH_MV(method)
Definition: vf_mestimate.c:130
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:203
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:188
uint8_t w
Width and height of the block.
Definition: motion_vector.h:34
void * priv
private data for use by the filter
Definition: avfilter.h:353
uint64_t ff_me_search_epzs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
simple assert() macros that are a bit more flexible than ISO C assert().
#define OFFSET(x)
Definition: vf_mestimate.c:49
int search_param
search parameter
Definition: vf_mestimate.c:40
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
static const AVFilterPad mestimate_inputs[]
Definition: vf_mestimate.c:353
AVFrame * prev
Definition: vf_mestimate.c:44
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
int32_t
AVFormatContext * ctx
Definition: movenc.c:48
Motion vectors exported by some codecs (on demand through the export_mvs flag set in the libavcodec A...
Definition: frame.h:96
int(*[3] mv_table)[2][2]
motion vectors of current & prev 2 frames
Definition: vf_mestimate.c:46
#define s(width, name)
Definition: cbs_vp9.c:257
#define AV_ME_METHOD_UMH
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
#define AV_ME_METHOD_TSS
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition: frame.c:541
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const int8_t mv[256][2]
Definition: 4xm.c:77
#define ADD_PRED(preds, px, py)
Definition: vf_mestimate.c:142
void ff_me_init_context(AVMotionEstContext *me_ctx, int mb_size, int search_param, int width, int height, int x_min, int x_max, int y_min, int y_max)
int method
motion estimation method
Definition: vf_mestimate.c:37
static const AVOption mestimate_options[]
Definition: vf_mestimate.c:53
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:331
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_mestimate.c:340
uint8_t * data
Definition: frame.h:208
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
Describe the class of an AVClass context structure.
Definition: log.h:67
AVFrame * next
Definition: vf_mestimate.c:44
Filter definition.
Definition: avfilter.h:144
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, int size)
Add a new side data to a frame.
Definition: frame.c:727
#define mid_pred
Definition: mathops.h:97
const char * name
Filter name.
Definition: avfilter.h:148
#define AV_ME_METHOD_FSS
int b_height
Definition: vf_mestimate.c:41
#define FLAGS
Definition: vf_mestimate.c:50
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:350
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:314
int
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74
uint64_t flags
Extra flag information.
Definition: motion_vector.h:47
common internal and external API header
AVMotionEstContext me_ctx
Definition: vf_mestimate.c:36
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
#define AV_ME_METHOD_ESA
Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<.com>
AVFilter ff_vf_mestimate
Definition: vf_mestimate.c:371
static int query_formats(AVFilterContext *ctx)
Definition: vf_mestimate.c:71
A list of supported formats for one end of a filter link.
Definition: formats.h:64
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:258
An instance of a filter.
Definition: avfilter.h:338
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_mestimate.c:149
FILE * out
Definition: movenc.c:54
int log2_mb_size
Definition: vf_mestimate.c:42
#define av_freep(p)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
static const AVFilterPad mestimate_outputs[]
Definition: vf_mestimate.c:363
static av_always_inline av_const int av_ceil_log2_c(int x)
Compute ceil(log2(x)).
Definition: common.h:372
internal API functions
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
Definition: mem.c:190