]> granicus.if.org Git - libx264/commitdiff
Fix a bug in lossless sub-8x8 RD
authorFiona Glaser <fiona@x264.com>
Tue, 26 Jul 2011 14:40:23 +0000 (07:40 -0700)
committerFiona Glaser <fiona@x264.com>
Tue, 26 Jul 2011 14:41:11 +0000 (07:41 -0700)
Caused crashes in rare cases with lossless encoding.  Regression in 4:4:4.

encoder/macroblock.c

index d9a601736dd5f8440b8d610855dc77ce78af4b5f..1ec39cfabbf7dac05ef4a7060bb0d9cd59fbd4d2 100644 (file)
@@ -1135,8 +1135,8 @@ static ALWAYS_INLINE void x264_macroblock_encode_p8x8_internal( x264_t *h, int i
                 dctcoef dc;
                 pixel *p_fenc = h->mb.pic.p_fenc[1+ch] + 4*x + 4*y*FENC_STRIDE;
                 pixel *p_fdec = h->mb.pic.p_fdec[1+ch] + 4*x + 4*y*FDEC_STRIDE;
-                nz = h->zigzagf.sub_4x4ac( h->dct.luma4x4[16+i8+ch*4], p_fenc, p_fdec, &dc );
-                h->mb.cache.non_zero_count[x264_scan8[16+i8+ch*4]] = nz;
+                nz = h->zigzagf.sub_4x4ac( h->dct.luma4x4[16+i8+ch*16], p_fenc, p_fdec, &dc );
+                h->mb.cache.non_zero_count[x264_scan8[16+i8+ch*16]] = nz;
             }
             h->mb.i_cbp_chroma = 0x02;
         }