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
This commit is contained in:
@@ -31,7 +31,7 @@ int16_t WebRtcG711_EncodeA(void* state,
|
||||
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 @@ int16_t WebRtcG711_EncodeU(void* state,
|
||||
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 @@ int16_t WebRtcG711_DecodeA(void* state,
|
||||
}
|
||||
|
||||
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 @@ int16_t WebRtcG711_DecodeU(void* state,
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
@@ -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 @@ void WebRtcIlbcfix_DecodeImpl(
|
||||
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 @@ void WebRtcIlbcfix_DecodeImpl(
|
||||
|
||||
/* 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
|
||||
|
||||
@@ -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 @@ void WebRtcIlbcfix_EncodeImpl(
|
||||
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
|
||||
|
||||
@@ -327,7 +327,7 @@ int16_t WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
{
|
||||
ISACFIX_SubStruct *ISAC_inst;
|
||||
int16_t stream_len;
|
||||
#ifndef WEBRTC_BIG_ENDIAN
|
||||
#ifndef WEBRTC_ARCH_BIG_ENDIAN
|
||||
int k;
|
||||
#endif
|
||||
|
||||
@@ -352,7 +352,7 @@ int16_t WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
|
||||
|
||||
/* 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 @@ int16_t WebRtcIsacfix_EncodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
|
||||
|
||||
/* 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 @@ int16_t WebRtcIsacfix_GetNewBitStream(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
{
|
||||
ISACFIX_SubStruct *ISAC_inst;
|
||||
int16_t stream_len;
|
||||
#ifndef WEBRTC_BIG_ENDIAN
|
||||
#ifndef WEBRTC_ARCH_BIG_ENDIAN
|
||||
int k;
|
||||
#endif
|
||||
|
||||
@@ -507,7 +507,7 @@ int16_t WebRtcIsacfix_GetNewBitStream(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsacfix_UpdateBwEstimate(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsacfix_UpdateBwEstimate(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsacfix_Decode(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
/* 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 @@ int16_t WebRtcIsacfix_Decode(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
(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 @@ int16_t WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
/* 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 @@ int16_t WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
(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 @@ int16_t WebRtcIsacfix_ReadFrameLen(const int16_t* encoded,
|
||||
{
|
||||
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 @@ int16_t WebRtcIsacfix_ReadFrameLen(const int16_t* encoded,
|
||||
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 @@ int16_t WebRtcIsacfix_ReadBwIndex(const int16_t* encoded,
|
||||
{
|
||||
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 @@ int16_t WebRtcIsacfix_ReadBwIndex(const int16_t* encoded,
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -742,7 +742,7 @@ int16_t WebRtcIsac_Encode(ISACStruct* ISAC_main_inst,
|
||||
|
||||
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 @@ int16_t WebRtcIsac_GetNewBitStream(ISACStruct* ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsac_GetNewBitStream(ISACStruct* ISAC_main_inst,
|
||||
|
||||
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 @@ int16_t WebRtcIsac_UpdateBwEstimate(ISACStruct* ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsac_UpdateBwEstimate(ISACStruct* ISAC_main_inst,
|
||||
|
||||
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_UpdateUplinkBw(ISACStruct* ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsac_ReadFrameLen(ISACStruct* ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsac_ReadFrameLen(ISACStruct* ISAC_main_inst,
|
||||
|
||||
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 WebRtcIsac_GetRedPayload(ISACStruct* ISAC_main_inst,
|
||||
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 @@ int16_t WebRtcIsac_GetRedPayload(ISACStruct* ISAC_main_inst,
|
||||
|
||||
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);
|
||||
|
||||
@@ -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 WebRtcPcm16b_EncodeW16(int16_t *speechIn16b,
|
||||
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 WebRtcPcm16b_DecodeW16(void *inst,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user