1 /*
2 * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
3 *
4 * This file is part of libswresample
5 *
6 * libswresample is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * libswresample is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with libswresample; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef SWR_INTERNAL_H
22 #define SWR_INTERNAL_H
23
26 #include "config.h"
27
29
30 #define SQRT3_2 1.22474487139158904909 /* sqrt(3/2) */
31
33
34 #if ARCH_X86_64
36 #else
38 #endif
39
42
44
49 int bps;
///< bytes per sample
50 int count;
///< number of samples
51 int planar;
///< 1 if planar audio, 0 otherwise
54
60 int ns_taps;
///< Noise shaping dither taps
61 float ns_scale;
///< Noise shaping dither scale
63 int ns_pos;
///< Noise shaping dither position
67 AudioData temp;
///< temporary storage when writing into the input buffer isn't possible
69 };
70
79
88 };
89
92
96 void *
log_ctx;
///< parent logging context
104 int flags;
///< miscellaneous flags such as SWR_FLAG_RESAMPLE
105 float slev;
///< surround mixing level
106 float clev;
///< center mixing level
111 const int *
channel_map;
///< channel index (or -1 if muted channel) map
112 int used_ch_count;
///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count)
114
116
117 int filter_size;
/**< length of each FIR filter in the resampling filterbank relative to the cutoff frequency */
118 int phase_shift;
/**< log2 of the number of entries in the resampling polyphase filterbank */
119 int linear_interp;
/**< if 1 then the resampling FIR filter will be linearly interpolated */
120 double cutoff;
/**< resampling cutoff frequency (swr: 6dB point; soxr: 0dB point). 1.0 corresponds to half the output sample rate */
122 int kaiser_beta;
/**< swr beta value for Kaiser window (only applicable if filter_type == AV_FILTER_TYPE_KAISER) */
123 double precision;
/**< soxr resampling precision (in bits) */
124 int cheby;
/**< soxr: if 1 then passband rolloff will be none (Chebyshev) & irrational ratio approximation precision will be higher */
125
130 float async;
///< swr simple 1 parameter async, similar to ffmpegs -async
132
134 int rematrix;
///< flag to indicate if rematrixing is needed (basically if input and output layouts mismatch)
136
148 int flushed;
///< 1 if data is to be flushed and no further input is expected
152
158
168
171
173
174 /* TODO: callbacks for ASM optimizations */
175 };
176
178
183
188
191
195 int channels);
199 int channels);
203 int channels);
204
205 #endif