#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/audio/vector_math.h"
#include <cmath>
#include "base/compiler_specific.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_MAC)
#include "third_party/blink/renderer/platform/audio/mac/vector_math_mac.h"
#elif defined(CPU_ARM_NEON)
#include "third_party/blink/renderer/platform/audio/cpu/arm/vector_math_neon.h"
#elif defined(HAVE_MIPS_MSA_INTRINSICS)
#include "third_party/blink/renderer/platform/audio/cpu/mips/vector_math_msa.h"
#elif defined(ARCH_CPU_X86_FAMILY)
#include "third_party/blink/renderer/platform/audio/cpu/x86/vector_math_x86.h"
#else
#include "third_party/blink/renderer/platform/audio/vector_math_scalar.h"
#endif
namespace blink::vector_math {
namespace {
#if BUILDFLAG(IS_MAC)
namespace impl = mac;
#elif defined(CPU_ARM_NEON)
namespace impl = neon;
#elif defined(HAVE_MIPS_MSA_INTRINSICS)
namespace impl = msa;
#elif defined(ARCH_CPU_X86_FAMILY)
impl;
#else
namespace impl = scalar;
#endif
}
void PrepareFilterForConv(const float* filter_p,
int filter_stride,
size_t filter_size,
AudioFloatArray* prepared_filter) { … }
void Conv(const float* source_p,
int source_stride,
const float* filter_p,
int filter_stride,
float* dest_p,
int dest_stride,
uint32_t frames_to_process,
size_t filter_size,
const AudioFloatArray* prepared_filter) { … }
void Vadd(const float* source1p,
int source_stride1,
const float* source2p,
int source_stride2,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsub(const float* source1p,
int source_stride1,
const float* source2p,
int source_stride2,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vclip(const float* source_p,
int source_stride,
const float* low_threshold_p,
const float* high_threshold_p,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vclip(const float* source_p,
int source_stride,
float low_threshold_p,
float high_threshold_p,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vmaxmgv(const float* source_p,
int source_stride,
float* max_p,
uint32_t frames_to_process) { … }
void Vmul(const float* source1p,
int source_stride1,
const float* source2p,
int source_stride2,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsma(const float* source_p,
int source_stride,
const float* scale,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsma(const float* source_p,
int source_stride,
float scale,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsmul(const float* source_p,
int source_stride,
const float* scale,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsmul(const float* source_p,
int source_stride,
float scale,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsadd(const float* source_p,
int source_stride,
const float* addend,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsadd(const float* source_p,
int source_stride,
float addend,
float* dest_p,
int dest_stride,
uint32_t frames_to_process) { … }
void Vsvesq(const float* source_p,
int source_stride,
float* sum_p,
uint32_t frames_to_process) { … }
void Zvmul(const float* real1p,
const float* imag1p,
const float* real2p,
const float* imag2p,
float* real_dest_p,
float* imag_dest_p,
uint32_t frames_to_process) { … }
}