chromium/media/filters/wsola_internals.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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) {}

// Fit the curve f(x) = a * x^2 + b * x + c such that
//   f(-1) = y[0]
//   f(0) = y[1]
//   f(1) = y[2]
// and return the maximum, assuming that y[0] <= y[1] >= y[2].
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) {}

}  // namespace internal

}  // namespace media