summaryrefslogtreecommitdiff
path: root/libavcodec/vqavideo.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2003-10-30 05:40:58 +0000
committerMike Melanson <mike@multimedia.cx>2003-10-30 05:40:58 +0000
commit2a2bbcb05fde486eef76d070f26eecddd4de0ace (patch)
tree781c3c83552a80cb71014d3ff66ff05df14f5f7e /libavcodec/vqavideo.c
parent9df1d2490d61c273a3ac9573c49cf4d20b4d750e (diff)
revised palette API, courtesy of Roberto Togni (rtogni at freemail.it)
Originally committed as revision 2451 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vqavideo.c')
-rw-r--r--libavcodec/vqavideo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 174116dbc3..8f4ac173f3 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -120,7 +120,7 @@ typedef struct VqaContext {
unsigned char *buf;
int size;
- unsigned char palette[PALETTE_COUNT * 4];
+ unsigned int palette[PALETTE_COUNT];
int width; /* width of a frame */
int height; /* height of a frame */
@@ -311,7 +311,6 @@ static void vqa_decode_chunk(VqaContext *s)
unsigned int index = 0;
int i;
unsigned char r, g, b;
- unsigned int *palette32;
int index_shift;
int cbf0_chunk = -1;
@@ -407,13 +406,12 @@ static void vqa_decode_chunk(VqaContext *s)
return;
}
cpl0_chunk += CHUNK_PREAMBLE_SIZE;
- palette32 = (unsigned int *)s->palette;
for (i = 0; i < chunk_size / 3; i++) {
/* scale by 4 to transform 6-bit palette -> 8-bit */
r = s->buf[cpl0_chunk++] * 4;
g = s->buf[cpl0_chunk++] * 4;
b = s->buf[cpl0_chunk++] * 4;
- palette32[i] = (r << 16) | (g << 8) | (b);
+ s->palette[i] = (r << 16) | (g << 8) | (b);
}
}
@@ -583,6 +581,7 @@ static int vqa_decode_frame(AVCodecContext *avctx,
/* make the palette available on the way out */
memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4);
+ s->frame.palette_has_changed = 1;
*data_size = sizeof(AVFrame);
*(AVFrame*)data = s->frame;