From 2809cb6ce63817a58c5639642fe05bc50747e126 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Mon, 20 Jun 2011 16:20:21 -0700 Subject: [PATCH] Properly weight slice header lambda in chroma weightp analysis --- encoder/slicetype.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/encoder/slicetype.c b/encoder/slicetype.c index d6240b3c..39721898 100644 --- a/encoder/slicetype.c +++ b/encoder/slicetype.c @@ -136,6 +136,9 @@ static int x264_weight_slice_header_cost( x264_t *h, x264_weight_t *w, int b_chr { /* Add cost of weights in the slice header. */ int lambda = x264_lambda_tab[X264_LOOKAHEAD_QP]; + /* 4 times higher, because chroma is analyzed at full resolution. */ + if( b_chroma ) + lambda *= 4; int numslices; if( h->param.i_slice_count ) numslices = h->param.i_slice_count; -- 2.47.3