Commit fead30d4 authored by Alex Beregszaszi's avatar Alex Beregszaszi

rename BE/LE_8/16/32 to AV_RL/B_8/16/32

Originally committed as revision 7587 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 50eaa857
......@@ -1100,19 +1100,19 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
break;
case CODEC_ID_ADPCM_EA:
samples_in_chunk = LE_32(src);
samples_in_chunk = AV_RL32(src);
if (samples_in_chunk >= ((buf_size - 12) * 2)) {
src += buf_size;
break;
}
src += 4;
current_left_sample = (int16_t)LE_16(src);
current_left_sample = (int16_t)AV_RL16(src);
src += 2;
previous_left_sample = (int16_t)LE_16(src);
previous_left_sample = (int16_t)AV_RL16(src);
src += 2;
current_right_sample = (int16_t)LE_16(src);
current_right_sample = (int16_t)AV_RL16(src);
src += 2;
previous_right_sample = (int16_t)LE_16(src);
previous_right_sample = (int16_t)AV_RL16(src);
src += 2;
for (count1 = 0; count1 < samples_in_chunk/28;count1++) {
......
......@@ -110,11 +110,11 @@ static int alac_set_info(ALACContext *alac)
ptr += 4; /* alac */
ptr += 4; /* 0 ? */
if(BE_32(ptr) >= UINT_MAX/4){
if(AV_RB32(ptr) >= UINT_MAX/4){
av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");
return -1;
}
alac->setinfo_max_samples_per_frame = BE_32(ptr); /* buffer size / 2 ? */
alac->setinfo_max_samples_per_frame = AV_RB32(ptr); /* buffer size / 2 ? */
ptr += 4;
alac->setinfo_7a = *ptr++;
alac->setinfo_sample_size = *ptr++;
......@@ -122,13 +122,13 @@ static int alac_set_info(ALACContext *alac)
alac->setinfo_rice_initialhistory = *ptr++;
alac->setinfo_rice_kmodifier = *ptr++;
alac->setinfo_7f = *ptr++; // channels?
alac->setinfo_80 = BE_16(ptr);
alac->setinfo_80 = AV_RB16(ptr);
ptr += 2;
alac->setinfo_82 = BE_32(ptr); // max coded frame size
alac->setinfo_82 = AV_RB32(ptr); // max coded frame size
ptr += 4;
alac->setinfo_86 = BE_32(ptr); // bitrate ?
alac->setinfo_86 = AV_RB32(ptr); // bitrate ?
ptr += 4;
alac->setinfo_8a_rate = BE_32(ptr); // samplerate
alac->setinfo_8a_rate = AV_RB32(ptr); // samplerate
ptr += 4;
allocate_buffers(alac);
......
......@@ -74,8 +74,8 @@ avs_decode_frame(AVCodecContext * avctx,
int first, last;
uint32_t *pal = (uint32_t *) avs->picture.data[1];
first = LE_16(buf);
last = first + LE_16(buf + 2);
first = AV_RL16(buf);
last = first + AV_RL16(buf + 2);
buf += 4;
for (i=first; i<last; i++, buf+=3)
pal[i] = (buf[0] << 18) | (buf[1] << 10) | (buf[2] << 2);
......
......@@ -138,7 +138,7 @@ static int mp3_header_compress(AVBitStreamFilterContext *bsfc, AVCodecContext *a
return -1;
}
header = BE_32(buf);
header = AV_RB32(buf);
mode_extension= (header>>4)&3;
if(ff_mpa_check_header(header) < 0 || (header&0x60000) != 0x20000){
......@@ -160,7 +160,7 @@ output_unchanged:
av_log(avctx, AV_LOG_ERROR, "Extradata invalid\n");
return -1;
}
extraheader = BE_32(avctx->extradata+11);
extraheader = AV_RB32(avctx->extradata+11);
if((extraheader&MP3_MASK) != (header&MP3_MASK))
goto output_unchanged;
......@@ -192,7 +192,7 @@ static int mp3_header_decompress(AVBitStreamFilterContext *bsfc, AVCodecContext
int sample_rate_index=0;
int lsf, mpeg25, bitrate_index, frame_size;
header = BE_32(buf);
header = AV_RB32(buf);
if(ff_mpa_check_header(header) >= 0){
*poutbuf= (uint8_t *) buf;
*poutbuf_size= buf_size;
......@@ -205,7 +205,7 @@ static int mp3_header_decompress(AVBitStreamFilterContext *bsfc, AVCodecContext
return -1;
}
header= BE_32(avctx->extradata+11) & MP3_MASK;
header= AV_RB32(avctx->extradata+11) & MP3_MASK;
lsf = sample_rate < (24000+32000)/2;
mpeg25 = sample_rate < (12000+16000)/2;
......
......@@ -25,13 +25,13 @@
static av_always_inline unsigned int bytestream_get_le32(uint8_t **b)
{
(*b) += 4;
return LE_32(*b - 4);
return AV_RL32(*b - 4);
}
static av_always_inline unsigned int bytestream_get_le16(uint8_t **b)
{
(*b) += 2;
return LE_16(*b - 2);
return AV_RL16(*b - 2);
}
static av_always_inline unsigned int bytestream_get_byte(uint8_t **b)
......
......@@ -90,7 +90,7 @@ static void cinepak_decode_codebook (cvid_codebook_t *codebook,
if ((data + 4) > eod)
break;
flag = BE_32 (data);
flag = AV_RB32 (data);
data += 4;
mask = 0x80000000;
}
......@@ -152,7 +152,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip_t *strip,
if ((data + 4) > eod)
return -1;
flag = BE_32 (data);
flag = AV_RB32 (data);
data += 4;
mask = 0x80000000;
}
......@@ -162,7 +162,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip_t *strip,
if ((data + 4) > eod)
return -1;
flag = BE_32 (data);
flag = AV_RB32 (data);
data += 4;
mask = 0x80000000;
}
......@@ -278,8 +278,8 @@ static int cinepak_decode_strip (CinepakContext *s,
return -1;
while ((data + 4) <= eod) {
chunk_id = BE_16 (&data[0]);
chunk_size = BE_16 (&data[2]) - 4;
chunk_id = AV_RB16 (&data[0]);
chunk_size = AV_RB16 (&data[2]) - 4;
if(chunk_size < 0)
return -1;
......@@ -328,8 +328,8 @@ static int cinepak_decode (CinepakContext *s)
return -1;
frame_flags = s->data[0];
num_strips = BE_16 (&s->data[8]);
encoded_buf_size = ((s->data[1] << 16) | BE_16 (&s->data[2]));
num_strips = AV_RB16 (&s->data[8]);
encoded_buf_size = ((s->data[1] << 16) | AV_RB16 (&s->data[2]));
/* if this is the first frame, check for deviant Sega FILM data */
if (s->sega_film_skip_bytes == -1) {
......@@ -361,13 +361,13 @@ static int cinepak_decode (CinepakContext *s)
if ((s->data + 12) > eod)
return -1;
s->strips[i].id = BE_16 (s->data);
s->strips[i].id = AV_RB16 (s->data);
s->strips[i].y1 = y0;
s->strips[i].x1 = 0;
s->strips[i].y2 = y0 + BE_16 (&s->data[8]);
s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]);
s->strips[i].x2 = s->avctx->width;
strip_size = BE_16 (&s->data[2]) - 12;
strip_size = AV_RB16 (&s->data[2]) - 12;
s->data += 12;
strip_size = ((s->data + strip_size) > eod) ? (eod - s->data) : strip_size;
......
......@@ -179,7 +179,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
case CODEC_ID_ROQ_DPCM:
if (s->channels == 1)
predictor[0] = LE_16(&buf[6]);
predictor[0] = AV_RL16(&buf[6]);
else {
predictor[0] = buf[7] << 8;
predictor[1] = buf[6] << 8;
......@@ -200,12 +200,12 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
case CODEC_ID_INTERPLAY_DPCM:
in = 6; /* skip over the stream mask and stream length */
predictor[0] = LE_16(&buf[in]);
predictor[0] = AV_RL16(&buf[in]);
in += 2;
SE_16BIT(predictor[0])
output_samples[out++] = predictor[0];
if (s->channels == 2) {
predictor[1] = LE_16(&buf[in]);
predictor[1] = AV_RL16(&buf[in]);
in += 2;
SE_16BIT(predictor[1])
output_samples[out++] = predictor[1];
......@@ -225,11 +225,11 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
case CODEC_ID_XAN_DPCM:
in = 0;
shift[0] = shift[1] = 4;
predictor[0] = LE_16(&buf[in]);
predictor[0] = AV_RL16(&buf[in]);
in += 2;
SE_16BIT(predictor[0]);
if (s->channels == 2) {
predictor[1] = LE_16(&buf[in]);
predictor[1] = AV_RL16(&buf[in]);
in += 2;
SE_16BIT(predictor[1]);
}
......
......@@ -159,7 +159,7 @@ static void cin_decode_lzss(const unsigned char *src, int src_size, unsigned cha
if (code & (1 << i)) {
*dst++ = *src++;
} else {
cmd = LE_16(src); src += 2;
cmd = AV_RL16(src); src += 2;
offset = cmd >> 4;
sz = (cmd & 0xF) + 2;
/* don't use memcpy/memmove here as the decoding routine (ab)uses */
......@@ -321,7 +321,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx,
if (cin->initial_decode_frame) {
cin->initial_decode_frame = 0;
cin->delta = (int16_t)LE_16(src); src += 2;
cin->delta = (int16_t)AV_RL16(src); src += 2;
*samples++ = cin->delta;
buf_size -= 2;
}
......
......@@ -851,7 +851,7 @@ static void dvbsub_parse_object_segment(AVCodecContext *avctx,
int coding_method, non_modifying_colour;
object_id = BE_16(buf);
object_id = AV_RB16(buf);
buf += 2;
object = get_object(ctx, object_id);
......@@ -863,9 +863,9 @@ static void dvbsub_parse_object_segment(AVCodecContext *avctx,
non_modifying_colour = ((*buf++) >> 1) & 1;
if (coding_method == 0) {
top_field_len = BE_16(buf);
top_field_len = AV_RB16(buf);
buf += 2;
bottom_field_len = BE_16(buf);
bottom_field_len = AV_RB16(buf);
buf += 2;
if (buf + top_field_len + bottom_field_len > buf_end) {
......@@ -1042,9 +1042,9 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
fill = ((*buf++) >> 3) & 1;
region->width = BE_16(buf);
region->width = AV_RB16(buf);
buf += 2;
region->height = BE_16(buf);
region->height = AV_RB16(buf);
buf += 2;
if (region->width * region->height != region->buf_size) {
......@@ -1086,7 +1086,7 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
delete_region_display_list(ctx, region);
while (buf + 5 < buf_end) {
object_id = BE_16(buf);
object_id = AV_RB16(buf);
buf += 2;
object = get_object(ctx, object_id);
......@@ -1106,9 +1106,9 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
display->object_id = object_id;
display->region_id = region_id;
display->x_pos = BE_16(buf) & 0xfff;
display->x_pos = AV_RB16(buf) & 0xfff;
buf += 2;
display->y_pos = BE_16(buf) & 0xfff;
display->y_pos = AV_RB16(buf) & 0xfff;
buf += 2;
if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) {
......@@ -1171,9 +1171,9 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
display->region_id = region_id;
display->x_pos = BE_16(buf);
display->x_pos = AV_RB16(buf);
buf += 2;
display->y_pos = BE_16(buf);
display->y_pos = AV_RB16(buf);
buf += 2;
*tmp_ptr = display->next;
......@@ -1405,9 +1405,9 @@ static int dvbsub_decode(AVCodecContext *avctx,
{
p += 1;
segment_type = *p++;
page_id = BE_16(p);
page_id = AV_RB16(p);
p += 2;
segment_length = BE_16(p);
segment_length = AV_RB16(p);
p += 2;
if (page_id == ctx->composition_id || page_id == ctx->ancillary_id) {
......@@ -1576,7 +1576,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
{
if (p + 6 <= p_end)
{
len = BE_16(p + 4);
len = AV_RB16(p + 4);
if (p + len + 6 <= p_end)
{
......
......@@ -87,8 +87,8 @@ static int flic_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
avctx->has_b_frames = 0;
s->fli_type = LE_16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
depth = LE_16(&fli_header[12]);
s->fli_type = AV_RL16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
depth = AV_RL16(&fli_header[12]);
if (depth == 0) {
depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
......@@ -172,18 +172,18 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
pixels = s->frame.data[0];
pixel_limit = s->avctx->height * s->frame.linesize[0];
frame_size = LE_32(&buf[stream_ptr]);
frame_size = AV_RL32(&buf[stream_ptr]);
stream_ptr += 6; /* skip the magic number */
num_chunks = LE_16(&buf[stream_ptr]);
num_chunks = AV_RL16(&buf[stream_ptr]);
stream_ptr += 10; /* skip padding */
frame_size -= 16;
/* iterate through the chunks */
while ((frame_size > 0) && (num_chunks > 0)) {
chunk_size = LE_32(&buf[stream_ptr]);
chunk_size = AV_RL32(&buf[stream_ptr]);
stream_ptr += 4;
chunk_type = LE_16(&buf[stream_ptr]);
chunk_type = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
switch (chunk_type) {
......@@ -200,7 +200,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
else
color_shift = 2;
/* set up the palette */
color_packets = LE_16(&buf[stream_ptr]);
color_packets = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
palette_ptr = 0;
for (i = 0; i < color_packets; i++) {
......@@ -241,10 +241,10 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
case FLI_DELTA:
y_ptr = 0;
compressed_lines = LE_16(&buf[stream_ptr]);
compressed_lines = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
while (compressed_lines > 0) {
line_packets = LE_16(&buf[stream_ptr]);
line_packets = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
if ((line_packets & 0xC000) == 0xC000) {
// line skip opcode
......@@ -290,12 +290,12 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
case FLI_LC:
/* line compressed */
starting_line = LE_16(&buf[stream_ptr]);
starting_line = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
y_ptr = 0;
y_ptr += starting_line * s->frame.linesize[0];
compressed_lines = LE_16(&buf[stream_ptr]);
compressed_lines = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
while (compressed_lines > 0) {
pixel_ptr = y_ptr;
......@@ -466,18 +466,18 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
pixels = s->frame.data[0];
pixel_limit = s->avctx->height * s->frame.linesize[0];
frame_size = LE_32(&buf[stream_ptr]);
frame_size = AV_RL32(&buf[stream_ptr]);
stream_ptr += 6; /* skip the magic number */
num_chunks = LE_16(&buf[stream_ptr]);
num_chunks = AV_RL16(&buf[stream_ptr]);
stream_ptr += 10; /* skip padding */
frame_size -= 16;
/* iterate through the chunks */
while ((frame_size > 0) && (num_chunks > 0)) {
chunk_size = LE_32(&buf[stream_ptr]);
chunk_size = AV_RL32(&buf[stream_ptr]);
stream_ptr += 4;
chunk_type = LE_16(&buf[stream_ptr]);
chunk_type = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
switch (chunk_type) {
......@@ -492,10 +492,10 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
case FLI_DELTA:
case FLI_DTA_LC:
y_ptr = 0;
compressed_lines = LE_16(&buf[stream_ptr]);
compressed_lines = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
while (compressed_lines > 0) {
line_packets = LE_16(&buf[stream_ptr]);
line_packets = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
if (line_packets < 0) {
line_packets = -line_packets;
......@@ -512,7 +512,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
byte_run = (signed char)(buf[stream_ptr++]);
if (byte_run < 0) {
byte_run = -byte_run;
pixel = LE_16(&buf[stream_ptr]);
pixel = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
CHECK_PIXEL_PTR(byte_run);
for (j = 0; j < byte_run; j++, pixel_countdown -= 2) {
......@@ -522,7 +522,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
} else {
CHECK_PIXEL_PTR(byte_run);
for (j = 0; j < byte_run; j++, pixel_countdown--) {
*((signed short*)(&pixels[pixel_ptr])) = LE_16(&buf[stream_ptr]);
*((signed short*)(&pixels[pixel_ptr])) = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
pixel_ptr += 2;
}
......@@ -586,12 +586,12 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
* a second pass over the line here, swapping the bytes.
*/
pixel = 0xFF00;
if (0xFF00 != LE_16(&pixel)) /* Check if its not an LE Target */
if (0xFF00 != AV_RL16(&pixel)) /* Check if its not an LE Target */
{
pixel_ptr = y_ptr;
pixel_countdown = s->avctx->width;
while (pixel_countdown > 0) {
*((signed short*)(&pixels[pixel_ptr])) = LE_16(&buf[pixel_ptr]);
*((signed short*)(&pixels[pixel_ptr])) = AV_RL16(&buf[pixel_ptr]);
pixel_ptr += 2;
}
}
......@@ -611,7 +611,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
while (pixel_countdown > 0) {
byte_run = (signed char)(buf[stream_ptr++]);
if (byte_run > 0) {
pixel = LE_16(&buf[stream_ptr]);
pixel = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
CHECK_PIXEL_PTR(byte_run);
for (j = 0; j < byte_run; j++) {
......@@ -626,7 +626,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
byte_run = -byte_run;
CHECK_PIXEL_PTR(byte_run);
for (j = 0; j < byte_run; j++) {
*((signed short*)(&pixels[pixel_ptr])) = LE_16(&buf[stream_ptr]);
*((signed short*)(&pixels[pixel_ptr])) = AV_RL16(&buf[stream_ptr]);
stream_ptr += 2;
pixel_ptr += 2;
pixel_countdown--;
......@@ -656,7 +656,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
pixel_countdown = s->avctx->width;
pixel_ptr = 0;
while (pixel_countdown > 0) {
*((signed short*)(&pixels[y_ptr + pixel_ptr])) = LE_16(&buf[stream_ptr+pixel_ptr]);
*((signed short*)(&pixels[y_ptr + pixel_ptr])) = AV_RL16(&buf[stream_ptr+pixel_ptr]);
pixel_ptr += 2;
pixel_countdown--;
}
......
......@@ -138,7 +138,7 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
for(i = 0; i < 256; i++){
s->nodes[i].sym = i;
s->nodes[i].count = LE_32(src);
s->nodes[i].count = AV_RL32(src);
s->nodes[i].n0 = -2;
if(s->nodes[i].count < 0) {
av_log(s->avctx, AV_LOG_ERROR, "Symbol count < 0\n");
......@@ -215,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx,
int i, is_chroma, planes;
header = LE_32(buf);
header = AV_RL32(buf);
version = header & 0xff;
header_size = (header & (1<<30))? 8 : 4; /* bit 30 means pad to 8 bytes */
......@@ -337,12 +337,12 @@ static int decode_frame(AVCodecContext *avctx,
}
f->pict_type = FF_I_TYPE;
f->key_frame = 1;
if ((LE_32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) {
if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) {
av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n");
return -1;
}
for(i = 0; i < planes; i++) {
offs[i] = LE_32(buf + 4 + i * 4);
offs[i] = AV_RL32(buf + 4 + i * 4);
if(offs[i] >= buf_size || (i && offs[i] <= offs[i - 1] + 1024)) {
av_log(avctx, AV_LOG_ERROR, "Fraps: plane %i offset is out of bounds\n", i);
return -1;
......
......@@ -8215,7 +8215,7 @@ static int decode_frame(AVCodecContext *avctx,
cnt = *(p+5) & 0x1f; // Number of sps
p += 6;
for (i = 0; i < cnt; i++) {
nalsize = BE_16(p) + 2;
nalsize = AV_RB16(p) + 2;
if(decode_nal_units(h, p, nalsize) < 0) {
av_log(avctx, AV_LOG_ERROR, "Decoding sps %d from avcC failed\n", i);
return -1;
......@@ -8225,7 +8225,7 @@ static int decode_frame(AVCodecContext *avctx,
// Decode pps from avcC
cnt = *(p++); // Number of pps
for (i = 0; i < cnt; i++) {
nalsize = BE_16(p) + 2;
nalsize = AV_RB16(p) + 2;
if(decode_nal_units(h, p, nalsize) != nalsize) {
av_log(avctx, AV_LOG_ERROR, "Decoding pps %d from avcC failed\n", i);
return -1;
......
......@@ -368,13 +368,13 @@ static int decode_init(AVCodecContext * avctx)
av_log(NULL, 0, "Extradata missing, decoding may not work properly...\n");
c->palsize = 127;
} else {
c->palsize = LE_16(avctx->extradata + 10);
c->palsize = AV_RL16(avctx->extradata + 10);
}
if (avctx->extradata_size == 1036) { // palette in extradata
uint8_t *src = avctx->extradata + 12;
for (i = 0; i < 256; i++) {
c->pal[i] = LE_32(src);
c->pal[i] = AV_RL32(src);
src += 4;
}
c->setpal = 1;
......
......@@ -237,20 +237,20 @@ static int decode_init(AVCodecContext *avctx){
avctx->extradata_size);
return -1;
}
version = LE_32(avctx->extradata);
version = AV_RL32(avctx->extradata);
switch(version) {
case 1:
l->lossy = 0;
break;
case 2:
l->lossy = LE_32(avctx->extradata + 8);
l->lossy = AV_RL32(avctx->extradata + 8);
break;
default:
l->lossy = LE_32(avctx->extradata + 8);
l->lossy = AV_RL32(avctx->extradata + 8);
av_log(avctx, AV_LOG_INFO, "This is LOCO codec version %i, please upload file for study\n", version);
}
l->mode = LE_32(avctx->extradata + 4);
l->mode = AV_RL32(avctx->extradata + 4);
switch(l->mode) {
case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:
avctx->pix_fmt = PIX_FMT_YUV422P;
......
......@@ -2540,12 +2540,12 @@ static int mjpega_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *av
break;
case SOS:
bytestream_put_be32(&poutbufp, i + 46); /* scan off */
bytestream_put_be32(&poutbufp, i + 46 + BE_16(buf + i + 2)); /* data off */
bytestream_put_be32(&poutbufp, i + 46 + AV_RB16(buf + i + 2)); /* data off */
bytestream_put_buffer(&poutbufp, buf + 2, buf_size - 2); /* skip already written SOI */
*poutbuf_size = poutbufp - *poutbuf;
return 1;
case APP1:
if (i + 8 < buf_size && LE_32(buf + i + 8) == ff_get_fourcc("mjpg")) {
if (i + 8 < buf_size && AV_RL32(buf + i + 8) == ff_get_fourcc("mjpg")) {
av_log(avctx, AV_LOG_ERROR, "bitstream already formatted\n");
memcpy(*poutbuf, buf, buf_size);
*poutbuf_size = buf_size;
......
......@@ -110,7 +110,7 @@ static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const
static void mm_decode_inter(MmContext * s, int half_horiz, int half_vert, const uint8_t *buf, int buf_size)
{
const int data_ptr = 2 + LE_16(&buf[0]);
const int data_ptr = 2 + AV_RL16(&buf[0]);
int d, r, y;
d = data_ptr; r = 2; y = 0;
......@@ -162,7 +162,7 @@ static int mm_decode_frame(AVCodecContext *avctx,
palette_control->palette_changed = 0;
}
type = LE_16(&buf[0]);
type = AV_RL16(&buf[0]);
buf += MM_PREAMBLE_SIZE;
buf_size -= MM_PREAMBLE_SIZE;
......
......@@ -245,25 +245,25 @@ static void msvideo1_decode_16bit(Msvideo1Context *s)
flags = (byte_b << 8) | byte_a;
CHECK_STREAM_PTR(4);
colors[0] = LE_16(&s->buf[stream_ptr]);
colors[0] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
colors[1] = LE_16(&s->buf[stream_ptr]);
colors[1] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
if (colors[0] & 0x8000) {
/* 8-color encoding */
CHECK_STREAM_PTR(12);
colors[2] = LE_16(&s->buf[stream_ptr]);
colors[2] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
colors[3] = LE_16(&s->buf[stream_ptr]);
colors[3] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
colors[4] = LE_16(&s->buf[stream_ptr]);
colors[4] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
colors[5] = LE_16(&s->buf[stream_ptr]);
colors[5] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
colors[6] = LE_16(&s->buf[stream_ptr]);
colors[6] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
colors[7] = LE_16(&s->buf[stream_ptr]);
colors[7] = AV_RL16(&s->buf[stream_ptr]);
stream_ptr += 2;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
......
......@@ -64,9 +64,9 @@ static int get_quant(AVCodecContext *avctx, NuvContext *c,
return -1;
}
for (i = 0; i < 64; i++, buf += 4)
c->lq[i] = LE_32(buf);
c->lq[i] = AV_RL32(buf);
for (i = 0; i < 64; i++, buf += 4)
c->cq[i] = LE_32(buf);
c->cq[i] = AV_RL32(buf);
return 0;
}
......
......@@ -1836,7 +1836,7 @@ static int qdm2_decode_init(AVCodecContext *avctx)
extradata += 8;
extradata_size -= 8;
size = BE_32(extradata);
size = AV_RB32(extradata);
if(size > extradata_size){
av_log(avctx, AV_LOG_ERROR, "extradata size too small, %i < %i\n",
......@@ -1846,29 +1846,29 @@ static int qdm2_decode_init(AVCodecContext *avctx)
extradata += 4;
av_log(avctx, AV_LOG_DEBUG, "size: %d\n", size);
if (BE_32(extradata) != MKBETAG('Q','D','C','A')) {
if (AV_RB32(extradata) != MKBETAG('Q','D','C','A')) {
av_log(avctx, AV_LOG_ERROR, "invalid extradata, expecting QDCA\n");
return -1;
}
extradata += 8;
avctx->channels = s->nb_channels = s->channels = BE_32(extradata);
avctx->channels = s->nb_channels = s->channels = AV_RB32(extradata);
extradata += 4;