summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2003-10-11 01:11:29 +0000
committerMike Melanson <mike@multimedia.cx>2003-10-11 01:11:29 +0000
commitb3a5d0039cb9b14421d6f1cc4fa38f316ccf9f0c (patch)
tree435ab43118078f1c2c81b1d5866a602ff5f44568 /libavcodec
parent7ac25f2d0005c337f49544fff74f69792927a920 (diff)
support a few more types of VQA files
Originally committed as revision 2349 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vqavideo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 28eea1df47..174116dbc3 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -312,6 +312,7 @@ static void vqa_decode_chunk(VqaContext *s)
int i;
unsigned char r, g, b;
unsigned int *palette32;
+ int index_shift;
int cbf0_chunk = -1;
int cbfz_chunk = -1;
@@ -462,6 +463,10 @@ static void vqa_decode_chunk(VqaContext *s)
s->decode_buffer, s->decode_buffer_size, 1);
/* render the final PAL8 frame */
+ if (s->vector_height == 4)
+ index_shift = 4;
+ else
+ index_shift = 3;
for (y = 0; y < s->frame.linesize[0] * s->height;
y += s->frame.linesize[0] * s->vector_height) {
@@ -482,7 +487,7 @@ static void vqa_decode_chunk(VqaContext *s)
lobyte = s->decode_buffer[lobytes];
hibyte = s->decode_buffer[hibytes];
vector_index = (hibyte << 8) | lobyte;
- vector_index *= 8;
+ vector_index <<= index_shift;
lines = s->vector_height;
break;