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

Side by Side Diff: media/base/sinc_resampler_perftest.cc

Issue 308003004: Remove runtime CPU detection for SSE optimized media/ methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more salty fix. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/base/sinc_resampler.cc ('k') | media/base/sinc_resampler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/cpu.h"
8 #include "base/time/time.h" 7 #include "base/time/time.h"
9 #include "media/base/sinc_resampler.h" 8 #include "media/base/sinc_resampler.h"
10 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/perf/perf_test.h" 11 #include "testing/perf/perf_test.h"
13 12
14 namespace media { 13 namespace media {
15 14
16 static const int kBenchmarkIterations = 50000000; 15 static const int kBenchmarkIterations = 50000000;
17 16
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // branding=Chrome so that DCHECKs are compiled out when benchmarking. 53 // branding=Chrome so that DCHECKs are compiled out when benchmarking.
55 TEST(SincResamplerPerfTest, Convolve) { 54 TEST(SincResamplerPerfTest, Convolve) {
56 SincResampler resampler(kSampleRateRatio, 55 SincResampler resampler(kSampleRateRatio,
57 SincResampler::kDefaultRequestSize, 56 SincResampler::kDefaultRequestSize,
58 base::Bind(&DoNothing)); 57 base::Bind(&DoNothing));
59 58
60 RunConvolveBenchmark( 59 RunConvolveBenchmark(
61 &resampler, SincResampler::Convolve_C, true, "unoptimized_aligned"); 60 &resampler, SincResampler::Convolve_C, true, "unoptimized_aligned");
62 61
63 #if defined(CONVOLVE_FUNC) 62 #if defined(CONVOLVE_FUNC)
64 #if defined(ARCH_CPU_X86_FAMILY)
65 ASSERT_TRUE(base::CPU().has_sse());
66 #endif
67 RunConvolveBenchmark( 63 RunConvolveBenchmark(
68 &resampler, SincResampler::CONVOLVE_FUNC, true, "optimized_aligned"); 64 &resampler, SincResampler::CONVOLVE_FUNC, true, "optimized_aligned");
69 RunConvolveBenchmark( 65 RunConvolveBenchmark(
70 &resampler, SincResampler::CONVOLVE_FUNC, false, "optimized_unaligned"); 66 &resampler, SincResampler::CONVOLVE_FUNC, false, "optimized_unaligned");
71 #endif 67 #endif
72 } 68 }
73 69
74 #undef CONVOLVE_FUNC 70 #undef CONVOLVE_FUNC
75 71
76 } // namespace media 72 } // namespace media
OLDNEW
« no previous file with comments | « media/base/sinc_resampler.cc ('k') | media/base/sinc_resampler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698