aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/interplayvideo.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-03-31 19:36:44 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-03-31 19:36:44 +0000
commit993a4423158abb2bc66b05398ed6590962a32b34 (patch)
tree8852f40a5d435e1baa69a5838ebead443bbf1c6f /libavcodec/interplayvideo.c
parent49a20ffabc08170f795681c8642d65d0ab087932 (diff)
downloadffmpeg-993a4423158abb2bc66b05398ed6590962a32b34.tar.gz
Slightly simplify ipvideo_decode_block_opcode_0xD
Originally committed as revision 18283 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/interplayvideo.c')
-rw-r--r--libavcodec/interplayvideo.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index a9bf7cd271..0dfeac66bb 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -500,24 +500,18 @@ static int ipvideo_decode_block_opcode_0xC(IpvideoContext *s)
static int ipvideo_decode_block_opcode_0xD(IpvideoContext *s)
{
int y;
- unsigned char P[4];
- unsigned char index = 0;
+ unsigned char P;
/* 4-color block encoding: each 4x4 block is a different color */
CHECK_STREAM_PTR(4);
- memcpy(P, s->stream_ptr, 4);
- s->stream_ptr += 4;
-
- for (y = 0; y < 8; y++) {
- if (y < 4)
- index = 0;
- else
- index = 2;
-
- memset(s->pixel_ptr , P[index ], 4);
- memset(s->pixel_ptr + 4, P[index + 1], 4);
+ for (y = 0; y < 16; y++) {
+ if (!(y & 3)) // start of block
+ P = *s->stream_ptr++;
+ memset(s->pixel_ptr, P, 4);
s->pixel_ptr += s->stride;
+ // switch to right half
+ if (y == 7) s->pixel_ptr -= 8 * s->stride - 4;
}
/* report success */