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
28 #define SQRT3_2 1.22474487139158904909 /* sqrt(3/2) */
29
31
32 #if ARCH_X86_64
34 #else
36 #endif
37
40
42
47 int bps;
///< bytes per sample
48 int count;
///< number of samples
49 int planar;
///< 1 if planar audio, 0 otherwise
52
58 int ns_taps;
///< Noise shaping dither taps
59 float ns_scale;
///< Noise shaping dither scale
61 int ns_pos;
///< Noise shaping dither position
65 AudioData temp;
///< temporary storage when writing into the input buffer isn't possible
67 };
68
72 void *
log_ctx;
///< parent logging context
80 int flags;
///< miscellaneous flags such as SWR_FLAG_RESAMPLE
81 float slev;
///< surround mixing level
82 float clev;
///< center mixing level
87 const int *
channel_map;
///< channel index (or -1 if muted channel) map
88 int used_ch_count;
///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count)
90
92
93 int filter_size;
/**< length of each FIR filter in the resampling filterbank relative to the cutoff frequency */
94 int phase_shift;
/**< log2 of the number of entries in the resampling polyphase filterbank */
95 int linear_interp;
/**< if 1 then the resampling FIR filter will be linearly interpolated */
96 double cutoff;
/**< resampling cutoff frequency (swr: 6dB point; soxr: 0dB point). 1.0 corresponds to half the output sample rate */
98 int kaiser_beta;
/**< swr beta value for Kaiser window (only applicable if filter_type == AV_FILTER_TYPE_KAISER) */
99 double precision;
/**< soxr resampling precision (in bits) */
100 int cheby;
/**< soxr: if 1 then passband rolloff will be none (Chebyshev) & irrational ratio approximation precision will be higher */
101
106 float async;
///< swr simple 1 parameter async, similar to ffmpegs -async
108
110 int rematrix;
///< flag to indicate if rematrixing is needed (basically if input and output layouts mismatch)
112
124 int flushed;
///< 1 if data is to be flushed and no further input is expected
128
134
144
147
149
150 /* TODO: callbacks for ASM optimizations */
151 };
152
161
170 };
171
173
175
180
185
188
192 int channels);
196 int channels);
197 #endif