]> git.videolan.org Git - x264.git/commitdiff
Fix regression in chroma weightp
authorAnton Mitrofanov <BugMaster@narod.ru>
Mon, 22 Nov 2010 14:17:36 +0000 (17:17 +0300)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Mon, 22 Nov 2010 14:33:45 +0000 (06:33 -0800)
Missing cache calls could cause artifacts, encoder/decoder desync.

encoder/encoder.c
encoder/slicetype.c

index 6cfef3cdc57914e744b6c83e78a3a9b944adf98a..8b14b41d0afc1b594d1b65fe1fe67d9db8c2d4c4 100644 (file)
@@ -1537,7 +1537,8 @@ static void x264_weighted_pred_init( x264_t *h )
     if( !weightplane[0] )
         h->sh.weight[0][0].i_denom = 0;
     if( !weightplane[1] )
-        h->sh.weight[0][1].i_denom = h->sh.weight[0][2].i_denom = 0;
+        h->sh.weight[0][1].i_denom = 0;
+    h->sh.weight[0][2].i_denom = h->sh.weight[0][1].i_denom;
 }
 
 static inline void x264_reference_build_list( x264_t *h, int i_poc )
index 450cc5c19dcb8de8a1ccbe6c4a7ea4fd9f59a763..edf74c49422222fd2c60e767b6e83cdc66654dd6 100644 (file)
@@ -262,6 +262,8 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
         }
         else
             x264_weight_get_h264( round( guess_scale * 128 ), 0, &weights[plane] );
+        if( weights[plane].weightfn )
+            h->mc.weight_cache( h, &weights[plane] );
 
         found = 0;
         mindenom = weights[plane].i_denom;
@@ -333,6 +335,7 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
         {
             weights[i].i_scale = x264_clip3( weights[i].i_scale >> ( weights[i].i_denom - denom ), 0, 255 );
             weights[i].i_denom = denom;
+            h->mc.weight_cache( h, &weights[i] );
         }
     }