1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #define LOG_TAG "ResamplerCoefficients" 18 //#define LOG_NDEBUG 0 19 20 #include <utils/Log.h> 21 22 #include "filter_coefficients.h" 23 24 const int32_t RESAMPLE_FIR_NUM_COEF = 16; 25 const int32_t RESAMPLE_FIR_LERP_INT_BITS = 7; 26 27 using namespace android; 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 readResamplerCoefficients(bool upSample)33const int32_t* readResamplerCoefficients(bool upSample) { 34 35 ALOGV("readResamplerCoefficients"); 36 if (upSample) { 37 return (const int32_t *) up_sampler_filter_coefficients; 38 } else { 39 return (const int32_t *) dn_sampler_filter_coefficients; 40 } 41 42 } 43 readResampleFirNumCoeff()44int32_t readResampleFirNumCoeff() { 45 return RESAMPLE_FIR_NUM_COEF; 46 } 47 readResampleFirLerpIntBits()48int32_t readResampleFirLerpIntBits() { 49 return RESAMPLE_FIR_LERP_INT_BITS; 50 } 51 52 #ifdef __cplusplus 53 } 54 #endif 55