annotate liba52/resample_mmx.c @ 22648:9c884a0a8375

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