1 /*****************************************************************************
2 * bandlimited.h : bandlimited interpolation resampler
3 *****************************************************************************
4 * Copyright (C) 2002 the VideoLAN team
7 * Authors: Gildas Bazin <gbazin@netcourrier.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /* Conversion constants */
28 /* Description of constants:
30 * Npc - is the number of look-up values available for the lowpass filter
31 * between the beginning of its impulse response and the "cutoff time"
32 * of the filter. The cutoff time is defined as the reciprocal of the
33 * lowpass-filter cut off frequence in Hz. For example, if the
34 * lowpass filter were a sinc function, Npc would be the index of the
35 * impulse-response lookup-table corresponding to the first zero-
36 * crossing of the sinc function. (The inverse first zero-crossing
37 * time of a sinc function equals its nominal cutoff frequency in Hz.)
38 * Npc must be a power of 2 due to the details of the current
39 * implementation. The default value of 512 is sufficiently high that
40 * using linear interpolation to fill in between the table entries
41 * gives approximately 16-bit accuracy in filter coefficients.
43 * Nhc - is log base 2 of Npc.
46 #define SMALL_FILTER_NMULT ((int16_t)13)
47 #define SMALL_FILTER_SCALE 13128 /* Unity-gain scale factor */
48 #define SMALL_FILTER_NWING 1536 /* Filter table length */
49 static const float SMALL_FILTER_FLOAT_IMP[] /* Impulse response */ = {
1588 static const float SMALL_FILTER_FLOAT_IMPD[] /* Impulse response */ = {