2 * Copyright (c) 2016 Davinder Singh (DSM_) <ds.mudhar<@gmail.com>
4 * This file is part of FFmpeg.
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.
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.
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
21 #ifndef AVFILTER_MOTION_ESTIMATION_H
22 #define AVFILTER_MOTION_ESTIMATION_H
24 #include "libavutil/avutil.h"
26 #define AV_ME_METHOD_ESA 1
27 #define AV_ME_METHOD_TSS 2
28 #define AV_ME_METHOD_TDLS 3
29 #define AV_ME_METHOD_NTSS 4
30 #define AV_ME_METHOD_FSS 5
31 #define AV_ME_METHOD_DS 6
32 #define AV_ME_METHOD_HEXBS 7
33 #define AV_ME_METHOD_EPZS 8
34 #define AV_ME_METHOD_UMH 9
36 typedef struct AVMotionEstPredictor {
39 } AVMotionEstPredictor;
41 typedef struct AVMotionEstContext {
42 uint8_t *data_cur, *data_ref;
56 int pred_x; ///< median predictor x
57 int pred_y; ///< median predictor y
58 AVMotionEstPredictor preds[2];
60 uint64_t (*get_cost)(struct AVMotionEstContext *me_ctx, int x_mb, int y_mb,
64 void ff_me_init_context(AVMotionEstContext *me_ctx, int mb_size, int search_param,
65 int width, int height, int x_min, int x_max, int y_min, int y_max);
67 uint64_t ff_me_cmp_sad(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int x_mv, int y_mv);
69 uint64_t ff_me_search_esa(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
71 uint64_t ff_me_search_tss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
73 uint64_t ff_me_search_tdls(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
75 uint64_t ff_me_search_ntss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
77 uint64_t ff_me_search_fss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
79 uint64_t ff_me_search_ds(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
81 uint64_t ff_me_search_hexbs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
83 uint64_t ff_me_search_epzs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
85 uint64_t ff_me_search_umh(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
87 #endif /* AVFILTER_MOTION_ESTIMATION_H */