changeset 1673:a782462e2497 libavformat

rename BE/LE_8/16/32 to AV_RL/B_8/16/32
author alex
date Fri, 19 Jan 2007 22:12:59 +0000
parents 818eafa8fc95
children a216ebdce1ff
files 4xm.c dsicin.c electronicarts.c flic.c idcin.c idroq.c ipmovie.c matroska.c mm.c mov.c movenc.c nuv.c psxstr.c rtp.c rtp_h264.c segafilm.c sgi.c sierravmd.c smacker.c swf.c wc3movie.c westwood.c wv.c
diffstat 23 files changed, 137 insertions(+), 137 deletions(-) [+]
line wrap: on
line diff
--- a/4xm.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/4xm.c	Fri Jan 19 22:12:59 2007 +0000
@@ -82,8 +82,8 @@
     if (p->buf_size < 12)
         return 0;
 
-    if ((LE_32(&p->buf[0]) != RIFF_TAG) ||
-        (LE_32(&p->buf[8]) != _4XMV_TAG))
+    if ((AV_RL32(&p->buf[0]) != RIFF_TAG) ||
+        (AV_RL32(&p->buf[8]) != _4XMV_TAG))
         return 0;
 
     return AVPROBE_SCORE_MAX;
@@ -125,19 +125,19 @@
 
     /* take the lazy approach and search for any and all vtrk and strk chunks */
     for (i = 0; i < header_size - 8; i++) {
-        fourcc_tag = LE_32(&header[i]);
-        size = LE_32(&header[i + 4]);
+        fourcc_tag = AV_RL32(&header[i]);
+        size = AV_RL32(&header[i + 4]);
 
         if (fourcc_tag == std__TAG) {
-            fourxm->fps = av_int2flt(LE_32(&header[i + 12]));
+            fourxm->fps = av_int2flt(AV_RL32(&header[i + 12]));
         } else if (fourcc_tag == vtrk_TAG) {
             /* check that there is enough data */
             if (size != vtrk_SIZE) {
                 av_free(header);
                 return AVERROR_INVALIDDATA;
             }
-            fourxm->width = LE_32(&header[i + 36]);
-            fourxm->height = LE_32(&header[i + 40]);
+            fourxm->width = AV_RL32(&header[i + 36]);
+            fourxm->height = AV_RL32(&header[i + 40]);
             i += 8 + size;
 
             /* allocate a new AVStream */
@@ -160,7 +160,7 @@
                 av_free(header);
                 return AVERROR_INVALIDDATA;
             }
-            current_track = LE_32(&header[i + 8]);
+            current_track = AV_RL32(&header[i + 8]);
             if (current_track + 1 > fourxm->track_count) {
                 fourxm->track_count = current_track + 1;
                 if((unsigned)fourxm->track_count >= UINT_MAX / sizeof(AudioTrack))
@@ -172,10 +172,10 @@
                     return AVERROR_NOMEM;
                 }
             }
-            fourxm->tracks[current_track].adpcm = LE_32(&header[i + 12]);
-            fourxm->tracks[current_track].channels = LE_32(&header[i + 36]);
-            fourxm->tracks[current_track].sample_rate = LE_32(&header[i + 40]);
-            fourxm->tracks[current_track].bits = LE_32(&header[i + 44]);
+            fourxm->tracks[current_track].adpcm = AV_RL32(&header[i + 12]);
+            fourxm->tracks[current_track].channels = AV_RL32(&header[i + 36]);
+            fourxm->tracks[current_track].sample_rate = AV_RL32(&header[i + 40]);
+            fourxm->tracks[current_track].bits = AV_RL32(&header[i + 44]);
             i += 8 + size;
 
             /* allocate a new AVStream */
@@ -235,8 +235,8 @@
 
         if ((ret = get_buffer(&s->pb, header, 8)) < 0)
             return ret;
-        fourcc_tag = LE_32(&header[0]);
-        size = LE_32(&header[4]);
+        fourcc_tag = AV_RL32(&header[0]);
+        size = AV_RL32(&header[4]);
         if (url_feof(pb))
             return AVERROR_IO;
         switch (fourcc_tag) {
--- a/dsicin.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/dsicin.c	Fri Jan 19 22:12:59 2007 +0000
@@ -62,11 +62,11 @@
         return 0;
 
     /* header starts with this special marker */
-    if (LE_32(&p->buf[0]) != 0x55AA0000)
+    if (AV_RL32(&p->buf[0]) != 0x55AA0000)
         return 0;
 
     /* for accuracy, check some header field values */
-    if (LE_32(&p->buf[12]) != 22050 || p->buf[16] != 16 || p->buf[17] != 0)
+    if (AV_RL32(&p->buf[12]) != 22050 || p->buf[16] != 16 || p->buf[17] != 0)
         return 0;
 
     return AVPROBE_SCORE_MAX;
--- a/electronicarts.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/electronicarts.c	Fri Jan 19 22:12:59 2007 +0000
@@ -168,7 +168,7 @@
     if (p->buf_size < 4)
         return 0;
 
-    if (LE_32(&p->buf[0]) != SCHl_TAG)
+    if (AV_RL32(&p->buf[0]) != SCHl_TAG)
         return 0;
 
     return AVPROBE_SCORE_MAX;
@@ -230,8 +230,8 @@
 
         if (get_buffer(pb, preamble, EA_PREAMBLE_SIZE) != EA_PREAMBLE_SIZE)
             return AVERROR_IO;
-        chunk_type = LE_32(&preamble[0]);
-        chunk_size = LE_32(&preamble[4]) - EA_PREAMBLE_SIZE;
+        chunk_type = AV_RL32(&preamble[0]);
+        chunk_size = AV_RL32(&preamble[4]) - EA_PREAMBLE_SIZE;
 
         switch (chunk_type) {
         /* audio data */
--- a/flic.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/flic.c	Fri Jan 19 22:12:59 2007 +0000
@@ -58,7 +58,7 @@
     if (p->buf_size < 6)
         return 0;
 
-    magic_number = LE_16(&p->buf[4]);
+    magic_number = AV_RL16(&p->buf[4]);
     if ((magic_number != FLIC_FILE_MAGIC_1) &&
         (magic_number != FLIC_FILE_MAGIC_2) &&
         (magic_number != FLIC_FILE_MAGIC_3))
@@ -83,8 +83,8 @@
     if (get_buffer(pb, header, FLIC_HEADER_SIZE) != FLIC_HEADER_SIZE)
         return AVERROR_IO;
 
-    magic_number = LE_16(&header[4]);
-    speed = LE_32(&header[0x10]);
+    magic_number = AV_RL16(&header[4]);
+    speed = AV_RL32(&header[0x10]);
 
     /* initialize the decoder streams */
     st = av_new_stream(s, 0);
@@ -94,8 +94,8 @@
     st->codec->codec_type = CODEC_TYPE_VIDEO;
     st->codec->codec_id = CODEC_ID_FLIC;
     st->codec->codec_tag = 0;  /* no fourcc */
-    st->codec->width = LE_16(&header[0x08]);
-    st->codec->height = LE_16(&header[0x0A]);
+    st->codec->width = AV_RL16(&header[0x08]);
+    st->codec->height = AV_RL16(&header[0x0A]);
 
     if (!st->codec->width || !st->codec->height)
         return AVERROR_INVALIDDATA;
@@ -110,7 +110,7 @@
     /* Time to figure out the framerate: If there is a FLIC chunk magic
      * number at offset 0x10, assume this is from the Bullfrog game,
      * Magic Carpet. */
-    if (LE_16(&header[0x10]) == FLIC_CHUNK_MAGIC_1) {
+    if (AV_RL16(&header[0x10]) == FLIC_CHUNK_MAGIC_1) {
 
         flic->frame_pts_inc = FLIC_MC_PTS_INC;
 
@@ -174,8 +174,8 @@
             break;
         }
 
-        size = LE_32(&preamble[0]);
-        magic = LE_16(&preamble[4]);
+        size = AV_RL32(&preamble[0]);
+        magic = AV_RL16(&preamble[4]);
 
         if (((magic == FLIC_CHUNK_MAGIC_1) || (magic == FLIC_CHUNK_MAGIC_2)) && size > FLIC_PREAMBLE_SIZE) {
             if (av_new_packet(pkt, size)) {
--- a/idcin.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/idcin.c	Fri Jan 19 22:12:59 2007 +0000
@@ -109,27 +109,27 @@
         return 0;
 
     /* check the video width */
-    number = LE_32(&p->buf[0]);
+    number = AV_RL32(&p->buf[0]);
     if ((number == 0) || (number > 1024))
        return 0;
 
     /* check the video height */
-    number = LE_32(&p->buf[4]);
+    number = AV_RL32(&p->buf[4]);
     if ((number == 0) || (number > 1024))
        return 0;
 
     /* check the audio sample rate */
-    number = LE_32(&p->buf[8]);
+    number = AV_RL32(&p->buf[8]);
     if ((number != 0) && ((number < 8000) | (number > 48000)))
         return 0;
 
     /* check the audio bytes/sample */
-    number = LE_32(&p->buf[12]);
+    number = AV_RL32(&p->buf[12]);
     if (number > 2)
         return 0;
 
     /* check the audio channels */
-    number = LE_32(&p->buf[16]);
+    number = AV_RL32(&p->buf[16]);
     if (number > 2)
         return 0;
 
--- a/idroq.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/idroq.c	Fri Jan 19 22:12:59 2007 +0000
@@ -61,8 +61,8 @@
     if (p->buf_size < 6)
         return 0;
 
-    if ((LE_16(&p->buf[0]) != RoQ_MAGIC_NUMBER) ||
-        (LE_32(&p->buf[2]) != 0xFFFFFFFF))
+    if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) ||
+        (AV_RL32(&p->buf[2]) != 0xFFFFFFFF))
         return 0;
 
     return AVPROBE_SCORE_MAX;
@@ -83,7 +83,7 @@
     if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
         RoQ_CHUNK_PREAMBLE_SIZE)
         return AVERROR_IO;
-    roq->framerate = LE_16(&preamble[6]);
+    roq->framerate = AV_RL16(&preamble[6]);
     roq->frame_pts_inc = 90000 / roq->framerate;
 
     /* init private context parameters */
@@ -96,8 +96,8 @@
             RoQ_CHUNK_PREAMBLE_SIZE)
             return AVERROR_IO;
 
-        chunk_type = LE_16(&preamble[0]);
-        chunk_size = LE_32(&preamble[2]);
+        chunk_type = AV_RL16(&preamble[0]);
+        chunk_size = AV_RL32(&preamble[2]);
 
         switch (chunk_type) {
 
@@ -106,8 +106,8 @@
             if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
                 RoQ_CHUNK_PREAMBLE_SIZE)
                 return AVERROR_IO;
-            roq->width = LE_16(&preamble[0]);
-            roq->height = LE_16(&preamble[2]);
+            roq->width = AV_RL16(&preamble[0]);
+            roq->height = AV_RL16(&preamble[2]);
             break;
 
         case RoQ_QUAD_CODEBOOK:
@@ -127,7 +127,7 @@
             break;
 
         default:
-            av_log(s, AV_LOG_ERROR, " unknown RoQ chunk type (%04X)\n", LE_16(&preamble[0]));
+            av_log(s, AV_LOG_ERROR, " unknown RoQ chunk type (%04X)\n", AV_RL16(&preamble[0]));
             return AVERROR_INVALIDDATA;
             break;
         }
@@ -196,8 +196,8 @@
             RoQ_CHUNK_PREAMBLE_SIZE)
             return AVERROR_IO;
 
-        chunk_type = LE_16(&preamble[0]);
-        chunk_size = LE_32(&preamble[2]);
+        chunk_type = AV_RL16(&preamble[0]);
+        chunk_size = AV_RL32(&preamble[2]);
         if(chunk_size > INT_MAX)
             return AVERROR_INVALIDDATA;
 
@@ -216,7 +216,7 @@
             if (get_buffer(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE) !=
                 RoQ_CHUNK_PREAMBLE_SIZE)
                 return AVERROR_IO;
-            chunk_size = LE_32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 +
+            chunk_size = AV_RL32(&preamble[2]) + RoQ_CHUNK_PREAMBLE_SIZE * 2 +
                 codebook_size;
 
             /* rewind */
--- a/ipmovie.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/ipmovie.c	Fri Jan 19 22:12:59 2007 +0000
@@ -236,8 +236,8 @@
     if (get_buffer(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
         CHUNK_PREAMBLE_SIZE)
         return CHUNK_BAD;
-    chunk_size = LE_16(&chunk_preamble[0]);
-    chunk_type = LE_16(&chunk_preamble[2]);
+    chunk_size = AV_RL16(&chunk_preamble[0]);
+    chunk_type = AV_RL16(&chunk_preamble[2]);
 
     debug_ipmovie("chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
 
@@ -287,7 +287,7 @@
             break;
         }
 
-        opcode_size = LE_16(&opcode_preamble[0]);
+        opcode_size = AV_RL16(&opcode_preamble[0]);
         opcode_type = opcode_preamble[2];
         opcode_version = opcode_preamble[3];
 
@@ -325,10 +325,10 @@
                 chunk_type = CHUNK_BAD;
                 break;
             }
-            s->fps = 1000000.0 / (LE_32(&scratch[0]) * LE_16(&scratch[4]));
+            s->fps = 1000000.0 / (AV_RL32(&scratch[0]) * AV_RL16(&scratch[4]));
             s->frame_pts_inc = 90000 / s->fps;
             debug_ipmovie("  %.2f frames/second (timer div = %d, subdiv = %d)\n",
-                s->fps, LE_32(&scratch[0]), LE_16(&scratch[4]));
+                s->fps, AV_RL32(&scratch[0]), AV_RL16(&scratch[4]));
             break;
 
         case OPCODE_INIT_AUDIO_BUFFERS:
@@ -343,8 +343,8 @@
                 chunk_type = CHUNK_BAD;
                 break;
             }
-            s->audio_sample_rate = LE_16(&scratch[4]);
-            audio_flags = LE_16(&scratch[2]);
+            s->audio_sample_rate = AV_RL16(&scratch[4]);
+            audio_flags = AV_RL16(&scratch[2]);
             /* bit 0 of the flags: 0 = mono, 1 = stereo */
             s->audio_channels = (audio_flags & 1) + 1;
             /* bit 1 of the flags: 0 = 8 bit, 1 = 16 bit */
@@ -381,8 +381,8 @@
                 chunk_type = CHUNK_BAD;
                 break;
             }
-            s->video_width = LE_16(&scratch[0]) * 8;
-            s->video_height = LE_16(&scratch[2]) * 8;
+            s->video_width = AV_RL16(&scratch[0]) * 8;
+            s->video_height = AV_RL16(&scratch[2]) * 8;
             debug_ipmovie("video resolution: %d x %d\n",
                 s->video_width, s->video_height);
             break;
@@ -442,8 +442,8 @@
             }
 
             /* load the palette into internal data structure */
-            first_color = LE_16(&scratch[0]);
-            last_color = first_color + LE_16(&scratch[2]) - 1;
+            first_color = AV_RL16(&scratch[0]);
+            last_color = first_color + AV_RL16(&scratch[2]) - 1;
             /* sanity check (since they are 16 bit values) */
             if ((first_color > 0xFF) || (last_color > 0xFF)) {
                 debug_ipmovie("demux_ipmovie: set_palette indices out of range (%d -> %d)\n",
@@ -542,7 +542,7 @@
     if (get_buffer(pb, chunk_preamble, CHUNK_PREAMBLE_SIZE) !=
         CHUNK_PREAMBLE_SIZE)
         return AVERROR_IO;
-    chunk_type = LE_16(&chunk_preamble[2]);
+    chunk_type = AV_RL16(&chunk_preamble[2]);
     url_fseek(pb, -CHUNK_PREAMBLE_SIZE, SEEK_CUR);
 
     if (chunk_type == CHUNK_VIDEO)
--- a/matroska.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/matroska.c	Fri Jan 19 22:12:59 2007 +0000
@@ -2372,7 +2372,7 @@
 static inline int
 rv_offset(uint8_t *data, int slice, int slices)
 {
-    return LE_32(data+8*slice+4) + 8*slices;
+    return AV_RL32(data+8*slice+4) + 8*slices;
 }
 
 static int
--- a/mm.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/mm.c	Fri Jan 19 22:12:59 2007 +0000
@@ -61,9 +61,9 @@
     /* the first chunk is always the header */
     if (p->buf_size < MM_PREAMBLE_SIZE)
         return 0;
-    if (LE_16(&p->buf[0]) != MM_TYPE_HEADER)
+    if (AV_RL16(&p->buf[0]) != MM_TYPE_HEADER)
         return 0;
-    if (LE_32(&p->buf[2]) != MM_HEADER_LEN_V && LE_32(&p->buf[2]) != MM_HEADER_LEN_AV)
+    if (AV_RL32(&p->buf[2]) != MM_HEADER_LEN_V && AV_RL32(&p->buf[2]) != MM_HEADER_LEN_AV)
         return 0;
 
     /* only return half certainty since this check is a bit sketchy */
@@ -141,8 +141,8 @@
             return AVERROR_IO;
         }
 
-        type = LE_16(&preamble[0]);
-        length = LE_16(&preamble[2]);
+        type = AV_RL16(&preamble[0]);
+        length = AV_RL16(&preamble[2]);
 
         switch(type) {
         case MM_TYPE_PALETTE :
--- a/mov.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/mov.c	Fri Jan 19 22:12:59 2007 +0000
@@ -1447,7 +1447,7 @@
         /* ignore invalid offset */
         if ((offset + 8) > (unsigned int)p->buf_size)
             return score;
-        tag = LE_32(p->buf + offset + 4);
+        tag = AV_RL32(p->buf + offset + 4);
         switch(tag) {
         /* check for obvious tags */
         case MKTAG( 'j', 'P', ' ', ' ' ): /* jpeg 2000 signature */
@@ -1465,7 +1465,7 @@
         case MKTAG( 'f', 't', 'y', 'p' ):
         case MKTAG( 's', 'k', 'i', 'p' ):
         case MKTAG( 'u', 'u', 'i', 'd' ):
-            offset = BE_32(p->buf+offset) + offset;
+            offset = AV_RB32(p->buf+offset) + offset;
             /* if we only find those cause probedata is too small at least rate them */
             score = AVPROBE_SCORE_MAX - 50;
             break;
--- a/movenc.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/movenc.c	Fri Jan 19 22:12:59 2007 +0000
@@ -480,7 +480,7 @@
     put_tag(pb, "avcC");
     if (track->vosLen > 6) {
         /* check for h264 start code */
-        if (BE_32(track->vosData) == 0x00000001) {
+        if (AV_RB32(track->vosData) == 0x00000001) {
             uint8_t *buf, *end;
             uint32_t sps_size=0, pps_size=0;
             uint8_t *sps=0, *pps=0;
@@ -493,7 +493,7 @@
             while (buf < end) {
                 unsigned int size;
                 uint8_t nal_type;
-                size = BE_32(buf);
+                size = AV_RB32(buf);
                 nal_type = buf[4] & 0x1f;
                 if (nal_type == 7) { /* SPS */
                     sps = buf + 4;
--- a/nuv.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/nuv.c	Fri Jan 19 22:12:59 2007 +0000
@@ -190,7 +190,7 @@
         if (ret <= 0)
             return ret ? ret : -1;
         frametype = hdr[0];
-        size = PKTSIZE(LE_32(&hdr[8]));
+        size = PKTSIZE(AV_RL32(&hdr[8]));
         switch (frametype) {
             case NUV_VIDEO:
             case NUV_EXTRADATA:
@@ -203,7 +203,7 @@
                 if (ret < 0)
                     return ret;
                 pkt->pos = url_ftell(pb);
-                pkt->pts = LE_32(&hdr[4]);
+                pkt->pts = AV_RL32(&hdr[4]);
                 pkt->stream_index = ctx->v_id;
                 memcpy(pkt->data, hdr, HDRSIZE);
                 ret = get_buffer(pb, pkt->data + HDRSIZE, size);
@@ -215,7 +215,7 @@
                     break;
                 }
                 ret = av_get_packet(pb, pkt, size);
-                pkt->pts = LE_32(&hdr[4]);
+                pkt->pts = AV_RL32(&hdr[4]);
                 pkt->stream_index = ctx->a_id;
                 return ret;
             case NUV_SEEKP:
--- a/psxstr.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/psxstr.c	Fri Jan 19 22:12:59 2007 +0000
@@ -92,8 +92,8 @@
     if (p->buf_size < 0x38)
         return 0;
 
-    if ((LE_32(&p->buf[0]) == RIFF_TAG) &&
-        (LE_32(&p->buf[8]) == CDXA_TAG)) {
+    if ((AV_RL32(&p->buf[0]) == RIFF_TAG) &&
+        (AV_RL32(&p->buf[8]) == CDXA_TAG)) {
 
         /* RIFF header seen; skip 0x2C bytes */
         start = RIFF_HEADER_SIZE;
@@ -143,7 +143,7 @@
     /* skip over any RIFF header */
     if (get_buffer(pb, sector, RIFF_HEADER_SIZE) != RIFF_HEADER_SIZE)
         return AVERROR_IO;
-    if (LE_32(&sector[0]) == RIFF_TAG)
+    if (AV_RL32(&sector[0]) == RIFF_TAG)
         start = RIFF_HEADER_SIZE;
     else
         start = 0;
@@ -168,12 +168,12 @@
             /* check if this channel gets to be the dominant video channel */
             if (str->video_channel == -1) {
                 /* qualify the magic number */
-                if (LE_32(&sector[0x18]) != STR_MAGIC)
+                if (AV_RL32(&sector[0x18]) != STR_MAGIC)
                     break;
                 str->video_channel = channel;
                 str->channels[channel].type = STR_VIDEO;
-                str->channels[channel].width = LE_16(&sector[0x28]);
-                str->channels[channel].height = LE_16(&sector[0x2A]);
+                str->channels[channel].width = AV_RL16(&sector[0x28]);
+                str->channels[channel].height = AV_RL16(&sector[0x2A]);
 
                 /* allocate a new AVStream */
                 st = av_new_stream(s, 0);
@@ -273,9 +273,9 @@
             /* check if this the video channel we care about */
             if (channel == str->video_channel) {
 
-                int current_sector = LE_16(&sector[0x1C]);
-                int sector_count   = LE_16(&sector[0x1E]);
-                int frame_size = LE_32(&sector[0x24]);
+                int current_sector = AV_RL16(&sector[0x1C]);
+                int sector_count   = AV_RL16(&sector[0x1E]);
+                int frame_size = AV_RL32(&sector[0x24]);
                 int bytes_to_copy;
 //        printf("%d %d %d\n",current_sector,sector_count,frame_size);
                 /* if this is the first sector of the frame, allocate a pkt */
--- a/rtp.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/rtp.c	Fri Jan 19 22:12:59 2007 +0000
@@ -504,7 +504,7 @@
 
     /* decode the first 2 bytes where are stored the AUHeader sections
        length in bits */
-    au_headers_length = BE_16(buf);
+    au_headers_length = AV_RB16(buf);
 
     if (au_headers_length > RTP_MAX_PACKET_LENGTH)
       return -1;
--- a/rtp_h264.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/rtp_h264.c	Fri Jan 19 22:12:59 2007 +0000
@@ -209,7 +209,7 @@
                 int src_len= len;
 
                 do {
-                    uint16_t nal_size = BE_16(src); // this going to be a problem if unaligned (can it be?)
+                    uint16_t nal_size = AV_RB16(src); // this going to be a problem if unaligned (can it be?)
 
                     // consume the length of the aggregate...
                     src += 2;
--- a/segafilm.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/segafilm.c	Fri Jan 19 22:12:59 2007 +0000
@@ -69,7 +69,7 @@
     if (p->buf_size < 4)
         return 0;
 
-    if (BE_32(&p->buf[0]) != FILM_TAG)
+    if (AV_RB32(&p->buf[0]) != FILM_TAG)
         return 0;
 
     return AVPROBE_SCORE_MAX;
@@ -93,8 +93,8 @@
     /* load the main FILM header */
     if (get_buffer(pb, scratch, 16) != 16)
         return AVERROR_IO;
-    data_offset = BE_32(&scratch[4]);
-    film->version = BE_32(&scratch[8]);
+    data_offset = AV_RB32(&scratch[4]);
+    film->version = AV_RB32(&scratch[8]);
 
     /* load the FDSC chunk */
     if (film->version == 0) {
@@ -110,7 +110,7 @@
         /* normal Saturn .cpk files; 32-byte header */
         if (get_buffer(pb, scratch, 32) != 32)
             return AVERROR_IO;
-        film->audio_samplerate = BE_16(&scratch[24]);;
+        film->audio_samplerate = AV_RB16(&scratch[24]);;
         film->audio_channels = scratch[21];
         film->audio_bits = scratch[22];
         if (film->audio_bits == 8)
@@ -121,10 +121,10 @@
             film->audio_type = 0;
     }
 
-    if (BE_32(&scratch[0]) != FDSC_TAG)
+    if (AV_RB32(&scratch[0]) != FDSC_TAG)
         return AVERROR_INVALIDDATA;
 
-    if (BE_32(&scratch[8]) == CVID_TAG) {
+    if (AV_RB32(&scratch[8]) == CVID_TAG) {
         film->video_type = CODEC_ID_CINEPAK;
     } else
         film->video_type = 0;
@@ -138,8 +138,8 @@
         st->codec->codec_type = CODEC_TYPE_VIDEO;
         st->codec->codec_id = film->video_type;
         st->codec->codec_tag = 0;  /* no fourcc */
-        st->codec->width = BE_32(&scratch[16]);
-        st->codec->height = BE_32(&scratch[12]);
+        st->codec->width = AV_RB32(&scratch[16]);
+        st->codec->height = AV_RB32(&scratch[12]);
     }
 
     if (film->audio_type) {
@@ -162,10 +162,10 @@
     /* load the sample table */
     if (get_buffer(pb, scratch, 16) != 16)
         return AVERROR_IO;
-    if (BE_32(&scratch[0]) != STAB_TAG)
+    if (AV_RB32(&scratch[0]) != STAB_TAG)
         return AVERROR_INVALIDDATA;
-    film->base_clock = BE_32(&scratch[8]);
-    film->sample_count = BE_32(&scratch[12]);
+    film->base_clock = AV_RB32(&scratch[8]);
+    film->sample_count = AV_RB32(&scratch[12]);
     if(film->sample_count >= UINT_MAX / sizeof(film_sample_t))
         return -1;
     film->sample_table = av_malloc(film->sample_count * sizeof(film_sample_t));
@@ -181,9 +181,9 @@
             return AVERROR_IO;
         }
         film->sample_table[i].sample_offset =
-            data_offset + BE_32(&scratch[0]);
-        film->sample_table[i].sample_size = BE_32(&scratch[4]);
-        if (BE_32(&scratch[8]) == 0xFFFFFFFF) {
+            data_offset + AV_RB32(&scratch[0]);
+        film->sample_table[i].sample_size = AV_RB32(&scratch[4]);
+        if (AV_RB32(&scratch[8]) == 0xFFFFFFFF) {
             film->sample_table[i].stream = film->audio_stream_index;
             film->sample_table[i].pts = audio_frame_counter;
             film->sample_table[i].pts *= film->base_clock;
@@ -193,7 +193,7 @@
                 (film->audio_channels * film->audio_bits / 8));
         } else {
             film->sample_table[i].stream = film->video_stream_index;
-            film->sample_table[i].pts = BE_32(&scratch[8]) & 0x7FFFFFFF;
+            film->sample_table[i].pts = AV_RB32(&scratch[8]) & 0x7FFFFFFF;
             film->sample_table[i].keyframe = (scratch[8] & 0x80) ? 0 : 1;
         }
     }
--- a/sgi.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/sgi.c	Fri Jan 19 22:12:59 2007 +0000
@@ -50,7 +50,7 @@
 static int sgi_probe(AVProbeData *pd)
 {
     /* test for sgi magic */
-    if (pd->buf_size >= 2 && BE_16(&pd->buf[0]) == SGI_MAGIC) {
+    if (pd->buf_size >= 2 && AV_RB16(&pd->buf[0]) == SGI_MAGIC) {
         return AVPROBE_SCORE_MAX;
     } else {
         return 0;
@@ -197,7 +197,7 @@
         for (y = 0; y < ysize; y++) {
             dest_row = pict->data[0] + (ysize - 1 - y) * (xsize * zsize);
 
-            start_offset = BE_32(&start_table[y + z * ysize]);
+            start_offset = AV_RB32(&start_table[y + z * ysize]);
 
             /* don't seek if already at the next rle start offset */
             if (url_ftell(f) != start_offset) {
--- a/sierravmd.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/sierravmd.c	Fri Jan 19 22:12:59 2007 +0000
@@ -64,7 +64,7 @@
 
     /* check if the first 2 bytes of the file contain the appropriate size
      * of a VMD header chunk */
-    if (LE_16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
+    if (AV_RL16(&p->buf[0]) != VMD_HEADER_SIZE - 2)
         return 0;
 
     /* only return half certainty since this check is a bit sketchy */
@@ -103,14 +103,14 @@
     vst->codec->codec_type = CODEC_TYPE_VIDEO;
     vst->codec->codec_id = CODEC_ID_VMDVIDEO;
     vst->codec->codec_tag = 0;  /* no fourcc */
-    vst->codec->width = LE_16(&vmd->vmd_header[12]);
-    vst->codec->height = LE_16(&vmd->vmd_header[14]);
+    vst->codec->width = AV_RL16(&vmd->vmd_header[12]);
+    vst->codec->height = AV_RL16(&vmd->vmd_header[14]);
     vst->codec->extradata_size = VMD_HEADER_SIZE;
     vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
     memcpy(vst->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE);
 
     /* if sample rate is 0, assume no audio */
-    vmd->sample_rate = LE_16(&vmd->vmd_header[804]);
+    vmd->sample_rate = AV_RL16(&vmd->vmd_header[804]);
     if (vmd->sample_rate) {
         st = av_new_stream(s, 0);
         if (!st)
@@ -121,7 +121,7 @@
         st->codec->codec_tag = 0;  /* no fourcc */
         st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1;
         st->codec->sample_rate = vmd->sample_rate;
-        st->codec->block_align = LE_16(&vmd->vmd_header[806]);
+        st->codec->block_align = AV_RL16(&vmd->vmd_header[806]);
         if (st->codec->block_align & 0x8000) {
             st->codec->bits_per_sample = 16;
             st->codec->block_align = -(st->codec->block_align - 0x10000);
@@ -140,14 +140,14 @@
         pts_inc = num;
     }
 
-    toc_offset = LE_32(&vmd->vmd_header[812]);
-    vmd->frame_count = LE_16(&vmd->vmd_header[6]);
-    vmd->frames_per_block = LE_16(&vmd->vmd_header[18]);
+    toc_offset = AV_RL32(&vmd->vmd_header[812]);
+    vmd->frame_count = AV_RL16(&vmd->vmd_header[6]);
+    vmd->frames_per_block = AV_RL16(&vmd->vmd_header[18]);
     url_fseek(pb, toc_offset, SEEK_SET);
 
     raw_frame_table = NULL;
     vmd->frame_table = NULL;
-    sound_buffers = LE_16(&vmd->vmd_header[808]);
+    sound_buffers = AV_RL16(&vmd->vmd_header[808]);
     raw_frame_table_size = vmd->frame_count * 6;
     raw_frame_table = av_malloc(raw_frame_table_size);
     if(vmd->frame_count * vmd->frames_per_block  >= UINT_MAX / sizeof(vmd_frame_t)){
@@ -170,7 +170,7 @@
     total_frames = 0;
     for (i = 0; i < vmd->frame_count; i++) {
 
-        current_offset = LE_32(&raw_frame_table[6 * i + 2]);
+        current_offset = AV_RL32(&raw_frame_table[6 * i + 2]);
 
         /* handle each entry in index block */
         for (j = 0; j < vmd->frames_per_block; j++) {
@@ -179,7 +179,7 @@
 
             get_buffer(pb, chunk, BYTES_PER_FRAME_RECORD);
             type = chunk[0];
-            size = LE_32(&chunk[2]);
+            size = AV_RL32(&chunk[2]);
             if(!size)
                 continue;
             switch(type) {
--- a/smacker.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/smacker.c	Fri Jan 19 22:12:59 2007 +0000
@@ -311,7 +311,7 @@
         pkt->size = smk->buf_sizes[smk->curstream];
         pkt->stream_index = smk->stream_id[smk->curstream];
         pkt->pts = smk->aud_pts[smk->curstream];
-        smk->aud_pts[smk->curstream] += LE_32(pkt->data);
+        smk->aud_pts[smk->curstream] += AV_RL32(pkt->data);
         smk->curstream--;
     }
 
--- a/swf.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/swf.c	Fri Jan 19 22:12:59 2007 +0000
@@ -878,7 +878,7 @@
                     get_le16(pb); /* BITMAP_ID */
                     av_new_packet(pkt, len-2);
                     get_buffer(pb, pkt->data, 4);
-                    if (BE_32(pkt->data) == 0xffd8ffd9) {
+                    if (AV_RB32(pkt->data) == 0xffd8ffd9) {
                         /* old SWF files containing SOI/EOI as data start */
                         pkt->size -= 4;
                         get_buffer(pb, pkt->data, pkt->size);
--- a/wc3movie.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/wc3movie.c	Fri Jan 19 22:12:59 2007 +0000
@@ -115,8 +115,8 @@
     if (p->buf_size < 12)
         return 0;
 
-    if ((LE_32(&p->buf[0]) != FORM_TAG) ||
-        (LE_32(&p->buf[8]) != MOVE_TAG))
+    if ((AV_RL32(&p->buf[0]) != FORM_TAG) ||
+        (AV_RL32(&p->buf[8]) != MOVE_TAG))
         return 0;
 
     return AVPROBE_SCORE_MAX;
@@ -153,8 +153,8 @@
     if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
         WC3_PREAMBLE_SIZE)
         return AVERROR_IO;
-    fourcc_tag = LE_32(&preamble[0]);
-    size = (BE_32(&preamble[4]) + 1) & (~1);
+    fourcc_tag = AV_RL32(&preamble[0]);
+    size = (AV_RB32(&preamble[4]) + 1) & (~1);
 
     do {
         switch (fourcc_tag) {
@@ -170,7 +170,7 @@
             url_fseek(pb, 8, SEEK_CUR);
             if ((ret = get_buffer(pb, preamble, 4)) != 4)
                 return AVERROR_IO;
-            wc3->palette_count = LE_32(&preamble[0]);
+            wc3->palette_count = AV_RL32(&preamble[0]);
             if((unsigned)wc3->palette_count >= UINT_MAX / PALETTE_SIZE){
                 wc3->palette_count= 0;
                 return -1;
@@ -193,8 +193,8 @@
             if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
                 WC3_PREAMBLE_SIZE)
                 return AVERROR_IO;
-            wc3->width = LE_32(&preamble[0]);
-            wc3->height = LE_32(&preamble[4]);
+            wc3->width = AV_RL32(&preamble[0]);
+            wc3->height = AV_RL32(&preamble[4]);
             break;
 
         case PALT_TAG:
@@ -229,9 +229,9 @@
         if ((ret = get_buffer(pb, preamble, WC3_PREAMBLE_SIZE)) !=
             WC3_PREAMBLE_SIZE)
             return AVERROR_IO;
-        fourcc_tag = LE_32(&preamble[0]);
+        fourcc_tag = AV_RL32(&preamble[0]);
         /* chunk sizes are 16-bit aligned */
-        size = (BE_32(&preamble[4]) + 1) & (~1);
+        size = (AV_RB32(&preamble[4]) + 1) & (~1);
 
     } while (fourcc_tag != BRCH_TAG);
 
@@ -291,9 +291,9 @@
             WC3_PREAMBLE_SIZE)
             ret = AVERROR_IO;
 
-        fourcc_tag = LE_32(&preamble[0]);
+        fourcc_tag = AV_RL32(&preamble[0]);
         /* chunk sizes are 16-bit aligned */
-        size = (BE_32(&preamble[4]) + 1) & (~1);
+        size = (AV_RB32(&preamble[4]) + 1) & (~1);
 
         switch (fourcc_tag) {
 
@@ -305,7 +305,7 @@
             /* load up new palette */
             if ((ret = get_buffer(pb, preamble, 4)) != 4)
                 return AVERROR_IO;
-            palette_number = LE_32(&preamble[0]);
+            palette_number = AV_RL32(&preamble[0]);
             if (palette_number >= wc3->palette_count)
                 return AVERROR_INVALIDDATA;
             base_palette_index = palette_number * PALETTE_COUNT * 3;
--- a/westwood.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/westwood.c	Fri Jan 19 22:12:59 2007 +0000
@@ -101,7 +101,7 @@
         return 0;
 
     /* check sample rate */
-    field = LE_16(&p->buf[0]);
+    field = AV_RL16(&p->buf[0]);
     if ((field < 8000) || (field > 48000))
         return 0;
 
@@ -124,7 +124,7 @@
 
     if (get_buffer(pb, header, AUD_HEADER_SIZE) != AUD_HEADER_SIZE)
         return AVERROR_IO;
-    wsaud->audio_samplerate = LE_16(&header[0]);
+    wsaud->audio_samplerate = AV_RL16(&header[0]);
     if (header[11] == 99)
         wsaud->audio_type = CODEC_ID_ADPCM_IMA_WS;
     else
@@ -170,10 +170,10 @@
         return AVERROR_IO;
 
     /* validate the chunk */
-    if (LE_32(&preamble[4]) != AUD_CHUNK_SIGNATURE)
+    if (AV_RL32(&preamble[4]) != AUD_CHUNK_SIGNATURE)
         return AVERROR_INVALIDDATA;
 
-    chunk_size = LE_16(&preamble[0]);
+    chunk_size = AV_RL16(&preamble[0]);
     ret= av_get_packet(pb, pkt, chunk_size);
     if (ret != chunk_size)
         return AVERROR_IO;
@@ -202,8 +202,8 @@
         return 0;
 
     /* check for the VQA signatures */
-    if ((BE_32(&p->buf[0]) != FORM_TAG) ||
-        (BE_32(&p->buf[8]) != WVQA_TAG))
+    if ((AV_RB32(&p->buf[0]) != FORM_TAG) ||
+        (AV_RB32(&p->buf[8]) != WVQA_TAG))
         return 0;
 
     return AVPROBE_SCORE_MAX;
@@ -242,22 +242,22 @@
         av_free(st->codec->extradata);
         return AVERROR_IO;
     }
-    st->codec->width = LE_16(&header[6]);
-    st->codec->height = LE_16(&header[8]);
+    st->codec->width = AV_RL16(&header[6]);
+    st->codec->height = AV_RL16(&header[8]);
 
     /* initialize the audio decoder stream for VQA v1 or nonzero samplerate */
-    if (LE_16(&header[24]) || (LE_16(&header[0]) == 1 && LE_16(&header[2]) == 1)) {
+    if (AV_RL16(&header[24]) || (AV_RL16(&header[0]) == 1 && AV_RL16(&header[2]) == 1)) {
         st = av_new_stream(s, 0);
         if (!st)
             return AVERROR_NOMEM;
         av_set_pts_info(st, 33, 1, VQA_FRAMERATE);
         st->codec->codec_type = CODEC_TYPE_AUDIO;
-        if (LE_16(&header[0]) == 1)
+        if (AV_RL16(&header[0]) == 1)
             st->codec->codec_id = CODEC_ID_WESTWOOD_SND1;
         else
             st->codec->codec_id = CODEC_ID_ADPCM_IMA_WS;
         st->codec->codec_tag = 0;  /* no tag */
-        st->codec->sample_rate = LE_16(&header[24]);
+        st->codec->sample_rate = AV_RL16(&header[24]);
         if (!st->codec->sample_rate)
             st->codec->sample_rate = 22050;
         st->codec->channels = header[26];
@@ -281,8 +281,8 @@
             av_free(st->codec->extradata);
             return AVERROR_IO;
         }
-        chunk_tag = BE_32(&scratch[0]);
-        chunk_size = BE_32(&scratch[4]);
+        chunk_tag = AV_RB32(&scratch[0]);
+        chunk_size = AV_RB32(&scratch[4]);
 
         /* catch any unknown header tags, for curiousity */
         switch (chunk_tag) {
@@ -323,8 +323,8 @@
     int skip_byte;
 
     while (get_buffer(pb, preamble, VQA_PREAMBLE_SIZE) == VQA_PREAMBLE_SIZE) {
-        chunk_type = BE_32(&preamble[0]);
-        chunk_size = BE_32(&preamble[4]);
+        chunk_type = AV_RB32(&preamble[0]);
+        chunk_size = AV_RB32(&preamble[4]);
         skip_byte = chunk_size & 0x01;
 
         if ((chunk_type == SND1_TAG) || (chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) {
@@ -344,7 +344,7 @@
             } else if(chunk_type == SND1_TAG) {
                 pkt->stream_index = wsvqa->audio_stream_index;
                 /* unpacked size is stored in header */
-                wsvqa->audio_frame_counter += LE_16(pkt->data) / wsvqa->audio_channels;
+                wsvqa->audio_frame_counter += AV_RL16(pkt->data) / wsvqa->audio_channels;
             } else {
                 pkt->stream_index = wsvqa->video_stream_index;
                 wsvqa->video_pts += VQA_VIDEO_PTS_INC;
--- a/wv.c	Thu Jan 18 23:23:41 2007 +0000
+++ b/wv.c	Fri Jan 19 22:12:59 2007 +0000
@@ -92,7 +92,7 @@
     get_le32(pb); // total samples in file
     get_le32(pb); // offset in samples of current block
     get_buffer(pb, wc->extra, WV_EXTRA_SIZE);
-    wc->flags = LE_32(wc->extra + 4);
+    wc->flags = AV_RL32(wc->extra + 4);
     //parse flags
     if(wc->flags & WV_FLOAT){
         av_log(ctx, AV_LOG_ERROR, "Floating point data is not supported\n");