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

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

Issue 41633002: Port SincResampler's ConvolveBenchmark, as well as VectorMath's benchmarks to media_perftests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@portbus
Patch Set: Move unused constant into prepreocessor define to fix android build. Created 7 years, 1 month 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
« no previous file with comments | « no previous file | media/base/sinc_resampler_perftest.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 (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/atomic_ref_count.h" 8 #include "base/atomic_ref_count.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // Update |io_sample_rate_ratio_|. SetRatio() will cause a reconstruction of 69 // Update |io_sample_rate_ratio_|. SetRatio() will cause a reconstruction of
70 // the kernels used for resampling. Not thread safe, do not call while 70 // the kernels used for resampling. Not thread safe, do not call while
71 // Resample() is in progress. 71 // Resample() is in progress.
72 void SetRatio(double io_sample_rate_ratio); 72 void SetRatio(double io_sample_rate_ratio);
73 73
74 float* get_kernel_for_testing() { return kernel_storage_.get(); } 74 float* get_kernel_for_testing() { return kernel_storage_.get(); }
75 75
76 private: 76 private:
77 FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve); 77 FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve);
78 FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, ConvolveBenchmark); 78 FRIEND_TEST_ALL_PREFIXES(SincResamplerPerfTest, Convolve);
79 79
80 void InitializeKernel(); 80 void InitializeKernel();
81 void UpdateRegions(bool second_load); 81 void UpdateRegions(bool second_load);
82 82
83 // Compute convolution of |k1| and |k2| over |input_ptr|, resultant sums are 83 // Compute convolution of |k1| and |k2| over |input_ptr|, resultant sums are
84 // linearly interpolated using |kernel_interpolation_factor|. On x86, the 84 // linearly interpolated using |kernel_interpolation_factor|. On x86, the
85 // underlying implementation is chosen at run time based on SSE support. On 85 // underlying implementation is chosen at run time based on SSE support. On
86 // ARM, NEON support is chosen at compile time based on compilation flags. 86 // ARM, NEON support is chosen at compile time based on compilation flags.
87 static float Convolve_C(const float* input_ptr, const float* k1, 87 static float Convolve_C(const float* input_ptr, const float* k1,
88 const float* k2, double kernel_interpolation_factor); 88 const float* k2, double kernel_interpolation_factor);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // Will be CHECK'd to find crashes... 140 // Will be CHECK'd to find crashes...
141 // TODO(dalecurtis): Remove debug helpers for http://crbug.com/295278 141 // TODO(dalecurtis): Remove debug helpers for http://crbug.com/295278
142 base::AtomicRefCount currently_resampling_; 142 base::AtomicRefCount currently_resampling_;
143 143
144 DISALLOW_COPY_AND_ASSIGN(SincResampler); 144 DISALLOW_COPY_AND_ASSIGN(SincResampler);
145 }; 145 };
146 146
147 } // namespace media 147 } // namespace media
148 148
149 #endif // MEDIA_BASE_SINC_RESAMPLER_H_ 149 #endif // MEDIA_BASE_SINC_RESAMPLER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/sinc_resampler_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698