chromium/third_party/webrtc/modules/audio_coding/neteq/dsp_helper.cc

/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "modules/audio_coding/neteq/dsp_helper.h"

#include <string.h>  // Access to memset.

#include <algorithm>  // Access to min, max.

#include "common_audio/signal_processing/include/signal_processing_library.h"

namespace webrtc {

// Table of constants used in method DspHelper::ParabolicFit().
const int16_t DspHelper::kParabolaCoefficients[17][3] =;

// Filter coefficients used when downsampling from the indicated sample rates
// (8, 16, 32, 48 kHz) to 4 kHz. Coefficients are in Q12. The corresponding Q0
// values are provided in the comments before each array.

// Q0 values: {0.3, 0.4, 0.3}.
const int16_t DspHelper::kDownsample8kHzTbl[3] =;

// Q0 values: {0.15, 0.2, 0.3, 0.2, 0.15}.
const int16_t DspHelper::kDownsample16kHzTbl[5] =;

// Q0 values: {0.1425, 0.1251, 0.1525, 0.1628, 0.1525, 0.1251, 0.1425}.
const int16_t DspHelper::kDownsample32kHzTbl[7] =;

// Q0 values: {0.2487, 0.0952, 0.1042, 0.1074, 0.1042, 0.0952, 0.2487}.
const int16_t DspHelper::kDownsample48kHzTbl[7] =;

int DspHelper::RampSignal(const int16_t* input,
                          size_t length,
                          int factor,
                          int increment,
                          int16_t* output) {}

int DspHelper::RampSignal(int16_t* signal,
                          size_t length,
                          int factor,
                          int increment) {}

int DspHelper::RampSignal(AudioVector* signal,
                          size_t start_index,
                          size_t length,
                          int factor,
                          int increment) {}

int DspHelper::RampSignal(AudioMultiVector* signal,
                          size_t start_index,
                          size_t length,
                          int factor,
                          int increment) {}

void DspHelper::PeakDetection(int16_t* data,
                              size_t data_length,
                              size_t num_peaks,
                              int fs_mult,
                              size_t* peak_index,
                              int16_t* peak_value) {}

void DspHelper::ParabolicFit(int16_t* signal_points,
                             int fs_mult,
                             size_t* peak_index,
                             int16_t* peak_value) {}

size_t DspHelper::MinDistortion(const int16_t* signal,
                                size_t min_lag,
                                size_t max_lag,
                                size_t length,
                                int32_t* distortion_value) {}

void DspHelper::CrossFade(const int16_t* input1,
                          const int16_t* input2,
                          size_t length,
                          int16_t* mix_factor,
                          int16_t factor_decrement,
                          int16_t* output) {}

void DspHelper::UnmuteSignal(const int16_t* input,
                             size_t length,
                             int16_t* factor,
                             int increment,
                             int16_t* output) {}

void DspHelper::MuteSignal(int16_t* signal, int mute_slope, size_t length) {}

int DspHelper::DownsampleTo4kHz(const int16_t* input,
                                size_t input_length,
                                size_t output_length,
                                int input_rate_hz,
                                bool compensate_delay,
                                int16_t* output) {}

}  // namespace webrtc