diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-12-27 18:26:31 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-12-27 18:26:31 +0100 |
commit | ec0dc7e2e029a53023e8ed9eb79c870131773c7b (patch) | |
tree | 0b2fc050bea8c2a5dd41e8ae9c47cfc9071498a5 /libavformat/ipmovie.c | |
parent | 387d86077f5237e53cec7a4ed31f5531224feebf (diff) | |
download | ffmpeg-ec0dc7e2e029a53023e8ed9eb79c870131773c7b.tar.gz |
Make Interplay palette opaque and increase its dynamics.
Diffstat (limited to 'libavformat/ipmovie.c')
-rw-r--r-- | libavformat/ipmovie.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index 24dc24bec8..bb42a12e62 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -456,7 +456,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, r = scratch[j++] * 4; g = scratch[j++] * 4; b = scratch[j++] * 4; - s->palette[i] = (r << 16) | (g << 8) | (b); + s->palette[i] = (0xFFU << 24) | (r << 16) | (g << 8) | (b); + s->palette[i] |= s->palette[i] >> 6 & 0x30303; } s->has_palette = 1; break; @@ -524,7 +525,7 @@ static int ipmovie_read_header(AVFormatContext *s, AVPacket pkt; AVStream *st; unsigned char chunk_preamble[CHUNK_PREAMBLE_SIZE]; - int chunk_type; + int chunk_type, i; uint8_t signature_buffer[sizeof(signature)]; avio_read(pb, signature_buffer, sizeof(signature_buffer)); @@ -542,6 +543,9 @@ static int ipmovie_read_header(AVFormatContext *s, /* on the first read, this will position the stream at the first chunk */ ipmovie->next_chunk_offset = avio_tell(pb) + 4; + for (i = 0; i < 256; i++) + ipmovie->palette[i] = 0xFFU << 24; + /* process the first chunk which should be CHUNK_INIT_VIDEO */ if (process_ipmovie_chunk(ipmovie, pb, &pkt) != CHUNK_INIT_VIDEO) return AVERROR_INVALIDDATA; |