From 582f80e95c87c7763b29dd4c9c68edca12f843b0 Mon Sep 17 00:00:00 2001 From: Henrik Lundin Date: Mon, 30 Mar 2015 15:01:40 +0200 Subject: [PATCH] Clamp decoder sample rate to 32000 in iSAC We want to crate the illusion that iSAC supports 48000 Hz decoding, while in fact it outputs 32000 Hz. This is the iSAC fullband mode. Currently this is (also) handled by higher layers, but in future changes this will not be the case. R=tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/47809004 Cr-Commit-Position: refs/heads/master@{#8889} --- .../audio_coding/codecs/isac/audio_encoder_isac_t_impl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h index db30444203..e81686a96c 100644 --- a/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h +++ b/webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t_impl.h @@ -226,6 +226,10 @@ int AudioEncoderDecoderIsacT::DecodeInternal(const uint8_t* encoded, int16_t* decoded, SpeechType* speech_type) { CriticalSectionScoped cs(state_lock_.get()); + // We want to crate the illusion that iSAC supports 48000 Hz decoding, while + // in fact it outputs 32000 Hz. This is the iSAC fullband mode. + if (sample_rate_hz == 48000) + sample_rate_hz = 32000; CHECK(sample_rate_hz == 16000 || sample_rate_hz == 32000) << "Unsupported sample rate " << sample_rate_hz; if (sample_rate_hz != decoder_sample_rate_hz_) {