Mercurial > mplayer.hg
comparison liba52/imdct.c @ 3908:0cc94b1eec0f
runtime cpudetect in liba52 way
author | michael |
---|---|
date | Sun, 30 Dec 2001 21:38:53 +0000 |
parents | 0410677eda4a |
children | 2dbd637ffe05 |
comparison
equal
deleted
inserted
replaced
3907:6312aa265429 | 3908:0cc94b1eec0f |
---|---|
24 * 3DNOW optimizations from Nick Kurshev <nickols_k@mail.ru> | 24 * 3DNOW optimizations from Nick Kurshev <nickols_k@mail.ru> |
25 * michael did port them from libac3 (untested, perhaps totally broken) | 25 * michael did port them from libac3 (untested, perhaps totally broken) |
26 */ | 26 */ |
27 | 27 |
28 #include "config.h" | 28 #include "config.h" |
29 #include "../cpudetect.h" | |
30 | 29 |
31 #include <math.h> | 30 #include <math.h> |
32 #include <stdio.h> | 31 #include <stdio.h> |
33 #ifndef M_PI | 32 #ifndef M_PI |
34 #define M_PI 3.1415926535897932384626433832795029 | 33 #define M_PI 3.1415926535897932384626433832795029 |
1105 } else | 1104 } else |
1106 #endif | 1105 #endif |
1107 { | 1106 { |
1108 int i, j, k; | 1107 int i, j, k; |
1109 | 1108 |
1110 if(gCpuCaps.hasSSE) fprintf (stderr, "Using SSE optimized IMDCT transform\n"); | 1109 if(mm_accel & MM_ACCEL_X86_SSE) fprintf (stderr, "Using SSE optimized IMDCT transform\n"); |
1111 else if(gCpuCaps.has3DNow) fprintf (stderr, "Using experimental 3DNow optimized IMDCT transform\n"); | 1110 else if(mm_accel & MM_ACCEL_X86_3DNOW) fprintf (stderr, "Using 3DNow optimized IMDCT transform\n"); |
1112 else fprintf (stderr, "No accelerated IMDCT transform found\n"); | 1111 else fprintf (stderr, "No accelerated IMDCT transform found\n"); |
1113 | 1112 |
1114 /* Twiddle factors to turn IFFT into IMDCT */ | 1113 /* Twiddle factors to turn IFFT into IMDCT */ |
1115 for (i = 0; i < 128; i++) { | 1114 for (i = 0; i < 128; i++) { |
1116 xcos1[i] = -cos ((M_PI / 2048) * (8 * i + 1)); | 1115 xcos1[i] = -cos ((M_PI / 2048) * (8 * i + 1)); |
1117 xsin1[i] = -sin ((M_PI / 2048) * (8 * i + 1)); | 1116 xsin1[i] = -sin ((M_PI / 2048) * (8 * i + 1)); |
1183 } | 1182 } |
1184 #endif // arch_x86 | 1183 #endif // arch_x86 |
1185 | 1184 |
1186 imdct_512 = imdct_do_512; | 1185 imdct_512 = imdct_do_512; |
1187 #ifdef ARCH_X86 | 1186 #ifdef ARCH_X86 |
1188 if(gCpuCaps.hasSSE) imdct_512 = imdct_do_512_sse; | 1187 if(mm_accel & MM_ACCEL_X86_SSE) imdct_512 = imdct_do_512_sse; |
1189 else if(gCpuCaps.has3DNow) imdct_512 = imdct_do_512_3dnow; | 1188 else if(mm_accel & MM_ACCEL_X86_3DNOW) imdct_512 = imdct_do_512_3dnow; |
1190 #endif // arch_x86 | 1189 #endif // arch_x86 |
1191 imdct_256 = imdct_do_256; | 1190 imdct_256 = imdct_do_256; |
1192 } | 1191 } |
1193 } | 1192 } |
1194 | 1193 |