Commit b6cef5f7 authored by michael's avatar michael

motion estimation cleanup

replace ugly macros by always_inline functions, that way its much more readable and flexible as always_inline can simply be removed while the macros couldnt be
about 0.5 % speedup with default parameters


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3037 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7e240d7a
...@@ -1575,7 +1575,7 @@ typedef struct AVCodecContext { ...@@ -1575,7 +1575,7 @@ typedef struct AVCodecContext {
* - encoding: set by user * - encoding: set by user
* - decoding: set by user * - decoding: set by user
*/ */
void *me_threshold; int me_threshold;
} AVCodecContext; } AVCodecContext;
......
This diff is collapsed.
This diff is collapsed.
...@@ -200,6 +200,10 @@ typedef struct MotionEstContext{ ...@@ -200,6 +200,10 @@ typedef struct MotionEstContext{
int co_located_mv[4][2]; ///< mv from last p frame for direct mode ME int co_located_mv[4][2]; ///< mv from last p frame for direct mode ME
int direct_basis_mv[4][2]; int direct_basis_mv[4][2];
uint8_t *scratchpad; ///< data area for the me algo, so that the ME doesnt need to malloc/free uint8_t *scratchpad; ///< data area for the me algo, so that the ME doesnt need to malloc/free
uint8_t *best_mb;
uint8_t *temp_mb[2];
uint8_t *temp;
int best_bits;
uint32_t *map; ///< map to avoid duplicate evaluations uint32_t *map; ///< map to avoid duplicate evaluations
uint32_t *score_map; ///< map to store the scores uint32_t *score_map; ///< map to store the scores
int map_generation; int map_generation;
...@@ -207,31 +211,33 @@ typedef struct MotionEstContext{ ...@@ -207,31 +211,33 @@ typedef struct MotionEstContext{
int penalty_factor; int penalty_factor;
int sub_penalty_factor; int sub_penalty_factor;
int mb_penalty_factor; int mb_penalty_factor;
int flags;
int sub_flags;
int mb_flags;
int pre_pass; ///< = 1 for the pre pass int pre_pass; ///< = 1 for the pre pass
int dia_size; int dia_size;
int xmin; int xmin;
int xmax; int xmax;
int ymin; int ymin;
int ymax; int ymax;
int pred_x;
int pred_y;
uint8_t *src[4][4];
uint8_t *ref[4][4];
int stride;
int uvstride;
/* cmp, chroma_cmp;*/
op_pixels_func (*hpel_put)[4];
op_pixels_func (*hpel_avg)[4];
op_pixels_func (*chroma_hpel_put)[4];
qpel_mc_func (*qpel_put)[16];
qpel_mc_func (*qpel_avg)[16];
uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV
uint8_t *current_mv_penalty;
int (*sub_motion_search)(struct MpegEncContext * s, int (*sub_motion_search)(struct MpegEncContext * s,
int *mx_ptr, int *my_ptr, int dmin, int *mx_ptr, int *my_ptr, int dmin,
int pred_x, int pred_y, uint8_t *src_data[3], int src_index, int ref_index,
uint8_t *ref_data[6], int stride, int uvstride, int size, int h);
int size, int h, uint8_t * const mv_penalty);
int (*motion_search[7])(struct MpegEncContext * s,
int *mx_ptr, int *my_ptr,
int P[10][2], int pred_x, int pred_y, uint8_t *src_data[3],
uint8_t *ref_data[6], int stride, int uvstride, int16_t (*last_mv)[2],
int ref_mv_scale, uint8_t * const mv_penalty);
int (*pre_motion_search)(struct MpegEncContext * s,
int *mx_ptr, int *my_ptr,
int P[10][2], int pred_x, int pred_y, uint8_t *src_data[3],
uint8_t *ref_data[6], int stride, int uvstride, int16_t (*last_mv)[2],
int ref_mv_scale, uint8_t * const mv_penalty);
int (*get_mb_score)(struct MpegEncContext * s, int mx, int my, int pred_x, int pred_y, uint8_t *src_data[3],
uint8_t *ref_data[6], int stride, int uvstride,
uint8_t * const mv_penalty);
}MotionEstContext; }MotionEstContext;
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment