]> granicus.if.org Git - libx264/commitdiff
Properly weight slice header lambda in chroma weightp analysis
authorFiona Glaser <fiona@x264.com>
Mon, 20 Jun 2011 23:20:21 +0000 (16:20 -0700)
committerFiona Glaser <fiona@x264.com>
Sun, 10 Jul 2011 04:15:48 +0000 (21:15 -0700)
encoder/slicetype.c

index 35483338b08eef672d72f297fd0e1f71e972d12a..7cfd90b9f84cdd61967f3a2d3028250151f02767 100644 (file)
@@ -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;