Commit e5e15eb3 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Adding vp9_rb_read_signed_literal function.

Change-Id: I30ea91561ffac7e5065ba41b2d3ab7dedb720593
parent 993942ce
...@@ -512,29 +512,21 @@ static void setup_loopfilter(VP9D_COMP *pbi, struct vp9_read_bit_buffer *rb) { ...@@ -512,29 +512,21 @@ static void setup_loopfilter(VP9D_COMP *pbi, struct vp9_read_bit_buffer *rb) {
if (xd->mode_ref_lf_delta_update) { if (xd->mode_ref_lf_delta_update) {
int i; int i;
for (i = 0; i < MAX_REF_LF_DELTAS; i++) { for (i = 0; i < MAX_REF_LF_DELTAS; i++)
if (vp9_rb_read_bit(rb)) { if (vp9_rb_read_bit(rb))
const int value = vp9_rb_read_literal(rb, 6); xd->ref_lf_deltas[i] = vp9_rb_read_signed_literal(rb, 6);
xd->ref_lf_deltas[i] = vp9_rb_read_bit(rb) ? -value : value;
}
}
for (i = 0; i < MAX_MODE_LF_DELTAS; i++) { for (i = 0; i < MAX_MODE_LF_DELTAS; i++)
if (vp9_rb_read_bit(rb)) { if (vp9_rb_read_bit(rb))
const int value = vp9_rb_read_literal(rb, 6); xd->mode_lf_deltas[i] = vp9_rb_read_signed_literal(rb, 6);
xd->mode_lf_deltas[i] = vp9_rb_read_bit(rb) ? -value : value;
}
}
} }
} }
} }
static int read_delta_q(struct vp9_read_bit_buffer *rb, int *delta_q) { static int read_delta_q(struct vp9_read_bit_buffer *rb, int *delta_q) {
const int old = *delta_q; const int old = *delta_q;
if (vp9_rb_read_bit(rb)) { if (vp9_rb_read_bit(rb))
const int value = vp9_rb_read_literal(rb, 4); *delta_q = vp9_rb_read_signed_literal(rb, 4);
*delta_q = vp9_rb_read_bit(rb) ? -value : value;
}
return old != *delta_q; return old != *delta_q;
} }
......
...@@ -51,4 +51,10 @@ static int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits) { ...@@ -51,4 +51,10 @@ static int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits) {
return value; return value;
} }
static int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb,
int bits) {
const int value = vp9_rb_read_literal(rb, bits);
return vp9_rb_read_bit(rb) ? -value : value;
}
#endif // VP9_READ_BIT_BUFFER_ #endif // VP9_READ_BIT_BUFFER_
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