mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/vp3data: combine eob_run_base and eob_run_get_bits tables
This commit is contained in:
parent
ad2745e867
commit
b6ca032ade
|
@ -988,9 +988,9 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
|
||||||
token = get_vlc2(gb, vlc_table, 11, 3);
|
token = get_vlc2(gb, vlc_table, 11, 3);
|
||||||
/* use the token to get a zero run, a coefficient, and an eob run */
|
/* use the token to get a zero run, a coefficient, and an eob run */
|
||||||
if ((unsigned) token <= 6U) {
|
if ((unsigned) token <= 6U) {
|
||||||
eob_run = eob_run_base[token];
|
eob_run = eob_run_table[token].base;
|
||||||
if (eob_run_get_bits[token])
|
if (eob_run_table[token].bits)
|
||||||
eob_run += get_bits(gb, eob_run_get_bits[token]);
|
eob_run += get_bits(gb, eob_run_table[token].bits);
|
||||||
|
|
||||||
if (!eob_run)
|
if (!eob_run)
|
||||||
eob_run = INT_MAX;
|
eob_run = INT_MAX;
|
||||||
|
|
|
@ -198,11 +198,10 @@ static const int8_t fixed_motion_vector_table[64] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* only tokens 0..6 indicate eob runs */
|
/* only tokens 0..6 indicate eob runs */
|
||||||
static const uint8_t eob_run_base[7] = {
|
static const struct {
|
||||||
1, 2, 3, 4, 8, 16, 0
|
uint8_t base, bits;
|
||||||
};
|
} eob_run_table[7] = {
|
||||||
static const uint8_t eob_run_get_bits[7] = {
|
{1, 0}, {2, 0}, {3, 0}, {4, 2}, {8, 3}, {16, 4}, {0, 12}
|
||||||
0, 0, 0, 2, 3, 4, 12
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t zero_run_base[32] = {
|
static const uint8_t zero_run_base[32] = {
|
||||||
|
|
Loading…
Reference in New Issue