summaryrefslogtreecommitdiff
path: root/libavcodec/interplayvideo.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2007-06-02 01:41:07 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2007-06-02 01:41:07 +0000
commit2c124cb65c24cc7d0538260726045d68442eef25 (patch)
tree3752a8d02aa478d977264e8ce0438f49c92a4aca /libavcodec/interplayvideo.c
parent29b29011e5631c4e867baf42258a00886d142841 (diff)
Use AV_xx throughout libavcodec
Originally committed as revision 9169 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/interplayvideo.c')
-rw-r--r--libavcodec/interplayvideo.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index 32406f76d7..bce3a9a430 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -41,6 +41,7 @@
#include <unistd.h>
#include "avcodec.h"
+#include "bytestream.h"
#include "dsputil.h"
#define PALETTE_COUNT 256
@@ -297,10 +298,8 @@ static int ipvideo_decode_block_opcode_0x7(IpvideoContext *s)
/* need 2 more bytes from the stream */
CHECK_STREAM_PTR(2);
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
- flags = (B[1] << 8) | B[0];
+ flags = bytestream_get_le16(&s->stream_ptr);
bitmask = 0x0001;
for (y = 0; y < 8; y += 2) {
for (x = 0; x < 8; x += 2, bitmask <<= 1) {
@@ -478,7 +477,6 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
{
int x, y;
unsigned char P[4];
- unsigned char B[4];
unsigned int flags = 0;
int shifter = 0;
unsigned char pix;
@@ -496,8 +494,7 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
for (y = 0; y < 8; y++) {
/* get the next set of 8 2-bit flags */
- flags = (s->stream_ptr[1] << 8) | s->stream_ptr[0];
- s->stream_ptr += 2;
+ flags = bytestream_get_le16(&s->stream_ptr);
for (x = 0, shifter = 0; x < 8; x++, shifter += 2) {
*s->pixel_ptr++ = P[(flags >> shifter) & 0x03];
}
@@ -509,11 +506,7 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
/* 1 of 4 colors for each 2x2 block, need 4 more bytes */
CHECK_STREAM_PTR(4);
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++;
- B[3] = *s->stream_ptr++;
- flags = (B[3] << 24) | (B[2] << 16) | (B[1] << 8) | B[0];
+ flags = bytestream_get_le32(&s->stream_ptr);
shifter = 0;
for (y = 0; y < 8; y += 2) {
@@ -535,11 +528,7 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
for (y = 0; y < 8; y++) {
/* time to reload flags? */
if ((y == 0) || (y == 4)) {
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++;
- B[3] = *s->stream_ptr++;
- flags = (B[3] << 24) | (B[2] << 16) | (B[1] << 8) | B[0];
+ flags = bytestream_get_le32(&s->stream_ptr);
shifter = 0;
}
for (x = 0; x < 8; x += 2, shifter += 2) {
@@ -558,11 +547,7 @@ static int ipvideo_decode_block_opcode_0x9(IpvideoContext *s)
for (y = 0; y < 8; y += 2) {
/* time to reload flags? */
if ((y == 0) || (y == 4)) {
- B[0] = *s->stream_ptr++;
- B[1] = *s->stream_ptr++;
- B[2] = *s->stream_ptr++;
- B[3] = *s->stream_ptr++;
- flags = (B[3] << 24) | (B[2] << 16) | (B[1] << 8) | B[0];
+ flags = bytestream_get_le32(&s->stream_ptr);
shifter = 0;
}
for (x = 0; x < 8; x++, shifter += 2) {