annotate liba52/resample_c.c @ 4182:17d005bf07f2 libavcodec

Output proper 16-bit sound (fixes decoding on PPC)
author kostya
date Mon, 13 Nov 2006 05:15:55 +0000
parents e2aafe2aa2df
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3696
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
1 /*
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
2 * this code is based on a52dec/libao/audio_out_oss.c
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
3 * copyright (C) 2001 Arpad Gereoffy
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
4 *
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
5 * This file is part of a52dec, a free ATSC A-52 stream decoder.
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
6 * See http://liba52.sourceforge.net/ for updates.
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
7 *
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
8 * a52dec is free software; you can redistribute it and/or modify
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
9 * it under the terms of the GNU General Public License as published by
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
11 * (at your option) any later version.
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
12 *
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
13 * a52dec is distributed in the hope that it will be useful,
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
16 * GNU General Public License for more details.
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
17 *
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
18 * You should have received a copy of the GNU General Public License
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
19 * along with this program; if not, write to the Free Software
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
e2aafe2aa2df Add proper GPL headers.
diego
parents: 1193
diff changeset
21 */
1193
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
22
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
23 static inline int16_t convert (int32_t i)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
24 {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
25 if (i > 0x43c07fff)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
26 return 32767;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
27 else if (i < 0x43bf8000)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
28 return -32768;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
29 else
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
30 return i - 0x43c00000;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
31 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
32
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
33 static int a52_resample_MONO_to_5_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
34 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
35 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
36 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
37 s16[5*i] = s16[5*i+1] = s16[5*i+2] = s16[5*i+3] = 0;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
38 s16[5*i+4] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
39 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
40 return 5*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
41 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
42
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
43 static int a52_resample_MONO_to_1_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
44 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
45 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
46 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
47 s16[i] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
48 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
49 return 1*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
50 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
51
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
52 static int a52_resample_STEREO_to_2_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
53 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
54 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
55 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
56 s16[2*i] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
57 s16[2*i+1] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
58 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
59 return 2*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
60 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
61
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
62 static int a52_resample_3F_to_5_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
63 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
64 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
65 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
66 s16[5*i] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
67 s16[5*i+1] = convert (f[i+512]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
68 s16[5*i+2] = s16[5*i+3] = 0;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
69 s16[5*i+4] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
70 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
71 return 5*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
72 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
73
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
74 static int a52_resample_2F_2R_to_4_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
75 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
76 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
77 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
78 s16[4*i] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
79 s16[4*i+1] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
80 s16[4*i+2] = convert (f[i+512]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
81 s16[4*i+3] = convert (f[i+768]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
82 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
83 return 4*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
84 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
85
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
86 static int a52_resample_3F_2R_to_5_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
87 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
88 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
89 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
90 s16[5*i] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
91 s16[5*i+1] = convert (f[i+512]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
92 s16[5*i+2] = convert (f[i+768]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
93 s16[5*i+3] = convert (f[i+1024]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
94 s16[5*i+4] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
95 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
96 return 5*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
97 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
98
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
99 static int a52_resample_MONO_LFE_to_6_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
100 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
101 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
102 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
103 s16[6*i] = s16[6*i+1] = s16[6*i+2] = s16[6*i+3] = 0;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
104 s16[6*i+4] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
105 s16[6*i+5] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
106 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
107 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
108 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
109
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
110 static int a52_resample_STEREO_LFE_to_6_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
111 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
112 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
113 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
114 s16[6*i] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
115 s16[6*i+1] = convert (f[i+512]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
116 s16[6*i+2] = s16[6*i+3] = s16[6*i+4] = 0;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
117 s16[6*i+5] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
118 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
119 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
120 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
121
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
122 static int a52_resample_3F_LFE_to_6_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
123 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
124 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
125 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
126 s16[6*i] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
127 s16[6*i+1] = convert (f[i+768]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
128 s16[6*i+2] = s16[6*i+3] = 0;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
129 s16[6*i+4] = convert (f[i+512]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
130 s16[6*i+5] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
131 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
132 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
133 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
134
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
135 static int a52_resample_2F_2R_LFE_to_6_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
136 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
137 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
138 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
139 s16[6*i] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
140 s16[6*i+1] = convert (f[i+512]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
141 s16[6*i+2] = convert (f[i+768]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
142 s16[6*i+3] = convert (f[i+1024]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
143 s16[6*i+4] = 0;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
144 s16[6*i+5] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
145 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
146 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
147 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
148
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
149 static int a52_resample_3F_2R_LFE_to_6_C(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
150 int i;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
151 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
152 for (i = 0; i < 256; i++) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
153 s16[6*i] = convert (f[i+256]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
154 s16[6*i+1] = convert (f[i+768]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
155 s16[6*i+2] = convert (f[i+1024]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
156 s16[6*i+3] = convert (f[i+1280]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
157 s16[6*i+4] = convert (f[i+512]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
158 s16[6*i+5] = convert (f[i]);
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
159 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
160 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
161 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
162
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
163
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
164 static void* a52_resample_C(int flags, int ch){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
165 switch (flags) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
166 case A52_MONO:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
167 if(ch==5) return a52_resample_MONO_to_5_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
168 if(ch==1) return a52_resample_MONO_to_1_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
169 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
170 case A52_CHANNEL:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
171 case A52_STEREO:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
172 case A52_DOLBY:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
173 if(ch==2) return a52_resample_STEREO_to_2_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
174 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
175 case A52_3F:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
176 if(ch==5) return a52_resample_3F_to_5_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
177 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
178 case A52_2F2R:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
179 if(ch==4) return a52_resample_2F_2R_to_4_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
180 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
181 case A52_3F2R:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
182 if(ch==5) return a52_resample_3F_2R_to_5_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
183 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
184 case A52_MONO | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
185 if(ch==6) return a52_resample_MONO_LFE_to_6_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
186 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
187 case A52_CHANNEL | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
188 case A52_STEREO | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
189 case A52_DOLBY | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
190 if(ch==6) return a52_resample_STEREO_LFE_to_6_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
191 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
192 case A52_3F | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
193 if(ch==6) return a52_resample_3F_LFE_to_6_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
194 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
195 case A52_2F2R | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
196 if(ch==6) return a52_resample_2F_2R_LFE_to_6_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
197 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
198 case A52_3F2R | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
199 if(ch==6) return a52_resample_3F_2R_LFE_to_6_C;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
200 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
201 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
202 return NULL;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
203 }