Fix chroma intra analysis in 4:4:4 lossless mode
authorAnton Mitrofanov <BugMaster@narod.ru>
Sun, 9 Oct 2011 15:14:16 +0000 (19:14 +0400)
committerFiona Glaser <fiona@x264.com>
Sun, 9 Oct 2011 19:40:46 +0000 (12:40 -0700)
encoder/analyse.c

index 537b829..a324335 100644 (file)
@@ -702,8 +702,16 @@ static void x264_mb_analyse_intra_chroma( x264_t *h, x264_mb_analysis_t *a )
         }
 
         /* Cheap approximation of chroma costs to avoid a full i4x4/i8x8 analysis. */
-        h->predict_16x16[a->i_predict16x16]( h->mb.pic.p_fdec[1] );
-        h->predict_16x16[a->i_predict16x16]( h->mb.pic.p_fdec[2] );
+        if( h->mb.b_lossless )
+        {
+            x264_predict_lossless_16x16( h, 1, a->i_predict16x16 );
+            x264_predict_lossless_16x16( h, 2, a->i_predict16x16 );
+        }
+        else
+        {
+            h->predict_16x16[a->i_predict16x16]( h->mb.pic.p_fdec[1] );
+            h->predict_16x16[a->i_predict16x16]( h->mb.pic.p_fdec[2] );
+        }
         a->i_satd_chroma = h->pixf.mbcmp[PIXEL_16x16]( h->mb.pic.p_fdec[1], FDEC_STRIDE, h->mb.pic.p_fenc[1], FENC_STRIDE )
                          + h->pixf.mbcmp[PIXEL_16x16]( h->mb.pic.p_fdec[2], FDEC_STRIDE, h->mb.pic.p_fenc[2], FENC_STRIDE );
         return;