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

Unified Diff: media/base/sinc_resampler_unittest.cc

Issue 13741004: Varispeed support for SincResampler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/sinc_resampler_unittest.cc
diff --git a/media/base/sinc_resampler_unittest.cc b/media/base/sinc_resampler_unittest.cc
index b7aaec43c2c2d6729f24d8d385f6a88570ed1c88..1b2c338bc38312859df65a01d0fb0914dfc829ca 100644
--- a/media/base/sinc_resampler_unittest.cc
+++ b/media/base/sinc_resampler_unittest.cc
@@ -98,6 +98,24 @@ TEST(SincResamplerTest, Flush) {
ASSERT_FLOAT_EQ(resampled_destination[i], 0);
}
+// Test flush resets the internal state properly.
+TEST(SincResamplerTest, KernelBench) {
+ MockSource mock_source;
+ SincResampler resampler(
+ kSampleRateRatio,
+ base::Bind(&MockSource::ProvideInput, base::Unretained(&mock_source)));
+ scoped_array<float> resampled_destination(new float[resampler.ChunkSize()]);
+
+ base::TimeTicks start = base::TimeTicks::HighResNow();
+ for (int i = 1; i < 10000; ++i) {
+ resampler.UpdateSampleRateRatio((i % 100) / 100.0);
+ }
+ double total_time_c_ms =
+ (base::TimeTicks::HighResNow() - start).InMillisecondsF();
+ printf("UpdateSampleRateRatio took %.2fms.\n", total_time_c_ms);
+}
+
+
// Define platform independent function name for Convolve* tests.
#if defined(ARCH_CPU_X86_FAMILY)
#define CONVOLVE_FUNC Convolve_SSE
« media/base/sinc_resampler.cc ('K') | « media/base/sinc_resampler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698