Mercurial > libavcodec.hg
diff ulti.c @ 5089:bff60ecc02f9 libavcodec
Use AV_xx throughout libavcodec
author | ramiro |
---|---|
date | Sat, 02 Jun 2007 01:41:07 +0000 |
parents | f99e40a7155b |
children | 2b72f9bc4f06 |
line wrap: on
line diff
--- a/ulti.c Fri Jun 01 21:17:05 2007 +0000 +++ b/ulti.c Sat Jun 02 01:41:07 2007 +0000 @@ -31,6 +31,7 @@ #include <unistd.h> #include "avcodec.h" +#include "bytestream.h" #include "ulti_cb.h" @@ -305,9 +306,7 @@ 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 @@ 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 @@ 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;