[x264-devel] Fix two bugs in 4:4:4 chroma weightp analysis

Henrik Gramner git at videolan.org
Wed Aug 10 05:15:11 CEST 2011


x264 | branch: master | Henrik Gramner <hengar-6 at student.ltu.se> | Sun Aug  7 11:58:36 2011 +0200| [59cb2eb53913ac463f7aef99332d3558a95ff040] | committer: Jason Garrett-Glaser

Fix two bugs in 4:4:4 chroma weightp analysis
Caused slightly worse compression.

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

 encoder/slicetype.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index 8fb7031..609b0f1 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -273,7 +273,7 @@ static NOINLINE unsigned int x264_weight_cost_chroma444( x264_t *h, x264_frame_t
     else
         for( int y = 0; y < i_lines; y += 16, pixoff = y*i_stride )
             for( int x = 0; x < i_width; x += 16, pixoff += 16 )
-                cost += h->pixf.mbcmp[PIXEL_16x16]( &ref[pixoff], 16, &src[pixoff], i_stride );
+                cost += h->pixf.mbcmp[PIXEL_16x16]( &ref[pixoff], i_stride, &src[pixoff], i_stride );
     x264_emms();
     return cost;
 }
@@ -340,7 +340,10 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
         else
         {
             if( CHROMA444 )
+            {
                 mcbuf = x264_weight_cost_init_chroma444( h, fenc, ref, h->mb.p_weight_buf[0], plane );
+                origscore = minscore = x264_weight_cost_chroma444( h, fenc, mcbuf, NULL, plane );
+            }
             else
             {
                 pixel *dstu = h->mb.p_weight_buf[0];
@@ -349,8 +352,8 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
                 if( plane == 1 )
                     x264_weight_cost_init_chroma( h, fenc, ref, dstu, dstv );
                 mcbuf = plane == 1 ? dstu : dstv;
+                origscore = minscore = x264_weight_cost_chroma( h, fenc, mcbuf, NULL );
             }
-            origscore = minscore = x264_weight_cost_chroma( h, fenc, mcbuf, NULL );
         }
 
         if( !minscore )



More information about the x264-devel mailing list