| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef VectorMath_h | 25 #ifndef VectorMath_h |
| 26 #define VectorMath_h | 26 #define VectorMath_h |
| 27 | 27 |
| 28 #include "platform/PlatformExport.h" | 28 #include "platform/PlatformExport.h" |
| 29 #include "wtf/build_config.h" | 29 #include "wtf/build_config.h" |
| 30 #include <cstddef> | 30 #include <cstddef> |
| 31 | 31 |
| 32 #if ENABLE(WEB_AUDIO) | |
| 33 | |
| 34 // Defines the interface for several vector math functions whose implementation
will ideally be optimized. | 32 // Defines the interface for several vector math functions whose implementation
will ideally be optimized. |
| 35 | 33 |
| 36 namespace blink { | 34 namespace blink { |
| 37 namespace VectorMath { | 35 namespace VectorMath { |
| 38 | 36 |
| 39 // Vector scalar multiply and then add. | 37 // Vector scalar multiply and then add. |
| 40 PLATFORM_EXPORT void vsma(const float* sourceP, int sourceStride, const float* s
cale, float* destP, int destStride, size_t framesToProcess); | 38 PLATFORM_EXPORT void vsma(const float* sourceP, int sourceStride, const float* s
cale, float* destP, int destStride, size_t framesToProcess); |
| 41 | 39 |
| 42 PLATFORM_EXPORT void vsmul(const float* sourceP, int sourceStride, const float*
scale, float* destP, int destStride, size_t framesToProcess); | 40 PLATFORM_EXPORT void vsmul(const float* sourceP, int sourceStride, const float*
scale, float* destP, int destStride, size_t framesToProcess); |
| 43 PLATFORM_EXPORT void vadd(const float* source1P, int sourceStride1, const float*
source2P, int sourceStride2, float* destP, int destStride, size_t framesToProce
ss); | 41 PLATFORM_EXPORT void vadd(const float* source1P, int sourceStride1, const float*
source2P, int sourceStride2, float* destP, int destStride, size_t framesToProce
ss); |
| 44 | 42 |
| 45 // Finds the maximum magnitude of a float vector. | 43 // Finds the maximum magnitude of a float vector. |
| 46 PLATFORM_EXPORT void vmaxmgv(const float* sourceP, int sourceStride, float* maxP
, size_t framesToProcess); | 44 PLATFORM_EXPORT void vmaxmgv(const float* sourceP, int sourceStride, float* maxP
, size_t framesToProcess); |
| 47 | 45 |
| 48 // Sums the squares of a float vector's elements. | 46 // Sums the squares of a float vector's elements. |
| 49 PLATFORM_EXPORT void vsvesq(const float* sourceP, int sourceStride, float* sumP,
size_t framesToProcess); | 47 PLATFORM_EXPORT void vsvesq(const float* sourceP, int sourceStride, float* sumP,
size_t framesToProcess); |
| 50 | 48 |
| 51 // For an element-by-element multiply of two float vectors. | 49 // For an element-by-element multiply of two float vectors. |
| 52 PLATFORM_EXPORT void vmul(const float* source1P, int sourceStride1, const float*
source2P, int sourceStride2, float* destP, int destStride, size_t framesToProce
ss); | 50 PLATFORM_EXPORT void vmul(const float* source1P, int sourceStride1, const float*
source2P, int sourceStride2, float* destP, int destStride, size_t framesToProce
ss); |
| 53 | 51 |
| 54 // Multiplies two complex vectors. | 52 // Multiplies two complex vectors. |
| 55 PLATFORM_EXPORT void zvmul(const float* real1P, const float* imag1P, const float
* real2P, const float* imag2P, float* realDestP, float* imagDestP, size_t frames
ToProcess); | 53 PLATFORM_EXPORT void zvmul(const float* real1P, const float* imag1P, const float
* real2P, const float* imag2P, float* realDestP, float* imagDestP, size_t frames
ToProcess); |
| 56 | 54 |
| 57 // Copies elements while clipping values to the threshold inputs. | 55 // Copies elements while clipping values to the threshold inputs. |
| 58 PLATFORM_EXPORT void vclip(const float* sourceP, int sourceStride, const float*
lowThresholdP, const float* highThresholdP, float* destP, int destStride, size_t
framesToProcess); | 56 PLATFORM_EXPORT void vclip(const float* sourceP, int sourceStride, const float*
lowThresholdP, const float* highThresholdP, float* destP, int destStride, size_t
framesToProcess); |
| 59 | 57 |
| 60 } // namespace VectorMath | 58 } // namespace VectorMath |
| 61 } // namespace blink | 59 } // namespace blink |
| 62 | 60 |
| 63 #endif // ENABLE(WEB_AUDIO) | |
| 64 | |
| 65 #endif // VectorMath_h | 61 #endif // VectorMath_h |
| OLD | NEW |