1 /*
2 * Motion estimation
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 AVCODEC_MOTION_EST_H
22 #define AVCODEC_MOTION_EST_H
23
24 #include <stdint.h>
25
30
33
34 #if ARCH_IA64 // Limit static arrays to avoid gcc failing "short data segment overflowed"
35 #define MAX_MV 1024
36 #else
38 #endif
39 #define MAX_DMV (2*MAX_MV)
40 #define ME_MAP_SIZE 64
41
45
46 /**
47 * Motion estimation context.
48 */
52 int skip;
///< set if ME is skipped for the current MB
55 uint8_t *
scratchpad;
/**< data area for the ME algo, so that
56 * the ME does not need to malloc/free. */
61 * code a given mv value, e.g. (1,0) takes
62 * more bits than (0,0). We have to
63 * estimate whether any reduction in
64 * residual is worth the extra bits. */
79 const uint8_t *
src[4][4];
80 const uint8_t *
ref[4][4];
83 /* temp variables for picture complexity calculation */
87
92
95
103 int *mx_ptr, int *my_ptr, int dmin,
104 int src_index, int ref_index,
106
110
111 /**
112 * Performs one-time initialization of the MotionEstContext.
113 */
116
118
121
123 int mb_x, int mb_y);
124
126 int P[10][2],
int src_index,
int ref_index,
127 const int16_t (*last_mv)[2], int ref_mv_scale,
129
131 int ref_index,
int size,
int h,
int add_rate);
132
134 const int16_t (*mv_table)[2],
int type);
135
138 int field_select, int16_t (*mv_table)[2], int f_code,
139 int type,
int truncate);
140
141 #endif /* AVCODEC_MOTION_EST_H */