From 9ac39f6078659f4f5cf548460dec940a04fd52c8 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Sun, 9 Oct 2011 19:14:16 +0400 Subject: [PATCH] Fix chroma intra analysis in 4:4:4 lossless mode --- encoder/analyse.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/encoder/analyse.c b/encoder/analyse.c index 537b8292..a3243351 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -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; -- 2.40.0