From 2c124cb65c24cc7d0538260726045d68442eef25 Mon Sep 17 00:00:00 2001 From: Ramiro Polla Date: Sat, 2 Jun 2007 01:41:07 +0000 Subject: Use AV_xx throughout libavcodec Originally committed as revision 9169 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ulti.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'libavcodec/ulti.c') diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index 5c6ba00114..c2439c4d16 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -31,6 +31,7 @@ #include #include "avcodec.h" +#include "bytestream.h" #include "ulti_cb.h" @@ -305,9 +306,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, case 2: if (modifier) { // unpack four luma samples - tmp = (*buf++) << 16; - tmp += (*buf++) << 8; - tmp += *buf++; + tmp = bytestream_get_be24(&buf); Y[0] = (tmp >> 18) & 0x3F; Y[1] = (tmp >> 12) & 0x3F; @@ -315,8 +314,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, Y[3] = tmp & 0x3F; angle = 16; } else { // retrieve luma samples from codebook - tmp = (*buf++) << 8; - tmp += (*buf++); + tmp = bytestream_get_be16(&buf); angle = (tmp >> 12) & 0xF; tmp &= 0xFFF; @@ -332,33 +330,25 @@ static int ulti_decode_frame(AVCodecContext *avctx, if (modifier) { // all 16 luma samples uint8_t Luma[16]; - tmp = (*buf++) << 16; - tmp += (*buf++) << 8; - tmp += *buf++; + tmp = bytestream_get_be24(&buf); Luma[0] = (tmp >> 18) & 0x3F; Luma[1] = (tmp >> 12) & 0x3F; Luma[2] = (tmp >> 6) & 0x3F; Luma[3] = tmp & 0x3F; - tmp = (*buf++) << 16; - tmp += (*buf++) << 8; - tmp += *buf++; + tmp = bytestream_get_be24(&buf); Luma[4] = (tmp >> 18) & 0x3F; Luma[5] = (tmp >> 12) & 0x3F; Luma[6] = (tmp >> 6) & 0x3F; Luma[7] = tmp & 0x3F; - tmp = (*buf++) << 16; - tmp += (*buf++) << 8; - tmp += *buf++; + tmp = bytestream_get_be24(&buf); Luma[8] = (tmp >> 18) & 0x3F; Luma[9] = (tmp >> 12) & 0x3F; Luma[10] = (tmp >> 6) & 0x3F; Luma[11] = tmp & 0x3F; - tmp = (*buf++) << 16; - tmp += (*buf++) << 8; - tmp += *buf++; + tmp = bytestream_get_be24(&buf); Luma[12] = (tmp >> 18) & 0x3F; Luma[13] = (tmp >> 12) & 0x3F; Luma[14] = (tmp >> 6) & 0x3F; -- cgit v1.2.3