Mercurial > mplayer.hg
annotate liba52/resample_c.c @ 3569:d14494d84c29
MMX opt
author | michael |
---|---|
date | Mon, 17 Dec 2001 21:19:57 +0000 |
parents | 9e1e88b3ca18 |
children | 8600f40003de |
rev | line source |
---|---|
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
1 // this code come from a52dec/libao/audio_out_oss.c |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
2 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
3 // FIXME FIXME FIXME |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
4 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
5 // a52_resample_init should find the requested converter (from type flags -> |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
6 // given number of channels) and set up some function pointers... |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
7 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
8 // a52_resample() should do the conversion. |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
9 |
3569 | 10 // MMX optimizations from Michael Niedermayer (michaelni@gmx.at) (under GPL) |
11 | |
12 /* optimization TODO / NOTES | |
13 movntq is slightly faster (0.5% with the current test.c benchmark) | |
14 (but thats just test.c so that needs to be testd in reallity) | |
15 and it would mean (C / MMX2 / MMX / 3DNOW) versions | |
16 */ | |
17 | |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
18 #include <inttypes.h> |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
19 #include "a52.h" |
3567 | 20 #include "../config.h" |
21 | |
22 #ifdef HAVE_MMX | |
23 static uint64_t __attribute__((aligned(16))) magicF2W= 0x43c0000043c00000LL; | |
24 #endif | |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
25 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
26 static inline int16_t convert (int32_t i) |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
27 { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
28 if (i > 0x43c07fff) |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
29 return 32767; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
30 else if (i < 0x43bf8000) |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
31 return -32768; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
32 else |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
33 return i - 0x43c00000; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
34 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
35 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
36 static int chans=2; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
37 static int flags=0; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
38 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
39 void a52_resample_init(int _flags,int _chans){ |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
40 chans=_chans; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
41 flags=_flags; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
42 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
43 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
44 int a52_resample(float * _f, int16_t * s16) |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
45 { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
46 int i; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
47 int32_t * f = (int32_t *) _f; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
48 |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
49 switch (flags) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
50 case A52_MONO: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
51 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
52 s16[5*i] = s16[5*i+1] = s16[5*i+2] = s16[5*i+3] = 0; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
53 s16[5*i+4] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
54 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
55 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
56 case A52_CHANNEL: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
57 case A52_STEREO: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
58 case A52_DOLBY: |
3567 | 59 /* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it |
60 #ifdef HAVE_SSE | |
61 asm volatile( | |
62 "movl $-1024, %%esi \n\t" | |
63 "1: \n\t" | |
64 "cvtps2pi (%1, %%esi), %%mm0 \n\t" | |
65 "cvtps2pi 1024(%1, %%esi), %%mm2\n\t" | |
66 "movq %%mm0, %%mm1 \n\t" | |
67 "punpcklwd %%mm2, %%mm0 \n\t" | |
68 "punpckhwd %%mm2, %%mm1 \n\t" | |
69 "movq %%mm0, (%0, %%esi) \n\t" | |
70 "movq %%mm1, 8(%0, %%esi) \n\t" | |
71 "addl $16, %%esi \n\t" | |
72 " jnz 1b \n\t" | |
73 "emms \n\t" | |
74 :: "r" (s16+512), "r" (f+256) | |
75 :"%esi", "memory" | |
76 );*/ | |
77 #ifdef HAVE_MMX | |
78 asm volatile( | |
79 "movl $-1024, %%esi \n\t" | |
80 "movq magicF2W, %%mm7 \n\t" | |
81 "1: \n\t" | |
82 "movq (%1, %%esi), %%mm0 \n\t" | |
83 "movq 8(%1, %%esi), %%mm1 \n\t" | |
84 "movq 1024(%1, %%esi), %%mm2 \n\t" | |
85 "movq 1032(%1, %%esi), %%mm3 \n\t" | |
86 "psubd %%mm7, %%mm0 \n\t" | |
87 "psubd %%mm7, %%mm1 \n\t" | |
88 "psubd %%mm7, %%mm2 \n\t" | |
89 "psubd %%mm7, %%mm3 \n\t" | |
90 "packssdw %%mm1, %%mm0 \n\t" | |
91 "packssdw %%mm3, %%mm2 \n\t" | |
92 "movq %%mm0, %%mm1 \n\t" | |
93 "punpcklwd %%mm2, %%mm0 \n\t" | |
94 "punpckhwd %%mm2, %%mm1 \n\t" | |
95 "movq %%mm0, (%0, %%esi) \n\t" | |
96 "movq %%mm1, 8(%0, %%esi) \n\t" | |
97 "addl $16, %%esi \n\t" | |
98 " jnz 1b \n\t" | |
99 "emms \n\t" | |
100 :: "r" (s16+512), "r" (f+256) | |
101 :"%esi", "memory" | |
102 ); | |
103 #else | |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
104 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
105 s16[2*i] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
106 s16[2*i+1] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
107 } |
3567 | 108 #endif |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
109 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
110 case A52_3F: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
111 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
112 s16[5*i] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
113 s16[5*i+1] = convert (f[i+512]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
114 s16[5*i+2] = s16[5*i+3] = 0; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
115 s16[5*i+4] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
116 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
117 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
118 case A52_2F2R: |
3569 | 119 #ifdef HAVE_MMX |
120 asm volatile( | |
121 "movl $-1024, %%esi \n\t" | |
122 "movq magicF2W, %%mm7 \n\t" | |
123 "1: \n\t" | |
124 "movq (%1, %%esi), %%mm0 \n\t" | |
125 "movq 8(%1, %%esi), %%mm1 \n\t" | |
126 "movq 1024(%1, %%esi), %%mm2 \n\t" | |
127 "movq 1032(%1, %%esi), %%mm3 \n\t" | |
128 "psubd %%mm7, %%mm0 \n\t" | |
129 "psubd %%mm7, %%mm1 \n\t" | |
130 "psubd %%mm7, %%mm2 \n\t" | |
131 "psubd %%mm7, %%mm3 \n\t" | |
132 "packssdw %%mm1, %%mm0 \n\t" | |
133 "packssdw %%mm3, %%mm2 \n\t" | |
134 "movq 2048(%1, %%esi), %%mm3 \n\t" | |
135 "movq 2056(%1, %%esi), %%mm4 \n\t" | |
136 "movq 3072(%1, %%esi), %%mm5 \n\t" | |
137 "movq 3080(%1, %%esi), %%mm6 \n\t" | |
138 "psubd %%mm7, %%mm3 \n\t" | |
139 "psubd %%mm7, %%mm4 \n\t" | |
140 "psubd %%mm7, %%mm5 \n\t" | |
141 "psubd %%mm7, %%mm6 \n\t" | |
142 "packssdw %%mm4, %%mm3 \n\t" | |
143 "packssdw %%mm6, %%mm5 \n\t" | |
144 "movq %%mm0, %%mm1 \n\t" | |
145 "movq %%mm3, %%mm4 \n\t" | |
146 "punpcklwd %%mm2, %%mm0 \n\t" | |
147 "punpckhwd %%mm2, %%mm1 \n\t" | |
148 "punpcklwd %%mm5, %%mm3 \n\t" | |
149 "punpckhwd %%mm5, %%mm4 \n\t" | |
150 "movq %%mm0, %%mm2 \n\t" | |
151 "movq %%mm1, %%mm5 \n\t" | |
152 "punpckldq %%mm3, %%mm0 \n\t" | |
153 "punpckhdq %%mm3, %%mm2 \n\t" | |
154 "punpckldq %%mm4, %%mm1 \n\t" | |
155 "punpckhdq %%mm4, %%mm5 \n\t" | |
156 "movq %%mm0, (%0, %%esi,2) \n\t" | |
157 "movq %%mm2, 8(%0, %%esi,2) \n\t" | |
158 "movq %%mm1, 16(%0, %%esi,2) \n\t" | |
159 "movq %%mm5, 24(%0, %%esi,2) \n\t" | |
160 "addl $16, %%esi \n\t" | |
161 " jnz 1b \n\t" | |
162 "emms \n\t" | |
163 :: "r" (s16+1024), "r" (f+256) | |
164 :"%esi", "memory" | |
165 ); | |
166 #else | |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
167 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
168 s16[4*i] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
169 s16[4*i+1] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
170 s16[4*i+2] = convert (f[i+512]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
171 s16[4*i+3] = convert (f[i+768]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
172 } |
3569 | 173 #endif |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
174 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
175 case A52_3F2R: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
176 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
177 s16[5*i] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
178 s16[5*i+1] = convert (f[i+512]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
179 s16[5*i+2] = convert (f[i+768]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
180 s16[5*i+3] = convert (f[i+1024]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
181 s16[5*i+4] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
182 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
183 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
184 case A52_MONO | A52_LFE: |
3569 | 185 #ifdef HAVE_MMX |
186 asm volatile( | |
187 "movl $-1024, %%esi \n\t" | |
188 "movq magicF2W, %%mm7 \n\t" | |
189 "pxor %%mm6, %%mm6 \n\t" | |
190 "1: \n\t" | |
191 "movq 1024(%1, %%esi), %%mm0 \n\t" | |
192 "movq 1032(%1, %%esi), %%mm1 \n\t" | |
193 "movq (%1, %%esi), %%mm2 \n\t" | |
194 "movq 8(%1, %%esi), %%mm3 \n\t" | |
195 "psubd %%mm7, %%mm0 \n\t" | |
196 "psubd %%mm7, %%mm1 \n\t" | |
197 "psubd %%mm7, %%mm2 \n\t" | |
198 "psubd %%mm7, %%mm3 \n\t" | |
199 "packssdw %%mm1, %%mm0 \n\t" | |
200 "packssdw %%mm3, %%mm2 \n\t" | |
201 "movq %%mm0, %%mm1 \n\t" | |
202 "punpcklwd %%mm2, %%mm0 \n\t" | |
203 "punpckhwd %%mm2, %%mm1 \n\t" | |
204 "leal (%%esi, %%esi, 2), %%edi \n\t" | |
205 "movq %%mm6, (%0, %%edi) \n\t" | |
206 "movd %%mm0, 8(%0, %%edi) \n\t" | |
207 "punpckhdq %%mm0, %%mm0 \n\t" | |
208 "movq %%mm6, 12(%0, %%edi) \n\t" | |
209 "movd %%mm0, 20(%0, %%edi) \n\t" | |
210 "movq %%mm6, 24(%0, %%edi) \n\t" | |
211 "movd %%mm1, 32(%0, %%edi) \n\t" | |
212 "punpckhdq %%mm1, %%mm1 \n\t" | |
213 "movq %%mm6, 36(%0, %%edi) \n\t" | |
214 "movd %%mm1, 44(%0, %%edi) \n\t" | |
215 "addl $16, %%esi \n\t" | |
216 " jnz 1b \n\t" | |
217 "emms \n\t" | |
218 :: "r" (s16+1536), "r" (f+256) | |
219 :"%esi", "%edi", "memory" | |
220 ); | |
221 #else | |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
222 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
223 s16[6*i] = s16[6*i+1] = s16[6*i+2] = s16[6*i+3] = 0; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
224 s16[6*i+4] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
225 s16[6*i+5] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
226 } |
3569 | 227 #endif |
3412
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
228 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
229 case A52_CHANNEL | A52_LFE: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
230 case A52_STEREO | A52_LFE: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
231 case A52_DOLBY | A52_LFE: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
232 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
233 s16[6*i] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
234 s16[6*i+1] = convert (f[i+512]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
235 s16[6*i+2] = s16[6*i+3] = s16[6*i+4] = 0; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
236 s16[6*i+5] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
237 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
238 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
239 case A52_3F | A52_LFE: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
240 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
241 s16[6*i] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
242 s16[6*i+1] = convert (f[i+768]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
243 s16[6*i+2] = s16[6*i+3] = 0; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
244 s16[6*i+4] = convert (f[i+512]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
245 s16[6*i+5] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
246 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
247 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
248 case A52_2F2R | A52_LFE: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
249 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
250 s16[6*i] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
251 s16[6*i+1] = convert (f[i+512]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
252 s16[6*i+2] = convert (f[i+768]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
253 s16[6*i+3] = convert (f[i+1024]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
254 s16[6*i+4] = 0; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
255 s16[6*i+5] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
256 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
257 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
258 case A52_3F2R | A52_LFE: |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
259 for (i = 0; i < 256; i++) { |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
260 s16[6*i] = convert (f[i+256]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
261 s16[6*i+1] = convert (f[i+768]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
262 s16[6*i+2] = convert (f[i+1024]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
263 s16[6*i+3] = convert (f[i+1280]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
264 s16[6*i+4] = convert (f[i+512]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
265 s16[6*i+5] = convert (f[i]); |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
266 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
267 break; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
268 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
269 return chans*256; |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
270 } |
21d65a4ae3c9
resample.c added - float->int conversion and channel ordering
arpi
parents:
diff
changeset
|
271 |