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

Side by Side Diff: media/base/sinc_resampler.h

Issue 10918098: Introduce AudioOutputResampler for browser side resampling. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unittests! Bugs! Created 8 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_SINC_RESAMPLER_H_ 5 #ifndef MEDIA_BASE_SINC_RESAMPLER_H_
6 #define MEDIA_BASE_SINC_RESAMPLER_H_ 6 #define MEDIA_BASE_SINC_RESAMPLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/memory/aligned_memory.h" 10 #include "base/memory/aligned_memory.h"
(...skipping 17 matching lines...) Expand all
28 SincResampler(double io_sample_rate_ratio, const ReadCB& read_cb); 28 SincResampler(double io_sample_rate_ratio, const ReadCB& read_cb);
29 virtual ~SincResampler(); 29 virtual ~SincResampler();
30 30
31 // Resample |frames| of data from |read_cb_| into |destination|. 31 // Resample |frames| of data from |read_cb_| into |destination|.
32 void Resample(float* destination, int frames); 32 void Resample(float* destination, int frames);
33 33
34 // The maximum size in frames that guarantees Resample() will only make a 34 // The maximum size in frames that guarantees Resample() will only make a
35 // single call to |read_cb_| for more data. 35 // single call to |read_cb_| for more data.
36 int ChunkSize(); 36 int ChunkSize();
37 37
38 // Flush all buffered data and reset internal indexes.
scherkus (not reviewing) 2012/09/10 12:47:47 indices?
DaleCurtis 2012/09/10 14:05:51 Done.
39 void Flush();
40
38 private: 41 private:
39 FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve); 42 FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve);
40 FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, ConvolveBenchmark); 43 FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, ConvolveBenchmark);
41 44
42 void InitializeKernel(); 45 void InitializeKernel();
43 46
44 // Compute convolution of |k1| and |k2| over |input_ptr|, resultant sums are 47 // Compute convolution of |k1| and |k2| over |input_ptr|, resultant sums are
45 // linearly interpolated using |kernel_interpolation_factor|. The underlying 48 // linearly interpolated using |kernel_interpolation_factor|. The underlying
46 // implementation is chosen at run time based on SSE support. 49 // implementation is chosen at run time based on SSE support.
47 static float Convolve(const float* input_ptr, const float* k1, 50 static float Convolve(const float* input_ptr, const float* k1,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 float* const r3_; 84 float* const r3_;
82 float* const r4_; 85 float* const r4_;
83 float* const r5_; 86 float* const r5_;
84 87
85 DISALLOW_COPY_AND_ASSIGN(SincResampler); 88 DISALLOW_COPY_AND_ASSIGN(SincResampler);
86 }; 89 };
87 90
88 } // namespace media 91 } // namespace media
89 92
90 #endif // MEDIA_BASE_SINC_RESAMPLER_H_ 93 #endif // MEDIA_BASE_SINC_RESAMPLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698