diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-04-17 19:28:36 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-04-17 19:28:36 +0000 |
commit | 6000439ca4ddbe14304b2ca75f25d3b7d67ba700 (patch) | |
tree | ba05ae12dbe072ff90535236483e0566efcce6f0 | |
parent | 28ab90edde2353d5367fbbc4d00519f9924f75ab (diff) | |
download | ffmpeg-6000439ca4ddbe14304b2ca75f25d3b7d67ba700.tar.gz |
Simplify ipvideo_decode_opcodes by using get_bits, this might be slower
but is not performance-critical anyway.
Originally committed as revision 18593 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/interplayvideo.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 67df4b363d..6ef560c940 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -42,6 +42,8 @@ #include "avcodec.h" #include "bytestream.h" #include "dsputil.h" +#define ALT_BITSTREAM_READER_LE +#include "get_bits.h" #define PALETTE_COUNT 256 @@ -566,10 +568,10 @@ static int (* const ipvideo_decode_block[])(IpvideoContext *s) = { static void ipvideo_decode_opcodes(IpvideoContext *s) { int x, y; - int index = 0; unsigned char opcode; int ret; static int frame = 0; + GetBitContext gb; debug_interplay("------------------ frame %d\n", frame); frame++; @@ -584,15 +586,10 @@ static void ipvideo_decode_opcodes(IpvideoContext *s) s->upper_motion_limit_offset = (s->avctx->height - 8) * s->stride + s->avctx->width - 8; + init_get_bits(&gb, s->decoding_map, s->decoding_map_size * 8); for (y = 0; y < (s->stride * s->avctx->height); y += s->stride * 8) { for (x = y; x < y + s->avctx->width; x += 8) { - /* bottom nibble first, then top nibble (which makes it - * hard to use a GetBitcontext) */ - if (index & 1) - opcode = s->decoding_map[index >> 1] >> 4; - else - opcode = s->decoding_map[index >> 1] & 0xF; - index++; + opcode = get_bits(&gb, 4); debug_interplay(" block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n", x - y, y / s->stride, opcode, s->stream_ptr); |