aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/interplayvideo.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-03-31 14:04:54 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-03-31 14:04:54 +0000
commit268a618ba6f94f01fe8762de13fa7c29d50e9cdc (patch)
treecd478feb1506197f3ec76b53a235e7bc2876c82b /libavcodec/interplayvideo.c
parent168fffdf0194989d4c8a01d89b8ef2fbdd90e287 (diff)
downloadffmpeg-268a618ba6f94f01fe8762de13fa7c29d50e9cdc.tar.gz
Rearrange how the different cases are checked to reduce the number of
comparisons and allow further simplifications. Originally committed as revision 18268 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/interplayvideo.c')
-rw-r--r--libavcodec/interplayvideo.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index 12a3223e2a..ac0656c5d5 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -386,7 +386,8 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
memcpy(P, s->stream_ptr, 4);
s->stream_ptr += 4;
- if ((P[0] <= P[1]) && (P[2] <= P[3])) {
+ if (P[0] <= P[1]) {
+ if (P[2] <= P[3]) {
/* 1 of 4 colors for each pixel, need 16 more bytes */
CHECK_STREAM_PTR(16);
@@ -400,7 +401,7 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
s->pixel_ptr += s->line_inc;
}
- } else if ((P[0] <= P[1]) && (P[2] > P[3])) {
+ } else {
uint32_t flags;
/* 1 of 4 colors for each 2x2 block, need 4 more bytes */
@@ -418,7 +419,9 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
s->pixel_ptr += s->stride * 2;
}
- } else if ((P[0] > P[1]) && (P[2] <= P[3])) {
+ }
+ } else {
+ if (P[2] <= P[3]) {
uint64_t flags;
/* 1 of 4 colors for each 2x1 block, need 8 more bytes */
@@ -432,8 +435,7 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
}
s->pixel_ptr += s->stride;
}
-
- } else {
+ } else {
uint64_t flags;
/* 1 of 4 colors for each 1x2 block, need 8 more bytes */
@@ -447,6 +449,7 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
}
s->pixel_ptr += s->stride * 2;
}
+ }
}
/* report success */