[x264-devel] Fix a bug in lossless sub-8x8 RD

Jason Garrett-Glaser git at videolan.org
Sat Jul 30 05:54:45 CEST 2011


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Tue Jul 26 07:40:23 2011 -0700| [c28471e2500a6071aab8f9c3adac104f201e5f2a] | committer: Jason Garrett-Glaser

Fix a bug in lossless sub-8x8 RD
Caused crashes in rare cases with lossless encoding.  Regression in 4:4:4.

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

 encoder/macroblock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/encoder/macroblock.c b/encoder/macroblock.c
index 85521df..7b772c4 100644
--- a/encoder/macroblock.c
+++ b/encoder/macroblock.c
@@ -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;
         }



More information about the x264-devel mailing list