/* * Copyright (c) 2011 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. */ /* * This file contains the resampling functions between 48, 44, 32 and 24 kHz. * The description headers can be found in signal_processing_library.h * */ #include "common_audio/signal_processing/include/signal_processing_library.h" // interpolation coefficients static const int16_t kCoefficients48To32[2][8] = …; static const int16_t kCoefficients32To24[3][8] = …; static const int16_t kCoefficients44To32[4][9] = …; // Resampling ratio: 2/3 // input: int32_t (normalized, not saturated) :: size 3 * K // output: int32_t (shifted 15 positions to the left, + offset 16384) :: size 2 * K // K: number of blocks void WebRtcSpl_Resample48khzTo32khz(const int32_t *In, int32_t *Out, size_t K) { … } // Resampling ratio: 3/4 // input: int32_t (normalized, not saturated) :: size 4 * K // output: int32_t (shifted 15 positions to the left, + offset 16384) :: size 3 * K // K: number of blocks void WebRtcSpl_Resample32khzTo24khz(const int32_t *In, int32_t *Out, size_t K) { … } // // fractional resampling filters // Fout = 11/16 * Fin // Fout = 8/11 * Fin // // compute two inner-products and store them to output array static void WebRtcSpl_ResampDotProduct(const int32_t *in1, const int32_t *in2, const int16_t *coef_ptr, int32_t *out1, int32_t *out2) { … } // Resampling ratio: 8/11 // input: int32_t (normalized, not saturated) :: size 11 * K // output: int32_t (shifted 15 positions to the left, + offset 16384) :: size 8 * K // K: number of blocks void WebRtcSpl_Resample44khzTo32khz(const int32_t *In, int32_t *Out, size_t K) { … }