annotate liba52/resample.c @ 3653:b11b15df02ed

3F2R sse optimized
author michael
date Sat, 22 Dec 2001 00:33:52 +0000
parents e22ff7ebdc05
children 33c3cff374a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
10 // MMX optimizations from Michael Niedermayer (michaelni@gmx.at) (under GPL)
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
11
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
12 /* optimization TODO / NOTES
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
13 movntq is slightly faster (0.5% with the current test.c benchmark)
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
14 (but thats just test.c so that needs to be testd in reallity)
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
15 and it would mean (C / MMX2 / MMX / 3DNOW) versions
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
16 */
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
17
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
18 #include <inttypes.h>
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
19 #include <stdio.h>
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
20 #include "a52.h"
3567
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
21 #include "../config.h"
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
22 #include "../cpudetect.h"
3567
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
23
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
24 int (* a52_resample) (float * _f, int16_t * s16)=NULL;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
25
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
26 #ifdef ARCH_X86
3574
8600f40003de mmx opt
michael
parents: 3569
diff changeset
27 static uint64_t __attribute__((aligned(8))) magicF2W= 0x43c0000043c00000LL;
8600f40003de mmx opt
michael
parents: 3569
diff changeset
28 static uint64_t __attribute__((aligned(8))) wm1010= 0xFFFF0000FFFF0000LL;
8600f40003de mmx opt
michael
parents: 3569
diff changeset
29 static uint64_t __attribute__((aligned(8))) wm0101= 0x0000FFFF0000FFFFLL;
8600f40003de mmx opt
michael
parents: 3569
diff changeset
30 static uint64_t __attribute__((aligned(8))) wm1100= 0xFFFFFFFF00000000LL;
3567
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
31 #endif
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
32
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
33 static inline int16_t convert (int32_t i)
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 if (i > 0x43c07fff)
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
36 return 32767;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
37 else if (i < 0x43bf8000)
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
38 return -32768;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
39 else
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
40 return i - 0x43c00000;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
41 }
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 static int chans=2;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
44 static int flags=0;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
45
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
46 int a52_resample_C(float * _f, int16_t * s16)
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
47 {
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
48 int i;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
49 int32_t * f = (int32_t *) _f;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
50
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
51 switch (flags) {
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
52 case A52_MONO:
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
53 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
54 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
55 s16[5*i+4] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
56 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
57 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
58 case A52_CHANNEL:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
59 case A52_STEREO:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
60 case A52_DOLBY:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
61 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
62 s16[2*i] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
63 s16[2*i+1] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
64 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
65 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
66 case A52_3F:
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 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
73 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
74 case A52_2F2R:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
75 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
76 s16[4*i] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
77 s16[4*i+1] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
78 s16[4*i+2] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
79 s16[4*i+3] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
80 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
81 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
82 case A52_3F2R:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
83 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
84 s16[5*i] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
85 s16[5*i+1] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
86 s16[5*i+2] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
87 s16[5*i+3] = convert (f[i+1024]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
88 s16[5*i+4] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
89 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
90 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
91 case A52_MONO | A52_LFE:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
92 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
93 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
94 s16[6*i+4] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
95 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
96 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
97 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
98 case A52_CHANNEL | A52_LFE:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
99 case A52_STEREO | A52_LFE:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
100 case A52_DOLBY | A52_LFE:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
101 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
102 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
103 s16[6*i+1] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
104 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
105 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
106 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
107 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
108 case A52_3F | A52_LFE:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
109 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
110 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
111 s16[6*i+1] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
112 s16[6*i+2] = s16[6*i+3] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
113 s16[6*i+4] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
114 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
115 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
116 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
117 case A52_2F2R | A52_LFE:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
118 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
119 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
120 s16[6*i+1] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
121 s16[6*i+2] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
122 s16[6*i+3] = convert (f[i+1024]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
123 s16[6*i+4] = 0;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
124 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
125 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
126 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
127 case A52_3F2R | A52_LFE:
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
128 for (i = 0; i < 256; i++) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
129 s16[6*i] = convert (f[i+256]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
130 s16[6*i+1] = convert (f[i+768]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
131 s16[6*i+2] = convert (f[i+1024]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
132 s16[6*i+3] = convert (f[i+1280]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
133 s16[6*i+4] = convert (f[i+512]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
134 s16[6*i+5] = convert (f[i]);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
135 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
136 break;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
137 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
138 return chans*256;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
139 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
140
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
141 #ifdef ARCH_X86
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
142 int a52_resample_MMX(float * _f, int16_t * s16)
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
143 {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
144 int i;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
145 int32_t * f = (int32_t *) _f;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
146
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
147 switch (flags) {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
148 case A52_MONO:
3574
8600f40003de mmx opt
michael
parents: 3569
diff changeset
149 asm volatile(
8600f40003de mmx opt
michael
parents: 3569
diff changeset
150 "movl $-512, %%esi \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
151 "movq magicF2W, %%mm7 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
152 "movq wm1100, %%mm3 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
153 "movq wm0101, %%mm4 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
154 "movq wm1010, %%mm5 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
155 "pxor %%mm6, %%mm6 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
156 "1: \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
157 "movq (%1, %%esi, 2), %%mm0 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
158 "movq 8(%1, %%esi, 2), %%mm1 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
159 "leal (%%esi, %%esi, 4), %%edi \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
160 "psubd %%mm7, %%mm0 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
161 "psubd %%mm7, %%mm1 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
162 "packssdw %%mm1, %%mm0 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
163 "movq %%mm0, %%mm1 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
164 "pand %%mm4, %%mm0 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
165 "pand %%mm5, %%mm1 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
166 "movq %%mm6, (%0, %%edi) \n\t" // 0 0 0 0
8600f40003de mmx opt
michael
parents: 3569
diff changeset
167 "movd %%mm0, 8(%0, %%edi) \n\t" // A 0
8600f40003de mmx opt
michael
parents: 3569
diff changeset
168 "pand %%mm3, %%mm0 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
169 "movd %%mm6, 12(%0, %%edi) \n\t" // 0 0
8600f40003de mmx opt
michael
parents: 3569
diff changeset
170 "movd %%mm1, 16(%0, %%edi) \n\t" // 0 B
8600f40003de mmx opt
michael
parents: 3569
diff changeset
171 "pand %%mm3, %%mm1 \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
172 "movd %%mm6, 20(%0, %%edi) \n\t" // 0 0
8600f40003de mmx opt
michael
parents: 3569
diff changeset
173 "movq %%mm0, 24(%0, %%edi) \n\t" // 0 0 C 0
8600f40003de mmx opt
michael
parents: 3569
diff changeset
174 "movq %%mm1, 32(%0, %%edi) \n\t" // 0 0 0 B
8600f40003de mmx opt
michael
parents: 3569
diff changeset
175 "addl $8, %%esi \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
176 " jnz 1b \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
177 "emms \n\t"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
178 :: "r" (s16+1280), "r" (f+256)
8600f40003de mmx opt
michael
parents: 3569
diff changeset
179 :"%esi", "%edi", "memory"
8600f40003de mmx opt
michael
parents: 3569
diff changeset
180 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
181 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
182 case A52_CHANNEL:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
183 case A52_STEREO:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
184 case A52_DOLBY:
3567
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
185 /* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
186 #ifdef HAVE_SSE
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
187 asm volatile(
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
188 "movl $-1024, %%esi \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
189 "1: \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
190 "cvtps2pi (%1, %%esi), %%mm0 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
191 "cvtps2pi 1024(%1, %%esi), %%mm2\n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
192 "movq %%mm0, %%mm1 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
193 "punpcklwd %%mm2, %%mm0 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
194 "punpckhwd %%mm2, %%mm1 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
195 "movq %%mm0, (%0, %%esi) \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
196 "movq %%mm1, 8(%0, %%esi) \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
197 "addl $16, %%esi \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
198 " jnz 1b \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
199 "emms \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
200 :: "r" (s16+512), "r" (f+256)
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
201 :"%esi", "memory"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
202 );*/
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
203 asm volatile(
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
204 "movl $-1024, %%esi \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
205 "movq magicF2W, %%mm7 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
206 "1: \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
207 "movq (%1, %%esi), %%mm0 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
208 "movq 8(%1, %%esi), %%mm1 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
209 "movq 1024(%1, %%esi), %%mm2 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
210 "movq 1032(%1, %%esi), %%mm3 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
211 "psubd %%mm7, %%mm0 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
212 "psubd %%mm7, %%mm1 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
213 "psubd %%mm7, %%mm2 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
214 "psubd %%mm7, %%mm3 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
215 "packssdw %%mm1, %%mm0 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
216 "packssdw %%mm3, %%mm2 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
217 "movq %%mm0, %%mm1 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
218 "punpcklwd %%mm2, %%mm0 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
219 "punpckhwd %%mm2, %%mm1 \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
220 "movq %%mm0, (%0, %%esi) \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
221 "movq %%mm1, 8(%0, %%esi) \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
222 "addl $16, %%esi \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
223 " jnz 1b \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
224 "emms \n\t"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
225 :: "r" (s16+512), "r" (f+256)
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
226 :"%esi", "memory"
9e1e88b3ca18 mmx opt
michael
parents: 3412
diff changeset
227 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
228 break;
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
229 case A52_3F: //FIXME Optimize
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
230 for (i = 0; i < 256; i++) {
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
231 s16[5*i] = convert (f[i]);
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
232 s16[5*i+1] = convert (f[i+512]);
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
233 s16[5*i+2] = s16[5*i+3] = 0;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
234 s16[5*i+4] = convert (f[i+256]);
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
235 }
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
236 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
237 case A52_2F2R:
3569
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
238 asm volatile(
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
239 "movl $-1024, %%esi \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
240 "movq magicF2W, %%mm7 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
241 "1: \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
242 "movq (%1, %%esi), %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
243 "movq 8(%1, %%esi), %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
244 "movq 1024(%1, %%esi), %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
245 "movq 1032(%1, %%esi), %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
246 "psubd %%mm7, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
247 "psubd %%mm7, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
248 "psubd %%mm7, %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
249 "psubd %%mm7, %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
250 "packssdw %%mm1, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
251 "packssdw %%mm3, %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
252 "movq 2048(%1, %%esi), %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
253 "movq 2056(%1, %%esi), %%mm4 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
254 "movq 3072(%1, %%esi), %%mm5 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
255 "movq 3080(%1, %%esi), %%mm6 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
256 "psubd %%mm7, %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
257 "psubd %%mm7, %%mm4 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
258 "psubd %%mm7, %%mm5 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
259 "psubd %%mm7, %%mm6 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
260 "packssdw %%mm4, %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
261 "packssdw %%mm6, %%mm5 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
262 "movq %%mm0, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
263 "movq %%mm3, %%mm4 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
264 "punpcklwd %%mm2, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
265 "punpckhwd %%mm2, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
266 "punpcklwd %%mm5, %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
267 "punpckhwd %%mm5, %%mm4 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
268 "movq %%mm0, %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
269 "movq %%mm1, %%mm5 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
270 "punpckldq %%mm3, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
271 "punpckhdq %%mm3, %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
272 "punpckldq %%mm4, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
273 "punpckhdq %%mm4, %%mm5 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
274 "movq %%mm0, (%0, %%esi,2) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
275 "movq %%mm2, 8(%0, %%esi,2) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
276 "movq %%mm1, 16(%0, %%esi,2) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
277 "movq %%mm5, 24(%0, %%esi,2) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
278 "addl $16, %%esi \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
279 " jnz 1b \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
280 "emms \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
281 :: "r" (s16+1024), "r" (f+256)
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
282 :"%esi", "memory"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
283 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
284 break;
3653
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
285 case A52_3F2R:
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
286 asm volatile(
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
287 "movl $-1024, %%esi \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
288 "movq magicF2W, %%mm7 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
289 "1: \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
290 "movd (%1, %%esi), %%mm0 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
291 "punpckldq 2048(%1, %%esi), %%mm0\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
292 "movd 3072(%1, %%esi), %%mm1 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
293 "punpckldq 4096(%1, %%esi), %%mm1\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
294 "movd 1024(%1, %%esi), %%mm2 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
295 "punpckldq 4(%1, %%esi), %%mm2 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
296 "movd 2052(%1, %%esi), %%mm3 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
297 "punpckldq 3076(%1, %%esi), %%mm3\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
298 "movd 4100(%1, %%esi), %%mm4 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
299 "punpckldq 1028(%1, %%esi), %%mm4\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
300 "movd 8(%1, %%esi), %%mm5 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
301 "punpckldq 2056(%1, %%esi), %%mm5\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
302 "leal (%%esi, %%esi, 4), %%edi \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
303 "sarl $1, %%edi \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
304 "psubd %%mm7, %%mm0 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
305 "psubd %%mm7, %%mm1 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
306 "psubd %%mm7, %%mm2 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
307 "psubd %%mm7, %%mm3 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
308 "psubd %%mm7, %%mm4 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
309 "psubd %%mm7, %%mm5 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
310 "packssdw %%mm1, %%mm0 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
311 "packssdw %%mm3, %%mm2 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
312 "packssdw %%mm5, %%mm4 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
313 "movq %%mm0, (%0, %%edi) \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
314 "movq %%mm2, 8(%0, %%edi) \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
315 "movq %%mm4, 16(%0, %%edi) \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
316
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
317 "movd 3080(%1, %%esi), %%mm0 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
318 "punpckldq 4104(%1, %%esi), %%mm0\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
319 "movd 1032(%1, %%esi), %%mm1 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
320 "punpckldq 12(%1, %%esi), %%mm1\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
321 "movd 2060(%1, %%esi), %%mm2 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
322 "punpckldq 3084(%1, %%esi), %%mm2\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
323 "movd 4108(%1, %%esi), %%mm3 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
324 "punpckldq 1036(%1, %%esi), %%mm3\n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
325 "psubd %%mm7, %%mm0 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
326 "psubd %%mm7, %%mm1 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
327 "psubd %%mm7, %%mm2 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
328 "psubd %%mm7, %%mm3 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
329 "packssdw %%mm1, %%mm0 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
330 "packssdw %%mm3, %%mm2 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
331 "packssdw %%mm5, %%mm4 \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
332 "movq %%mm0, 24(%0, %%edi) \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
333 "movq %%mm2, 32(%0, %%edi) \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
334 "movq %%mm4, 40(%0, %%edi) \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
335
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
336 "addl $16, %%esi \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
337 " jnz 1b \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
338 "emms \n\t"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
339 :: "r" (s16+1280), "r" (f+256)
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
340 :"%esi", "%edi", "memory"
b11b15df02ed 3F2R sse optimized
michael
parents: 3626
diff changeset
341 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
342 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
343 case A52_MONO | A52_LFE:
3569
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
344 asm volatile(
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
345 "movl $-1024, %%esi \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
346 "movq magicF2W, %%mm7 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
347 "pxor %%mm6, %%mm6 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
348 "1: \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
349 "movq 1024(%1, %%esi), %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
350 "movq 1032(%1, %%esi), %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
351 "movq (%1, %%esi), %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
352 "movq 8(%1, %%esi), %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
353 "psubd %%mm7, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
354 "psubd %%mm7, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
355 "psubd %%mm7, %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
356 "psubd %%mm7, %%mm3 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
357 "packssdw %%mm1, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
358 "packssdw %%mm3, %%mm2 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
359 "movq %%mm0, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
360 "punpcklwd %%mm2, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
361 "punpckhwd %%mm2, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
362 "leal (%%esi, %%esi, 2), %%edi \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
363 "movq %%mm6, (%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
364 "movd %%mm0, 8(%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
365 "punpckhdq %%mm0, %%mm0 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
366 "movq %%mm6, 12(%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
367 "movd %%mm0, 20(%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
368 "movq %%mm6, 24(%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
369 "movd %%mm1, 32(%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
370 "punpckhdq %%mm1, %%mm1 \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
371 "movq %%mm6, 36(%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
372 "movd %%mm1, 44(%0, %%edi) \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
373 "addl $16, %%esi \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
374 " jnz 1b \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
375 "emms \n\t"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
376 :: "r" (s16+1536), "r" (f+256)
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
377 :"%esi", "%edi", "memory"
d14494d84c29 MMX opt
michael
parents: 3567
diff changeset
378 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
379 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
380 case A52_CHANNEL | A52_LFE:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
381 case A52_STEREO | A52_LFE:
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
382 case A52_DOLBY | A52_LFE:
3576
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
383 asm volatile(
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
384 "movl $-1024, %%esi \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
385 "movq magicF2W, %%mm7 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
386 "pxor %%mm6, %%mm6 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
387 "1: \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
388 "movq 1024(%1, %%esi), %%mm0 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
389 "movq 2048(%1, %%esi), %%mm1 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
390 "movq (%1, %%esi), %%mm5 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
391 "psubd %%mm7, %%mm0 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
392 "psubd %%mm7, %%mm1 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
393 "psubd %%mm7, %%mm5 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
394 "leal (%%esi, %%esi, 2), %%edi \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
395
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
396 "pxor %%mm4, %%mm4 \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
397 "packssdw %%mm5, %%mm0 \n\t" // FfAa
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
398 "packssdw %%mm4, %%mm1 \n\t" // 00Bb
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
399 "punpckhwd %%mm0, %%mm4 \n\t" // F0f0
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
400 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
401 "movq %%mm0, %%mm1 \n\t" // BAba
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
402 "punpckldq %%mm4, %%mm3 \n\t" // f0XX
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
403 "punpckldq %%mm6, %%mm0 \n\t" // 00ba
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
404 "punpckhdq %%mm1, %%mm3 \n\t" // BAf0
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
405
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
406 "movq %%mm0, (%0, %%edi) \n\t" // 00ba
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
407 "punpckhdq %%mm4, %%mm0 \n\t" // F000
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
408 "movq %%mm3, 8(%0, %%edi) \n\t" // BAf0
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
409 "movq %%mm0, 16(%0, %%edi) \n\t" // F000
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
410 "addl $8, %%esi \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
411 " jnz 1b \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
412 "emms \n\t"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
413 :: "r" (s16+1536), "r" (f+256)
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
414 :"%esi", "%edi", "memory"
c282fd9e8534 mmx opt
michael
parents: 3575
diff changeset
415 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
416 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
417 case A52_3F | A52_LFE:
3578
79759c05911e mmx opt
michael
parents: 3577
diff changeset
418 asm volatile(
79759c05911e mmx opt
michael
parents: 3577
diff changeset
419 "movl $-1024, %%esi \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
420 "movq magicF2W, %%mm7 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
421 "pxor %%mm6, %%mm6 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
422 "1: \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
423 "movq 1024(%1, %%esi), %%mm0 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
424 "movq 3072(%1, %%esi), %%mm1 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
425 "movq 2048(%1, %%esi), %%mm4 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
426 "movq (%1, %%esi), %%mm5 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
427 "psubd %%mm7, %%mm0 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
428 "psubd %%mm7, %%mm1 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
429 "psubd %%mm7, %%mm4 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
430 "psubd %%mm7, %%mm5 \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
431 "leal (%%esi, %%esi, 2), %%edi \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
432
79759c05911e mmx opt
michael
parents: 3577
diff changeset
433 "packssdw %%mm4, %%mm0 \n\t" // EeAa
79759c05911e mmx opt
michael
parents: 3577
diff changeset
434 "packssdw %%mm5, %%mm1 \n\t" // FfBb
79759c05911e mmx opt
michael
parents: 3577
diff changeset
435 "movq %%mm0, %%mm2 \n\t" // EeAa
79759c05911e mmx opt
michael
parents: 3577
diff changeset
436 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
79759c05911e mmx opt
michael
parents: 3577
diff changeset
437 "punpckhwd %%mm1, %%mm2 \n\t" // FEfe
79759c05911e mmx opt
michael
parents: 3577
diff changeset
438 "movq %%mm0, %%mm1 \n\t" // BAba
79759c05911e mmx opt
michael
parents: 3577
diff changeset
439 "punpckldq %%mm6, %%mm0 \n\t" // 00ba
79759c05911e mmx opt
michael
parents: 3577
diff changeset
440 "punpckhdq %%mm1, %%mm1 \n\t" // BABA
79759c05911e mmx opt
michael
parents: 3577
diff changeset
441
79759c05911e mmx opt
michael
parents: 3577
diff changeset
442 "movq %%mm0, (%0, %%edi) \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
443 "punpckhdq %%mm2, %%mm0 \n\t" // FE00
79759c05911e mmx opt
michael
parents: 3577
diff changeset
444 "punpckldq %%mm1, %%mm2 \n\t" // BAfe
79759c05911e mmx opt
michael
parents: 3577
diff changeset
445 "movq %%mm2, 8(%0, %%edi) \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
446 "movq %%mm0, 16(%0, %%edi) \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
447 "addl $8, %%esi \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
448 " jnz 1b \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
449 "emms \n\t"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
450 :: "r" (s16+1536), "r" (f+256)
79759c05911e mmx opt
michael
parents: 3577
diff changeset
451 :"%esi", "%edi", "memory"
79759c05911e mmx opt
michael
parents: 3577
diff changeset
452 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
453 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
454 case A52_2F2R | A52_LFE:
3577
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
455 asm volatile(
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
456 "movl $-1024, %%esi \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
457 "movq magicF2W, %%mm7 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
458 // "pxor %%mm6, %%mm6 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
459 "1: \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
460 "movq 1024(%1, %%esi), %%mm0 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
461 "movq 2048(%1, %%esi), %%mm1 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
462 "movq 3072(%1, %%esi), %%mm2 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
463 "movq 4096(%1, %%esi), %%mm3 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
464 "movq (%1, %%esi), %%mm5 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
465 "psubd %%mm7, %%mm0 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
466 "psubd %%mm7, %%mm1 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
467 "psubd %%mm7, %%mm2 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
468 "psubd %%mm7, %%mm3 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
469 "psubd %%mm7, %%mm5 \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
470 "leal (%%esi, %%esi, 2), %%edi \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
471
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
472 "packssdw %%mm2, %%mm0 \n\t" // CcAa
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
473 "packssdw %%mm3, %%mm1 \n\t" // DdBb
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
474 "packssdw %%mm5, %%mm5 \n\t" // FfFf
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
475 "movq %%mm0, %%mm2 \n\t" // CcAa
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
476 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
477 "punpckhwd %%mm1, %%mm2 \n\t" // DCdc
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
478 "pxor %%mm4, %%mm4 \n\t" // 0000
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
479 "punpcklwd %%mm5, %%mm4 \n\t" // F0f0
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
480 "movq %%mm0, %%mm1 \n\t" // BAba
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
481 "movq %%mm4, %%mm3 \n\t" // F0f0
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
482 "punpckldq %%mm2, %%mm0 \n\t" // dcba
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
483 "punpckhdq %%mm1, %%mm1 \n\t" // BABA
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
484 "punpckldq %%mm1, %%mm4 \n\t" // BAf0
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
485 "punpckhdq %%mm3, %%mm2 \n\t" // F0DC
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
486
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
487 "movq %%mm0, (%0, %%edi) \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
488 "movq %%mm4, 8(%0, %%edi) \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
489 "movq %%mm2, 16(%0, %%edi) \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
490 "addl $8, %%esi \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
491 " jnz 1b \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
492 "emms \n\t"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
493 :: "r" (s16+1536), "r" (f+256)
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
494 :"%esi", "%edi", "memory"
6bf4dbfb941c mmx opt
michael
parents: 3576
diff changeset
495 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
496 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
497 case A52_3F2R | A52_LFE:
3575
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
498 asm volatile(
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
499 "movl $-1024, %%esi \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
500 "movq magicF2W, %%mm7 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
501 // "pxor %%mm6, %%mm6 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
502 "1: \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
503 "movq 1024(%1, %%esi), %%mm0 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
504 "movq 3072(%1, %%esi), %%mm1 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
505 "movq 4096(%1, %%esi), %%mm2 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
506 "movq 5120(%1, %%esi), %%mm3 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
507 "movq 2048(%1, %%esi), %%mm4 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
508 "movq (%1, %%esi), %%mm5 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
509 "psubd %%mm7, %%mm0 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
510 "psubd %%mm7, %%mm1 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
511 "psubd %%mm7, %%mm2 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
512 "psubd %%mm7, %%mm3 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
513 "psubd %%mm7, %%mm4 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
514 "psubd %%mm7, %%mm5 \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
515 "leal (%%esi, %%esi, 2), %%edi \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
516
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
517 "packssdw %%mm2, %%mm0 \n\t" // CcAa
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
518 "packssdw %%mm3, %%mm1 \n\t" // DdBb
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
519 "packssdw %%mm4, %%mm4 \n\t" // EeEe
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
520 "packssdw %%mm5, %%mm5 \n\t" // FfFf
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
521 "movq %%mm0, %%mm2 \n\t" // CcAa
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
522 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
523 "punpckhwd %%mm1, %%mm2 \n\t" // DCdc
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
524 "punpcklwd %%mm5, %%mm4 \n\t" // FEfe
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
525 "movq %%mm0, %%mm1 \n\t" // BAba
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
526 "movq %%mm4, %%mm3 \n\t" // FEfe
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
527 "punpckldq %%mm2, %%mm0 \n\t" // dcba
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
528 "punpckhdq %%mm1, %%mm1 \n\t" // BABA
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
529 "punpckldq %%mm1, %%mm4 \n\t" // BAfe
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
530 "punpckhdq %%mm3, %%mm2 \n\t" // FEDC
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
531
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
532 "movq %%mm0, (%0, %%edi) \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
533 "movq %%mm4, 8(%0, %%edi) \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
534 "movq %%mm2, 16(%0, %%edi) \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
535 "addl $8, %%esi \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
536 " jnz 1b \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
537 "emms \n\t"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
538 :: "r" (s16+1536), "r" (f+256)
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
539 :"%esi", "%edi", "memory"
01a2466e035e mmx opt
michael
parents: 3574
diff changeset
540 );
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
541 break;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
542 }
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
543 return chans*256;
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
544 }
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
545 #endif //arch_x86
3412
21d65a4ae3c9 resample.c added - float->int conversion and channel ordering
arpi
parents:
diff changeset
546
3626
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
547 void a52_resample_init(int _flags,int _chans){
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
548 chans=_chans;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
549 flags=_flags;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
550
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
551 if(a52_resample==NULL) // only once please ;)
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
552 {
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
553 if(gCpuCaps.hasMMX) fprintf(stderr, "Using MMX optimized resampler\n");
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
554 else fprintf(stderr, "No accelerated resampler found\n");
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
555 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
556
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
557 #ifdef ARCH_X86
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
558 if(gCpuCaps.hasMMX) a52_resample= a52_resample_MMX;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
559 #else
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
560 if(0);
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
561 #endif
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
562 else a52_resample= a52_resample_C;
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
563 }
e22ff7ebdc05 runtime cpu detection for the resample stuff
michael
parents: 3578
diff changeset
564