@ -64,8 +64,8 @@ static int hpel_motion_search(MpegEncContext * s,
//FIXME factorize
cmp_sub = s - > mecc . me_sub_cmp [ size ] ;
chroma_cmp_sub = s - > mecc . me_sub_cmp [ size + 1 ] ;
cmp_sub = c - > me_sub_cmp [ size ] ;
chroma_cmp_sub = c - > me_sub_cmp [ size + 1 ] ;
if ( c - > skip ) { //FIXME move out of hpel?
* mx_ptr = 0 ;
@ -178,8 +178,8 @@ static inline int get_mb_score(MpegEncContext *s, int mx, int my,
//FIXME factorize
cmp_sub = s - > mecc . mb_cmp [ size ] ;
chroma_cmp_sub = s - > mecc . mb_cmp [ size + 1 ] ;
cmp_sub = c - > mb_cmp [ size ] ;
chroma_cmp_sub = c - > mb_cmp [ size + 1 ] ;
d = cmp ( s , mx > > ( qpel + 1 ) , my > > ( qpel + 1 ) , mx & mask , my & mask , size , h , ref_index , src_index , cmp_sub , chroma_cmp_sub , flags ) ;
//FIXME check cbp before adding penalty for (0,0) vector
@ -222,12 +222,12 @@ static int qpel_motion_search(MpegEncContext * s,
LOAD_COMMON
int flags = c - > sub_flags ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ; // FIXME: factorize
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ; // FIXME: factorize
//FIXME factorize
cmp_sub = s - > mecc . me_sub_cmp [ size ] ;
chroma_cmp_sub = s - > mecc . me_sub_cmp [ size + 1 ] ;
cmp_sub = c - > me_sub_cmp [ size ] ;
chroma_cmp_sub = c - > me_sub_cmp [ size + 1 ] ;
if ( c - > skip ) { //FIXME somehow move up (benchmark)
* mx_ptr = 0 ;
@ -424,8 +424,8 @@ static av_always_inline int small_diamond_search(MpegEncContext * s, int *best,
LOAD_COMMON2
unsigned map_generation = c - > map_generation ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
{ /* ensure that the best point is in the MAP as h/qpel refinement needs it */
const unsigned key = ( ( unsigned ) best [ 1 ] < < ME_MAP_MV_BITS ) + best [ 0 ] + map_generation ;
@ -465,8 +465,8 @@ static int funny_diamond_search(MpegEncContext * s, int *best, int dmin,
LOAD_COMMON2
unsigned map_generation = c - > map_generation ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
for ( dia_size = 1 ; dia_size < = 4 ; dia_size + + ) {
int dir ;
@ -508,8 +508,8 @@ static int hex_search(MpegEncContext * s, int *best, int dmin,
int x , y , d ;
const int dec = dia_size & ( dia_size - 1 ) ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
for ( ; dia_size ; dia_size = dec ? dia_size - 1 : dia_size > > 1 ) {
do {
@ -545,8 +545,8 @@ static int l2s_dia_search(MpegEncContext * s, int *best, int dmin,
static const int hex [ 8 ] [ 2 ] = { { - 2 , 0 } , { - 1 , - 1 } , { 0 , - 2 } , { 1 , - 1 } ,
{ 2 , 0 } , { 1 , 1 } , { 0 , 2 } , { - 1 , 1 } } ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
for ( ; dia_size ; dia_size = dec ? dia_size - 1 : dia_size > > 1 ) {
do {
@ -584,8 +584,8 @@ static int umh_search(MpegEncContext * s, int *best, int dmin,
{ - 2 , 3 } , { 0 , 4 } , { 2 , 3 } ,
{ - 2 , - 3 } , { 0 , - 4 } , { 2 , - 3 } , } ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
x = best [ 0 ] ;
y = best [ 1 ] ;
@ -627,8 +627,8 @@ static int full_search(MpegEncContext * s, int *best, int dmin,
int x , y , d ;
const int dia_size = c - > dia_size & 0xFF ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
for ( y = FFMAX ( - dia_size , ymin ) ; y < = FFMIN ( dia_size , ymax ) ; y + + ) {
for ( x = FFMAX ( - dia_size , xmin ) ; x < = FFMIN ( dia_size , xmax ) ; x + + ) {
@ -693,8 +693,8 @@ static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
av_assert1 ( minima_count < = MAX_SAB_SIZE ) ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
/*Note j<MAX_SAB_SIZE is needed if MAX_SAB_SIZE < ME_MAP_SIZE as j can
become larger due to MVs overflowing their ME_MAP_MV_BITS bits space in map
@ -779,8 +779,8 @@ static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
LOAD_COMMON2
unsigned map_generation = c - > map_generation ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
for ( dia_size = 1 ; dia_size < = c - > dia_size ; dia_size + + ) {
int dir , start , end ;
@ -880,12 +880,12 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
if ( c - > pre_pass ) {
penalty_factor = c - > pre_penalty_factor ;
cmpf = s - > mecc . me_pre_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_pre_cmp [ size + 1 ] ;
cmpf = c - > me_pre_cmp [ size ] ;
chroma_cmpf = c - > me_pre_cmp [ size + 1 ] ;
} else {
penalty_factor = c - > penalty_factor ;
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
}
map_generation = update_map_generation ( c ) ;
@ -1008,8 +1008,8 @@ static int epzs_motion_search2(MpegEncContext * s,
int flags = c - > flags ;
LOAD_COMMON2
cmpf = s - > mecc . me_cmp [ size ] ;
chroma_cmpf = s - > mecc . me_cmp [ size + 1 ] ;
cmpf = c - > me_cmp [ size ] ;
chroma_cmpf = c - > me_cmp [ size + 1 ] ;
map_generation = update_map_generation ( c ) ;