Adding vp9_rb_read_signed_literal function.

Change-Id: I30ea91561ffac7e5065ba41b2d3ab7dedb720593
This commit is contained in:
Dmitry Kovalev 2013-07-01 02:09:36 -07:00
parent 993942ce0c
commit e5e15eb38e
2 changed files with 14 additions and 16 deletions

View File

@ -512,29 +512,21 @@ static void setup_loopfilter(VP9D_COMP *pbi, struct vp9_read_bit_buffer *rb) {
if (xd->mode_ref_lf_delta_update) {
int i;
for (i = 0; i < MAX_REF_LF_DELTAS; i++) {
if (vp9_rb_read_bit(rb)) {
const int value = vp9_rb_read_literal(rb, 6);
xd->ref_lf_deltas[i] = vp9_rb_read_bit(rb) ? -value : value;
}
}
for (i = 0; i < MAX_REF_LF_DELTAS; i++)
if (vp9_rb_read_bit(rb))
xd->ref_lf_deltas[i] = vp9_rb_read_signed_literal(rb, 6);
for (i = 0; i < MAX_MODE_LF_DELTAS; i++) {
if (vp9_rb_read_bit(rb)) {
const int value = vp9_rb_read_literal(rb, 6);
xd->mode_lf_deltas[i] = vp9_rb_read_bit(rb) ? -value : value;
}
}
for (i = 0; i < MAX_MODE_LF_DELTAS; i++)
if (vp9_rb_read_bit(rb))
xd->mode_lf_deltas[i] = vp9_rb_read_signed_literal(rb, 6);
}
}
}
static int read_delta_q(struct vp9_read_bit_buffer *rb, int *delta_q) {
const int old = *delta_q;
if (vp9_rb_read_bit(rb)) {
const int value = vp9_rb_read_literal(rb, 4);
*delta_q = vp9_rb_read_bit(rb) ? -value : value;
}
if (vp9_rb_read_bit(rb))
*delta_q = vp9_rb_read_signed_literal(rb, 4);
return old != *delta_q;
}

View File

@ -51,4 +51,10 @@ static int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits) {
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_