Mercurial > mplayer.hg
comparison mp3lib/tabinit.c @ 1245:03b7e2955a20
Added newest MMX-optimized decore which speedups decoding at least on 13% for any cpu.
author | nick |
---|---|
date | Fri, 29 Jun 2001 17:55:35 +0000 |
parents | 2ee9a18ed6f3 |
children | 1320f1b3229d |
comparison
equal
deleted
inserted
replaced
1244:a2c71bf9a7d3 | 1245:03b7e2955a20 |
---|---|
1 real decwin[(512+32)], cos64[32], cos32[16], cos16[8], cos8[4], cos4[2]; | |
2 real *pnts[]={ cos64,cos32,cos16,cos8,cos4 }; | |
1 | 3 |
2 | 4 static long intwinbase[] = { |
3 #ifdef HAVE_3DNOW | |
4 real decwin[2*(512+32)] __attribute__((aligned(8))); | |
5 real cos64[32] __attribute__((aligned(8))); | |
6 real cos32[16] __attribute__((aligned(8))); | |
7 real cos16[8] __attribute__((aligned(8))); | |
8 real cos8[4] __attribute__((aligned(8))); | |
9 real cos4[2] __attribute__((aligned(8))); | |
10 real *pnts[]={ cos64,cos32,cos16,cos8,cos4 }; | |
11 #else | |
12 real decwin[512+32]; | |
13 real cos64[16],cos32[8],cos16[4],cos8[2],cos4[1]; | |
14 real *pnts[] = { cos64,cos32,cos16,cos8,cos4 }; | |
15 #endif | |
16 | |
17 long intwinbase[] = { | |
18 0, -1, -1, -1, -1, -1, -1, -2, -2, -2, | 5 0, -1, -1, -1, -1, -1, -1, -2, -2, -2, |
19 -2, -3, -3, -4, -4, -5, -5, -6, -7, -7, | 6 -2, -3, -3, -4, -4, -5, -5, -6, -7, -7, |
20 -8, -9, -10, -11, -13, -14, -16, -17, -19, -21, | 7 -8, -9, -10, -11, -13, -14, -16, -17, -19, -21, |
21 -24, -26, -29, -31, -35, -38, -41, -45, -49, -53, | 8 -24, -26, -29, -31, -35, -38, -41, -45, -49, -53, |
22 -58, -63, -68, -73, -79, -85, -91, -97, -104, -111, | 9 -58, -63, -68, -73, -79, -85, -91, -97, -104, -111, |
40 30112, 31947, 33791, 35640, 37489, 39336, 41176, 43006, 44821, 46617, | 27 30112, 31947, 33791, 35640, 37489, 39336, 41176, 43006, 44821, 46617, |
41 48390, 50137, 51853, 53534, 55178, 56778, 58333, 59838, 61289, 62684, | 28 48390, 50137, 51853, 53534, 55178, 56778, 58333, 59838, 61289, 62684, |
42 64019, 65290, 66494, 67629, 68692, 69679, 70590, 71420, 72169, 72835, | 29 64019, 65290, 66494, 67629, 68692, 69679, 70590, 71420, 72169, 72835, |
43 73415, 73908, 74313, 74630, 74856, 74992, 75038 }; | 30 73415, 73908, 74313, 74630, 74856, 74992, 75038 }; |
44 | 31 |
45 void make_decode_tables(long scaleval) | 32 void make_decode_tables(long scaleval) |
46 { | 33 { |
47 int i,j,k,kr,divv; | 34 int i,j,k,kr,divv; |
48 real *table,*costab; | 35 real *table,*costab; |
49 | 36 |
50 | 37 |
51 for(i=0;i<5;i++) | 38 for(i=0;i<5;i++) |
52 { | 39 { |
53 kr=0x10>>i; divv=0x40>>i; | 40 kr=0x10>>i; divv=0x40>>i; |
54 costab = pnts[i]; | 41 costab = pnts[i]; |
55 for(k=0;k<kr;k++) costab[k] = 1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv)); | 42 for(k=0;k<kr;k++) costab[k] = 1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv)); |
56 #ifdef HAVE_3DNOW | |
57 if ( _3dnow ) for(k=0;k<kr;k++) costab[k+kr]=-costab[k]; | |
58 #endif | |
59 | |
60 } | 43 } |
61 | 44 |
62 table = decwin; | 45 table = decwin; |
63 scaleval = -scaleval; | 46 scaleval = -scaleval; |
64 for(i=0,j=0;i<256;i++,j++,table+=32) | 47 for(i=0,j=0;i<256;i++,j++,table+=32) |
65 { | 48 { |
66 if(table < decwin+512+16) | 49 if(table < decwin+512+16) |
67 table[16] = table[0] = (double) intwinbase[j] / 65536.0 * (double) scaleval; | 50 table[16] = table[0] = (double) intwinbase[j] / 65536.0 * (double) scaleval; |
68 if(i % 32 == 31) | 51 if(i % 32 == 31) |
69 table -= 1023; | 52 table -= 1023; |
70 if(i % 64 == 63) | 53 if(i % 64 == 63) |
71 scaleval = - scaleval; | 54 scaleval = - scaleval; |
78 if(i % 32 == 31) | 61 if(i % 32 == 31) |
79 table -= 1023; | 62 table -= 1023; |
80 if(i % 64 == 63) | 63 if(i % 64 == 63) |
81 scaleval = - scaleval; | 64 scaleval = - scaleval; |
82 } | 65 } |
83 #ifdef HAVE_3DNOW | |
84 if ( _3dnow ) | |
85 for(i=0;i<512+32;i++) | |
86 { | |
87 decwin[512+31-i]*=65536.0; // allows faster clipping in 3dnow code | |
88 decwin[512+32+i]=decwin[512+31-i]; | |
89 } | |
90 #endif | |
91 } | 66 } |
92 | 67 |
93 | 68 |