FFmpeg
Loading...
Searching...
No Matches
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/common.h"
24#include "libavutil/mem.h"
25#include "libavutil/opt.h"
27#include "avfilter.h"
28#include "filters.h"
29
30typedef struct MEContext {
31 const AVClass *class;
33 int method; ///< motion estimation method
34
35 int mb_size; ///< macroblock size
36 int search_param; ///< search parameter
39
41
42 int (*mv_table[3])[2][2]; ///< motion vectors of current & prev 2 frames
43} MEContext;
44
45#define OFFSET(x) offsetof(MEContext, x)
46#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
47#define CONST(name, help, val, u) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, 0, 0, FLAGS, .unit = u }
48
49static const AVOption mestimate_options[] = {
50 { "method", "motion estimation method", OFFSET(method), AV_OPT_TYPE_INT, {.i64 = AV_ME_METHOD_ESA}, AV_ME_METHOD_ESA, AV_ME_METHOD_UMH, FLAGS, .unit = "method" },
51 CONST("esa", "exhaustive search", AV_ME_METHOD_ESA, "method"),
52 CONST("tss", "three step search", AV_ME_METHOD_TSS, "method"),
53 CONST("tdls", "two dimensional logarithmic search", AV_ME_METHOD_TDLS, "method"),
54 CONST("ntss", "new three step search", AV_ME_METHOD_NTSS, "method"),
55 CONST("fss", "four step search", AV_ME_METHOD_FSS, "method"),
56 CONST("ds", "diamond search", AV_ME_METHOD_DS, "method"),
57 CONST("hexbs", "hexagon-based search", AV_ME_METHOD_HEXBS, "method"),
58 CONST("epzs", "enhanced predictive zonal search", AV_ME_METHOD_EPZS, "method"),
59 CONST("umh", "uneven multi-hexagon search", AV_ME_METHOD_UMH, "method"),
60 { "mb_size", "macroblock size", OFFSET(mb_size), AV_OPT_TYPE_INT, {.i64 = 16}, 8, INT_MAX, FLAGS },
61 { "search_param", "search parameter", OFFSET(search_param), AV_OPT_TYPE_INT, {.i64 = 7}, 4, INT_MAX, FLAGS },
62 { NULL }
63};
64
66
78
79static int config_input(AVFilterLink *inlink)
80{
81 MEContext *s = inlink->dst->priv;
82 int i;
83
84 s->log2_mb_size = av_ceil_log2_c(s->mb_size);
85 s->mb_size = 1 << s->log2_mb_size;
86
87 s->b_width = inlink->w >> s->log2_mb_size;
88 s->b_height = inlink->h >> s->log2_mb_size;
89 s->b_count = s->b_width * s->b_height;
90
91 if (s->b_count == 0)
92 return AVERROR(EINVAL);
93
94 for (i = 0; i < 3; i++) {
95 s->mv_table[i] = av_calloc(s->b_count, sizeof(*s->mv_table[0]));
96 if (!s->mv_table[i])
97 return AVERROR(ENOMEM);
98 }
99
100 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);
101
102 return 0;
103}
104
105static void add_mv_data(AVMotionVector *mv, int mb_size,
106 int x, int y, int x_mv, int y_mv, int dir)
107{
108 mv->w = mb_size;
109 mv->h = mb_size;
110 mv->dst_x = x + (mb_size >> 1);
111 mv->dst_y = y + (mb_size >> 1);
112 mv->src_x = x_mv + (mb_size >> 1);
113 mv->src_y = y_mv + (mb_size >> 1);
114 mv->source = dir ? 1 : -1;
115 mv->flags = 0;
116}
117
118#define SEARCH_MV(method)\
119 do {\
120 for (mb_y = 0; mb_y < s->b_height; mb_y++)\
121 for (mb_x = 0; mb_x < s->b_width; mb_x++) {\
122 const int x_mb = mb_x << s->log2_mb_size;\
123 const int y_mb = mb_y << s->log2_mb_size;\
124 int mv[2] = {x_mb, y_mb};\
125 ff_me_search_##method(me_ctx, x_mb, y_mb, mv);\
126 add_mv_data(((AVMotionVector *) sd->data) + mv_count++, me_ctx->mb_size, x_mb, y_mb, mv[0], mv[1], dir);\
127 }\
128 } while (0)
129
130#define ADD_PRED(preds, px, py)\
131 do {\
132 preds.mvs[preds.nb][0] = px;\
133 preds.mvs[preds.nb][1] = py;\
134 preds.nb++;\
135 } while(0)
136
138{
139 AVFilterContext *ctx = inlink->dst;
140 MEContext *s = ctx->priv;
141 AVMotionEstContext *me_ctx = &s->me_ctx;
142 AVFrameSideData *sd;
143 AVFrame *out;
144 int mb_x, mb_y, dir;
145 int32_t mv_count = 0;
146 int ret;
147
148 if (frame && frame->pts == AV_NOPTS_VALUE) {
149 ret = ff_filter_frame(ctx->outputs[0], frame);
150 return ret;
151 }
152
153 av_frame_free(&s->prev);
154 s->prev = s->cur;
155 s->cur = s->next;
156 s->next = frame;
157
158 s->mv_table[2] = memcpy(s->mv_table[2], s->mv_table[1], sizeof(*s->mv_table[1]) * s->b_count);
159 s->mv_table[1] = memcpy(s->mv_table[1], s->mv_table[0], sizeof(*s->mv_table[0]) * s->b_count);
160
161 if (!s->cur) {
162 if (!frame)
163 return 0;
164 s->cur = av_frame_clone(frame);
165 if (!s->cur)
166 return AVERROR(ENOMEM);
167 }
168
169 if (!s->prev)
170 return 0;
171
172 out = av_frame_clone(s->cur);
173 if (!out)
174 return AVERROR(ENOMEM);
175
176 /* The last frame has no forward reference. */
177 const int nb_dirs = s->next ? 2 : 1;
178
180 nb_dirs * s->b_count * sizeof(AVMotionVector));
181 if (!sd) {
183 return AVERROR(ENOMEM);
184 }
185
186 me_ctx->data_cur = s->cur->data[0];
187 me_ctx->linesize = s->cur->linesize[0];
188
189 for (dir = 0; dir < nb_dirs; dir++) {
190 me_ctx->data_ref = (dir ? s->next : s->prev)->data[0];
191
192 if (s->method == AV_ME_METHOD_DS)
193 SEARCH_MV(ds);
194 else if (s->method == AV_ME_METHOD_ESA)
195 SEARCH_MV(esa);
196 else if (s->method == AV_ME_METHOD_FSS)
197 SEARCH_MV(fss);
198 else if (s->method == AV_ME_METHOD_NTSS)
199 SEARCH_MV(ntss);
200 else if (s->method == AV_ME_METHOD_TDLS)
201 SEARCH_MV(tdls);
202 else if (s->method == AV_ME_METHOD_TSS)
203 SEARCH_MV(tss);
204 else if (s->method == AV_ME_METHOD_HEXBS)
205 SEARCH_MV(hexbs);
206 else if (s->method == AV_ME_METHOD_UMH) {
207 for (mb_y = 0; mb_y < s->b_height; mb_y++)
208 for (mb_x = 0; mb_x < s->b_width; mb_x++) {
209 const int mb_i = mb_x + mb_y * s->b_width;
210 const int x_mb = mb_x << s->log2_mb_size;
211 const int y_mb = mb_y << s->log2_mb_size;
212 int mv[2] = {x_mb, y_mb};
213
214 AVMotionEstPredictor *preds = me_ctx->preds;
215 preds[0].nb = 0;
216
217 ADD_PRED(preds[0], 0, 0);
218
219 //left mb in current frame
220 if (mb_x > 0)
221 ADD_PRED(preds[0], s->mv_table[0][mb_i - 1][dir][0], s->mv_table[0][mb_i - 1][dir][1]);
222
223 if (mb_y > 0) {
224 //top mb in current frame
225 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]);
226
227 //top-right mb in current frame
228 if (mb_x + 1 < s->b_width)
229 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]);
230 //top-left mb in current frame
231 else if (mb_x > 0)
232 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]);
233 }
234
235 //median predictor
236 if (preds[0].nb == 4) {
237 me_ctx->pred_x = mid_pred(preds[0].mvs[1][0], preds[0].mvs[2][0], preds[0].mvs[3][0]);
238 me_ctx->pred_y = mid_pred(preds[0].mvs[1][1], preds[0].mvs[2][1], preds[0].mvs[3][1]);
239 } else if (preds[0].nb == 3) {
240 me_ctx->pred_x = mid_pred(0, preds[0].mvs[1][0], preds[0].mvs[2][0]);
241 me_ctx->pred_y = mid_pred(0, preds[0].mvs[1][1], preds[0].mvs[2][1]);
242 } else if (preds[0].nb == 2) {
243 me_ctx->pred_x = preds[0].mvs[1][0];
244 me_ctx->pred_y = preds[0].mvs[1][1];
245 } else {
246 me_ctx->pred_x = 0;
247 me_ctx->pred_y = 0;
248 }
249
250 ff_me_search_umh(me_ctx, x_mb, y_mb, mv);
251
252 s->mv_table[0][mb_i][dir][0] = mv[0] - x_mb;
253 s->mv_table[0][mb_i][dir][1] = mv[1] - y_mb;
254 add_mv_data(((AVMotionVector *) sd->data) + mv_count++, me_ctx->mb_size, x_mb, y_mb, mv[0], mv[1], dir);
255 }
256
257 } else if (s->method == AV_ME_METHOD_EPZS) {
258
259 for (mb_y = 0; mb_y < s->b_height; mb_y++)
260 for (mb_x = 0; mb_x < s->b_width; mb_x++) {
261 const int mb_i = mb_x + mb_y * s->b_width;
262 const int x_mb = mb_x << s->log2_mb_size;
263 const int y_mb = mb_y << s->log2_mb_size;
264 int mv[2] = {x_mb, y_mb};
265
266 AVMotionEstPredictor *preds = me_ctx->preds;
267 preds[0].nb = 0;
268 preds[1].nb = 0;
269
270 ADD_PRED(preds[0], 0, 0);
271
272 //left mb in current frame
273 if (mb_x > 0)
274 ADD_PRED(preds[0], s->mv_table[0][mb_i - 1][dir][0], s->mv_table[0][mb_i - 1][dir][1]);
275
276 //top mb in current frame
277 if (mb_y > 0)
278 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]);
279
280 //top-right mb in current frame
281 if (mb_y > 0 && mb_x + 1 < s->b_width)
282 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]);
283
284 //median predictor
285 if (preds[0].nb == 4) {
286 me_ctx->pred_x = mid_pred(preds[0].mvs[1][0], preds[0].mvs[2][0], preds[0].mvs[3][0]);
287 me_ctx->pred_y = mid_pred(preds[0].mvs[1][1], preds[0].mvs[2][1], preds[0].mvs[3][1]);
288 } else if (preds[0].nb == 3) {
289 me_ctx->pred_x = mid_pred(0, preds[0].mvs[1][0], preds[0].mvs[2][0]);
290 me_ctx->pred_y = mid_pred(0, preds[0].mvs[1][1], preds[0].mvs[2][1]);
291 } else if (preds[0].nb == 2) {
292 me_ctx->pred_x = preds[0].mvs[1][0];
293 me_ctx->pred_y = preds[0].mvs[1][1];
294 } else {
295 me_ctx->pred_x = 0;
296 me_ctx->pred_y = 0;
297 }
298
299 //collocated mb in prev frame
300 ADD_PRED(preds[0], s->mv_table[1][mb_i][dir][0], s->mv_table[1][mb_i][dir][1]);
301
302 //accelerator motion vector of collocated block in prev frame
303 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]),
304 s->mv_table[1][mb_i][dir][1] + (s->mv_table[1][mb_i][dir][1] - s->mv_table[2][mb_i][dir][1]));
305
306 //left mb in prev frame
307 if (mb_x > 0)
308 ADD_PRED(preds[1], s->mv_table[1][mb_i - 1][dir][0], s->mv_table[1][mb_i - 1][dir][1]);
309
310 //top mb in prev frame
311 if (mb_y > 0)
312 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]);
313
314 //right mb in prev frame
315 if (mb_x + 1 < s->b_width)
316 ADD_PRED(preds[1], s->mv_table[1][mb_i + 1][dir][0], s->mv_table[1][mb_i + 1][dir][1]);
317
318 //bottom mb in prev frame
319 if (mb_y + 1 < s->b_height)
320 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]);
321
322 ff_me_search_epzs(me_ctx, x_mb, y_mb, mv);
323
324 s->mv_table[0][mb_i][dir][0] = mv[0] - x_mb;
325 s->mv_table[0][mb_i][dir][1] = mv[1] - y_mb;
326 add_mv_data(((AVMotionVector *) sd->data) + mv_count++, s->mb_size, x_mb, y_mb, mv[0], mv[1], dir);
327 }
328 }
329 }
330
331 return ff_filter_frame(ctx->outputs[0], out);
332}
333
334static int request_frame(AVFilterLink *outlink)
335{
336 AVFilterContext *ctx = outlink->src;
337 MEContext *s = ctx->priv;
338 int ret;
339
340 ret = ff_request_frame(ctx->inputs[0]);
341 if (ret == AVERROR_EOF && s->next)
342 ret = filter_frame(ctx->inputs[0], NULL);
343
344 return ret;
345}
346
348{
349 MEContext *s = ctx->priv;
350 int i;
351
352 av_frame_free(&s->prev);
353 av_frame_free(&s->cur);
354 av_frame_free(&s->next);
355
356 for (i = 0; i < 3; i++)
357 av_freep(&s->mv_table[i]);
358}
359
361 {
362 .name = "default",
363 .type = AVMEDIA_TYPE_VIDEO,
364 .filter_frame = filter_frame,
365 .config_props = config_input,
366 },
367};
368
370 {
371 .name = "default",
372 .type = AVMEDIA_TYPE_VIDEO,
373 .request_frame = request_frame,
374 },
375};
376
378 .p.name = "mestimate",
379 .p.description = NULL_IF_CONFIG_SMALL("Generate motion vectors."),
380 .p.priv_class = &mestimate_class,
382 .priv_size = sizeof(MEContext),
383 .uninit = uninit,
387};
static int config_input(AVFilterLink *inlink)
static int request_frame(AVFilterLink *outlink)
Definition af_aecho.c:272
const FFFilter ff_vf_mestimate
static FILE * out
static AVFormatContext * ctx
int32_t
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition avfilter.c:483
Main libavfilter public API header.
#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:597
common internal and external API header
static av_always_inline av_const int av_ceil_log2_c(int x)
Compute ceil(log2(x)).
Definition common.h:425
#define NULL
Definition coverity.c:32
static AVFrame * frame
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition avfilter.h:182
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, size_t size)
Add a new side data to a frame.
Definition frame.c:647
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition frame.c:483
@ AV_FRAME_DATA_MOTION_VECTORS
Motion vectors exported by some codecs (on demand through the export_mvs flag set in the libavcodec A...
Definition frame.h:97
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition avutil.h:247
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static const int8_t mv[256][2]
Definition 4xm.c:81
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#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:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
#define mid_pred
Definition mathops.h:115
void * av_calloc(size_t nmemb, size_t size)
Definition mem.c:264
Memory handling functions.
uint64_t ff_me_search_epzs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
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)
uint64_t ff_me_search_umh(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
#define AV_ME_METHOD_UMH
#define AV_ME_METHOD_NTSS
#define AV_ME_METHOD_FSS
#define AV_ME_METHOD_DS
#define AV_ME_METHOD_HEXBS
#define AV_ME_METHOD_EPZS
#define AV_ME_METHOD_ESA
Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<@gmail.com>
#define AV_ME_METHOD_TDLS
#define AV_ME_METHOD_TSS
const char data[16]
Definition mxf.c:149
AVOptions.
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition pixfmt.h:108
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition pixfmt.h:107
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition pixfmt.h:174
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition pixfmt.h:283
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition pixfmt.h:86
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition pixfmt.h:173
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition pixfmt.h:87
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
void * priv
private data for use by the filter
Definition avfilter.h:288
A filter pad used for either input or output.
Definition filters.h:40
Structure to hold side data for an AVFrame.
Definition frame.h:327
uint8_t * data
Definition frame.h:329
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
AVMotionEstPredictor preds[2]
int pred_y
median predictor y
int pred_x
median predictor x
AVOption.
Definition opt.h:428
Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<@gmail.com>
int search_param
search parameter
int(*[3] mv_table)[2][2]
motion vectors of current & prev 2 frames
AVFrame * cur
AVFrame * next
AVFrame * prev
AVMotionEstContext me_ctx
int mb_size
macroblock size
int method
motion estimation method
int log2_mb_size
#define av_freep(p)
#define SEARCH_MV(method)
static const AVOption mestimate_options[]
#define ADD_PRED(preds, px, py)
static const AVFilterPad mestimate_inputs[]
static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static void add_mv_data(AVMotionVector *mv, int mb_size, int x, int y, int x_mv, int y_mv, int dir)
static int request_frame(AVFilterLink *outlink)
#define CONST(name, help, val, u)
static const AVFilterPad mestimate_outputs[]
static av_cold void uninit(AVFilterContext *ctx)
#define OFFSET(x)