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

Unified Diff: remoting/codec/audio_encoder_opus.cc

Issue 14189035: Reduce jitter from uneven SincResampler buffer size requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. Created 7 years, 8 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
« media/base/sinc_resampler.cc ('K') | « media/base/sinc_resampler_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/audio_encoder_opus.cc
diff --git a/remoting/codec/audio_encoder_opus.cc b/remoting/codec/audio_encoder_opus.cc
index 15160df75f5b0a2764137245ad472f14deb3e8d6..f7d5dce85cadc704f0989e8ce2d0f3850db63c6a 100644
--- a/remoting/codec/audio_encoder_opus.cc
+++ b/remoting/codec/audio_encoder_opus.cc
@@ -80,6 +80,7 @@ void AudioEncoderOpus::InitEncoder() {
resampler_.reset(new media::MultiChannelResampler(
channels_,
static_cast<double>(sampling_rate_) / kOpusSamplingRate,
+ media::SincResampler::kDefaultBlockSize,
Sergey Ulanov 2013/04/29 06:23:37 I think it would be better to mach default frame s
Sergey Ulanov 2013/04/29 07:16:54 Sorry, just realized that kFrameSamples is already
DaleCurtis 2013/04/29 22:12:31 kFrameSamples appears to refer to the output sampl
Sergey Ulanov 2013/05/01 02:06:25 Oh, right. Then it should be frame_size_, which is
DaleCurtis 2013/05/07 23:49:41 Hmm, I'm not sure about this, so I've just kept th
base::Bind(&AudioEncoderOpus::FetchBytesToResample,
base::Unretained(this))));
resampler_bus_ = media::AudioBus::Create(channels_, kFrameSamples);
@@ -88,7 +89,7 @@ void AudioEncoderOpus::InitEncoder() {
// Drop leftover data because it's for different sampling rate.
leftover_samples_ = 0;
leftover_buffer_size_ =
- frame_size_ + media::SincResampler::kMaximumLookAheadSize;
+ frame_size_ + media::SincResampler::kDefaultBlockSize;
leftover_buffer_.reset(
new int16[leftover_buffer_size_ * channels_]);
}
@@ -159,7 +160,7 @@ scoped_ptr<AudioPacket> AudioEncoderOpus::Encode(
encoded_packet->set_channels(channels_);
int prefetch_samples =
Sergey Ulanov 2013/05/01 02:06:25 Not sure if prefetching is still required. If not
- resampler_.get() ? media::SincResampler::kMaximumLookAheadSize : 0;
+ resampler_.get() ? media::SincResampler::kDefaultBlockSize : 0;
int samples_wanted = frame_size_ + prefetch_samples;
while (leftover_samples_ + samples_in_packet >= samples_wanted) {
« media/base/sinc_resampler.cc ('K') | « media/base/sinc_resampler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698