Commit d9421c20 authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Fiona Glaser

Fix regression in chroma weightp

Missing cache calls could cause artifacts, encoder/decoder desync.
parent 729d9bcc
......@@ -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 )
......
......@@ -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] );
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment