[x264-devel] commit: Fix regression in chroma weightp (Anton Mitrofanov )
git at videolan.org
git at videolan.org
Mon Nov 22 16:06:24 CET 2010
x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Mon Nov 22 17:17:36 2010 +0300| [af1a7413afbea7b6a2159b644144b2dcac3482a3] | committer: Jason Garrett-Glaser
Fix regression in chroma weightp
Missing cache calls could cause artifacts, encoder/decoder desync.
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=af1a7413afbea7b6a2159b644144b2dcac3482a3
---
encoder/encoder.c | 3 ++-
encoder/slicetype.c | 3 +++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/encoder/encoder.c b/encoder/encoder.c
index 6cfef3c..8b14b41 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -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 )
diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index 450cc5c..edf74c4 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -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] );
}
}
More information about the x264-devel
mailing list