[x264-devel] commit: earlier termination in SEA if mvcost exceeds residual ( Loren Merritt )

git version control git at videolan.org
Sun Apr 27 11:16:38 CEST 2008


x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Thu Apr 24 05:17:04 2008 -0600| [2f75bcc1b74ece41ae39134719bcdefc2a6a0265]

earlier termination in SEA if mvcost exceeds residual

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=2f75bcc1b74ece41ae39134719bcdefc2a6a0265
---

 encoder/me.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/encoder/me.c b/encoder/me.c
index 310c586..7198957 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; i<xn-2; i+=3 )
                     {
                         uint8_t *ref = p_fref+min_x+my*stride;
@@ -567,12 +569,15 @@ me_hex2:
                 // just ADS and SAD
                 for( my = min_y; my <= max_y; my++ )
                 {
-                    bcost -= p_cost_mvy[my<<2];
+                    int ycost = p_cost_mvy[my<<2];
+                    if( bcost <= ycost )
+                        continue;
+                    bcost -= 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(bcost,0) );
+                                               cost_fpel_mvx+min_x, xs, width, bcost );
                     for( i=0; i<xn-2; i+=3 )
                         COST_MV_X3_ABS( min_x+xs[i],my, min_x+xs[i+1],my, min_x+xs[i+2],my );
-                    bcost += p_cost_mvy[my<<2];
+                    bcost += ycost;
                     for( ; i<xn; i++ )
                         COST_MV( min_x+xs[i], my );
                 }



More information about the x264-devel mailing list