| Index: media/base/vector_math.h
|
| diff --git a/media/base/vector_math.h b/media/base/vector_math.h
|
| index a148ca050f1c399c7caa0b772870fb65fcc7d4e5..dce319495080801eeb820b16e3987f9b48348021 100644
|
| --- a/media/base/vector_math.h
|
| +++ b/media/base/vector_math.h
|
| @@ -12,16 +12,35 @@
|
| namespace media {
|
| namespace vector_math {
|
|
|
| -// Required alignment for inputs and outputs to all vector math functions
|
| -enum { kRequiredAlignment = 16 };
|
| +enum {
|
| + // Kernel size for use with Convolve(); must be a multiple of 32. Higher
|
| + // values increase the quality of the convolution.
|
| + kKernelSize = 32,
|
| +
|
| + // Required alignment for inputs and outputs to all vector math functions
|
| + kRequiredAlignment = 32
|
| +};
|
| +
|
| +// Sets up CPU specific optimizations.
|
| +MEDIA_EXPORT void Initialize();
|
| +
|
| +// Compute convolution of |k1| and |k2| over |src|, resultant sums are
|
| +// linearly interpolated using |kernel_interpolation_factor|.
|
| +MEDIA_EXPORT float Convolve(const float* src,
|
| + const float* k1,
|
| + const float* k2,
|
| + double kernel_interpolation_factor);
|
| +
|
| +// Computes the dot-product (scalar-product) of two vectors of length |len|.
|
| +MEDIA_EXPORT float DotProduct(const float* a, const float* b, int len);
|
|
|
| // Multiply each element of |src| (up to |len|) by |scale| and add to |dest|.
|
| // |src| and |dest| must be aligned by kRequiredAlignment.
|
| -MEDIA_EXPORT void FMAC(const float src[], float scale, int len, float dest[]);
|
| +MEDIA_EXPORT void FMAC(const float* src, float scale, int len, float* dest);
|
|
|
| // Multiply each element of |src| by |scale| and store in |dest|. |src| and
|
| // |dest| must be aligned by kRequiredAlignment.
|
| -MEDIA_EXPORT void FMUL(const float src[], float scale, int len, float dest[]);
|
| +MEDIA_EXPORT void FMUL(const float* src, float scale, int len, float* dest);
|
|
|
| // Computes the exponentially-weighted moving average power of a signal by
|
| // iterating the recurrence:
|
| @@ -30,10 +49,10 @@ MEDIA_EXPORT void FMUL(const float src[], float scale, int len, float dest[]);
|
| // y[n] = smoothing_factor * src[n]^2 + (1-smoothing_factor) * y[n-1]
|
| //
|
| // Returns the final average power and the maximum squared element value.
|
| -MEDIA_EXPORT std::pair<float, float> EWMAAndMaxPower(
|
| - float initial_value, const float src[], int len, float smoothing_factor);
|
| -
|
| -MEDIA_EXPORT void Crossfade(const float src[], int len, float dest[]);
|
| +MEDIA_EXPORT std::pair<float, float> EWMAAndMaxPower(float initial_value,
|
| + const float* src,
|
| + int len,
|
| + float smoothing_factor);
|
|
|
| } // namespace vector_math
|
| } // namespace media
|
|
|