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

Unified Diff: media/base/sinc_resampler.h

Issue 2556993002: Experiment with AVX optimizations for FMAC, FMUL operations.
Patch Set: Created 4 years 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
« no previous file with comments | « media/base/media.cc ('k') | media/base/sinc_resampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/sinc_resampler.h
diff --git a/media/base/sinc_resampler.h b/media/base/sinc_resampler.h
index afbd2abc9cc4e6513b7b8ebbefd2db0457652e34..6b3568899f25a28f9b9059f88846cf17d844b903 100644
--- a/media/base/sinc_resampler.h
+++ b/media/base/sinc_resampler.h
@@ -13,6 +13,7 @@
#include "base/memory/aligned_memory.h"
#include "build/build_config.h"
#include "media/base/media_export.h"
+#include "media/base/vector_math.h"
namespace media {
@@ -21,9 +22,9 @@ class MEDIA_EXPORT SincResampler {
public:
enum {
// The kernel size can be adjusted for quality (higher is better) at the
- // expense of performance. Must be a multiple of 32.
- // TODO(dalecurtis): Test performance to see if we can jack this up to 64+.
- kKernelSize = 32,
+ // expense of performance. For performance we use the same kernel size
+ // as the SIMD optimized Convolve() operation.
+ kKernelSize = vector_math::kKernelSize,
// Default request size. Affects how often and for how much SincResampler
// calls back for input. Must be greater than kKernelSize.
@@ -84,28 +85,9 @@ class MEDIA_EXPORT SincResampler {
double BufferedFrames() const;
private:
- FRIEND_TEST_ALL_PREFIXES(SincResamplerTest, Convolve);
- FRIEND_TEST_ALL_PREFIXES(SincResamplerPerfTest, Convolve);
-
void InitializeKernel();
void UpdateRegions(bool second_load);
- // Compute convolution of |k1| and |k2| over |input_ptr|, resultant sums are
- // linearly interpolated using |kernel_interpolation_factor|. On x86, the
- // underlying implementation is chosen at run time based on SSE support. On
- // ARM, NEON support is chosen at compile time based on compilation flags.
- static float Convolve_C(const float* input_ptr, const float* k1,
- const float* k2, double kernel_interpolation_factor);
-#if defined(ARCH_CPU_X86_FAMILY)
- static float Convolve_SSE(const float* input_ptr, const float* k1,
- const float* k2,
- double kernel_interpolation_factor);
-#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
- static float Convolve_NEON(const float* input_ptr, const float* k1,
- const float* k2,
- double kernel_interpolation_factor);
-#endif
-
// The ratio of input / output sample rates.
double io_sample_rate_ratio_;
« no previous file with comments | « media/base/media.cc ('k') | media/base/sinc_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698