mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Replace WORDS_BIGENDIAN with HAVE_BIGENDIAN
Originally committed as revision 19508 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
84c04e2519
commit
63613fe615
5
configure
vendored
5
configure
vendored
@ -2591,11 +2591,6 @@ echo "HOSTLIBS=$host_libs" >> config.mak
|
|||||||
echo "TARGET_EXEC=$target_exec" >> config.mak
|
echo "TARGET_EXEC=$target_exec" >> config.mak
|
||||||
echo "TARGET_PATH=$target_path" >> config.mak
|
echo "TARGET_PATH=$target_path" >> config.mak
|
||||||
|
|
||||||
if enabled bigendian; then
|
|
||||||
echo "WORDS_BIGENDIAN=yes" >> config.mak
|
|
||||||
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
|
|
||||||
fi
|
|
||||||
|
|
||||||
if enabled sdl; then
|
if enabled sdl; then
|
||||||
echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
|
echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
|
||||||
echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak
|
echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak
|
||||||
|
@ -183,7 +183,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
case 32:
|
case 32:
|
||||||
avctx->pix_fmt = PIX_FMT_RGB32;
|
avctx->pix_fmt = PIX_FMT_RGB32;
|
||||||
c->planes = 4;
|
c->planes = 4;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
c->planemap[0] = 1; // 1st plane is red
|
c->planemap[0] = 1; // 1st plane is red
|
||||||
c->planemap[1] = 2; // 2nd plane is green
|
c->planemap[1] = 2; // 2nd plane is green
|
||||||
c->planemap[2] = 3; // 3rd plane is blue
|
c->planemap[2] = 3; // 3rd plane is blue
|
||||||
|
@ -59,7 +59,7 @@ static void add_frame_default(AVFrame *f, const uint8_t *src,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WORDS_BIGENDIAN
|
#if !HAVE_BIGENDIAN
|
||||||
#define copy_frame_16 copy_frame_default
|
#define copy_frame_16 copy_frame_default
|
||||||
#define copy_frame_32 copy_frame_default
|
#define copy_frame_32 copy_frame_default
|
||||||
#define add_frame_16 add_frame_default
|
#define add_frame_16 add_frame_default
|
||||||
|
@ -1224,7 +1224,7 @@ static void output_frame_footer(FlacEncodeContext *s)
|
|||||||
|
|
||||||
static void update_md5_sum(FlacEncodeContext *s, int16_t *samples)
|
static void update_md5_sum(FlacEncodeContext *s, int16_t *samples)
|
||||||
{
|
{
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < s->frame.blocksize*s->channels; i++) {
|
for(i = 0; i < s->frame.blocksize*s->channels; i++) {
|
||||||
int16_t smp = le2me_16(samples[i]);
|
int16_t smp = le2me_16(samples[i]);
|
||||||
|
@ -585,7 +585,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
|
|||||||
* during decompression. So if it is required (i.e., this is not a LE target, we do
|
* during decompression. So if it is required (i.e., this is not a LE target, we do
|
||||||
* a second pass over the line here, swapping the bytes.
|
* a second pass over the line here, swapping the bytes.
|
||||||
*/
|
*/
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
pixel_ptr = y_ptr;
|
pixel_ptr = y_ptr;
|
||||||
pixel_countdown = s->avctx->width;
|
pixel_countdown = s->avctx->width;
|
||||||
while (pixel_countdown > 0) {
|
while (pixel_countdown > 0) {
|
||||||
|
@ -82,7 +82,7 @@ static void filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y,
|
|||||||
static Picture * remove_long(H264Context *h, int i, int ref_mask);
|
static Picture * remove_long(H264Context *h, int i, int ref_mask);
|
||||||
|
|
||||||
static av_always_inline uint32_t pack16to32(int a, int b){
|
static av_always_inline uint32_t pack16to32(int a, int b){
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
return (b&0xFFFF) + (a<<16);
|
return (b&0xFFFF) + (a<<16);
|
||||||
#else
|
#else
|
||||||
return (a&0xFFFF) + (b<<16);
|
return (a&0xFFFF) + (b<<16);
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#define VLC_BITS 11
|
#define VLC_BITS 11
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
#define B 3
|
#define B 3
|
||||||
#define G 2
|
#define G 2
|
||||||
#define R 1
|
#define R 1
|
||||||
|
@ -548,7 +548,7 @@ static enum PixelFormat avcodec_get_pix_fmt_internal(const char *name)
|
|||||||
return PIX_FMT_NONE;
|
return PIX_FMT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
# define X_NE(be, le) be
|
# define X_NE(be, le) be
|
||||||
#else
|
#else
|
||||||
# define X_NE(be, le) le
|
# define X_NE(be, le) le
|
||||||
|
@ -576,7 +576,7 @@ static void iv_Decode_Chunk(Indeo3DecodeContext *s,
|
|||||||
lv1 = ref_lp[0];
|
lv1 = ref_lp[0];
|
||||||
lv2 = ref_lp[1];
|
lv2 = ref_lp[1];
|
||||||
if(lp2 == 0 && flag1 != 0) {
|
if(lp2 == 0 && flag1 != 0) {
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
lv1 = lv1 & 0xFF00FF00;
|
lv1 = lv1 & 0xFF00FF00;
|
||||||
lv1 = (lv1 >> 8) | lv1;
|
lv1 = (lv1 >> 8) | lv1;
|
||||||
lv2 = lv2 & 0xFF00FF00;
|
lv2 = lv2 & 0xFF00FF00;
|
||||||
|
@ -214,7 +214,7 @@ static int pcm_encode_frame(AVCodecContext *avctx,
|
|||||||
*dst++ = v - 128;
|
*dst++ = v - 128;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
case CODEC_ID_PCM_F64LE:
|
case CODEC_ID_PCM_F64LE:
|
||||||
ENCODE(int64_t, le64, samples, dst, n, 0, 0)
|
ENCODE(int64_t, le64, samples, dst, n, 0, 0)
|
||||||
break;
|
break;
|
||||||
@ -244,7 +244,7 @@ static int pcm_encode_frame(AVCodecContext *avctx,
|
|||||||
case CODEC_ID_PCM_F32LE:
|
case CODEC_ID_PCM_F32LE:
|
||||||
case CODEC_ID_PCM_S32LE:
|
case CODEC_ID_PCM_S32LE:
|
||||||
case CODEC_ID_PCM_S16LE:
|
case CODEC_ID_PCM_S16LE:
|
||||||
#endif /* WORDS_BIGENDIAN */
|
#endif /* HAVE_BIGENDIAN */
|
||||||
case CODEC_ID_PCM_U8:
|
case CODEC_ID_PCM_U8:
|
||||||
memcpy(dst, samples, n*sample_size);
|
memcpy(dst, samples, n*sample_size);
|
||||||
dst += n*sample_size;
|
dst += n*sample_size;
|
||||||
@ -422,7 +422,7 @@ static int pcm_decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
samples= (short*)dstu8;
|
samples= (short*)dstu8;
|
||||||
break;
|
break;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
case CODEC_ID_PCM_F64LE:
|
case CODEC_ID_PCM_F64LE:
|
||||||
DECODE(int64_t, le64, src, samples, n, 0, 0)
|
DECODE(int64_t, le64, src, samples, n, 0, 0)
|
||||||
break;
|
break;
|
||||||
@ -452,7 +452,7 @@ static int pcm_decode_frame(AVCodecContext *avctx,
|
|||||||
case CODEC_ID_PCM_F32LE:
|
case CODEC_ID_PCM_F32LE:
|
||||||
case CODEC_ID_PCM_S32LE:
|
case CODEC_ID_PCM_S32LE:
|
||||||
case CODEC_ID_PCM_S16LE:
|
case CODEC_ID_PCM_S16LE:
|
||||||
#endif /* WORDS_BIGENDIAN */
|
#endif /* HAVE_BIGENDIAN */
|
||||||
case CODEC_ID_PCM_U8:
|
case CODEC_ID_PCM_U8:
|
||||||
memcpy(samples, src, n*sample_size);
|
memcpy(samples, src, n*sample_size);
|
||||||
src += n*sample_size;
|
src += n*sample_size;
|
||||||
|
@ -79,7 +79,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
stride = p->linesize[0];
|
stride = p->linesize[0];
|
||||||
|
|
||||||
for (y=0; y<h; y++) {
|
for (y=0; y<h; y++) {
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
unsigned int x;
|
unsigned int x;
|
||||||
for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
|
for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
|
||||||
AV_WN16(ptr+x, AV_RL16(buf+x));
|
AV_WN16(ptr+x, AV_RL16(buf+x));
|
||||||
|
@ -66,7 +66,7 @@ static inline void idctRowCondDC (DCTELEM * row)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_FAST_64BIT
|
#if HAVE_FAST_64BIT
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
#define ROW0_MASK 0xffff000000000000LL
|
#define ROW0_MASK 0xffff000000000000LL
|
||||||
#else
|
#else
|
||||||
#define ROW0_MASK 0xffffLL
|
#define ROW0_MASK 0xffffLL
|
||||||
|
@ -199,7 +199,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
targa_decode_rle(avctx, s, buf, dst, avctx->width, avctx->height, stride, bpp);
|
targa_decode_rle(avctx, s, buf, dst, avctx->width, avctx->height, stride, bpp);
|
||||||
else{
|
else{
|
||||||
for(y = 0; y < s->height; y++){
|
for(y = 0; y < s->height; y++){
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
if((s->bpp + 1) >> 3 == 2){
|
if((s->bpp + 1) >> 3 == 2){
|
||||||
uint16_t *dst16 = (uint16_t*)dst;
|
uint16_t *dst16 = (uint16_t*)dst;
|
||||||
for(x = 0; x < s->width; x++)
|
for(x = 0; x < s->width; x++)
|
||||||
|
@ -91,7 +91,7 @@ static void tnput(uint8_t ** p, int n, const uint8_t * val, enum TiffTypes type,
|
|||||||
int flip)
|
int flip)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
flip ^= ((int[]) {0, 0, 0, 1, 3, 3})[type];
|
flip ^= ((int[]) {0, 0, 0, 1, 3, 3})[type];
|
||||||
#endif
|
#endif
|
||||||
for (i = 0; i < n * type_sizes2[type]; i++)
|
for (i = 0; i < n * type_sizes2[type]; i++)
|
||||||
|
@ -163,7 +163,7 @@ static void select_delta_tables(TrueMotion1Context *s, int delta_table_index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
static int make_ydt15_entry(int p2, int p1, int16_t *ydt)
|
static int make_ydt15_entry(int p2, int p1, int16_t *ydt)
|
||||||
#else
|
#else
|
||||||
static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
|
static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
|
||||||
@ -178,7 +178,7 @@ static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
|
|||||||
return (lo + (hi << 16)) << 1;
|
return (lo + (hi << 16)) << 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
static int make_cdt15_entry(int p2, int p1, int16_t *cdt)
|
static int make_cdt15_entry(int p2, int p1, int16_t *cdt)
|
||||||
#else
|
#else
|
||||||
static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
|
static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
|
||||||
@ -192,7 +192,7 @@ static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
|
|||||||
return (lo + (lo << 16)) << 1;
|
return (lo + (lo << 16)) << 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
static int make_ydt16_entry(int p2, int p1, int16_t *ydt)
|
static int make_ydt16_entry(int p2, int p1, int16_t *ydt)
|
||||||
#else
|
#else
|
||||||
static int make_ydt16_entry(int p1, int p2, int16_t *ydt)
|
static int make_ydt16_entry(int p1, int p2, int16_t *ydt)
|
||||||
@ -207,7 +207,7 @@ static int make_ydt16_entry(int p1, int p2, int16_t *ydt)
|
|||||||
return (lo + (hi << 16)) << 1;
|
return (lo + (hi << 16)) << 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
static int make_cdt16_entry(int p2, int p1, int16_t *cdt)
|
static int make_cdt16_entry(int p2, int p1, int16_t *cdt)
|
||||||
#else
|
#else
|
||||||
static int make_cdt16_entry(int p1, int p2, int16_t *cdt)
|
static int make_cdt16_entry(int p1, int p2, int16_t *cdt)
|
||||||
@ -221,7 +221,7 @@ static int make_cdt16_entry(int p1, int p2, int16_t *cdt)
|
|||||||
return (lo + (lo << 16)) << 1;
|
return (lo + (lo << 16)) << 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
static int make_ydt24_entry(int p2, int p1, int16_t *ydt)
|
static int make_ydt24_entry(int p2, int p1, int16_t *ydt)
|
||||||
#else
|
#else
|
||||||
static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
|
static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
|
||||||
@ -234,7 +234,7 @@ static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
|
|||||||
return (lo + (hi << 8) + (hi << 16)) << 1;
|
return (lo + (hi << 8) + (hi << 16)) << 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
static int make_cdt24_entry(int p2, int p1, int16_t *cdt)
|
static int make_cdt24_entry(int p2, int p1, int16_t *cdt)
|
||||||
#else
|
#else
|
||||||
static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
|
static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
/* XXX: we make the assumption that the soundcard accepts this format */
|
/* XXX: we make the assumption that the soundcard accepts this format */
|
||||||
/* XXX: find better solution with "preinit" method, needed also in
|
/* XXX: find better solution with "preinit" method, needed also in
|
||||||
other formats */
|
other formats */
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16BE
|
#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16BE
|
||||||
#else
|
#else
|
||||||
#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16LE
|
#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16LE
|
||||||
|
@ -439,7 +439,7 @@ AVOutputFormat audio_beos_muxer = {
|
|||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
sizeof(AudioData),
|
sizeof(AudioData),
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
CODEC_ID_PCM_S16BE,
|
CODEC_ID_PCM_S16BE,
|
||||||
#else
|
#else
|
||||||
CODEC_ID_PCM_S16LE,
|
CODEC_ID_PCM_S16LE,
|
||||||
|
@ -238,7 +238,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream->codec->codec_type = CODEC_TYPE_AUDIO;
|
stream->codec->codec_type = CODEC_TYPE_AUDIO;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
stream->codec->codec_id = CODEC_ID_PCM_F32BE;
|
stream->codec->codec_id = CODEC_ID_PCM_F32BE;
|
||||||
#else
|
#else
|
||||||
stream->codec->codec_id = CODEC_ID_PCM_F32LE;
|
stream->codec->codec_id = CODEC_ID_PCM_F32LE;
|
||||||
|
@ -89,7 +89,7 @@ static int audio_open(AVFormatContext *s1, int is_output, const char *audio_devi
|
|||||||
/* select format : favour native format */
|
/* select format : favour native format */
|
||||||
err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
|
err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
if (tmp & AFMT_S16_BE) {
|
if (tmp & AFMT_S16_BE) {
|
||||||
tmp = AFMT_S16_BE;
|
tmp = AFMT_S16_BE;
|
||||||
} else if (tmp & AFMT_S16_LE) {
|
} else if (tmp & AFMT_S16_LE) {
|
||||||
@ -335,7 +335,7 @@ AVOutputFormat oss_muxer = {
|
|||||||
/* XXX: we make the assumption that the soundcard accepts this format */
|
/* XXX: we make the assumption that the soundcard accepts this format */
|
||||||
/* XXX: find better solution with "preinit" method, needed also in
|
/* XXX: find better solution with "preinit" method, needed also in
|
||||||
other formats */
|
other formats */
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
CODEC_ID_PCM_S16BE,
|
CODEC_ID_PCM_S16BE,
|
||||||
#else
|
#else
|
||||||
CODEC_ID_PCM_S16LE,
|
CODEC_ID_PCM_S16LE,
|
||||||
|
@ -364,7 +364,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
/* This is true for all paletted codecs implemented in ffmpeg */
|
/* This is true for all paletted codecs implemented in ffmpeg */
|
||||||
if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
||||||
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
|
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
|
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
|
||||||
st->codec->palctrl->palette[i] = bswap_32(((uint32_t*)st->codec->extradata)[i]);
|
st->codec->palctrl->palette[i] = bswap_32(((uint32_t*)st->codec->extradata)[i]);
|
||||||
#else
|
#else
|
||||||
|
@ -498,7 +498,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
/* This is true for all paletted codecs implemented in FFmpeg. */
|
/* This is true for all paletted codecs implemented in FFmpeg. */
|
||||||
if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
|
||||||
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
|
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
|
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
|
||||||
st->codec->palctrl->palette[i] = bswap_32(((uint32_t*)st->codec->extradata)[i]);
|
st->codec->palctrl->palette[i] = bswap_32(((uint32_t*)st->codec->extradata)[i]);
|
||||||
#else
|
#else
|
||||||
|
@ -77,7 +77,7 @@ static void flv_set_audio_codec(AVFormatContext *s, AVStream *astream, int flv_c
|
|||||||
//no distinction between S16 and S8 PCM codec flags
|
//no distinction between S16 and S8 PCM codec flags
|
||||||
case FLV_CODECID_PCM:
|
case FLV_CODECID_PCM:
|
||||||
acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 :
|
acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 :
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
CODEC_ID_PCM_S16BE;
|
CODEC_ID_PCM_S16BE;
|
||||||
#else
|
#else
|
||||||
CODEC_ID_PCM_S16LE;
|
CODEC_ID_PCM_S16LE;
|
||||||
|
@ -129,7 +129,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
MTVDemuxContext *mtv = s->priv_data;
|
MTVDemuxContext *mtv = s->priv_data;
|
||||||
ByteIOContext *pb = s->pb;
|
ByteIOContext *pb = s->pb;
|
||||||
int ret;
|
int ret;
|
||||||
#ifndef WORDS_BIGENDIAN
|
#if !HAVE_BIGENDIAN
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if(ret != mtv->img_segment_size)
|
if(ret != mtv->img_segment_size)
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
|
||||||
#ifndef WORDS_BIGENDIAN
|
#if !HAVE_BIGENDIAN
|
||||||
|
|
||||||
/* pkt->data is GGGRRRR BBBBBGGG
|
/* pkt->data is GGGRRRR BBBBBGGG
|
||||||
* and we need RRRRRGGG GGGBBBBB
|
* and we need RRRRRGGG GGGBBBBB
|
||||||
|
@ -1103,7 +1103,7 @@ AVOutputFormat null_muxer = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
CODEC_ID_PCM_S16BE,
|
CODEC_ID_PCM_S16BE,
|
||||||
#else
|
#else
|
||||||
CODEC_ID_PCM_S16LE,
|
CODEC_ID_PCM_S16LE,
|
||||||
@ -1232,7 +1232,7 @@ AVOutputFormat pcm_ ## name ## _muxer = {\
|
|||||||
#define PCMDEF(name, long_name, ext, codec)
|
#define PCMDEF(name, long_name, ext, codec)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
#define BE_DEF(s) s
|
#define BE_DEF(s) s
|
||||||
#define LE_DEF(s) NULL
|
#define LE_DEF(s) NULL
|
||||||
#else
|
#else
|
||||||
|
@ -80,7 +80,7 @@ static inline uint64_t av_const bswap_64(uint64_t x)
|
|||||||
// be2me ... big-endian to machine-endian
|
// be2me ... big-endian to machine-endian
|
||||||
// le2me ... little-endian to machine-endian
|
// le2me ... little-endian to machine-endian
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
#define be2me_16(x) (x)
|
#define be2me_16(x) (x)
|
||||||
#define be2me_32(x) (x)
|
#define be2me_32(x) (x)
|
||||||
#define be2me_64(x) (x)
|
#define be2me_64(x) (x)
|
||||||
|
@ -155,7 +155,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
|
|||||||
((uint8_t*)(p))[7] = (d)>>56; } while(0)
|
((uint8_t*)(p))[7] = (d)>>56; } while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
# define AV_RN(s, p) AV_RB##s(p)
|
# define AV_RN(s, p) AV_RB##s(p)
|
||||||
# define AV_WN(s, p, v) AV_WB##s(p, v)
|
# define AV_WN(s, p, v) AV_WB##s(p, v)
|
||||||
#else
|
#else
|
||||||
@ -189,7 +189,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
|
|||||||
# define AV_WN64(p, v) AV_WN(64, p, v)
|
# define AV_WN64(p, v) AV_WN(64, p, v)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
# define AV_RB(s, p) AV_RN(s, p)
|
# define AV_RB(s, p) AV_RN(s, p)
|
||||||
# define AV_WB(s, p, v) AV_WN(s, p, v)
|
# define AV_WB(s, p, v) AV_WN(s, p, v)
|
||||||
# define AV_RL(s, p) bswap_##s(AV_RN(s, p))
|
# define AV_RL(s, p) bswap_##s(AV_RN(s, p))
|
||||||
|
@ -93,7 +93,7 @@ static void body(uint32_t ABCD[4], uint32_t X[16]){
|
|||||||
unsigned int c= ABCD[1];
|
unsigned int c= ABCD[1];
|
||||||
unsigned int d= ABCD[0];
|
unsigned int d= ABCD[0];
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
for(i=0; i<16; i++)
|
for(i=0; i<16; i++)
|
||||||
X[i]= bswap_32(X[i]);
|
X[i]= bswap_32(X[i]);
|
||||||
#endif
|
#endif
|
||||||
|
@ -126,7 +126,7 @@ enum PixelFormat {
|
|||||||
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
|
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if HAVE_BIGENDIAN
|
||||||
# define PIX_FMT_NE(be, le) PIX_FMT_##be
|
# define PIX_FMT_NE(be, le) PIX_FMT_##be
|
||||||
#else
|
#else
|
||||||
# define PIX_FMT_NE(be, le) PIX_FMT_##le
|
# define PIX_FMT_NE(be, le) PIX_FMT_##le
|
||||||
|
Loading…
Reference in New Issue
Block a user