Let NetEq use the PLC output from a decoder
This change enables NetEq to use the packet concealment audio (aka PLC) produced by a decoder. The change also includes a new API to the AudioDecoder interface, which lets the decoder implementation generate and deliver concealment audio. Bug: webrtc:9180 Change-Id: Icaacebccf645d4694b0d2d6310f6f2c7132881c4 Reviewed-on: https://webrtc-review.googlesource.com/96340 Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org> Reviewed-by: Minyue Li <minyue@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24738}
This commit is contained in:
committed by
Commit Bot
parent
e899629be4
commit
00eb12a20c
@ -31,7 +31,8 @@ PreemptiveExpand::ReturnCodes PreemptiveExpand::Process(
|
||||
old_data_length >= input_length / num_channels_ - overlap_samples_) {
|
||||
// Length of input data too short to do preemptive expand. Simply move all
|
||||
// data from input to output.
|
||||
output->PushBackInterleaved(input, input_length);
|
||||
output->PushBackInterleaved(
|
||||
rtc::ArrayView<const int16_t>(input, input_length));
|
||||
return kError;
|
||||
}
|
||||
const bool kFastMode = false; // Fast mode is not available for PE Expand.
|
||||
@ -75,19 +76,19 @@ PreemptiveExpand::ReturnCodes PreemptiveExpand::CheckCriteriaAndStretch(
|
||||
size_t unmodified_length =
|
||||
std::max(old_data_length_per_channel_, fs_mult_120);
|
||||
// Copy first part, including cross-fade region.
|
||||
output->PushBackInterleaved(
|
||||
input, (unmodified_length + peak_index) * num_channels_);
|
||||
output->PushBackInterleaved(rtc::ArrayView<const int16_t>(
|
||||
input, (unmodified_length + peak_index) * num_channels_));
|
||||
// Copy the last |peak_index| samples up to 15 ms to |temp_vector|.
|
||||
AudioMultiVector temp_vector(num_channels_);
|
||||
temp_vector.PushBackInterleaved(
|
||||
temp_vector.PushBackInterleaved(rtc::ArrayView<const int16_t>(
|
||||
&input[(unmodified_length - peak_index) * num_channels_],
|
||||
peak_index * num_channels_);
|
||||
peak_index * num_channels_));
|
||||
// Cross-fade |temp_vector| onto the end of |output|.
|
||||
output->CrossFade(temp_vector, peak_index);
|
||||
// Copy the last unmodified part, 15 ms + pitch period until the end.
|
||||
output->PushBackInterleaved(
|
||||
output->PushBackInterleaved(rtc::ArrayView<const int16_t>(
|
||||
&input[unmodified_length * num_channels_],
|
||||
input_length - unmodified_length * num_channels_);
|
||||
input_length - unmodified_length * num_channels_));
|
||||
|
||||
if (active_speech) {
|
||||
return kSuccess;
|
||||
@ -96,7 +97,8 @@ PreemptiveExpand::ReturnCodes PreemptiveExpand::CheckCriteriaAndStretch(
|
||||
}
|
||||
} else {
|
||||
// Accelerate not allowed. Simply move all data from decoded to outData.
|
||||
output->PushBackInterleaved(input, input_length);
|
||||
output->PushBackInterleaved(
|
||||
rtc::ArrayView<const int16_t>(input, input_length));
|
||||
return kNoStretch;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user