Revert 7266 "WebRtcIsac_Encode and WebRtcIsacfix_Encode: Type en..."
This was causing apparently legitimate failures on the following bots: http://chromegw/i/client.webrtc/builders/Linux64%20Release%20%5Blarge%20tests%5D/builds/2599 http://chromegw/i/client.webrtc/builders/Android%20Tests%20%28KK%20Nexus5%29%28dbg%29/builds/2023 http://chromegw/i/client.webrtc/builders/Android%20Tests%20%28JB%20Nexus7.2%29%28dbg%29/builds/1825 http://chromegw/i/client.webrtc/builders/Android%20Tests%20%28KK%20Nexus5%29/builds/2013 http://chromegw/i/client.webrtc/builders/Android%20Tests%20%28JB%20Nexus7.2%29/builds/1795 > WebRtcIsac_Encode and WebRtcIsacfix_Encode: Type encoded stream as uint8_t > > We have to fix both at once, since there's a macro that calls one of > them or the other. > > BUG=909 > R=andrew@webrtc.org, bjornv@webrtc.org, henrik.lundin@webrtc.org, minyue@webrtc.org > > Review URL: https://webrtc-codereview.appspot.com/19229004 TBR=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/30519004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7267 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -17,7 +17,6 @@
|
||||
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.h"
|
||||
@ -356,7 +355,7 @@ int16_t WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
|
||||
int16_t WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
const int16_t *speechIn,
|
||||
uint8_t* encoded)
|
||||
int16_t *encoded)
|
||||
{
|
||||
ISACFIX_SubStruct *ISAC_inst;
|
||||
int16_t stream_len;
|
||||
@ -383,20 +382,16 @@ int16_t WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst,
|
||||
return -1;
|
||||
}
|
||||
|
||||
assert(stream_len % 2 == 0);
|
||||
|
||||
/* convert from bytes to int16_t */
|
||||
#ifndef WEBRTC_ARCH_BIG_ENDIAN
|
||||
/* The encoded data vector is supposesd to be big-endian, but our internal
|
||||
representation is little-endian. So byteswap. */
|
||||
for (k = 0; k < stream_len / 2; ++k) {
|
||||
uint16_t s = ISAC_inst->ISACenc_obj.bitstr_obj.stream[k];
|
||||
/* In big-endian, we have... */
|
||||
encoded[2 * k] = s >> 8; /* ...most significant byte at low address... */
|
||||
encoded[2 * k + 1] = s; /* ...least significant byte at high address. */
|
||||
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));
|
||||
}
|
||||
|
||||
#else
|
||||
/* The encoded data vector and our internal representation are both
|
||||
big-endian. */
|
||||
memcpy(encoded, ISAC_inst->ISACenc_obj.bitstr_obj.stream, stream_len);
|
||||
WEBRTC_SPL_MEMCPY_W16(encoded, (ISAC_inst->ISACenc_obj.bitstr_obj).stream, (stream_len + 1)>>1);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user