mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
vble: use LUT for vble_read_reverse_unary()
slightly faster Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c5e55e214c
commit
35fd7b2968
@ -40,11 +40,21 @@ typedef struct {
|
||||
|
||||
static uint8_t vble_read_reverse_unary(GetBitContext *gb)
|
||||
{
|
||||
static const uint8_t LUT[256] = {
|
||||
8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
|
||||
};
|
||||
/* At most we need to read 9 bits total to get indices up to 8 */
|
||||
int val = show_bits(gb, 8);
|
||||
|
||||
if (val) {
|
||||
val = 7 - av_log2_16bit(av_reverse[val]);
|
||||
val = LUT[val];
|
||||
skip_bits(gb, val + 1);
|
||||
return val;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user