#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/filters/wsola_internals.h"
#include <algorithm>
#include <cmath>
#include <cstring>
#include <limits>
#include <memory>
#include <numbers>
#include "base/check_op.h"
#include "build/build_config.h"
#include "media/base/audio_bus.h"
#if defined(ARCH_CPU_X86_FAMILY)
#define USE_SIMD …
#include <xmmintrin.h>
#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
#define USE_SIMD …
#include <arm_neon.h>
#endif
namespace media {
namespace internal {
bool InInterval(int n, Interval q) { … }
float MultiChannelSimilarityMeasure(const float* dot_prod_a_b,
const float* energy_a,
const float* energy_b,
int channels) { … }
void MultiChannelDotProduct(const AudioBus* a,
int frame_offset_a,
const AudioBus* b,
int frame_offset_b,
int num_frames,
float* dot_product) { … }
void MultiChannelMovingBlockEnergies(const AudioBus* input,
int frames_per_block,
float* energy) { … }
void QuadraticInterpolation(const float* y_values,
float* extremum,
float* extremum_value) { … }
int DecimatedSearch(int decimation,
Interval exclude_interval,
const AudioBus* target_block,
const AudioBus* search_segment,
const float* energy_target_block,
const float* energy_candidate_blocks) { … }
int FullSearch(int low_limit,
int high_limit,
Interval exclude_interval,
const AudioBus* target_block,
const AudioBus* search_block,
const float* energy_target_block,
const float* energy_candidate_blocks) { … }
int OptimalIndex(const AudioBus* search_block,
const AudioBus* target_block,
Interval exclude_interval) { … }
void GetPeriodicHanningWindow(int window_length, float* window) { … }
}
}