aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp8.c
diff options
context:
space:
mode:
authorJanne Salonen <jsalonen@google.com>2012-03-19 09:35:09 +0200
committerRonald S. Bultje <rsbultje@gmail.com>2012-03-24 08:22:05 -0700
commit14ba7472dca38323104d05a3eacd0eb2890b00c6 (patch)
tree93d2e7e56d966a7e4cfbcd73641f949ea179a39d /libavcodec/vp8.c
parent494bce6224c7da6a174fb16a49ed26e5aab32af1 (diff)
downloadffmpeg-14ba7472dca38323104d05a3eacd0eb2890b00c6.tar.gz
vp8: fix update_lf_deltas in libavcodec/vp8.c
lf_delta.ref[i] and lf_delta.mode[i] were incorrectly reset to 0 if specific delta value was not updated. Fixed to keep the previous value if flag indicates that element in question is not updated. Signed-off-by: Janne Salonen <jsalonen@google.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r--libavcodec/vp8.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 36518d5f7e..6da835b2d1 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -162,11 +162,23 @@ static void update_lf_deltas(VP8Context *s)
VP56RangeCoder *c = &s->c;
int i;
- for (i = 0; i < 4; i++)
- s->lf_delta.ref[i] = vp8_rac_get_sint(c, 6);
+ for (i = 0; i < 4; i++) {
+ if (vp8_rac_get(c)) {
+ s->lf_delta.ref[i] = vp8_rac_get_uint(c, 6);
+
+ if (vp8_rac_get(c))
+ s->lf_delta.ref[i] = -s->lf_delta.ref[i];
+ }
+ }
+
+ for (i = MODE_I4x4; i <= VP8_MVMODE_SPLIT; i++) {
+ if (vp8_rac_get(c)) {
+ s->lf_delta.mode[i] = vp8_rac_get_uint(c, 6);
- for (i = MODE_I4x4; i <= VP8_MVMODE_SPLIT; i++)
- s->lf_delta.mode[i] = vp8_rac_get_sint(c, 6);
+ if (vp8_rac_get(c))
+ s->lf_delta.mode[i] = -s->lf_delta.mode[i];
+ }
+ }
}
static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size)