Commit b07a2a8e authored by Yaowu Xu's avatar Yaowu Xu

misc-fix: code sign bit before magnitude

This commit merges the fix that changes the coding order between sign
and magnitude to be sign first, magnitude later.

Related tracking issue:
Original libvpx commit:

Change-Id: Ifde537a1deea9baecba39923256310ee3309829e
parent 103f3000
......@@ -41,11 +41,7 @@ int aom_rb_read_signed_literal(struct aom_read_bit_buffer *rb, int bits) {
int aom_rb_read_inv_signed_literal(struct aom_read_bit_buffer *rb, int bits) {
const int nbits = sizeof(unsigned) * 8 - bits - 1;
const unsigned value = (unsigned)aom_rb_read_literal(rb, bits + 1) << nbits;
return ((int)value) >> nbits;
return aom_rb_read_signed_literal(rb, bits);
......@@ -39,10 +39,5 @@ void aom_wb_write_literal(struct aom_write_bit_buffer *wb, int data, int bits) {
void aom_wb_write_inv_signed_literal(struct aom_write_bit_buffer *wb, int data,
int bits) {
aom_wb_write_literal(wb, data, bits + 1);
aom_wb_write_literal(wb, abs(data), bits);
aom_wb_write_bit(wb, data < 0);
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