Index: media/base/sinc_resampler.h |
diff --git a/media/base/sinc_resampler.h b/media/base/sinc_resampler.h |
index 7b1dfaa1246fe5714fb7b5151a40aaeee9d0de7e..5b2e875cebb97c5354541bf6842ad1a5909a777e 100644 |
--- a/media/base/sinc_resampler.h |
+++ b/media/base/sinc_resampler.h |
@@ -63,11 +63,13 @@ class MEDIA_EXPORT SincResampler { |
// Flush all buffered data and reset internal indices. |
void Flush(); |
+ void UpdateSampleRateRatio(double io_sample_rate_ratio_); |
Chris Rogers
2013/04/08 19:38:11
nit: method param should not have "_" at end
Also
henrika (OOO until Aug 14)
2013/04/11 18:27:20
Would it make any sense to add sanity checks here
DaleCurtis
2013/04/15 20:27:31
Removed _. Changed to SetRatio().
DaleCurtis
2013/04/15 20:27:31
Any value is okay.
|
+ |
private: |
FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve); |
FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, ConvolveBenchmark); |
- void InitializeKernel(); |
+ void InitializeKernel(bool first_run); |
Chris Rogers
2013/04/08 19:38:11
Can't we avoid having to pass this in as a param a
DaleCurtis
2013/04/15 20:27:31
Done.
|
// Compute convolution of |k1| and |k2| over |input_ptr|, resultant sums are |
// linearly interpolated using |kernel_interpolation_factor|. On x86, the |
@@ -86,7 +88,7 @@ class MEDIA_EXPORT SincResampler { |
#endif |
// The ratio of input / output sample rates. |
- const double io_sample_rate_ratio_; |
+ double io_sample_rate_ratio_; |
// An index on the source input buffer with sub-sample precision. It must be |
// double precision to avoid drift. |
@@ -101,10 +103,12 @@ class MEDIA_EXPORT SincResampler { |
// Contains kKernelOffsetCount kernels back-to-back, each of size kKernelSize. |
// The kernel offsets are sub-sample shifts of a windowed sinc shifted from |
// 0.0 to 1.0 sample. |
- scoped_ptr_malloc<float, base::ScopedPtrAlignedFree> kernel_storage_; |
+ scoped_ptr<float[], base::ScopedPtrAlignedFree> kernel_storage_; |
+ scoped_ptr<float[], base::ScopedPtrAlignedFree> kernel_pre_sinc_storage_; |
+ scoped_ptr<float[], base::ScopedPtrAlignedFree> kernel_window_storage_; |
// Data from the source is copied into this buffer for each processing pass. |
- scoped_ptr_malloc<float, base::ScopedPtrAlignedFree> input_buffer_; |
+ scoped_ptr<float[], base::ScopedPtrAlignedFree> input_buffer_; |
// Stores the runtime selection of which Convolve function to use. |
#if defined(ARCH_CPU_X86_FAMILY) && !defined(__SSE__) |