blob: 7fc03a6472fa30b374b3a249c3f916af3d052e20 [file] [log] [blame]
SathishKumar Mani12bff5d2012-09-24 11:48:11 -07001/*
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
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070017#define LOG_TAG "ResamplerCoefficients"
Glenn Kasten5dea84c2012-11-29 14:09:41 -080018//#define LOG_NDEBUG 0
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070019
Glenn Kasten9bcb4762012-11-19 09:00:47 -080020#include <utils/Log.h>
21
22#include "filter_coefficients.h"
23
24const int32_t RESAMPLE_FIR_NUM_COEF = 16;
25const int32_t RESAMPLE_FIR_LERP_INT_BITS = 7;
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070026
27using namespace android;
Glenn Kasten9bcb4762012-11-19 09:00:47 -080028
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070029#ifdef __cplusplus
30extern "C" {
31#endif
Glenn Kasten9bcb4762012-11-19 09:00:47 -080032
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070033const int32_t* readResamplerCoefficients(bool upSample) {
34
35 ALOGV("readResamplerCoefficients");
Glenn Kasten9bcb4762012-11-19 09:00:47 -080036 if (upSample) {
Glenn Kasten70dc7022013-01-08 16:45:38 -080037 return (const int32_t *) up_sampler_filter_coefficients;
Glenn Kasten9bcb4762012-11-19 09:00:47 -080038 } else {
Glenn Kasten70dc7022013-01-08 16:45:38 -080039 return (const int32_t *) dn_sampler_filter_coefficients;
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070040 }
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070041
42}
43
44int32_t readResampleFirNumCoeff() {
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070045 return RESAMPLE_FIR_NUM_COEF;
46}
47
48int32_t readResampleFirLerpIntBits() {
Glenn Kasten9bcb4762012-11-19 09:00:47 -080049 return RESAMPLE_FIR_LERP_INT_BITS;
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070050}
Glenn Kasten9bcb4762012-11-19 09:00:47 -080051
SathishKumar Mani12bff5d2012-09-24 11:48:11 -070052#ifdef __cplusplus
53}
54#endif