From 2f75bcc1b74ece41ae39134719bcdefc2a6a0265 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Thu, 24 Apr 2008 05:17:04 -0600 Subject: [PATCH] earlier termination in SEA if mvcost exceeds residual --- encoder/me.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/encoder/me.c b/encoder/me.c index 310c5868..7198957d 100644 --- a/encoder/me.c +++ b/encoder/me.c @@ -496,9 +496,11 @@ me_hex2: for( my = min_y; my <= max_y; my++ ) { int ycost = p_cost_mvy[my<<2]; + if( bsad <= ycost ) + continue; bsad -= ycost; xn = h->pixf.ads[i_pixel]( enc_dc, sums_base + min_x + my * stride, delta, - cost_fpel_mvx+min_x, xs, width, X264_MAX(bsad,0)*17/16 ); + cost_fpel_mvx+min_x, xs, width, bsad*17/16 ); for( i=0; ipixf.ads[i_pixel]( enc_dc, sums_base + min_x + my * stride, delta, - cost_fpel_mvx+min_x, xs, width, X264_MAX(bcost,0) ); + cost_fpel_mvx+min_x, xs, width, bcost ); for( i=0; i