Adding FEC support in NetEq 4.
R=henrik.lundin@webrtc.org, turaj@webrtc.org TEST=passes all trybots BUG= Review URL: https://webrtc-codereview.appspot.com/9999004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5748 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -458,6 +458,19 @@ int AudioDecoderOpus::Decode(const uint8_t* encoded, size_t encoded_len,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int AudioDecoderOpus::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 = WebRtcOpus_DecodeFec(static_cast<OpusDecInst*>(state_), encoded,
|
||||
static_cast<int16_t>(encoded_len), decoded,
|
||||
&temp_type);
|
||||
if (ret > 0)
|
||||
ret *= static_cast<int16_t>(channels_); // Return total number of samples.
|
||||
*speech_type = ConvertSpeechType(temp_type);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int AudioDecoderOpus::Init() {
|
||||
return WebRtcOpus_DecoderInitNew(static_cast<OpusDecInst*>(state_));
|
||||
}
|
||||
@ -467,6 +480,18 @@ int AudioDecoderOpus::PacketDuration(const uint8_t* encoded,
|
||||
return WebRtcOpus_DurationEst(static_cast<OpusDecInst*>(state_),
|
||||
encoded, static_cast<int>(encoded_len));
|
||||
}
|
||||
|
||||
int AudioDecoderOpus::PacketDurationRedundant(const uint8_t* encoded,
|
||||
size_t encoded_len) const {
|
||||
return WebRtcOpus_FecDurationEst(encoded, static_cast<int>(encoded_len));
|
||||
}
|
||||
|
||||
bool AudioDecoderOpus::PacketHasFec(const uint8_t* encoded,
|
||||
size_t encoded_len) const {
|
||||
int fec;
|
||||
fec = WebRtcOpus_PacketHasFec(encoded, static_cast<int>(encoded_len));
|
||||
return (fec == 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
AudioDecoderCng::AudioDecoderCng(enum NetEqDecoder type)
|
||||
|
||||
Reference in New Issue
Block a user