Commit 14ba7472 authored by Janne Salonen's avatar Janne Salonen Committed by Ronald S. Bultje

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: 's avatarJanne Salonen <jsalonen@google.com>
Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent 494bce62
......@@ -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)
......
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