Change bitreader to use a larger window.
authorTimothy B. Terriberry <tterribe@xiph.org>
Wed, 5 May 2010 21:58:19 +0000 (17:58 -0400)
committerTimothy B. Terriberry <tterribe@xiph.org>
Wed, 16 Jun 2010 02:55:14 +0000 (19:55 -0700)
commitc17b62e1bd8fe9335ba247061c072b10392e88a7
treece9b28fcd55dd269215e4d9901e1dd179ece3c66
parentec1871554b4793ad274ed8ae764ff5044d75e0d4
Change bitreader to use a larger window.

Change bitreading functions to use a larger window which is refilled less
 often.

This makes it cheap enough to do bounds checking each time the window is
 refilled, which avoids the need to copy the input into a large circular
 buffer.
This uses less memory and speeds up the total decode time by 1.6% on an ARM11,
 2.8% on a Cortex A8, and 2.2% on x86-32, but less than 1% on x86-64.

Inlining vp8dx_bool_decoder_fill() has a big penalty on x86-32, as does moving
 the refill loop to the front of vp8dx_decode_bool().
However, having the refill loop between computation of the split values and
 the branch in vp8_decode_mb_tokens() is a big win on ARM (presumably due to
 memory latency and code size: refilling after normalization duplicates the
 code in the DECODE_AND_BRANCH_IF_ZERO and DECODE_AND_LOOP_IF_ZERO cases.
Unfortunately, refilling at the end of vp8dx_bool_decoder_fill() and at the
 beginning of each decode step in vp8_decode_mb_tokens() means the latter
 requires an extra refill at the end.
Platform-specific versions could avoid the problem, but would require most of
 detokenize.c to be duplicated.

Change-Id: I16c782a63376f2a15b78f8086d899b987204c1c7
vp8/common/arm/vpx_asm_offsets.c
vp8/decoder/arm/dboolhuff_arm.h
vp8/decoder/arm/dsystemdependent.c
vp8/decoder/dboolhuff.c
vp8/decoder/dboolhuff.h
vp8/decoder/decodemv.c
vp8/decoder/decodframe.c
vp8/decoder/demode.c
vp8/decoder/detokenize.c
vp8/decoder/generic/dsystemdependent.c
vp8/decoder/threading.c