SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 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 | |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 17 | #define LOG_TAG "ResamplerCoefficients" |
Glenn Kasten | 5dea84c | 2012-11-29 14:09:41 -0800 | [diff] [blame] | 18 | //#define LOG_NDEBUG 0 |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 19 | |
Glenn Kasten | 9bcb476 | 2012-11-19 09:00:47 -0800 | [diff] [blame] | 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; |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 26 | |
| 27 | using namespace android; |
Glenn Kasten | 9bcb476 | 2012-11-19 09:00:47 -0800 | [diff] [blame] | 28 | |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 29 | #ifdef __cplusplus |
| 30 | extern "C" { |
| 31 | #endif |
Glenn Kasten | 9bcb476 | 2012-11-19 09:00:47 -0800 | [diff] [blame] | 32 | |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 33 | const int32_t* readResamplerCoefficients(bool upSample) { |
| 34 | |
| 35 | ALOGV("readResamplerCoefficients"); |
Glenn Kasten | 9bcb476 | 2012-11-19 09:00:47 -0800 | [diff] [blame] | 36 | if (upSample) { |
Glenn Kasten | 70dc702 | 2013-01-08 16:45:38 -0800 | [diff] [blame] | 37 | return (const int32_t *) up_sampler_filter_coefficients; |
Glenn Kasten | 9bcb476 | 2012-11-19 09:00:47 -0800 | [diff] [blame] | 38 | } else { |
Glenn Kasten | 70dc702 | 2013-01-08 16:45:38 -0800 | [diff] [blame] | 39 | return (const int32_t *) dn_sampler_filter_coefficients; |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 40 | } |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 41 | |
| 42 | } |
| 43 | |
| 44 | int32_t readResampleFirNumCoeff() { |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 45 | return RESAMPLE_FIR_NUM_COEF; |
| 46 | } |
| 47 | |
| 48 | int32_t readResampleFirLerpIntBits() { |
Glenn Kasten | 9bcb476 | 2012-11-19 09:00:47 -0800 | [diff] [blame] | 49 | return RESAMPLE_FIR_LERP_INT_BITS; |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 50 | } |
Glenn Kasten | 9bcb476 | 2012-11-19 09:00:47 -0800 | [diff] [blame] | 51 | |
SathishKumar Mani | 12bff5d | 2012-09-24 11:48:11 -0700 | [diff] [blame] | 52 | #ifdef __cplusplus |
| 53 | } |
| 54 | #endif |