FFmpeg
motion_estimation.h
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 #ifndef AVFILTER_MOTION_ESTIMATION_H
22 #define AVFILTER_MOTION_ESTIMATION_H
23 
24 #include "libavutil/avutil.h"
25 
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
35 
36 typedef struct AVMotionEstPredictor {
37  int mvs[10][2];
38  int nb;
40 
41 typedef struct AVMotionEstContext {
42  uint8_t *data_cur, *data_ref;
43  int linesize;
44 
45  int mb_size;
47 
48  int width;
49  int height;
50 
51  int x_min;
52  int x_max;
53  int y_min;
54  int y_max;
55 
56  int pred_x; ///< median predictor x
57  int pred_y; ///< median predictor y
59 
60  uint64_t (*get_cost)(struct AVMotionEstContext *me_ctx, int x_mb, int y_mb,
61  int mv_x, int mv_y);
63 
65  int width, int height, int x_min, int x_max, int y_min, int y_max);
66 
67 uint64_t ff_me_cmp_sad(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int x_mv, int y_mv);
68 
69 uint64_t ff_me_search_esa(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
70 
71 uint64_t ff_me_search_tss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
72 
73 uint64_t ff_me_search_tdls(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
74 
75 uint64_t ff_me_search_ntss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
76 
77 uint64_t ff_me_search_fss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
78 
79 uint64_t ff_me_search_ds(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
80 
81 uint64_t ff_me_search_hexbs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
82 
83 uint64_t ff_me_search_epzs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
84 
85 uint64_t ff_me_search_umh(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv);
86 
87 #endif /* AVFILTER_MOTION_ESTIMATION_H */
AVMotionEstPredictor::nb
int nb
Definition: motion_estimation.h:38
AVMotionEstContext::data_ref
uint8_t * data_ref
Definition: motion_estimation.h:42
ff_me_search_esa
uint64_t ff_me_search_esa(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:77
AVMotionEstPredictor
Definition: motion_estimation.h:36
ff_me_search_tss
uint64_t ff_me_search_tss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:96
mv
static const int8_t mv[256][2]
Definition: 4xm.c:79
AVMotionEstContext::data_cur
uint8_t * data_cur
Definition: motion_estimation.h:42
ff_me_search_epzs
uint64_t ff_me_search_epzs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:332
ff_me_search_fss
uint64_t ff_me_search_fss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:212
AVMotionEstContext::pred_x
int pred_x
median predictor x
Definition: motion_estimation.h:56
width
#define width
ff_me_search_umh
uint64_t ff_me_search_umh(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:373
AVMotionEstContext::x_max
int x_max
Definition: motion_estimation.h:52
ff_me_cmp_sad
uint64_t ff_me_cmp_sad(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int x_mv, int y_mv)
Definition: motion_estimation.c:59
AVMotionEstContext::x_min
int x_min
Definition: motion_estimation.h:51
ff_me_search_ds
uint64_t ff_me_search_ds(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:244
AVMotionEstContext
Definition: motion_estimation.h:41
AVMotionEstContext::search_param
int search_param
Definition: motion_estimation.h:46
AVMotionEstContext::y_min
int y_min
Definition: motion_estimation.h:53
height
#define height
AVMotionEstContext::width
int width
Definition: motion_estimation.h:48
AVMotionEstContext::y_max
int y_max
Definition: motion_estimation.h:54
ff_me_init_context
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)
Definition: motion_estimation.c:45
AVMotionEstContext::pred_y
int pred_y
median predictor y
Definition: motion_estimation.h:57
avutil.h
AVMotionEstContext::linesize
int linesize
Definition: motion_estimation.h:43
ff_me_search_tdls
uint64_t ff_me_search_tdls(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:127
AVMotionEstContext::height
int height
Definition: motion_estimation.h:49
AVMotionEstPredictor::mvs
int mvs[10][2]
Definition: motion_estimation.h:37
ff_me_search_hexbs
uint64_t ff_me_search_hexbs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:299
AVMotionEstContext::preds
AVMotionEstPredictor preds[2]
Definition: motion_estimation.h:58
AVMotionEstContext::get_cost
uint64_t(* get_cost)(struct AVMotionEstContext *me_ctx, int x_mb, int y_mb, int mv_x, int mv_y)
Definition: motion_estimation.h:60
AVMotionEstContext::mb_size
int mb_size
Definition: motion_estimation.h:45
ff_me_search_ntss
uint64_t ff_me_search_ntss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv)
Definition: motion_estimation.c:159