diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2007-01-19 22:12:59 +0000 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2007-01-19 22:12:59 +0000 |
commit | fead30d4440bc7b75006ae60f2742c63a05168b3 (patch) | |
tree | cead68d924846c1bfb756bb46c86184d889d10db /libavformat | |
parent | 50eaa857c099abda803c803927276d81c2d74edb (diff) | |
download | ffmpeg-streaming-fead30d4440bc7b75006ae60f2742c63a05168b3.zip ffmpeg-streaming-fead30d4440bc7b75006ae60f2742c63a05168b3.tar.gz |
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 'libavformat')
-rw-r--r-- | libavformat/4xm.c | 28 | ||||
-rw-r--r-- | libavformat/dsicin.c | 4 | ||||
-rw-r--r-- | libavformat/electronicarts.c | 6 | ||||
-rw-r--r-- | libavformat/flic.c | 16 | ||||
-rw-r--r-- | libavformat/idcin.c | 10 | ||||
-rw-r--r-- | libavformat/idroq.c | 22 | ||||
-rw-r--r-- | libavformat/ipmovie.c | 24 | ||||
-rw-r--r-- | libavformat/matroska.c | 2 | ||||
-rw-r--r-- | libavformat/mm.c | 8 | ||||
-rw-r--r-- | libavformat/mov.c | 4 | ||||
-rw-r--r-- | libavformat/movenc.c | 4 | ||||
-rw-r--r-- | libavformat/nuv.c | 6 | ||||
-rw-r--r-- | libavformat/psxstr.c | 18 | ||||
-rw-r--r-- | libavformat/rtp.c | 2 | ||||
-rw-r--r-- | libavformat/rtp_h264.c | 2 | ||||
-rw-r--r-- | libavformat/segafilm.c | 30 | ||||
-rw-r--r-- | libavformat/sgi.c | 4 | ||||
-rw-r--r-- | libavformat/sierravmd.c | 22 | ||||
-rw-r--r-- | libavformat/smacker.c | 2 | ||||
-rw-r--r-- | libavformat/swf.c | 2 | ||||
-rw-r--r-- | libavformat/wc3movie.c | 24 | ||||
-rw-r--r-- | libavformat/westwood.c | 32 | ||||
-rw-r--r-- | libavformat/wv.c | 2 |
23 files changed, 137 insertions, 137 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 12e7d9e..bf10b9e 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -82,8 +82,8 @@ static int fourxm_probe(AVProbeData *p) 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 @@ static int fourxm_read_header(AVFormatContext *s, /* 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 @@ static int fourxm_read_header(AVFormatContext *s, 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 @@ static int fourxm_read_header(AVFormatContext *s, 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 @@ static int fourxm_read_packet(AVFormatContext *s, 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) { diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index f274ead..fb9cb50 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -62,11 +62,11 @@ static int cin_probe(AVProbeData *p) 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; diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 943f75b..762d658 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -168,7 +168,7 @@ static int ea_probe(AVProbeData *p) 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 @@ static int ea_read_packet(AVFormatContext *s, 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 */ diff --git a/libavformat/flic.c b/libavformat/flic.c index ac32e73..e6aa26b 100644 --- a/libavformat/flic.c +++ b/libavformat/flic.c @@ -58,7 +58,7 @@ static int flic_probe(AVProbeData *p) 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 @@ static int flic_read_header(AVFormatContext *s, 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 @@ static int flic_read_header(AVFormatContext *s, 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 @@ static int flic_read_header(AVFormatContext *s, /* 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 @@ static int flic_read_packet(AVFormatContext *s, 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)) { diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 48d1e25..e2c92f3 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -109,27 +109,27 @@ static int idcin_probe(AVProbeData *p) 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; diff --git a/libavformat/idroq.c b/libavformat/idroq.c index 419696c..b8ee176 100644 --- a/libavformat/idroq.c +++ b/libavformat/idroq.c @@ -61,8 +61,8 @@ static int roq_probe(AVProbeData *p) 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 @@ static int roq_read_header(AVFormatContext *s, 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 @@ static int roq_read_header(AVFormatContext *s, 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 @@ static int roq_read_header(AVFormatContext *s, 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 @@ static int roq_read_header(AVFormatContext *s, 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 @@ static int roq_read_packet(AVFormatContext *s, 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 @@ static int roq_read_packet(AVFormatContext *s, 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 */ diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index 3c04599..e6470fa 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -236,8 +236,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb, 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 @@ static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb, 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 @@ static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb, 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 @@ static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb, 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 @@ static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb, 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 @@ static int process_ipmovie_chunk(IPMVEContext *s, ByteIOContext *pb, } /* 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 @@ static int ipmovie_read_header(AVFormatContext *s, 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) diff --git a/libavformat/matroska.c b/libavformat/matroska.c index 0cd119e..13321ab 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -2372,7 +2372,7 @@ matroska_find_track_by_num (MatroskaDemuxContext *matroska, 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 diff --git a/libavformat/mm.c b/libavformat/mm.c index a3c637f..443b709 100644 --- a/libavformat/mm.c +++ b/libavformat/mm.c @@ -61,9 +61,9 @@ static int mm_probe(AVProbeData *p) /* 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 @@ static int mm_read_packet(AVFormatContext *s, 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 : diff --git a/libavformat/mov.c b/libavformat/mov.c index a691c3b..1658b6d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1447,7 +1447,7 @@ static int mov_probe(AVProbeData *p) /* 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 @@ static int mov_probe(AVProbeData *p) 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; diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 0d1b8f8..56b0f76 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -480,7 +480,7 @@ static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track) 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 @@ static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track) 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; diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 3b96eb9..31f02b2 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -190,7 +190,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { 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 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { 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 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { 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: diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index b03f657..2f1a3dc 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -92,8 +92,8 @@ static int str_probe(AVProbeData *p) 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 @@ static int str_read_header(AVFormatContext *s, /* skip over any RIFF header */ if (get_buffer(pb, sector, RIFF_HEADER_SIZE) != RIFF_HEADER_SIZE) return AVERROR_IO; - if (LE_32(§or[0]) == RIFF_TAG) + if (AV_RL32(§or[0]) == RIFF_TAG) start = RIFF_HEADER_SIZE; else start = 0; @@ -168,12 +168,12 @@ static int str_read_header(AVFormatContext *s, /* check if this channel gets to be the dominant video channel */ if (str->video_channel == -1) { /* qualify the magic number */ - if (LE_32(§or[0x18]) != STR_MAGIC) + if (AV_RL32(§or[0x18]) != STR_MAGIC) break; str->video_channel = channel; str->channels[channel].type = STR_VIDEO; - str->channels[channel].width = LE_16(§or[0x28]); - str->channels[channel].height = LE_16(§or[0x2A]); + str->channels[channel].width = AV_RL16(§or[0x28]); + str->channels[channel].height = AV_RL16(§or[0x2A]); /* allocate a new AVStream */ st = av_new_stream(s, 0); @@ -273,9 +273,9 @@ static int str_read_packet(AVFormatContext *s, /* check if this the video channel we care about */ if (channel == str->video_channel) { - int current_sector = LE_16(§or[0x1C]); - int sector_count = LE_16(§or[0x1E]); - int frame_size = LE_32(§or[0x24]); + int current_sector = AV_RL16(§or[0x1C]); + int sector_count = AV_RL16(§or[0x1E]); + int frame_size = AV_RL32(§or[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 */ diff --git a/libavformat/rtp.c b/libavformat/rtp.c index 0ac0a7d..359b1f2 100644 --- a/libavformat/rtp.c +++ b/libavformat/rtp.c @@ -504,7 +504,7 @@ static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf) /* 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; diff --git a/libavformat/rtp_h264.c b/libavformat/rtp_h264.c index 68066aa..1d5c766 100644 --- a/libavformat/rtp_h264.c +++ b/libavformat/rtp_h264.c @@ -209,7 +209,7 @@ static int h264_handle_packet(RTPDemuxContext * s, 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; diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 56e898b..b5375cc 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -69,7 +69,7 @@ static int film_probe(AVProbeData *p) 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 @@ static int film_read_header(AVFormatContext *s, /* 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 @@ static int film_read_header(AVFormatContext *s, /* 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 @@ static int film_read_header(AVFormatContext *s, 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 @@ static int film_read_header(AVFormatContext *s, 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 @@ static int film_read_header(AVFormatContext *s, /* 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 @@ static int film_read_header(AVFormatContext *s, 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 @@ static int film_read_header(AVFormatContext *s, (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; } } diff --git a/libavformat/sgi.c b/libavformat/sgi.c index bf0297e..5adcb37 100644 --- a/libavformat/sgi.c +++ b/libavformat/sgi.c @@ -50,7 +50,7 @@ typedef struct SGIInfo{ 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 @@ static int read_rle_sgi(const SGIInfo *sgi_info, 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) { diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 92dbce9..3e1c859 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -64,7 +64,7 @@ static int vmd_probe(AVProbeData *p) /* 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 @@ static int vmd_read_header(AVFormatContext *s, 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 @@ static int vmd_read_header(AVFormatContext *s, 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 @@ static int vmd_read_header(AVFormatContext *s, 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 @@ static int vmd_read_header(AVFormatContext *s, 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 @@ static int vmd_read_header(AVFormatContext *s, 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) { diff --git a/libavformat/smacker.c b/libavformat/smacker.c index a08bd2d..0658c9a 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -311,7 +311,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) 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--; } diff --git a/libavformat/swf.c b/libavformat/swf.c index ab9ec5a..438ca52 100644 --- a/libavformat/swf.c +++ b/libavformat/swf.c @@ -878,7 +878,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) 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); diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c index 6b32427..3e58a1b 100644 --- a/libavformat/wc3movie.c +++ b/libavformat/wc3movie.c @@ -115,8 +115,8 @@ static int wc3_probe(AVProbeData *p) 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 @@ static int wc3_read_header(AVFormatContext *s, 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 @@ static int wc3_read_header(AVFormatContext *s, 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 @@ static int wc3_read_header(AVFormatContext *s, 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 @@ static int wc3_read_header(AVFormatContext *s, 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 @@ static int wc3_read_packet(AVFormatContext *s, 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 @@ static int wc3_read_packet(AVFormatContext *s, /* 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; diff --git a/libavformat/westwood.c b/libavformat/westwood.c index 0d986c8..bed2f0d 100644 --- a/libavformat/westwood.c +++ b/libavformat/westwood.c @@ -101,7 +101,7 @@ static int wsaud_probe(AVProbeData *p) 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 @@ static int wsaud_read_header(AVFormatContext *s, 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 @@ static int wsaud_read_packet(AVFormatContext *s, 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 @@ static int wsvqa_probe(AVProbeData *p) 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 @@ static int wsvqa_read_header(AVFormatContext *s, 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 @@ static int wsvqa_read_header(AVFormatContext *s, 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 @@ static int wsvqa_read_packet(AVFormatContext *s, 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 @@ static int wsvqa_read_packet(AVFormatContext *s, } 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; diff --git a/libavformat/wv.c b/libavformat/wv.c index 2de07fe..c50a150 100644 --- a/libavformat/wv.c +++ b/libavformat/wv.c @@ -92,7 +92,7 @@ static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb) 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"); |