aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/indeo2.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-12 03:49:05 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-10-12 22:06:28 +0200
commit57eee75c3fd075e555df122f1abc45ca636a2726 (patch)
tree0dad19be0e6f3b59b27915851a8d368ee3c69e54 /libavcodec/indeo2.c
parentb9727870ae26eadbaa443828d856f33c79938579 (diff)
downloadffmpeg-57eee75c3fd075e555df122f1abc45ca636a2726.tar.gz
avcodec/indeo2: Remove #ifdef BITSTREAM_READER_LE cruft
Before the LE bitstream reader was used in the Indeo 2 decoder, a standard BE bitstream reader with swapped bits was used; when the LE bitstream reader was added, the old code was only #ifdef'ed away and not removed. Said code has several problems: It modifies the input packet without ensuring that the packet is indeed writable; and it doesn't work since 09c4e5c5988c0037d108c5fc2a137d9ad488f7f4 because said commit removed the BE table used to initialize the VLC table. So just remove this cruft from the actual decoder, too. Also use INIT_LE_VLC_STATIC while at it. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/indeo2.c')
-rw-r--r--libavcodec/indeo2.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index ccf6cd84cb..7a568bfbc4 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -174,10 +174,6 @@ static int ir2_decode_frame(AVCodecContext *avctx,
s->decode_delta = buf[18];
/* decide whether frame uses deltas or not */
-#ifndef BITSTREAM_READER_LE
- for (i = 0; i < buf_size; i++)
- buf[i] = ff_reverse[buf[i]];
-#endif
if ((ret = init_get_bits8(&s->gb, buf + start, buf_size - start)) < 0)
return ret;
@@ -232,7 +228,6 @@ static int ir2_decode_frame(AVCodecContext *avctx,
static av_cold int ir2_decode_init(AVCodecContext *avctx)
{
Ir2Context * const ic = avctx->priv_data;
- static VLC_TYPE vlc_tables[1 << CODE_VLC_BITS][2];
ic->avctx = avctx;
@@ -242,17 +237,9 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx)
if (!ic->picture)
return AVERROR(ENOMEM);
- ir2_vlc.table = vlc_tables;
- ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;
-#ifdef BITSTREAM_READER_LE
- init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
- &ir2_codes[0][1], 4, 2,
- &ir2_codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);
-#else
- init_vlc(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
- &ir2_codes[0][1], 4, 2,
- &ir2_codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
-#endif
+ INIT_LE_VLC_STATIC(&ir2_vlc, CODE_VLC_BITS, IR2_CODES,
+ &ir2_codes[0][1], 4, 2,
+ &ir2_codes[0][0], 4, 2, 1 << CODE_VLC_BITS);
return 0;
}