Go to the documentation of this file.
21 #ifndef AVCODEC_MOTION_EST_H
22 #define AVCODEC_MOTION_EST_H
34 #if ARCH_IA64 // Limit static arrays to avoid gcc failing "short data segment overflowed"
39 #define MAX_DMV (2*MAX_MV)
40 #define ME_MAP_SIZE 64
78 const uint8_t *
src[4][4];
79 const uint8_t *
ref[4][4];
102 int *mx_ptr,
int *my_ptr,
int dmin,
103 int src_index,
int ref_index,
125 int P[10][2],
int src_index,
int ref_index,
126 const int16_t (*last_mv)[2],
int ref_mv_scale,
130 int ref_index,
int size,
int h,
int add_rate);
133 const int16_t (*mv_table)[2],
int type);
137 int field_select, int16_t (*mv_table)[2],
int f_code,
138 int type,
int truncate);
Motion estimation context.
const uint8_t * current_mv_penalty
uint32_t map[ME_MAP_SIZE]
map to avoid duplicate evaluations
int co_located_mv[4][2]
mv from last P-frame for direct mode ME
void ff_fix_long_p_mvs(MPVEncContext *s, int type)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
int(* sub_motion_search)(MPVEncContext *s, int *mx_ptr, int *my_ptr, int dmin, int src_index, int ref_index, int size, int h)
int ff_me_init(MotionEstContext *c, struct AVCodecContext *avctx, const struct MECmpContext *mecc, int mpvenc)
Performs one-time initialization of the MotionEstContext.
int ff_pre_estimate_p_frame_motion(MPVEncContext *s, int mb_x, int mb_y)
qpel_mc_func(* qpel_avg)[16]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
void ff_fix_long_mvs(MPVEncContext *s, uint8_t *field_select_table, int field_select, int16_t(*mv_table)[2], int f_code, int type, int truncate)
op_pixels_func(* hpel_avg)[4]
int(* me_cmp_func)(MPVEncContext *c, const uint8_t *blk1, const uint8_t *blk2, ptrdiff_t stride, int h)
me_cmp_func me_pre_cmp[6]
op_pixels_func(* hpel_put)[4]
void ff_estimate_p_frame_motion(MPVEncContext *s, int mb_x, int mb_y)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
uint32_t score_map[ME_MAP_SIZE]
map to store the scores
int skip
set if ME is skipped for the current MB
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
void(* qpel_mc_func)(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)
qpel_mc_func(* qpel_put)[16]
const uint8_t(* mv_penalty)[MAX_DMV *2+1]
bit amount needed to encode a MV
me_cmp_func me_sub_cmp[6]
void ff_estimate_b_frame_motion(MPVEncContext *s, int mb_x, int mb_y)
const uint8_t * ref[4][4]
int ff_get_mb_score(MPVEncContext *s, int mx, int my, int src_index, int ref_index, int size, int h, int add_rate)
int motion_est
ME algorithm.
int direct_basis_mv[4][2]
int penalty_factor
an estimate of the bits required to code a given mv value, e.g.
const uint8_t * src[4][4]
uint8_t * scratchpad
data area for the ME algo, so that the ME does not need to malloc/free.
main external API structure.
int64_t mc_mb_var_sum_temp
int pre_pass
= 1 for the pre pass
int ff_epzs_motion_search(MPVEncContext *s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, const int16_t(*last_mv)[2], int ref_mv_scale, int size, int h)
void ff_me_init_pic(MPVEncContext *s)
me_cmp_func pix_abs[2][4]
int ff_get_best_fcode(MPVMainEncContext *m, const int16_t(*mv_table)[2], int type)