WEBRTC_{BIG, LITTLE}_ENDIAN -> WEBRTC_ARCH_{BIG, LITTLE}_ENDIAN.
Mostly to remove a long-standing TODO...
TESTED=trybots
R=turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/2369005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5013 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/codecs/g711/g711_interface.c b/webrtc/modules/audio_coding/codecs/g711/g711_interface.c
index 9ef7884..087e3e1 100644
--- a/webrtc/modules/audio_coding/codecs/g711/g711_interface.c
+++ b/webrtc/modules/audio_coding/codecs/g711/g711_interface.c
@@ -31,7 +31,7 @@
for (n = 0; n < len; n++) {
tempVal = (uint16_t) linear_to_alaw(speechIn[n]);
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
if ((n & 0x1) == 1) {
encoded[n >> 1] |= ((uint16_t) tempVal);
} else {
@@ -69,7 +69,7 @@
for (n = 0; n < len; n++) {
tempVal = (uint16_t) linear_to_ulaw(speechIn[n]);
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
if ((n & 0x1) == 1) {
encoded[n >> 1] |= ((uint16_t) tempVal);
} else {
@@ -103,7 +103,7 @@
}
for (n = 0; n < len; n++) {
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
if ((n & 0x1) == 1) {
tempVal = ((uint16_t) encoded[n >> 1] & 0xFF);
} else {
@@ -140,7 +140,7 @@
}
for (n = 0; n < len; n++) {
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
if ((n & 0x1) == 1) {
tempVal = ((uint16_t) encoded[n >> 1] & 0xFF);
} else {
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/decode.c b/webrtc/modules/audio_coding/codecs/ilbc/decode.c
index 5da9685..febd4ce 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/decode.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/decode.c
@@ -28,7 +28,7 @@
#include "decode_residual.h"
#include "unpack_bits.h"
#include "hp_output.h"
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
#include "swap_bytes.h"
#endif
@@ -54,7 +54,7 @@
int16_t PLCresidual[BLOCKL_MAX + LPC_FILTERORDER];
int16_t syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)];
int16_t PLClpc[LPC_FILTERORDER + 1];
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
uint16_t swapped[NO_OF_WORDS_30MS];
#endif
iLBC_bits *iLBCbits_inst = (iLBC_bits*)PLCresidual;
@@ -68,7 +68,7 @@
/* Unpacketize bits into parameters */
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
WebRtcIlbcfix_SwapBytes(bytes, iLBCdec_inst->no_of_words, swapped);
last_bit = WebRtcIlbcfix_UnpackBits(swapped, iLBCbits_inst, iLBCdec_inst->mode);
#else
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/encode.c b/webrtc/modules/audio_coding/codecs/ilbc/encode.c
index 75d1672..2f899a5 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/encode.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/encode.c
@@ -32,7 +32,7 @@
#include "unpack_bits.h"
#include "index_conv_dec.h"
#endif
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
#include "swap_bytes.h"
#endif
@@ -489,7 +489,7 @@
WebRtcIlbcfix_PackBits(bytes, iLBCbits_inst, iLBCenc_inst->mode);
#endif
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
/* Swap bytes for LITTLE ENDIAN since the packbits()
function assumes BIG_ENDIAN machine */
#ifdef SPLIT_10MS
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c
index 945475f..8baa307 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.c
@@ -327,7 +327,7 @@
{
ISACFIX_SubStruct *ISAC_inst;
int16_t stream_len;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
@@ -352,7 +352,7 @@
/* convert from bytes to int16_t */
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0;k<(stream_len+1)>>1;k++) {
encoded[k] = (int16_t)( ( (uint16_t)(ISAC_inst->ISACenc_obj.bitstr_obj).stream[k] >> 8 )
| (((ISAC_inst->ISACenc_obj.bitstr_obj).stream[k] & 0x00FF) << 8));
@@ -442,7 +442,7 @@
/* convert from bytes to int16_t */
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0;k<(stream_len+1)>>1;k++) {
encoded[k] = (int16_t)(((uint16_t)(ISAC_inst->ISACenc_obj.bitstr_obj).stream[k] >> 8)
| (((ISAC_inst->ISACenc_obj.bitstr_obj).stream[k] & 0x00FF) << 8));
@@ -485,7 +485,7 @@
{
ISACFIX_SubStruct *ISAC_inst;
int16_t stream_len;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
@@ -507,7 +507,7 @@
return -1;
}
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0;k<(stream_len+1)>>1;k++) {
encoded[k] = (int16_t)( ( (uint16_t)(ISAC_inst->ISACenc_obj.bitstr_obj).stream[k] >> 8 )
| (((ISAC_inst->ISACenc_obj.bitstr_obj).stream[k] & 0x00FF) << 8));
@@ -588,7 +588,7 @@
ISACFIX_SubStruct *ISAC_inst;
Bitstr_dec streamdata;
uint16_t partOfStream[5];
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t err;
@@ -621,7 +621,7 @@
streamdata.stream_index = 0;
streamdata.full = 1;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0; k<5; k++) {
streamdata.stream[k] = (uint16_t) (((uint16_t)encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
}
@@ -676,7 +676,7 @@
ISACFIX_SubStruct *ISAC_inst;
Bitstr_dec streamdata;
uint16_t partOfStream[5];
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t err;
@@ -709,7 +709,7 @@
streamdata.stream_index = 0;
streamdata.full = 1;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0; k<5; k++) {
streamdata.stream[k] = (uint16_t) ((encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
}
@@ -765,7 +765,7 @@
/* number of samples (480 or 960), output from decoder */
/* that were actually used in the encoder/decoder (determined on the fly) */
int16_t number_of_samples;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t declen = 0;
@@ -793,7 +793,7 @@
(ISAC_inst->ISACdec_obj.bitstr_obj).stream = (uint16_t *)encoded;
/* convert bitstream from int16_t to bytes */
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0; k<(len>>1); k++) {
(ISAC_inst->ISACdec_obj.bitstr_obj).stream[k] = (uint16_t) ((encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
}
@@ -868,7 +868,7 @@
/* twice the number of samples (480 or 960), output from decoder */
/* that were actually used in the encoder/decoder (determined on the fly) */
int16_t number_of_samples;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t declen = 0;
@@ -894,7 +894,7 @@
(ISAC_inst->ISACdec_obj.bitstr_obj).stream = (uint16_t *)encoded;
/* convert bitstream from int16_t to bytes */
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0; k<(len>>1); k++) {
(ISAC_inst->ISACdec_obj.bitstr_obj).stream[k] = (uint16_t) ((encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
}
@@ -1267,7 +1267,7 @@
{
Bitstr_dec streamdata;
uint16_t partOfStream[5];
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t err;
@@ -1280,7 +1280,7 @@
streamdata.stream_index = 0;
streamdata.full = 1;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0; k<5; k++) {
streamdata.stream[k] = (uint16_t) (((uint16_t)encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
}
@@ -1316,7 +1316,7 @@
{
Bitstr_dec streamdata;
uint16_t partOfStream[5];
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t err;
@@ -1329,7 +1329,7 @@
streamdata.stream_index = 0;
streamdata.full = 1;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k=0; k<5; k++) {
streamdata.stream[k] = (uint16_t) (((uint16_t)encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
}
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
index 1e90272..f3f1650 100644
--- a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
+++ b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
@@ -742,7 +742,7 @@
WebRtcIsac_GetCrc((int16_t*)(&(ptrEncodedUW8[streamLenLB + 1])),
streamLenUB + garbageLen, &crc);
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < LEN_CHECK_SUM_WORD8; k++) {
ptrEncodedUW8[streamLen - LEN_CHECK_SUM_WORD8 + k] =
(uint8_t)((crc >> (24 - k * 8)) & 0xFF);
@@ -805,7 +805,7 @@
int32_t currentBN;
uint8_t* encodedPtrUW8 = (uint8_t*)encoded;
uint32_t crc;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int16_t k;
#endif
ISACMainStruct* instISAC = (ISACMainStruct*)ISAC_main_inst;
@@ -896,7 +896,7 @@
WebRtcIsac_GetCrc((int16_t*)(&(encodedPtrUW8[streamLenLB + 1])),
streamLenUB, &crc);
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < LEN_CHECK_SUM_WORD8; k++) {
encodedPtrUW8[totalStreamLen - LEN_CHECK_SUM_WORD8 + k] =
(uint8_t)((crc >> (24 - k * 8)) & 0xFF);
@@ -1008,7 +1008,7 @@
uint32_t arr_ts) {
ISACMainStruct* instISAC = (ISACMainStruct*)ISAC_main_inst;
Bitstr streamdata;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t err;
@@ -1029,7 +1029,7 @@
WebRtcIsac_ResetBitstream(&(streamdata));
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < 10; k++) {
streamdata.stream[k] = (uint8_t)((encoded[k >> 1] >>
((k & 1) << 3)) & 0xFF);
@@ -1741,14 +1741,14 @@
int16_t WebRtcIsac_ReadBwIndex(const int16_t* encoded,
int16_t* bweIndex) {
Bitstr streamdata;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t err;
WebRtcIsac_ResetBitstream(&(streamdata));
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < 10; k++) {
streamdata.stream[k] = (uint8_t)((encoded[k >> 1] >>
((k & 1) << 3)) & 0xFF);
@@ -1790,7 +1790,7 @@
const int16_t* encoded,
int16_t* frameLength) {
Bitstr streamdata;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
int16_t err;
@@ -1798,7 +1798,7 @@
WebRtcIsac_ResetBitstream(&(streamdata));
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < 10; k++) {
streamdata.stream[k] = (uint8_t)((encoded[k >> 1] >>
((k & 1) << 3)) & 0xFF);
@@ -2108,7 +2108,7 @@
int16_t totalLenUB;
uint8_t* ptrEncodedUW8 = (uint8_t*)encoded;
ISACMainStruct* instISAC = (ISACMainStruct*)ISAC_main_inst;
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
int k;
#endif
@@ -2164,7 +2164,7 @@
WebRtcIsac_GetCrc((int16_t*)(&(ptrEncodedUW8[streamLenLB + 1])),
streamLenUB, &crc);
-#ifndef WEBRTC_BIG_ENDIAN
+#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < LEN_CHECK_SUM_WORD8; k++) {
ptrEncodedUW8[streamLen - LEN_CHECK_SUM_WORD8 + k] =
(uint8_t)((crc >> (24 - k * 8)) & 0xFF);
diff --git a/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c b/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
index 04814b7..34aadc3 100644
--- a/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
+++ b/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
@@ -15,7 +15,7 @@
#include "typedefs.h"
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
#include "signal_processing_library.h"
#endif
@@ -29,7 +29,7 @@
int16_t len,
int16_t *speechOut16b)
{
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
WEBRTC_SPL_MEMCPY_W16(speechOut16b, speechIn16b, len);
#else
int i;
@@ -68,7 +68,7 @@
int16_t *speechOut16b,
int16_t* speechType)
{
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
WEBRTC_SPL_MEMCPY_W8(speechOut16b, speechIn16b, ((len*sizeof(int16_t)+1)>>1));
#else
int i;
diff --git a/webrtc/modules/audio_coding/neteq/dtmf_buffer.c b/webrtc/modules/audio_coding/neteq/dtmf_buffer.c
index 9e32126..1788635 100644
--- a/webrtc/modules/audio_coding/neteq/dtmf_buffer.c
+++ b/webrtc/modules/audio_coding/neteq/dtmf_buffer.c
@@ -93,7 +93,7 @@
if (len == 4)
{
EventStart = encoded;
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
value=((*EventStart)>>8);
endEvent=((*EventStart)&0x80)>>7;
Volume=((*EventStart)&0x3F);
diff --git a/webrtc/modules/audio_coding/neteq/rtp.c b/webrtc/modules/audio_coding/neteq/rtp.c
index f23f351..6ab5944 100644
--- a/webrtc/modules/audio_coding/neteq/rtp.c
+++ b/webrtc/modules/audio_coding/neteq/rtp.c
@@ -31,7 +31,7 @@
return RTP_TOO_SHORT_PACKET;
}
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
i_IPver = (((uint16_t) (pw16_Datagram[0] & 0xC000)) >> 14); /* Extract the version */
i_P = (((uint16_t) (pw16_Datagram[0] & 0x2000)) >> 13); /* Extract the P bit */
i_X = (((uint16_t) (pw16_Datagram[0] & 0x1000)) >> 12); /* Extract the X bit */
@@ -62,7 +62,7 @@
i_padlength = ((pw16_Datagram[(i_DatagramLen >> 1) - 1]) & 0xFF);
}
}
-#else /* WEBRTC_LITTLE_ENDIAN */
+#else /* WEBRTC_ARCH_LITTLE_ENDIAN */
i_IPver = (((uint16_t) (pw16_Datagram[0] & 0xC0)) >> 6); /* Extract the IP version */
i_P = (((uint16_t) (pw16_Datagram[0] & 0x20)) >> 5); /* Extract the P bit */
i_X = (((uint16_t) (pw16_Datagram[0] & 0x10)) >> 4); /* Extract the X bit */
@@ -126,7 +126,7 @@
int i_discardedBlockLength = 0;
int singlePayload = 0;
-#ifdef WEBRTC_BIG_ENDIAN
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
if ((pw16_data[0] & 0x8000) == 0)
{
/* Only one payload in this packet*/
@@ -155,7 +155,7 @@
((((uint16_t)pw16_data[1]) & 0xFC00) >> 10);
i_blockLength = (((uint16_t)pw16_data[1]) & 0x3FF);
}
-#else /* WEBRTC_LITTLE_ENDIAN */
+#else /* WEBRTC_ARCH_LITTLE_ENDIAN */
if ((pw16_data[0] & 0x80) == 0)
{
/* Only one payload in this packet */