]> git.sesse.net Git - ffmpeg/commit
avcodec/rv10: Use symbol table more effectively
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 28 Oct 2020 08:12:08 +0000 (09:12 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Dec 2020 16:51:45 +0000 (17:51 +0100)
commitdaf8b10eeb9c789cad5c2c263493249950c6f55f
tree0ed263eb134f2871968bbc569c58bbba27c36dd7
parentdf3269f5f74ff8ab976d00927a55a2940cc2255f
avcodec/rv10: Use symbol table more effectively

The RealVideo 1.0 decoder uses VLCs to parse DC coefficients. But the
values returned from get_vlc2() are not directly used; instead
-(val - 128) (which is in the range -127..128) is. This transformation
is unnecessary as it can effectively be done when initializing the VLC
by modifying the symbols table used. There is just one minor
complication: The chroma table is incomplete and in order to distinguish
an error from get_vlc2() (due to an invalid code) the ordinary return
range is modified to 0..255. This is possible because the only caller of
this function is (on success) only interested in the return value modulo
256.

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