summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2007-01-19 22:12:59 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2007-01-19 22:12:59 +0000
commitfead30d4440bc7b75006ae60f2742c63a05168b3 (patch)
treecead68d924846c1bfb756bb46c86184d889d10db /libavcodec
parent50eaa857c099abda803c803927276d81c2d74edb (diff)
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
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/adpcm.c10
-rw-r--r--libavcodec/alac.c12
-rw-r--r--libavcodec/avs.c4
-rw-r--r--libavcodec/bitstream_filter.c8
-rw-r--r--libavcodec/bytestream.h4
-rw-r--r--libavcodec/cinepak.c20
-rw-r--r--libavcodec/dpcm.c10
-rw-r--r--libavcodec/dsicinav.c4
-rw-r--r--libavcodec/dvbsubdec.c26
-rw-r--r--libavcodec/flicvideo.c48
-rw-r--r--libavcodec/fraps.c8
-rw-r--r--libavcodec/h264.c4
-rw-r--r--libavcodec/kmvc.c4
-rw-r--r--libavcodec/loco.c8
-rw-r--r--libavcodec/mjpeg.c4
-rw-r--r--libavcodec/mmvideo.c4
-rw-r--r--libavcodec/msvideo1.c16
-rw-r--r--libavcodec/nuv.c4
-rw-r--r--libavcodec/qdm2.c16
-rw-r--r--libavcodec/qdrw.c6
-rw-r--r--libavcodec/qtrle.c34
-rw-r--r--libavcodec/rpza.c10
-rw-r--r--libavcodec/rv10.c2
-rw-r--r--libavcodec/smacker.c10
-rw-r--r--libavcodec/smc.c6
-rw-r--r--libavcodec/svq3.c2
-rw-r--r--libavcodec/targa.c20
-rw-r--r--libavcodec/tiff.c6
-rw-r--r--libavcodec/truemotion1.c6
-rw-r--r--libavcodec/truemotion2.c16
-rw-r--r--libavcodec/truespeech.c16
-rw-r--r--libavcodec/tscc.c8
-rw-r--r--libavcodec/vc1.c4
-rw-r--r--libavcodec/vmdav.c14
-rw-r--r--libavcodec/vmnc.c20
-rw-r--r--libavcodec/vp6.c4
-rw-r--r--libavcodec/vqavideo.c30
-rw-r--r--libavcodec/wavpack.c24
-rw-r--r--libavcodec/ws-snd1.c4
-rw-r--r--libavcodec/xan.c10
-rw-r--r--libavcodec/xl.c2
-rw-r--r--libavcodec/zmbv.c6
42 files changed, 237 insertions, 237 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index ec3fe6f6ec..9be4c2274c 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -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++) {
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 793f71a11f..cc87c81e51 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -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);
diff --git a/libavcodec/avs.c b/libavcodec/avs.c
index 953aea1be0..ebfa8adb74 100644
--- a/libavcodec/avs.c
+++ b/libavcodec/avs.c
@@ -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);
diff --git a/libavcodec/bitstream_filter.c b/libavcodec/bitstream_filter.c
index b52acf60a2..89fc4e1759 100644
--- a/libavcodec/bitstream_filter.c
+++ b/libavcodec/bitstream_filter.c
@@ -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;
diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h
index a742fa1c14..ae5438b49c 100644
--- a/libavcodec/bytestream.h
+++ b/libavcodec/bytestream.h
@@ -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)
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index fd95b739e7..db0519b5db 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -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;
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index 99c0cac642..6243881dee 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -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]);
}
diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c
index ded53c45ab..dd256e5dc5 100644
--- a/libavcodec/dsicinav.c
+++ b/libavcodec/dsicinav.c
@@ -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;
}
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index ff43ca6b9e..79da1a60b0 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -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)
{
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 95cb26ce4e..78506eee87 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -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--;
}
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index 18d2700492..0a4567d053 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -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;
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index fc6bc4740c..1dc6fafd02 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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;
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index e8f39fca15..28dc014835 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -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;
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index 2ec850ed09..b1f99f425b 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -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;
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index 3d8383e7b9..09ff94658a 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -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;
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index 07d3f3fc5f..7ba1321cb2 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -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;
diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c
index 5929e1c633..1e3f6cce23 100644
--- a/libavcodec/msvideo1.c
+++ b/libavcodec/msvideo1.c
@@ -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++) {
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 592d3de03f..19e3430566 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -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;
}
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index b9462f3cb7..a2630fe7fc 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -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;
- avctx->sample_rate = BE_32(extradata);
+ avctx->sample_rate = AV_RB32(extradata);
extradata += 4;
- avctx->bit_rate = BE_32(extradata);
+ avctx->bit_rate = AV_RB32(extradata);
extradata += 4;
- s->group_size = BE_32(extradata);
+ s->group_size = AV_RB32(extradata);
extradata += 4;
- s->fft_size = BE_32(extradata);
+ s->fft_size = AV_RB32(extradata);
extradata += 4;
- s->checksum_size = BE_32(extradata);
+ s->checksum_size = AV_RB32(extradata);
extradata += 4;
s->fft_order = av_log2(s->fft_size) + 1;
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 8ebb43c4aa..664be2f4f3 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -58,7 +58,7 @@ static int decode_frame(AVCodecContext *avctx,
outdata = a->pic.data[0];
buf += 0x68; /* jump to palette */
- colors = BE_32(buf);
+ colors = AV_RB32(buf);
buf += 4;
if(colors < 0 || colors > 256) {
@@ -68,7 +68,7 @@ static int decode_frame(AVCodecContext *avctx,
for (i = 0; i <= colors; i++) {
unsigned int idx;
- idx = BE_16(buf); /* color index */
+ idx = AV_RB16(buf); /* color index */
buf += 2;
if (idx > 255) {
@@ -93,7 +93,7 @@ static int decode_frame(AVCodecContext *avctx,
/* decode line */
out = outdata;
- size = BE_16(buf); /* size of packed line */
+ size = AV_RB16(buf); /* size of packed line */
buf += 2;
left = size;
next = buf + size;
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index d4b314d03a..0ccca28c63 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -96,15 +96,15 @@ static void qtrle_decode_4bpp(QtrleContext *s)
/* fetch the header */
CHECK_STREAM_PTR(2);
- header = BE_16(&s->buf[stream_ptr]);
+ header = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
/* if a header is present, fetch additional decoding parameters */
if (header & 0x0008) {
CHECK_STREAM_PTR(8);
- start_line = BE_16(&s->buf[stream_ptr]);
+ start_line = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
- lines_to_change = BE_16(&s->buf[stream_ptr]);
+ lines_to_change = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
} else {
start_line = 0;
@@ -187,15 +187,15 @@ static void qtrle_decode_8bpp(QtrleContext *s)
/* fetch the header */
CHECK_STREAM_PTR(2);
- header = BE_16(&s->buf[stream_ptr]);
+ header = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
/* if a header is present, fetch additional decoding parameters */
if (header & 0x0008) {
CHECK_STREAM_PTR(8);
- start_line = BE_16(&s->buf[stream_ptr]);
+ start_line = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
- lines_to_change = BE_16(&s->buf[stream_ptr]);
+ lines_to_change = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
} else {
start_line = 0;
@@ -269,15 +269,15 @@ static void qtrle_decode_16bpp(QtrleContext *s)
/* fetch the header */
CHECK_STREAM_PTR(2);
- header = BE_16(&s->buf[stream_ptr]);
+ header = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
/* if a header is present, fetch additional decoding parameters */
if (header & 0x0008) {
CHECK_STREAM_PTR(8);
- start_line = BE_16(&s->buf[stream_ptr]);
+ start_line = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
- lines_to_change = BE_16(&s->buf[stream_ptr]);
+ lines_to_change = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
} else {
start_line = 0;
@@ -299,7 +299,7 @@ static void qtrle_decode_16bpp(QtrleContext *s)
/* decode the run length code */
rle_code = -rle_code;
CHECK_STREAM_PTR(2);
- rgb16 = BE_16(&s->buf[stream_ptr]);
+ rgb16 = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
CHECK_PIXEL_PTR(rle_code * 2);
@@ -314,7 +314,7 @@ static void qtrle_decode_16bpp(QtrleContext *s)
/* copy pixels directly to output */
while (rle_code--) {
- rgb16 = BE_16(&s->buf[stream_ptr]);
+ rgb16 = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
*(unsigned short *)(&rgb[pixel_ptr]) = rgb16;
pixel_ptr += 2;
@@ -347,15 +347,15 @@ static void qtrle_decode_24bpp(QtrleContext *s)
/* fetch the header */
CHECK_STREAM_PTR(2);
- header = BE_16(&s->buf[stream_ptr]);
+ header = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
/* if a header is present, fetch additional decoding parameters */
if (header & 0x0008) {
CHECK_STREAM_PTR(8);
- start_line = BE_16(&s->buf[stream_ptr]);
+ start_line = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
- lines_to_change = BE_16(&s->buf[stream_ptr]);
+ lines_to_change = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
} else {
start_line = 0;
@@ -427,15 +427,15 @@ static void qtrle_decode_32bpp(QtrleContext *s)
/* fetch the header */
CHECK_STREAM_PTR(2);
- header = BE_16(&s->buf[stream_ptr]);
+ header = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
/* if a header is present, fetch additional decoding parameters */
if (header & 0x0008) {
CHECK_STREAM_PTR(8);
- start_line = BE_16(&s->buf[stream_ptr]);
+ start_line = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
- lines_to_change = BE_16(&s->buf[stream_ptr]);
+ lines_to_change = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 4;
} else {
start_line = 0;
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index 9a996da379..8ab5dbb92d 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -98,7 +98,7 @@ static void rpza_decode_stream(RpzaContext *s)
s->buf[stream_ptr]);
/* Get chunk size, ingnoring first byte */
- chunk_size = BE_32(&s->buf[stream_ptr]) & 0x00FFFFFF;
+ chunk_size = AV_RB32(&s->buf[stream_ptr]) & 0x00FFFFFF;
stream_ptr += 4;
/* If length mismatch use size from MOV file and try to decode anyway */
@@ -140,7 +140,7 @@ static void rpza_decode_stream(RpzaContext *s)
/* Fill blocks with one color */
case 0xa0:
- colorA = BE_16 (&s->buf[stream_ptr]);
+ colorA = AV_RB16 (&s->buf[stream_ptr]);
stream_ptr += 2;
while (n_blocks--) {
block_ptr = row_ptr + pixel_ptr;
@@ -157,10 +157,10 @@ static void rpza_decode_stream(RpzaContext *s)
/* Fill blocks with 4 colors */
case 0xc0:
- colorA = BE_16 (&s->buf[stream_ptr]);
+ colorA = AV_RB16 (&s->buf[stream_ptr]);
stream_ptr += 2;
case 0x20:
- colorB = BE_16 (&s->buf[stream_ptr]);
+ colorB = AV_RB16 (&s->buf[stream_ptr]);
stream_ptr += 2;
/* sort out the colors */
@@ -209,7 +209,7 @@ static void rpza_decode_stream(RpzaContext *s)
for (pixel_x = 0; pixel_x < 4; pixel_x++){
/* We already have color of upper left pixel */
if ((pixel_y != 0) || (pixel_x !=0)) {
- colorA = BE_16 (&s->buf[stream_ptr]);
+ colorA = AV_RB16 (&s->buf[stream_ptr]);
stream_ptr += 2;
}
pixels[block_ptr] = colorA;
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 4b50609c1e..af438a34b7 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -535,7 +535,7 @@ static int rv10_decode_init(AVCodecContext *avctx)
s->height = avctx->height;
s->h263_long_vectors= ((uint8_t*)avctx->extradata)[3] & 1;
- avctx->sub_id= BE_32((uint8_t*)avctx->extradata + 4);
+ avctx->sub_id= AV_RB32((uint8_t*)avctx->extradata + 4);
switch(avctx->sub_id){
case 0x10000000:
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 2e1784075d..0bdbc79774 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -277,10 +277,10 @@ static int decode_header_trees(SmackVContext *smk) {
GetBitContext gb;
int mmap_size, mclr_size, full_size, type_size;
- mmap_size = LE_32(smk->avctx->extradata);
- mclr_size = LE_32(smk->avctx->extradata + 4);
- full_size = LE_32(smk->avctx->extradata + 8);
- type_size = LE_32(smk->avctx->extradata + 12);
+ mmap_size = AV_RL32(smk->avctx->extradata);
+ mclr_size = AV_RL32(smk->avctx->extradata + 4);
+ full_size = AV_RL32(smk->avctx->extradata + 8);
+ type_size = AV_RL32(smk->avctx->extradata + 12);
init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
@@ -584,7 +584,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int bits, stereo;
int pred[2] = {0, 0};
- unp_size = LE_32(buf);
+ unp_size = AV_RL32(buf);
init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 77fae328b7..349e5f81cb 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -120,7 +120,7 @@ static void smc_decode_stream(SmcContext *s)
s->avctx->palctrl->palette_changed = 0;
}
- chunk_size = BE_32(&s->buf[stream_ptr]) & 0x00FFFFFF;
+ chunk_size = AV_RB32(&s->buf[stream_ptr]) & 0x00FFFFFF;
stream_ptr += 4;
if (chunk_size != s->size)
av_log(s->avctx, AV_LOG_INFO, "warning: MOV chunk size != encoded chunk size (%d != %d); using MOV chunk size\n",
@@ -278,7 +278,7 @@ static void smc_decode_stream(SmcContext *s)
color_table_index = CPAIR * s->buf[stream_ptr++];
while (n_blocks--) {
- color_flags = BE_16(&s->buf[stream_ptr]);
+ color_flags = AV_RB16(&s->buf[stream_ptr]);
stream_ptr += 2;
flag_mask = 0x8000;
block_ptr = row_ptr + pixel_ptr;
@@ -321,7 +321,7 @@ static void smc_decode_stream(SmcContext *s)
color_table_index = CQUAD * s->buf[stream_ptr++];
while (n_blocks--) {
- color_flags = BE_32(&s->buf[stream_ptr]);
+ color_flags = AV_RB32(&s->buf[stream_ptr]);
stream_ptr += 4;
/* flag mask actually acts as a bit shift count here */
flag_mask = 30;
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index edf3b67149..c852832f66 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -830,7 +830,7 @@ static int svq3_decode_frame (AVCodecContext *avctx,
GetBitContext gb;
- size = BE_32(&extradata[4]);
+ size = AV_RB32(&extradata[4]);
init_get_bits (&gb, extradata + 8, size*8);
/* 'frame size code' and optional 'width, height' */
diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index 4eb18f87e8..4ad11cc13a 100644
--- a/libavcodec/targa.c
+++ b/libavcodec/targa.c
@@ -61,7 +61,7 @@ static void targa_decode_rle(AVCodecContext *avctx, TargaContext *s, uint8_t *sr
*dst = *src;
break;
case 2:
- *((uint16_t*)dst) = LE_16(src);
+ *((uint16_t*)dst) = AV_RL16(src);
break;
case 3:
dst[0] = src[0];
@@ -69,7 +69,7 @@ static void targa_decode_rle(AVCodecContext *avctx, TargaContext *s, uint8_t *sr
dst[2] = src[2];
break;
case 4:
- *((uint32_t*)dst) = LE_32(src);
+ *((uint32_t*)dst) = AV_RL32(src);
break;
}
dst += depth;
@@ -104,13 +104,13 @@ static int decode_frame(AVCodecContext *avctx,
idlen = *buf++;
pal = *buf++;
compr = *buf++;
- first_clr = LE_16(buf); buf += 2;
- colors = LE_16(buf); buf += 2;
+ first_clr = AV_RL16(buf); buf += 2;
+ colors = AV_RL16(buf); buf += 2;
csize = *buf++;
- x = LE_16(buf); buf += 2;
- y = LE_16(buf); buf += 2;
- w = LE_16(buf); buf += 2;
- h = LE_16(buf); buf += 2;
+ x = AV_RL16(buf); buf += 2;
+ y = AV_RL16(buf); buf += 2;
+ w = AV_RL16(buf); buf += 2;
+ h = AV_RL16(buf); buf += 2;
bpp = *buf++;
flags = *buf++;
//skip identifier if any
@@ -200,11 +200,11 @@ static int decode_frame(AVCodecContext *avctx,
if((s->bpp + 1) >> 3 == 2){
uint16_t *dst16 = (uint16_t*)dst;
for(x = 0; x < s->width; x++)
- dst16[x] = LE_16(buf + x * 2);
+ dst16[x] = AV_RL16(buf + x * 2);
}else if((s->bpp + 1) >> 3 == 4){
uint32_t *dst32 = (uint32_t*)dst;
for(x = 0; x < s->width; x++)
- dst32[x] = LE_32(buf + x * 4);
+ dst32[x] = AV_RL32(buf + x * 4);
}else
#endif
memcpy(dst, buf, s->width * ((s->bpp + 1) >> 3));
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 5925af1ae9..199fbad70b 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -87,13 +87,13 @@ typedef struct TiffContext {
} TiffContext;
static int tget_short(uint8_t **p, int le){
- int v = le ? LE_16(*p) : BE_16(*p);
+ int v = le ? AV_RL16(*p) : AV_RB16(*p);
*p += 2;
return v;
}
static int tget_long(uint8_t **p, int le){
- int v = le ? LE_32(*p) : BE_32(*p);
+ int v = le ? AV_RL32(*p) : AV_RB32(*p);
*p += 4;
return v;
}
@@ -447,7 +447,7 @@ static int decode_frame(AVCodecContext *avctx,
int i, entries;
//parse image header
- id = LE_16(buf); buf += 2;
+ id = AV_RL16(buf); buf += 2;
if(id == 0x4949) le = 1;
else if(id == 0x4D4D) le = 0;
else{
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index 11d9320c04..4b7aa976df 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -348,9 +348,9 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
header.compression = header_buffer[0];
header.deltaset = header_buffer[1];
header.vectable = header_buffer[2];
- header.ysize = LE_16(&header_buffer[3]);
- header.xsize = LE_16(&header_buffer[5]);
- header.checksum = LE_16(&header_buffer[7]);
+ header.ysize = AV_RL16(&header_buffer[3]);
+ header.xsize = AV_RL16(&header_buffer[5]);
+ header.checksum = AV_RL16(&header_buffer[7]);
header.version = header_buffer[9];
header.header_type = header_buffer[10];
header.flags = header_buffer[11];
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 1b67bd22af..e9bc6b7cbe 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -208,7 +208,7 @@ static inline int tm2_read_header(TM2Context *ctx, uint8_t *buf)
obuf = buf;
- magic = LE_32(buf);
+ magic = AV_RL32(buf);
buf += 4;
if(magic == 0x00000100) { /* old header */
@@ -217,7 +217,7 @@ static inline int tm2_read_header(TM2Context *ctx, uint8_t *buf)
} else if(magic == 0x00000101) { /* new header */
int w, h, size, flags, xr, yr;
- length = LE_32(buf);
+ length = AV_RL32(buf);
buf += 4;
init_get_bits(&ctx->gb, buf, 32 * 8);
@@ -270,17 +270,17 @@ static int tm2_read_stream(TM2Context *ctx, uint8_t *buf, int stream_id) {
TM2Codes codes;
/* get stream length in dwords */
- len = BE_32(buf); buf += 4; cur += 4;
+ len = AV_RB32(buf); buf += 4; cur += 4;
skip = len * 4 + 4;
if(len == 0)
return 4;
- toks = BE_32(buf); buf += 4; cur += 4;
+ toks = AV_RB32(buf); buf += 4; cur += 4;
if(toks & 1) {
- len = BE_32(buf); buf += 4; cur += 4;
+ len = AV_RB32(buf); buf += 4; cur += 4;
if(len == TM2_ESCAPE) {
- len = BE_32(buf); buf += 4; cur += 4;
+ len = AV_RB32(buf); buf += 4; cur += 4;
}
if(len > 0) {
init_get_bits(&ctx->gb, buf, (skip - cur) * 8);
@@ -291,7 +291,7 @@ static int tm2_read_stream(TM2Context *ctx, uint8_t *buf, int stream_id) {
}
}
/* skip unused fields */
- if(BE_32(buf) == TM2_ESCAPE) {
+ if(AV_RB32(buf) == TM2_ESCAPE) {
buf += 4; cur += 4; /* some unknown length - could be escaped too */
}
buf += 4; cur += 4;
@@ -312,7 +312,7 @@ static int tm2_read_stream(TM2Context *ctx, uint8_t *buf, int stream_id) {
}
ctx->tokens[stream_id] = av_realloc(ctx->tokens[stream_id], toks * sizeof(int));
ctx->tok_lens[stream_id] = toks;
- len = BE_32(buf); buf += 4; cur += 4;
+ len = AV_RB32(buf); buf += 4; cur += 4;
if(len > 0) {
init_get_bits(&ctx->gb, buf, (skip - cur) * 8);
for(i = 0; i < toks; i++)
diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 077e9b037a..d37aa9454a 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -62,7 +62,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
uint32_t t;
/* first dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->flag = t & 1;
@@ -77,7 +77,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
dec->vector[7] = ts_codebook[7][(t >> 29) & 0x7];
/* second dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->offset2[0] = (t >> 0) & 0x7F;
@@ -88,7 +88,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
dec->offset1[0] = ((t >> 28) & 0xF) << 4;
/* third dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->pulseval[0] = (t >> 0) & 0x3FFF;
@@ -97,7 +97,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
dec->offset1[1] = (t >> 28) & 0x0F;
/* fourth dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->pulseval[2] = (t >> 0) & 0x3FFF;
@@ -106,7 +106,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
dec->offset1[1] |= ((t >> 28) & 0x0F) << 4;
/* fifth dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->pulsepos[0] = (t >> 4) & 0x7FFFFFF;
@@ -116,7 +116,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
dec->offset1[0] |= (t >> 31) & 1;
/* sixth dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->pulsepos[1] = (t >> 4) & 0x7FFFFFF;
@@ -126,7 +126,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
dec->offset1[0] |= ((t >> 31) & 1) << 1;
/* seventh dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->pulsepos[2] = (t >> 4) & 0x7FFFFFF;
@@ -136,7 +136,7 @@ static void truespeech_read_frame(TSContext *dec, uint8_t *input)
dec->offset1[0] |= ((t >> 31) & 1) << 2;
/* eighth dword */
- t = LE_32(input);
+ t = AV_RL32(input);
input += 4;
dec->pulsepos[3] = (t >> 4) & 0x7FFFFFF;
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index a24540f374..e379abbbf8 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -121,14 +121,14 @@ static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
}
} else if (c->bpp == 16) {
for(i = 0; i < p2; i++) {
- pix16 = LE_16(src);
+ pix16 = AV_RL16(src);
src += 2;
*(uint16_t*)output = pix16;
output += 2;
}
} else if (c->bpp == 32) {
for(i = 0; i < p2; i++) {
- pix32 = LE_32(src);
+ pix32 = AV_RL32(src);
src += 4;
*(uint32_t*)output = pix32;
output += 4;
@@ -140,7 +140,7 @@ static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
switch(c->bpp){
case 8: pix[0] = *src++;
break;
- case 16: pix16 = LE_16(src);
+ case 16: pix16 = AV_RL16(src);
src += 2;
*(uint16_t*)pix = pix16;
break;
@@ -148,7 +148,7 @@ static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
pix[1] = *src++;
pix[2] = *src++;
break;
- case 32: pix32 = LE_32(src);
+ case 32: pix32 = AV_RL32(src);
src += 4;
*(uint32_t*)pix = pix32;
break;
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 231f3ca26c..124e5d0b64 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -4128,7 +4128,7 @@ static int vc1_decode_init(AVCodecContext *avctx)
}
while(edata_size > 8) {
// test if we've found header
- if(BE_32(edata) == 0x0000010F) {
+ if(AV_RB32(edata) == 0x0000010F) {
edata += 4;
edata_size -= 4;
break;
@@ -4144,7 +4144,7 @@ static int vc1_decode_init(AVCodecContext *avctx)
while(edata_size > 8) {
// test if we've found entry point
- if(BE_32(edata) == 0x0000010E) {
+ if(AV_RB32(edata) == 0x0000010E) {
edata += 4;
edata_size -= 4;
break;
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index a9937144e4..e0f958cbeb 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -92,10 +92,10 @@ static void lz_unpack(unsigned char *src, unsigned char *dest, int dest_len)
s = src;
d = dest;
d_end = d + dest_len;
- dataleft = LE_32(s);
+ dataleft = AV_RL32(s);
s += 4;
memset(queue, 0x20, QUEUE_SIZE);
- if (LE_32(s) == 0x56781234) {
+ if (AV_RL32(s) == 0x56781234) {
s += 4;
qpos = 0x111;
speclen = 0xF + 3;
@@ -204,10 +204,10 @@ static void vmd_decode(VmdVideoContext *s)
int frame_width, frame_height;
int dp_size;
- frame_x = LE_16(&s->buf[6]);
- frame_y = LE_16(&s->buf[8]);
- frame_width = LE_16(&s->buf[10]) - frame_x + 1;
- frame_height = LE_16(&s->buf[12]) - frame_y + 1;
+ frame_x = AV_RL16(&s->buf[6]);
+ frame_y = AV_RL16(&s->buf[8]);
+ frame_width = AV_RL16(&s->buf[10]) - frame_x + 1;
+ frame_height = AV_RL16(&s->buf[12]) - frame_y + 1;
/* if only a certain region will be updated, copy the entire previous
* frame before the decode */
@@ -339,7 +339,7 @@ static int vmdvideo_decode_init(AVCodecContext *avctx)
}
vmd_header = (unsigned char *)avctx->extradata;
- s->unpack_buffer_size = LE_32(&vmd_header[800]);
+ s->unpack_buffer_size = AV_RL32(&vmd_header[800]);
s->unpack_buffer = av_malloc(s->unpack_buffer_size);
if (!s->unpack_buffer)
return -1;
diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c
index 49210158ff..17abbea590 100644
--- a/libavcodec/vmnc.c
+++ b/libavcodec/vmnc.c
@@ -76,10 +76,10 @@ static av_always_inline int vmnc_get_pixel(uint8_t* buf, int bpp, int be) {
switch(bpp * 2 + be) {
case 2:
case 3: return *buf;
- case 4: return LE_16(buf);
- case 5: return BE_16(buf);
- case 8: return LE_32(buf);
- case 9: return BE_32(buf);
+ case 4: return AV_RL16(buf);
+ case 5: return AV_RB16(buf);
+ case 8: return AV_RL32(buf);
+ case 9: return AV_RB32(buf);
default: return 0;
}
}
@@ -328,13 +328,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
}
}
src += 2;
- chunks = BE_16(src); src += 2;
+ chunks = AV_RB16(src); src += 2;
while(chunks--) {
- dx = BE_16(src); src += 2;
- dy = BE_16(src); src += 2;
- w = BE_16(src); src += 2;
- h = BE_16(src); src += 2;
- enc = BE_32(src); src += 4;
+ dx = AV_RB16(src); src += 2;
+ dy = AV_RB16(src); src += 2;
+ w = AV_RB16(src); src += 2;
+ h = AV_RB16(src); src += 2;
+ enc = AV_RB32(src); src += 4;
outptr = c->pic.data[0] + dx * c->bpp2 + dy * c->pic.linesize[0];
size_left = buf_size - (src - buf);
switch(enc) {
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index 31d47cd0df..df4ebf87dd 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -63,7 +63,7 @@ static int vp6_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size,
return 0;
}
if (separated_coeff || !s->filter_header) {
- coeff_offset = BE_16(buf+2) - 2;
+ coeff_offset = AV_RB16(buf+2) - 2;
buf += 2;
buf_size -= 2;
}
@@ -95,7 +95,7 @@ static int vp6_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size,
return 0;
if (separated_coeff || !s->filter_header) {
- coeff_offset = BE_16(buf+1) - 2;
+ coeff_offset = AV_RB16(buf+1) - 2;
buf += 2;
buf_size -= 2;
}
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 912ced0df8..57fe6cf44b 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -151,8 +151,8 @@ static int vqa_decode_init(AVCodecContext *avctx)
/* load up the VQA parameters from the header */
vqa_header = (unsigned char *)s->avctx->extradata;
s->vqa_version = vqa_header[0];
- s->width = LE_16(&vqa_header[6]);
- s->height = LE_16(&vqa_header[8]);
+ s->width = AV_RL16(&vqa_header[6]);
+ s->height = AV_RL16(&vqa_header[8]);
if(avcodec_check_dimensions(avctx, s->width, s->height)){
s->width= s->height= 0;
return -1;
@@ -232,9 +232,9 @@ static void decode_format80(unsigned char *src, int src_size,
if (src[src_index] == 0xFF) {
src_index++;
- count = LE_16(&src[src_index]);
+ count = AV_RL16(&src[src_index]);
src_index += 2;
- src_pos = LE_16(&src[src_index]);
+ src_pos = AV_RL16(&src[src_index]);
src_index += 2;
vqa_debug("(1) copy %X bytes from absolute pos %X\n", count, src_pos);
CHECK_COUNT();
@@ -245,7 +245,7 @@ static void decode_format80(unsigned char *src, int src_size,
} else if (src[src_index] == 0xFE) {
src_index++;
- count = LE_16(&src[src_index]);
+ count = AV_RL16(&src[src_index]);
src_index += 2;
color = src[src_index++];
vqa_debug("(2) set %X bytes to %02X\n", count, color);
@@ -256,7 +256,7 @@ static void decode_format80(unsigned char *src, int src_size,
} else if ((src[src_index] & 0xC0) == 0xC0) {
count = (src[src_index++] & 0x3F) + 3;
- src_pos = LE_16(&src[src_index]);
+ src_pos = AV_RL16(&src[src_index]);
src_index += 2;
vqa_debug("(3) copy %X bytes from absolute pos %X\n", count, src_pos);
CHECK_COUNT();
@@ -276,7 +276,7 @@ static void decode_format80(unsigned char *src, int src_size,
} else {
count = ((src[src_index] & 0x70) >> 4) + 3;
- src_pos = BE_16(&src[src_index]) & 0x0FFF;
+ src_pos = AV_RB16(&src[src_index]) & 0x0FFF;
src_index += 2;
vqa_debug("(5) copy %X bytes from relpos %X\n", count, src_pos);
CHECK_COUNT();
@@ -326,8 +326,8 @@ static void vqa_decode_chunk(VqaContext *s)
/* first, traverse through the frame and find the subchunks */
while (index < s->size) {
- chunk_type = BE_32(&s->buf[index]);
- chunk_size = BE_32(&s->buf[index + 4]);
+ chunk_type = AV_RB32(&s->buf[index]);
+ chunk_size = AV_RB32(&s->buf[index + 4]);
switch (chunk_type) {
@@ -391,7 +391,7 @@ static void vqa_decode_chunk(VqaContext *s)
/* convert the RGB palette into the machine's endian format */
if (cpl0_chunk != -1) {
- chunk_size = BE_32(&s->buf[cpl0_chunk + 4]);
+ chunk_size = AV_RB32(&s->buf[cpl0_chunk + 4]);
/* sanity check the palette size */
if (chunk_size / 3 > 256) {
av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: found a palette chunk with %d colors\n",
@@ -419,7 +419,7 @@ static void vqa_decode_chunk(VqaContext *s)
/* decompress the full codebook chunk */
if (cbfz_chunk != -1) {
- chunk_size = BE_32(&s->buf[cbfz_chunk + 4]);
+ chunk_size = AV_RB32(&s->buf[cbfz_chunk + 4]);
cbfz_chunk += CHUNK_PREAMBLE_SIZE;
decode_format80(&s->buf[cbfz_chunk], chunk_size,
s->codebook, s->codebook_size, 0);
@@ -428,7 +428,7 @@ static void vqa_decode_chunk(VqaContext *s)
/* copy a full codebook */
if (cbf0_chunk != -1) {
- chunk_size = BE_32(&s->buf[cbf0_chunk + 4]);
+ chunk_size = AV_RB32(&s->buf[cbf0_chunk + 4]);
/* sanity check the full codebook size */
if (chunk_size > MAX_CODEBOOK_SIZE) {
av_log(s->avctx, AV_LOG_ERROR, " VQA video: problem: CBF0 chunk too large (0x%X bytes)\n",
@@ -448,7 +448,7 @@ static void vqa_decode_chunk(VqaContext *s)
return;
}
- chunk_size = BE_32(&s->buf[vptz_chunk + 4]);
+ chunk_size = AV_RB32(&s->buf[vptz_chunk + 4]);
vptz_chunk += CHUNK_PREAMBLE_SIZE;
decode_format80(&s->buf[vptz_chunk], chunk_size,
s->decode_buffer, s->decode_buffer_size, 1);
@@ -522,7 +522,7 @@ static void vqa_decode_chunk(VqaContext *s)
if (cbp0_chunk != -1) {
- chunk_size = BE_32(&s->buf[cbp0_chunk + 4]);
+ chunk_size = AV_RB32(&s->buf[cbp0_chunk + 4]);
cbp0_chunk += CHUNK_PREAMBLE_SIZE;
/* accumulate partial codebook */
@@ -545,7 +545,7 @@ static void vqa_decode_chunk(VqaContext *s)
if (cbpz_chunk != -1) {
- chunk_size = BE_32(&s->buf[cbpz_chunk + 4]);
+ chunk_size = AV_RB32(&s->buf[cbpz_chunk + 4]);
cbpz_chunk += CHUNK_PREAMBLE_SIZE;
/* accumulate partial codebook */
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 18544831e8..6f5d84bd0c 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -387,15 +387,15 @@ static int wavpack_decode_frame(AVCodecContext *avctx,
memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));
- s->samples = LE_32(buf); buf += 4;
+ s->samples = AV_RL32(buf); buf += 4;
if(!s->samples) return buf_size;
/* should not happen but who knows */
if(s->samples * 2 * avctx->channels > AVCODEC_MAX_AUDIO_FRAME_SIZE){
av_log(avctx, AV_LOG_ERROR, "Packet size is too big to be handled in lavc!\n");
return -1;
}
- s->joint = LE_32(buf) & WV_JOINT; buf += 4;
- s->CRC = LE_32(buf); buf += 4;
+ s->joint = AV_RL32(buf) & WV_JOINT; buf += 4;
+ s->CRC = AV_RL32(buf); buf += 4;
// parse metadata blocks
while(buf < buf_end){
id = *buf++;
@@ -467,23 +467,23 @@ static int wavpack_decode_frame(AVCodecContext *avctx,
t = 0;
for(i = s->terms - 1; (i >= 0) && (t < size); i--) {
if(s->decorr[i].value > 8){
- s->decorr[i].samplesA[0] = wp_exp2(LE_16(buf)); buf += 2;
- s->decorr[i].samplesA[1] = wp_exp2(LE_16(buf)); buf += 2;
+ s->decorr[i].samplesA[0] = wp_exp2(AV_RL16(buf)); buf += 2;
+ s->decorr[i].samplesA[1] = wp_exp2(AV_RL16(buf)); buf += 2;
if(s->stereo){
- s->decorr[i].samplesB[0] = wp_exp2(LE_16(buf)); buf += 2;
- s->decorr[i].samplesB[1] = wp_exp2(LE_16(buf)); buf += 2;
+ s->decorr[i].samplesB[0] = wp_exp2(AV_RL16(buf)); buf += 2;
+ s->decorr[i].samplesB[1] = wp_exp2(AV_RL16(buf)); buf += 2;
t += 4;
}
t += 4;
}else if(s->decorr[i].value < 0){
- s->decorr[i].samplesA[0] = wp_exp2(LE_16(buf)); buf += 2;
- s->decorr[i].samplesB[0] = wp_exp2(LE_16(buf)); buf += 2;
+ s->decorr[i].samplesA[0] = wp_exp2(AV_RL16(buf)); buf += 2;
+ s->decorr[i].samplesB[0] = wp_exp2(AV_RL16(buf)); buf += 2;
t += 4;
}else{
for(j = 0; j < s->decorr[i].value; j++){
- s->decorr[i].samplesA[j] = wp_exp2(LE_16(buf)); buf += 2;
+ s->decorr[i].samplesA[j] = wp_exp2(AV_RL16(buf)); buf += 2;
if(s->stereo){
- s->decorr[i].samplesB[j] = wp_exp2(LE_16(buf)); buf += 2;
+ s->decorr[i].samplesB[j] = wp_exp2(AV_RL16(buf)); buf += 2;
}
}
t += s->decorr[i].value * 2 * avctx->channels;
@@ -498,7 +498,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx,
continue;
}
for(i = 0; i < 3 * avctx->channels; i++){
- s->median[i] = wp_exp2(LE_16(buf));
+ s->median[i] = wp_exp2(AV_RL16(buf));
buf += 2;
}
got_entropy = 1;
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
index eb4fe81d3f..3624909a30 100644
--- a/libavcodec/ws-snd1.c
+++ b/libavcodec/ws-snd1.c
@@ -57,9 +57,9 @@ static int ws_snd_decode_frame(AVCodecContext *avctx,
if (!buf_size)
return 0;
- out_size = LE_16(&buf[0]);
+ out_size = AV_RL16(&buf[0]);
*data_size = out_size * 2;
- in_size = LE_16(&buf[2]);
+ in_size = AV_RL16(&buf[2]);
buf += 4;
if (in_size == out_size) {
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 56ce87a953..f697514a04 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -296,10 +296,10 @@ static void xan_wc3_decode_frame(XanContext *s) {
unsigned char *vector_segment;
unsigned char *imagedata_segment;
- huffman_segment = s->buf + LE_16(&s->buf[0]);
- size_segment = s->buf + LE_16(&s->buf[2]);
- vector_segment = s->buf + LE_16(&s->buf[4]);
- imagedata_segment = s->buf + LE_16(&s->buf[6]);
+ huffman_segment = s->buf + AV_RL16(&s->buf[0]);
+ size_segment = s->buf + AV_RL16(&s->buf[2]);
+ vector_segment = s->buf + AV_RL16(&s->buf[4]);
+ imagedata_segment = s->buf + AV_RL16(&s->buf[6]);
xan_huffman_decode(opcode_buffer, huffman_segment, opcode_buffer_size);
@@ -350,7 +350,7 @@ static void xan_wc3_decode_frame(XanContext *s) {
case 10:
case 20:
- size = BE_16(&size_segment[0]);
+ size = AV_RB16(&size_segment[0]);
size_segment += 2;
break;
diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index 67ad237e12..8a011d8875 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -73,7 +73,7 @@ static int decode_frame(AVCodecContext *avctx,
for (j = 0; j < avctx->width; j += 4) {
/* value is stored in LE dword with word swapped */
- val = LE_32(buf);
+ val = AV_RL32(buf);
buf -= 4;
val = ((val >> 16) & 0xFFFF) | ((val & 0xFFFF) << 16);
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index fe3745e09b..3b87c7db15 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -545,7 +545,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
case ZMBV_FMT_15BPP:
for(j = 0; j < c->height; j++) {
for(i = 0; i < c->width; i++) {
- uint16_t tmp = LE_16(src);
+ uint16_t tmp = AV_RL16(src);
src += 2;
out[i * 3 + 0] = (tmp & 0x7C00) >> 7;
out[i * 3 + 1] = (tmp & 0x03E0) >> 2;
@@ -557,7 +557,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
case ZMBV_FMT_16BPP:
for(j = 0; j < c->height; j++) {
for(i = 0; i < c->width; i++) {
- uint16_t tmp = LE_16(src);
+ uint16_t tmp = AV_RL16(src);
src += 2;
out[i * 3 + 0] = (tmp & 0xF800) >> 8;
out[i * 3 + 1] = (tmp & 0x07E0) >> 3;
@@ -578,7 +578,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
case ZMBV_FMT_32BPP:
for(j = 0; j < c->height; j++) {
for(i = 0; i < c->width; i++) {
- uint32_t tmp = LE_32(src);
+ uint32_t tmp = AV_RL32(src);
src += 4;
out[i * 3 + 0] = tmp >> 16;
out[i * 3 + 1] = tmp >> 8;