diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-08 14:26:42 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2015-09-16 19:35:03 -0400 |
commit | a3df343cda2b6f3d554138ce5dae831e2f946d0c (patch) | |
tree | ec3c040c3add312e37c58f00fde4377a0554af21 /vp10/decoder | |
parent | 3c8e04e93928b978dc6df84cf0f77939d7a2e64b (diff) | |
download | libvpx-a3df343cda2b6f3d554138ce5dae831e2f946d0c.tar libvpx-a3df343cda2b6f3d554138ce5dae831e2f946d0c.tar.gz libvpx-a3df343cda2b6f3d554138ce5dae831e2f946d0c.tar.bz2 libvpx-a3df343cda2b6f3d554138ce5dae831e2f946d0c.zip |
vp10: code sign bit before absolute value in non-arithcoded header.
For reading, this makes the operation branchless, although it still
requires two shifts. For writing, this makes the operation as fast
as writing an unsigned value, branchlessly. This is also how other
codecs typically code signed, non-arithcoded bitstream elements.
See issue 1039.
Change-Id: I6a8182cc88a16842fb431688c38f6b52d7f24ead
Diffstat (limited to 'vp10/decoder')
-rw-r--r-- | vp10/decoder/decodeframe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c index d6a4e6f6a..387204bfa 100644 --- a/vp10/decoder/decodeframe.c +++ b/vp10/decoder/decodeframe.c @@ -1095,17 +1095,17 @@ static void setup_loopfilter(struct loopfilter *lf, for (i = 0; i < MAX_REF_FRAMES; i++) if (vpx_rb_read_bit(rb)) - lf->ref_deltas[i] = vpx_rb_read_signed_literal(rb, 6); + lf->ref_deltas[i] = vpx_rb_read_inv_signed_literal(rb, 6); for (i = 0; i < MAX_MODE_LF_DELTAS; i++) if (vpx_rb_read_bit(rb)) - lf->mode_deltas[i] = vpx_rb_read_signed_literal(rb, 6); + lf->mode_deltas[i] = vpx_rb_read_inv_signed_literal(rb, 6); } } } static INLINE int read_delta_q(struct vpx_read_bit_buffer *rb) { - return vpx_rb_read_bit(rb) ? vpx_rb_read_signed_literal(rb, 4) : 0; + return vpx_rb_read_bit(rb) ? vpx_rb_read_inv_signed_literal(rb, 4) : 0; } static void setup_quantization(VP10_COMMON *const cm, MACROBLOCKD *const xd, |