Revert r8476 "Set decoder output frequency in AudioDecoder::Decode call"
This change uncovered issue 4143, evading the Memcheck suppression since the signature is changed in the Decode function. A fix for this is in the making; see https://review.webrtc.org/36309004. This CL will be re-landed once the fix is in place. BUG=4143 TBR=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/42089004 Cr-Commit-Position: refs/heads/master@{#8488} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8488 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -38,12 +38,8 @@
|
||||
namespace webrtc {
|
||||
|
||||
// PCMu
|
||||
int AudioDecoderPcmU::Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
DCHECK_EQ(sample_rate_hz, 8000);
|
||||
int AudioDecoderPcmU::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 = WebRtcG711_DecodeU(encoded, static_cast<int16_t>(encoded_len),
|
||||
decoded, &temp_type);
|
||||
@ -58,12 +54,8 @@ int AudioDecoderPcmU::PacketDuration(const uint8_t* encoded,
|
||||
}
|
||||
|
||||
// PCMa
|
||||
int AudioDecoderPcmA::Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
DCHECK_EQ(sample_rate_hz, 8000);
|
||||
int AudioDecoderPcmA::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 = WebRtcG711_DecodeA(encoded, static_cast<int16_t>(encoded_len),
|
||||
decoded, &temp_type);
|
||||
@ -81,14 +73,8 @@ int AudioDecoderPcmA::PacketDuration(const uint8_t* encoded,
|
||||
#ifdef WEBRTC_CODEC_PCM16
|
||||
AudioDecoderPcm16B::AudioDecoderPcm16B() {}
|
||||
|
||||
int AudioDecoderPcm16B::Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
DCHECK(sample_rate_hz == 8000 || sample_rate_hz == 16000 ||
|
||||
sample_rate_hz == 32000 || sample_rate_hz == 48000)
|
||||
<< "Unsupported sample rate " << sample_rate_hz;
|
||||
int AudioDecoderPcm16B::Decode(const uint8_t* encoded, size_t encoded_len,
|
||||
int16_t* decoded, SpeechType* speech_type) {
|
||||
int16_t ret =
|
||||
WebRtcPcm16b_Decode(encoded, static_cast<int16_t>(encoded_len), decoded);
|
||||
*speech_type = ConvertSpeechType(1);
|
||||
@ -117,12 +103,8 @@ AudioDecoderIlbc::~AudioDecoderIlbc() {
|
||||
WebRtcIlbcfix_DecoderFree(dec_state_);
|
||||
}
|
||||
|
||||
int AudioDecoderIlbc::Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
DCHECK_EQ(sample_rate_hz, 8000);
|
||||
int AudioDecoderIlbc::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 = WebRtcIlbcfix_Decode(dec_state_, encoded,
|
||||
static_cast<int16_t>(encoded_len), decoded,
|
||||
@ -150,12 +132,8 @@ AudioDecoderG722::~AudioDecoderG722() {
|
||||
WebRtcG722_FreeDecoder(dec_state_);
|
||||
}
|
||||
|
||||
int AudioDecoderG722::Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
DCHECK_EQ(sample_rate_hz, 16000);
|
||||
int AudioDecoderG722::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 =
|
||||
WebRtcG722_Decode(dec_state_, encoded, static_cast<int16_t>(encoded_len),
|
||||
@ -185,12 +163,8 @@ AudioDecoderG722Stereo::~AudioDecoderG722Stereo() {
|
||||
WebRtcG722_FreeDecoder(dec_state_right_);
|
||||
}
|
||||
|
||||
int AudioDecoderG722Stereo::Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
DCHECK_EQ(sample_rate_hz, 16000);
|
||||
int AudioDecoderG722Stereo::Decode(const uint8_t* encoded, size_t encoded_len,
|
||||
int16_t* decoded, SpeechType* speech_type) {
|
||||
int16_t temp_type = 1; // Default is speech.
|
||||
// De-interleave the bit-stream into two separate payloads.
|
||||
uint8_t* encoded_deinterleaved = new uint8_t[encoded_len];
|
||||
@ -270,12 +244,8 @@ AudioDecoderOpus::~AudioDecoderOpus() {
|
||||
WebRtcOpus_DecoderFree(dec_state_);
|
||||
}
|
||||
|
||||
int AudioDecoderOpus::Decode(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
DCHECK_EQ(sample_rate_hz, 48000);
|
||||
int AudioDecoderOpus::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 = WebRtcOpus_Decode(dec_state_, encoded,
|
||||
static_cast<int16_t>(encoded_len), decoded,
|
||||
@ -287,13 +257,11 @@ int AudioDecoderOpus::Decode(const uint8_t* encoded,
|
||||
}
|
||||
|
||||
int AudioDecoderOpus::DecodeRedundant(const uint8_t* encoded,
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
size_t encoded_len, int16_t* decoded,
|
||||
SpeechType* speech_type) {
|
||||
if (!PacketHasFec(encoded, encoded_len)) {
|
||||
// This packet is a RED packet.
|
||||
return Decode(encoded, encoded_len, sample_rate_hz, decoded, speech_type);
|
||||
return Decode(encoded, encoded_len, decoded, speech_type);
|
||||
}
|
||||
|
||||
int16_t temp_type = 1; // Default is speech.
|
||||
|
||||
Reference in New Issue
Block a user