Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: webrtc/modules/audio_coding/neteq/comfort_noise.cc

Issue 1948483002: Using ring buffer for AudioVector in NetEq. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: refinements Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/comfort_noise.cc
diff --git a/webrtc/modules/audio_coding/neteq/comfort_noise.cc b/webrtc/modules/audio_coding/neteq/comfort_noise.cc
index 2a512bd750f258491f3fac1a77f25ae356da59b1..c6b6517085ac0672b605b3b94ce73fd36d5afdf0 100644
--- a/webrtc/modules/audio_coding/neteq/comfort_noise.cc
+++ b/webrtc/modules/audio_coding/neteq/comfort_noise.cc
@@ -69,8 +69,9 @@ int ComfortNoise::Generate(size_t requested_length,
}
// The expression &(*output)[0][0] is a pointer to the first element in
hlundin-webrtc 2016/05/10 07:53:18 This comment needs updating.
minyue-webrtc 2016/05/10 12:48:07 thanks. I missed it.
// the first channel.
+ std::unique_ptr<int16_t[]> temp(new int16_t[number_of_samples]);
if (!cng_decoder->Generate(
- rtc::ArrayView<int16_t>(&(*output)[0][0], number_of_samples),
+ rtc::ArrayView<int16_t>(temp.get(), number_of_samples),
new_period)) {
// Error returned.
output->Zeros(requested_length);
@@ -78,6 +79,7 @@ int ComfortNoise::Generate(size_t requested_length,
"ComfortNoiseDecoder::Genererate failed to generate comfort noise";
return kInternalError;
}
+ (*output)[0].OverwriteAt(temp.get(), number_of_samples, 0);
if (first_call_) {
// Set tapering window parameters. Values are in Q15.

Powered by Google App Engine
This is Rietveld 408576698