Revision 63613fe6

View differences:

configure
2591 2591
echo "TARGET_EXEC=$target_exec" >> config.mak
2592 2592
echo "TARGET_PATH=$target_path" >> config.mak
2593 2593

  
2594
if enabled bigendian; then
2595
    echo "WORDS_BIGENDIAN=yes" >> config.mak
2596
    echo "#define WORDS_BIGENDIAN 1" >> $TMPH
2597
fi
2598

  
2599 2594
if enabled sdl; then
2600 2595
    echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak
2601 2596
    echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak
libavcodec/8bps.c
183 183
                case 32:
184 184
                        avctx->pix_fmt = PIX_FMT_RGB32;
185 185
                        c->planes = 4;
186
#ifdef WORDS_BIGENDIAN
186
#if HAVE_BIGENDIAN
187 187
                        c->planemap[0] = 1; // 1st plane is red
188 188
                        c->planemap[1] = 2; // 2nd plane is green
189 189
                        c->planemap[2] = 3; // 3rd plane is blue
libavcodec/cscd.c
59 59
    }
60 60
}
61 61

  
62
#ifndef WORDS_BIGENDIAN
62
#if !HAVE_BIGENDIAN
63 63
#define copy_frame_16 copy_frame_default
64 64
#define copy_frame_32 copy_frame_default
65 65
#define add_frame_16 add_frame_default
libavcodec/flacenc.c
1224 1224

  
1225 1225
static void update_md5_sum(FlacEncodeContext *s, int16_t *samples)
1226 1226
{
1227
#ifdef WORDS_BIGENDIAN
1227
#if HAVE_BIGENDIAN
1228 1228
    int i;
1229 1229
    for(i = 0; i < s->frame.blocksize*s->channels; i++) {
1230 1230
        int16_t smp = le2me_16(samples[i]);
libavcodec/flicvideo.c
585 585
                 * during decompression. So if it is required (i.e., this is not a LE target, we do
586 586
                 * a second pass over the line here, swapping the bytes.
587 587
                 */
588
#ifdef WORDS_BIGENDIAN
588
#if HAVE_BIGENDIAN
589 589
                pixel_ptr = y_ptr;
590 590
                pixel_countdown = s->avctx->width;
591 591
                while (pixel_countdown > 0) {
libavcodec/h264.c
82 82
static Picture * remove_long(H264Context *h, int i, int ref_mask);
83 83

  
84 84
static av_always_inline uint32_t pack16to32(int a, int b){
85
#ifdef WORDS_BIGENDIAN
85
#if HAVE_BIGENDIAN
86 86
   return (b&0xFFFF) + (a<<16);
87 87
#else
88 88
   return (a&0xFFFF) + (b<<16);
libavcodec/huffyuv.c
35 35

  
36 36
#define VLC_BITS 11
37 37

  
38
#ifdef WORDS_BIGENDIAN
38
#if HAVE_BIGENDIAN
39 39
#define B 3
40 40
#define G 2
41 41
#define R 1
libavcodec/imgconvert.c
548 548
    return PIX_FMT_NONE;
549 549
}
550 550

  
551
#ifdef WORDS_BIGENDIAN
551
#if HAVE_BIGENDIAN
552 552
#   define X_NE(be, le) be
553 553
#else
554 554
#   define X_NE(be, le) le
libavcodec/indeo3.c
576 576
                                lv1 = ref_lp[0];
577 577
                                lv2 = ref_lp[1];
578 578
                                if(lp2 == 0 && flag1 != 0) {
579
#ifdef WORDS_BIGENDIAN
579
#if HAVE_BIGENDIAN
580 580
                                    lv1 = lv1 & 0xFF00FF00;
581 581
                                    lv1 = (lv1 >> 8) | lv1;
582 582
                                    lv2 = lv2 & 0xFF00FF00;
libavcodec/pcm.c
214 214
            *dst++ = v - 128;
215 215
        }
216 216
        break;
217
#ifdef WORDS_BIGENDIAN
217
#if HAVE_BIGENDIAN
218 218
    case CODEC_ID_PCM_F64LE:
219 219
        ENCODE(int64_t, le64, samples, dst, n, 0, 0)
220 220
        break;
......
244 244
    case CODEC_ID_PCM_F32LE:
245 245
    case CODEC_ID_PCM_S32LE:
246 246
    case CODEC_ID_PCM_S16LE:
247
#endif /* WORDS_BIGENDIAN */
247
#endif /* HAVE_BIGENDIAN */
248 248
    case CODEC_ID_PCM_U8:
249 249
        memcpy(dst, samples, n*sample_size);
250 250
        dst += n*sample_size;
......
422 422
        }
423 423
        samples= (short*)dstu8;
424 424
        break;
425
#ifdef WORDS_BIGENDIAN
425
#if HAVE_BIGENDIAN
426 426
    case CODEC_ID_PCM_F64LE:
427 427
        DECODE(int64_t, le64, src, samples, n, 0, 0)
428 428
        break;
......
452 452
    case CODEC_ID_PCM_F32LE:
453 453
    case CODEC_ID_PCM_S32LE:
454 454
    case CODEC_ID_PCM_S16LE:
455
#endif /* WORDS_BIGENDIAN */
455
#endif /* HAVE_BIGENDIAN */
456 456
    case CODEC_ID_PCM_U8:
457 457
        memcpy(samples, src, n*sample_size);
458 458
        src += n*sample_size;
libavcodec/ptx.c
79 79
    stride = p->linesize[0];
80 80

  
81 81
    for (y=0; y<h; y++) {
82
#ifdef WORDS_BIGENDIAN
82
#if HAVE_BIGENDIAN
83 83
        unsigned int x;
84 84
        for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
85 85
            AV_WN16(ptr+x, AV_RL16(buf+x));
libavcodec/simple_idct.c
66 66
#endif
67 67

  
68 68
#if HAVE_FAST_64BIT
69
#ifdef WORDS_BIGENDIAN
69
#if HAVE_BIGENDIAN
70 70
#define ROW0_MASK 0xffff000000000000LL
71 71
#else
72 72
#define ROW0_MASK 0xffffLL
libavcodec/targa.c
199 199
            targa_decode_rle(avctx, s, buf, dst, avctx->width, avctx->height, stride, bpp);
200 200
        else{
201 201
            for(y = 0; y < s->height; y++){
202
#ifdef WORDS_BIGENDIAN
202
#if HAVE_BIGENDIAN
203 203
                if((s->bpp + 1) >> 3 == 2){
204 204
                    uint16_t *dst16 = (uint16_t*)dst;
205 205
                    for(x = 0; x < s->width; x++)
libavcodec/tiffenc.c
91 91
                  int flip)
92 92
{
93 93
    int i;
94
#ifdef WORDS_BIGENDIAN
94
#if HAVE_BIGENDIAN
95 95
    flip ^= ((int[]) {0, 0, 0, 1, 3, 3})[type];
96 96
#endif
97 97
    for (i = 0; i < n * type_sizes2[type]; i++)
libavcodec/truemotion1.c
163 163
    }
164 164
}
165 165

  
166
#ifdef WORDS_BIGENDIAN
166
#if HAVE_BIGENDIAN
167 167
static int make_ydt15_entry(int p2, int p1, int16_t *ydt)
168 168
#else
169 169
static int make_ydt15_entry(int p1, int p2, int16_t *ydt)
......
178 178
    return (lo + (hi << 16)) << 1;
179 179
}
180 180

  
181
#ifdef WORDS_BIGENDIAN
181
#if HAVE_BIGENDIAN
182 182
static int make_cdt15_entry(int p2, int p1, int16_t *cdt)
183 183
#else
184 184
static int make_cdt15_entry(int p1, int p2, int16_t *cdt)
......
192 192
    return (lo + (lo << 16)) << 1;
193 193
}
194 194

  
195
#ifdef WORDS_BIGENDIAN
195
#if HAVE_BIGENDIAN
196 196
static int make_ydt16_entry(int p2, int p1, int16_t *ydt)
197 197
#else
198 198
static int make_ydt16_entry(int p1, int p2, int16_t *ydt)
......
207 207
    return (lo + (hi << 16)) << 1;
208 208
}
209 209

  
210
#ifdef WORDS_BIGENDIAN
210
#if HAVE_BIGENDIAN
211 211
static int make_cdt16_entry(int p2, int p1, int16_t *cdt)
212 212
#else
213 213
static int make_cdt16_entry(int p1, int p2, int16_t *cdt)
......
221 221
    return (lo + (lo << 16)) << 1;
222 222
}
223 223

  
224
#ifdef WORDS_BIGENDIAN
224
#if HAVE_BIGENDIAN
225 225
static int make_ydt24_entry(int p2, int p1, int16_t *ydt)
226 226
#else
227 227
static int make_ydt24_entry(int p1, int p2, int16_t *ydt)
......
234 234
    return (lo + (hi << 8) + (hi << 16)) << 1;
235 235
}
236 236

  
237
#ifdef WORDS_BIGENDIAN
237
#if HAVE_BIGENDIAN
238 238
static int make_cdt24_entry(int p2, int p1, int16_t *cdt)
239 239
#else
240 240
static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
libavdevice/alsa-audio.h
37 37
/* XXX: we make the assumption that the soundcard accepts this format */
38 38
/* XXX: find better solution with "preinit" method, needed also in
39 39
        other formats */
40
#ifdef WORDS_BIGENDIAN
40
#if HAVE_BIGENDIAN
41 41
#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16BE
42 42
#else
43 43
#define DEFAULT_CODEC_ID CODEC_ID_PCM_S16LE
libavdevice/beosaudio.cpp
439 439
    "",
440 440
    "",
441 441
    sizeof(AudioData),
442
#ifdef WORDS_BIGENDIAN
442
#if HAVE_BIGENDIAN
443 443
    CODEC_ID_PCM_S16BE,
444 444
#else
445 445
    CODEC_ID_PCM_S16LE,
libavdevice/jack_audio.c
238 238
    }
239 239

  
240 240
    stream->codec->codec_type   = CODEC_TYPE_AUDIO;
241
#ifdef WORDS_BIGENDIAN
241
#if HAVE_BIGENDIAN
242 242
    stream->codec->codec_id     = CODEC_ID_PCM_F32BE;
243 243
#else
244 244
    stream->codec->codec_id     = CODEC_ID_PCM_F32LE;
libavdevice/oss_audio.c
89 89
    /* select format : favour native format */
90 90
    err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
91 91

  
92
#ifdef WORDS_BIGENDIAN
92
#if HAVE_BIGENDIAN
93 93
    if (tmp & AFMT_S16_BE) {
94 94
        tmp = AFMT_S16_BE;
95 95
    } else if (tmp & AFMT_S16_LE) {
......
335 335
    /* XXX: we make the assumption that the soundcard accepts this format */
336 336
    /* XXX: find better solution with "preinit" method, needed also in
337 337
       other formats */
338
#ifdef WORDS_BIGENDIAN
338
#if HAVE_BIGENDIAN
339 339
    CODEC_ID_PCM_S16BE,
340 340
#else
341 341
    CODEC_ID_PCM_S16LE,
libavformat/asfdec.c
364 364
                /* This is true for all paletted codecs implemented in ffmpeg */
365 365
                if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
366 366
                    st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
367
#ifdef WORDS_BIGENDIAN
367
#if HAVE_BIGENDIAN
368 368
                    for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
369 369
                        st->codec->palctrl->palette[i] = bswap_32(((uint32_t*)st->codec->extradata)[i]);
370 370
#else
libavformat/avidec.c
498 498
                    /* This is true for all paletted codecs implemented in FFmpeg. */
499 499
                    if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
500 500
                        st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
501
#ifdef WORDS_BIGENDIAN
501
#if HAVE_BIGENDIAN
502 502
                        for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
503 503
                            st->codec->palctrl->palette[i] = bswap_32(((uint32_t*)st->codec->extradata)[i]);
504 504
#else
libavformat/flvdec.c
77 77
        //no distinction between S16 and S8 PCM codec flags
78 78
        case FLV_CODECID_PCM:
79 79
            acodec->codec_id = acodec->bits_per_coded_sample == 8 ? CODEC_ID_PCM_S8 :
80
#ifdef WORDS_BIGENDIAN
80
#if HAVE_BIGENDIAN
81 81
                                CODEC_ID_PCM_S16BE;
82 82
#else
83 83
                                CODEC_ID_PCM_S16LE;
libavformat/mtv.c
129 129
    MTVDemuxContext *mtv = s->priv_data;
130 130
    ByteIOContext *pb = s->pb;
131 131
    int ret;
132
#ifndef WORDS_BIGENDIAN
132
#if !HAVE_BIGENDIAN
133 133
    int i;
134 134
#endif
135 135

  
......
150 150
        if(ret != mtv->img_segment_size)
151 151
            return AVERROR(EIO);
152 152

  
153
#ifndef WORDS_BIGENDIAN
153
#if !HAVE_BIGENDIAN
154 154

  
155 155
        /* pkt->data is GGGRRRR BBBBBGGG
156 156
         * and we need RRRRRGGG GGGBBBBB
libavformat/raw.c
1103 1103
    NULL,
1104 1104
    NULL,
1105 1105
    0,
1106
#ifdef WORDS_BIGENDIAN
1106
#if HAVE_BIGENDIAN
1107 1107
    CODEC_ID_PCM_S16BE,
1108 1108
#else
1109 1109
    CODEC_ID_PCM_S16LE,
......
1232 1232
#define PCMDEF(name, long_name, ext, codec)
1233 1233
#endif
1234 1234

  
1235
#ifdef WORDS_BIGENDIAN
1235
#if HAVE_BIGENDIAN
1236 1236
#define BE_DEF(s) s
1237 1237
#define LE_DEF(s) NULL
1238 1238
#else
libavutil/bswap.h
80 80
// be2me ... big-endian to machine-endian
81 81
// le2me ... little-endian to machine-endian
82 82

  
83
#ifdef WORDS_BIGENDIAN
83
#if HAVE_BIGENDIAN
84 84
#define be2me_16(x) (x)
85 85
#define be2me_32(x) (x)
86 86
#define be2me_64(x) (x)
libavutil/intreadwrite.h
155 155
                    ((uint8_t*)(p))[7] = (d)>>56; } while(0)
156 156
#endif
157 157

  
158
#ifdef WORDS_BIGENDIAN
158
#if HAVE_BIGENDIAN
159 159
#   define AV_RN(s, p)    AV_RB##s(p)
160 160
#   define AV_WN(s, p, v) AV_WB##s(p, v)
161 161
#else
......
189 189
#   define AV_WN64(p, v) AV_WN(64, p, v)
190 190
#endif
191 191

  
192
#ifdef WORDS_BIGENDIAN
192
#if HAVE_BIGENDIAN
193 193
#   define AV_RB(s, p)    AV_RN(s, p)
194 194
#   define AV_WB(s, p, v) AV_WN(s, p, v)
195 195
#   define AV_RL(s, p)    bswap_##s(AV_RN(s, p))
libavutil/md5.c
93 93
    unsigned int c= ABCD[1];
94 94
    unsigned int d= ABCD[0];
95 95

  
96
#ifdef WORDS_BIGENDIAN
96
#if HAVE_BIGENDIAN
97 97
    for(i=0; i<16; i++)
98 98
        X[i]= bswap_32(X[i]);
99 99
#endif
libavutil/pixfmt.h
126 126
    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
127 127
};
128 128

  
129
#ifdef WORDS_BIGENDIAN
129
#if HAVE_BIGENDIAN
130 130
#   define PIX_FMT_NE(be, le) PIX_FMT_##be
131 131
#else
132 132
#   define PIX_FMT_NE(be, le) PIX_FMT_##le

Also available in: Unified diff