From: Loren Merritt Date: Sun, 30 Aug 2009 20:49:07 +0000 (+0000) Subject: Faster me=tesa X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4767b0e12e335f6057327a18992a3c97abedabbb;p=libx264 Faster me=tesa But it still spends all too much time in me_search_ref rather than asm. --- diff --git a/encoder/me.c b/encoder/me.c index db182711..fd602c86 100644 --- a/encoder/me.c +++ b/encoder/me.c @@ -633,39 +633,35 @@ me_hex2: } limit = i_me_range / 2; - if( nmvsad > limit*2 ) + sad_thresh = bsad*sad_thresh>>3; + while( nmvsad > limit*2 && sad_thresh > bsad ) { // halve the range if the domain is too large... eh, close enough - bsad = bsad*(sad_thresh+8)>>4; - for( i=0; i> 1; + for( i=0; i limit ) + while( nmvsad > limit ) { - for( i=0; i i ) - { - if( sizeof( mvsad_t ) == sizeof( uint64_t ) ) - XCHG( uint64_t, *(uint64_t*)&mvsads[i], *(uint64_t*)&mvsads[bj] ); - else - XCHG( mvsad_t, mvsads[i], mvsads[bj] ); - } - } - nmvsad = limit; + int bsad = mvsads[0].sad; + int bi = 0; + for( i=1; i(x))\ +{\ + (x)=(y);\ + (a)=(b);\ +} + #endif