annotate liba52/resample_c.c @ 26835:315e911d5762

Forgotten changes to gl_common.h
author reimar
date Sat, 24 May 2008 11:04:18 +0000
parents 170fc6d9dfa1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25483
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
1 /*
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
2 * resample_c.c
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
3 * Copyright (C) 2001 Árpád Gereöffy
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
4 *
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
5 * This file is part of a52dec, a free ATSC A-52 stream decoder.
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
6 * See http://liba52.sourceforge.net/ for updates.
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
7 *
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
8 * File added for use with MPlayer and not part of original a52dec.
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
9 *
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
10 * a52dec is free software; you can redistribute it and/or modify
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
11 * it under the terms of the GNU General Public License as published by
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
13 * (at your option) any later version.
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
14 *
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
15 * a52dec is distributed in the hope that it will be useful,
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
18 * GNU General Public License for more details.
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
19 *
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
20 * You should have received a copy of the GNU General Public License
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
21 * along with this program; if not, write to the Free Software
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
23 */
170fc6d9dfa1 Add proper copyright/license headers.
diego
parents: 25481
diff changeset
24
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
25 static inline int16_t convert (int32_t i)
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
26 {
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
27 if (i > 0x43c07fff)
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
28 return 32767;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
29 else if (i < 0x43bf8000)
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
30 return -32768;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
31 else
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
32 return i - 0x43c00000;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
33 }
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
34
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
35 static int a52_resample_MONO_to_5_C(float * _f, int16_t * s16){
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
36 int i;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
37 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
38 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
39 s16[5*i] = s16[5*i+1] = s16[5*i+2] = s16[5*i+3] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
40 s16[5*i+4] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
41 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
42 return 5*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
43 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
44
3967
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
45 static int a52_resample_MONO_to_1_C(float * _f, int16_t * s16){
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
46 int i;
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
47 int32_t * f = (int32_t *) _f;
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
48 for (i = 0; i < 256; i++) {
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
49 s16[i] = convert (f[i]);
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
50 }
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
51 return 1*256;
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
52 }
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
53
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
54 static int a52_resample_STEREO_to_2_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
55 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
56 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
57 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
58 s16[2*i] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
59 s16[2*i+1] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
60 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
61 return 2*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
62 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
63
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
64 static int a52_resample_3F_to_5_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
65 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
66 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
67 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
68 s16[5*i] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
69 s16[5*i+1] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
70 s16[5*i+2] = s16[5*i+3] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
71 s16[5*i+4] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
72 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
73 return 5*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
74 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
75
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
76 static int a52_resample_2F_2R_to_4_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
77 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
78 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
79 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
80 s16[4*i] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
81 s16[4*i+1] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
82 s16[4*i+2] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
83 s16[4*i+3] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
84 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
85 return 4*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
86 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
87
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
88 static int a52_resample_3F_2R_to_5_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
89 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
90 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
91 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
92 s16[5*i] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
93 s16[5*i+1] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
94 s16[5*i+2] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
95 s16[5*i+3] = convert (f[i+1024]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
96 s16[5*i+4] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
97 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
98 return 5*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
99 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
100
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
101 static int a52_resample_MONO_LFE_to_6_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
102 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
103 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
104 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
105 s16[6*i] = s16[6*i+1] = s16[6*i+2] = s16[6*i+3] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
106 s16[6*i+4] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
107 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
108 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
109 return 6*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
110 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
111
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
112 static int a52_resample_STEREO_LFE_to_6_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
113 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
114 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
115 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
116 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
117 s16[6*i+1] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
118 s16[6*i+2] = s16[6*i+3] = s16[6*i+4] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
119 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
120 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
121 return 6*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
122 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
123
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
124 static int a52_resample_3F_LFE_to_6_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
125 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
126 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
127 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
128 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
129 s16[6*i+1] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
130 s16[6*i+2] = s16[6*i+3] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
131 s16[6*i+4] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
132 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
133 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
134 return 6*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
135 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
136
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
137 static int a52_resample_2F_2R_LFE_to_6_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
138 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
139 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
140 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
141 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
142 s16[6*i+1] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
143 s16[6*i+2] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
144 s16[6*i+3] = convert (f[i+1024]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
145 s16[6*i+4] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
146 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
147 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
148 return 6*256;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
149 }
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
150
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
151 static int a52_resample_3F_2R_LFE_to_6_C(float * _f, int16_t * s16){
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
152 int i;
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
153 int32_t * f = (int32_t *) _f;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
154 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
155 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
156 s16[6*i+1] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
157 s16[6*i+2] = convert (f[i+1024]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
158 s16[6*i+3] = convert (f[i+1280]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
159 s16[6*i+4] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
160 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
161 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
162 return 6*256;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
163 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
164
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
165
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
166 static void* a52_resample_C(int flags, int ch){
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
167 switch (flags) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
168 case A52_MONO:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
169 if(ch==5) return a52_resample_MONO_to_5_C;
3967
faf5af8e5481 mono ac3 support
arpi
parents: 3909
diff changeset
170 if(ch==1) return a52_resample_MONO_to_1_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
171 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
172 case A52_CHANNEL:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
173 case A52_STEREO:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
174 case A52_DOLBY:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
175 if(ch==2) return a52_resample_STEREO_to_2_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
176 break;
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
177 case A52_3F:
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
178 if(ch==5) return a52_resample_3F_to_5_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
179 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
180 case A52_2F2R:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
181 if(ch==4) return a52_resample_2F_2R_to_4_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
182 break;
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
183 case A52_3F2R:
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
184 if(ch==5) return a52_resample_3F_2R_to_5_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
185 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
186 case A52_MONO | A52_LFE:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
187 if(ch==6) return a52_resample_MONO_LFE_to_6_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
188 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
189 case A52_CHANNEL | A52_LFE:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
190 case A52_STEREO | A52_LFE:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
191 case A52_DOLBY | A52_LFE:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
192 if(ch==6) return a52_resample_STEREO_LFE_to_6_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
193 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
194 case A52_3F | A52_LFE:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
195 if(ch==6) return a52_resample_3F_LFE_to_6_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
196 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
197 case A52_2F2R | A52_LFE:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
198 if(ch==6) return a52_resample_2F_2R_LFE_to_6_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
199 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
200 case A52_3F2R | A52_LFE:
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
201 if(ch==6) return a52_resample_3F_2R_LFE_to_6_C;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
202 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
203 }
3909
ef32c8bdee81 c, mmx versions separated. a52 style runtime stuff
arpi
parents: 3908
diff changeset
204 return NULL;
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
205 }