]> git.sesse.net Git - ffmpeg/commit
avcodec/rv10: Simplify handling of skip VLC entries
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 28 Oct 2020 12:15:15 +0000 (13:15 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Dec 2020 16:51:45 +0000 (17:51 +0100)
commite804eb0ef6f163e5f939113afbd0cc73e4dac16e
tree488efe2aca24e45fb3649c12ae1ceaf8cab650f6
parent1320d336eff2d08f82aa98301fced00178aaea0a
avcodec/rv10: Simplify handling of skip VLC entries

The VLC tables to be used for parsing RealVideo 1.0 DC coefficients are
weird: The luma table contains a block of 2^11 codes beginning with the
same prefix and length that all have the same symbol (i.e. value only
depends upon the prefix); the same goes for the chroma block (except
it's only 2^9 codes). Up until now, these entries (which generally could
be parsed like ordinary entries with subtables) have been treated
specially: They have been treated like open ends of the tree, so that
get_vlc2() returned a value < 0 upon encountering them; afterwards it
was checked whether the right prefix was used and if so, the appropriate
number of bytes was skipped.

But there is actually an easy albeit slightly hacky way to support them
directly without pointless subtables: Just modify the VLC table so that
all the entries sharing the right prefix have a length that equals the
length of the whole entry.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/rv10.c