summaryrefslogtreecommitdiff
path: root/libavcodec/ituh263dec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-28 09:12:08 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-08 17:51:45 +0100
commitdaf8b10eeb9c789cad5c2c263493249950c6f55f (patch)
tree0ed263eb134f2871968bbc569c58bbba27c36dd7 /libavcodec/ituh263dec.c
parentdf3269f5f74ff8ab976d00927a55a2940cc2255f (diff)
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>
Diffstat (limited to 'libavcodec/ituh263dec.c')
-rw-r--r--libavcodec/ituh263dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index c1005b0994..ced7fa52ee 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -467,7 +467,7 @@ static int h263_decode_block(MpegEncContext * s, int16_t * block,
level = s->last_dc[component];
if (s->rv10_first_dc_coded[component]) {
diff = ff_rv_decode_dc(s, n);
- if (diff == 0xffff)
+ if (diff < 0)
return -1;
level += diff;
level = level & 0xff; /* handle wrap round */