Revert 7675 "Make an AudioEncoder subclass for iSAC"
Above CL did not compile on Android. Followings are links to Android builds http://chromegw.corp.google.com/i/internal.client.webrtc/builders/Android%20Builder%20%28dbg%29/builds/2648 http://chromegw.corp.google.com/i/internal.client.webrtc/builders/Android%20Clang%20%28dbg%29/builds/2369 http://chromegw.corp.google.com/i/internal.client.webrtc/builders/Android%20ARM64%20%28dbg%29/builds/1320 > Make an AudioEncoder subclass for iSAC > > BUG=3926 > R=henrik.lundin@webrtc.org, kjellander@webrtc.org > > Review URL: https://webrtc-codereview.appspot.com/25019004 TBR=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/32439004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7676 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -130,6 +130,67 @@ int AudioDecoderIlbc::Init() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// iSAC float
|
||||
#ifdef WEBRTC_CODEC_ISAC
|
||||
AudioDecoderIsac::AudioDecoderIsac(int decode_sample_rate_hz) {
|
||||
DCHECK(decode_sample_rate_hz == 16000 || decode_sample_rate_hz == 32000);
|
||||
WebRtcIsac_Create(&isac_state_);
|
||||
WebRtcIsac_SetDecSampRate(isac_state_, decode_sample_rate_hz);
|
||||
}
|
||||
|
||||
AudioDecoderIsac::~AudioDecoderIsac() {
|
||||
WebRtcIsac_Free(isac_state_);
|
||||
}
|
||||
|
||||
int AudioDecoderIsac::Decode(const uint8_t* encoded, size_t encoded_len,
|
||||
int16_t* decoded, SpeechType* speech_type) {
|
||||
int16_t temp_type = 1; // Default is speech.
|
||||
int16_t ret = WebRtcIsac_Decode(isac_state_,
|
||||
encoded,
|
||||
static_cast<int16_t>(encoded_len), decoded,
|
||||
&temp_type);
|
||||
*speech_type = ConvertSpeechType(temp_type);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int AudioDecoderIsac::DecodeRedundant(const uint8_t* encoded,
|
||||
size_t encoded_len, int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
int16_t temp_type = 1; // Default is speech.
|
||||
int16_t ret = WebRtcIsac_DecodeRcu(isac_state_,
|
||||
encoded,
|
||||
static_cast<int16_t>(encoded_len), decoded,
|
||||
&temp_type);
|
||||
*speech_type = ConvertSpeechType(temp_type);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int AudioDecoderIsac::DecodePlc(int num_frames, int16_t* decoded) {
|
||||
return WebRtcIsac_DecodePlc(isac_state_, decoded, num_frames);
|
||||
}
|
||||
|
||||
int AudioDecoderIsac::Init() {
|
||||
return WebRtcIsac_DecoderInit(isac_state_);
|
||||
}
|
||||
|
||||
int AudioDecoderIsac::IncomingPacket(const uint8_t* payload,
|
||||
size_t payload_len,
|
||||
uint16_t rtp_sequence_number,
|
||||
uint32_t rtp_timestamp,
|
||||
uint32_t arrival_timestamp) {
|
||||
return WebRtcIsac_UpdateBwEstimate(isac_state_,
|
||||
payload,
|
||||
static_cast<int32_t>(payload_len),
|
||||
rtp_sequence_number,
|
||||
rtp_timestamp,
|
||||
arrival_timestamp);
|
||||
}
|
||||
|
||||
int AudioDecoderIsac::ErrorCode() {
|
||||
return WebRtcIsac_GetErrorCode(isac_state_);
|
||||
}
|
||||
#endif
|
||||
|
||||
// iSAC fix
|
||||
#ifdef WEBRTC_CODEC_ISACFX
|
||||
AudioDecoderIsacFix::AudioDecoderIsacFix() {
|
||||
|
Reference in New Issue
Block a user