1 /*
2  * audio_out_internal.h
3  * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
4  * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
5  *
6  * This file is part of a52dec, a free ATSC A-52 stream decoder.
7  * See http://liba52.sourceforge.net/ for updates.
8  *
9  * a52dec 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.
13  *
14  * a52dec 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.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the
21  * Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 #ifdef LIBDCA_DOUBLE
26 typedef float convert_t;
27 #else
28 typedef sample_t convert_t;
29 #endif
30 
31 #ifdef LIBDCA_FIXED
32 #define CONVERT_LEVEL (1 << 26)
33 #define CONVERT_BIAS 0
34 #else
35 #define CONVERT_LEVEL 1
36 #define CONVERT_BIAS 384
37 #endif
38 
39 void convert2s16_1 (convert_t * f, int16_t * s16);
40 void convert2s16_2 (convert_t * f, int16_t * s16);
41 void convert2s16_3 (convert_t * f, int16_t * s16);
42 void convert2s16_4 (convert_t * f, int16_t * s16);
43 void convert2s16_5 (convert_t * f, int16_t * s16);
44 int channels_multi (int flags);
45 void convert2s16_multi (convert_t * f, int16_t * s16, int flags);
46 void convert2s16_wav (convert_t * f, int16_t * s16, int flags);
47 void s16_swap (int16_t * s16, int channels);
48 void s32_swap (int32_t * s32, int channels);
49 
50 #ifdef WORDS_BIGENDIAN
51 #define s16_LE(s16,channels) s16_swap (s16, channels)
52 #define s16_BE(s16,channels) do {} while (0)
53 #define s32_LE(s32,channels) s32_swap (s32, channels)
54 #define s32_BE(s32,channels) do {} while (0)
55 #else
56 #define s16_LE(s16,channels) do {} while (0)
57 #define s16_BE(s16,channels) s16_swap (s16, channels)
58 #define s32_LE(s32,channels) do {} while (0)
59 #define s32_BE(s32,channels) s32_swap (s32, channels)
60 #endif
61