Browse Source

Fix ipvideo_decode_block_opcode_0xD again.

Originally committed as revision 18289 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Reimar Döffinger 16 years ago
parent
commit
8514f8427f
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      libavcodec/interplayvideo.c

+ 8
- 7
libavcodec/interplayvideo.c View File

@@ -493,18 +493,19 @@ static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s)
{
int y;
unsigned char P;
unsigned char P[2];

/* 4-color block encoding: each 4x4 block is a different color */
CHECK_STREAM_PTR(4);

for (y = 0; y < 16; y++) {
if (!(y & 3)) // start of block
P = *s->stream_ptr++;
memset(s->pixel_ptr, P, 4);
for (y = 0; y < 8; y++) {
if (!(y & 3)) {
P[0] = *s->stream_ptr++;
P[1] = *s->stream_ptr++;
}
memset(s->pixel_ptr, P[0], 4);
memset(s->pixel_ptr + 4, P[1], 4);
s->pixel_ptr += s->stride;
// switch to right half
if (y == 7) s->pixel_ptr -= 8 * s->stride - 4;
}

/* report success */


Loading…
Cancel
Save