Mercurial > audlegacy
annotate Plugins/Input/mpg123/layer3.c @ 622:09888c08e5e5 trunk
[svn] Vorbis linking fix by Kiyoshi Aman.
author | chainsaw |
---|---|
date | Mon, 06 Feb 2006 16:41:01 -0800 |
parents | 15481b4017cc |
children | d539e5c5f730 |
rev | line source |
---|---|
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1 /* |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
2 * Mpeg Layer-3 audio decoder |
61 | 3 * -------------------------- |
4 * copyright (c) 1995-1999 by Michael Hipp. | |
5 * All rights reserved. See also 'README' | |
6 * | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
7 * Optimize-TODO: put short bands into the band-field without the stride |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
8 * of 3 reals |
61 | 9 * Length-optimze: unify long and short band code where it is possible |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
10 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
11 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
12 #if 0 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
13 #define L3_DEBUG 1 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
14 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
15 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
16 #if 0 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
17 #define CUT_HF |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
18 #endif |
61 | 19 |
20 #include <stdlib.h> | |
21 #include <math.h> | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
22 #include <glib.h> |
61 | 23 #include "audacious/output.h" |
24 #include "mpg123.h" | |
25 #include "huffman.h" | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
26 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
27 #include "common.h" |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
28 |
61 | 29 #include "getbits.h" |
30 | |
31 static real ispow[8207]; | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
32 static real aa_ca[8],aa_cs[8]; |
61 | 33 static real COS1[12][6]; |
34 static real win[4][36]; | |
35 static real win1[4][36]; | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
36 static real gainpow2[256+118+4]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
37 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
38 /* non static for external 3dnow functions */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
39 real COS9[9]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
40 static real COS6_1,COS6_2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
41 real tfcos36[9]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
42 |
61 | 43 static real tfcos12[3]; |
44 #define NEW_DCT9 | |
45 #ifdef NEW_DCT9 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
46 static real cos9[3],cos18[3]; |
61 | 47 #endif |
48 | |
49 struct bandInfoStruct { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
50 int longIdx[23]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
51 int longDiff[22]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
52 int shortIdx[14]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
53 int shortDiff[13]; |
61 | 54 }; |
55 | |
56 int longLimit[9][23]; | |
57 int shortLimit[9][14]; | |
58 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
59 struct bandInfoStruct bandInfo[9] = { |
61 | 60 |
61 /* MPEG 1.0 */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
62 { {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
63 {4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
64 {0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
65 {4,4,4,4,6,8,10,12,14,18,22,30,56} } , |
61 | 66 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
67 { {0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
68 {4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
69 {0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
70 {4,4,4,4,6,6,10,12,14,16,20,26,66} } , |
61 | 71 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
72 { {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
73 {4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
74 {0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
75 {4,4,4,4,6,8,12,16,20,26,34,42,12} } , |
61 | 76 |
77 /* MPEG 2.0 */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
78 { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
79 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
80 {0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
81 {4,4,4,6,6,8,10,14,18,26,32,42,18 } } , |
61 | 82 /* |
83 { {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,330,394,464,540,576}, | |
84 {6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,52,64,70,76,36 } , | |
85 */ | |
86 /* changed 19th value fropm 330 to 332 */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
87 { {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
88 {6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 } , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
89 {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
90 {4,4,4,6,8,10,12,14,18,24,32,44,12 } } , |
61 | 91 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
92 { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
93 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 }, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
94 {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
95 {4,4,4,6,8,10,12,14,18,24,30,40,18 } } , |
61 | 96 /* MPEG 2.5 */ |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
97 { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
98 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
99 {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
100 {4,4,4,6,8,10,12,14,18,24,30,40,18} }, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
101 { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
102 {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
103 {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
104 {4,4,4,6,8,10,12,14,18,24,30,40,18} }, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
105 { {0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
106 {12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
107 {0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
108 {8,8,8,12,16,20,24,28,36,2,2,2,26} } , |
61 | 109 }; |
110 | |
111 static int mapbuf0[9][152]; | |
112 static int mapbuf1[9][156]; | |
113 static int mapbuf2[9][44]; | |
114 static int *map[9][3]; | |
115 static int *mapend[9][3]; | |
116 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
117 static unsigned int n_slen2[512]; /* MPEG 2.0 slen for 'normal' mode */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
118 static unsigned int i_slen2[256]; /* MPEG 2.0 slen for intensity stereo */ |
61 | 119 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
120 static real tan1_1[16],tan2_1[16],tan1_2[16],tan2_2[16]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
121 static real pow1_1[2][16],pow2_1[2][16],pow1_2[2][16],pow2_2[2][16]; |
61 | 122 |
123 void | |
124 mpg123_init_layer3(int down_sample_sblimit) | |
125 { | |
126 int i, j, k, l; | |
127 | |
128 for (i = -256; i < 118 + 4; i++) | |
129 gainpow2[i + 256] = pow((double) 2.0, -0.25 * (double) (i + 210)); | |
130 for (i = 0; i < 8207; i++) | |
131 ispow[i] = pow((double) i, (double) 4.0 / 3.0); | |
132 | |
133 for (i = 0; i < 8; i++) { | |
134 static double Ci[8] = | |
135 { -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, | |
136 -0.0037 | |
137 }; | |
138 double sq = sqrt(1.0 + Ci[i] * Ci[i]); | |
139 | |
140 aa_cs[i] = 1.0 / sq; | |
141 aa_ca[i] = Ci[i] / sq; | |
142 } | |
143 | |
144 for (i = 0; i < 18; i++) { | |
145 win[0][i] = win[1][i] = | |
146 0.5 * sin(M_PI / 72.0 * (double) (2 * (i + 0) + 1)) / | |
147 cos(M_PI * (double) (2 * (i + 0) + 19) / 72.0); | |
148 win[0][i + 18] = win[3][i + 18] = | |
149 0.5 * sin(M_PI / 72.0 * (double) (2 * (i + 18) + 1)) / | |
150 cos(M_PI * (double) (2 * (i + 18) + 19) / 72.0); | |
151 } | |
152 for (i = 0; i < 6; i++) { | |
153 win[1][i + 18] = | |
154 0.5 / cos(M_PI * (double) (2 * (i + 18) + 19) / 72.0); | |
155 win[3][i + 12] = | |
156 0.5 / cos(M_PI * (double) (2 * (i + 12) + 19) / 72.0); | |
157 win[1][i + 24] = | |
158 0.5 * sin(M_PI / 24.0 * (double) (2 * i + 13)) / cos(M_PI * | |
159 (double) | |
160 (2 * | |
161 (i + | |
162 24) + | |
163 19) / 72.0); | |
164 win[1][i + 30] = win[3][i] = 0.0; | |
165 win[3][i + 6] = | |
166 0.5 * sin(M_PI / 24.0 * (double) (2 * i + 1)) / cos(M_PI * | |
167 (double) (2 | |
168 * | |
169 (i | |
170 + | |
171 6) | |
172 + | |
173 19) | |
174 / 72.0); | |
175 } | |
176 | |
177 for (i = 0; i < 9; i++) | |
178 COS9[i] = cos(M_PI / 18.0 * (double) i); | |
179 | |
180 for (i = 0; i < 9; i++) | |
181 tfcos36[i] = 0.5 / cos(M_PI * (double) (i * 2 + 1) / 36.0); | |
182 for (i = 0; i < 3; i++) | |
183 tfcos12[i] = 0.5 / cos(M_PI * (double) (i * 2 + 1) / 12.0); | |
184 | |
185 COS6_1 = cos(M_PI / 6.0 * (double) 1); | |
186 COS6_2 = cos(M_PI / 6.0 * (double) 2); | |
187 | |
188 #ifdef NEW_DCT9 | |
189 cos9[0] = cos(1.0 * M_PI / 9.0); | |
190 cos9[1] = cos(5.0 * M_PI / 9.0); | |
191 cos9[2] = cos(7.0 * M_PI / 9.0); | |
192 cos18[0] = cos(1.0 * M_PI / 18.0); | |
193 cos18[1] = cos(11.0 * M_PI / 18.0); | |
194 cos18[2] = cos(13.0 * M_PI / 18.0); | |
195 #endif | |
196 | |
197 for (i = 0; i < 12; i++) { | |
198 win[2][i] = | |
199 0.5 * sin(M_PI / 24.0 * (double) (2 * i + 1)) / cos(M_PI * | |
200 (double) (2 | |
201 * | |
202 i | |
203 + 7) | |
204 / 24.0); | |
205 for (j = 0; j < 6; j++) | |
206 COS1[i][j] = | |
207 cos(M_PI / 24.0 * (double) ((2 * i + 7) * (2 * j + 1))); | |
208 } | |
209 | |
210 for (j = 0; j < 4; j++) { | |
211 static int len[4] = { 36, 36, 12, 36 }; | |
212 | |
213 for (i = 0; i < len[j]; i += 2) | |
214 win1[j][i] = +win[j][i]; | |
215 for (i = 1; i < len[j]; i += 2) | |
216 win1[j][i] = -win[j][i]; | |
217 } | |
218 | |
219 for (i = 0; i < 16; i++) { | |
220 double t = tan((double) i * M_PI / 12.0); | |
221 | |
222 tan1_1[i] = t / (1.0 + t); | |
223 tan2_1[i] = 1.0 / (1.0 + t); | |
224 tan1_2[i] = M_SQRT2 * t / (1.0 + t); | |
225 tan2_2[i] = M_SQRT2 / (1.0 + t); | |
226 | |
227 for (j = 0; j < 2; j++) { | |
228 double base = pow(2.0, -0.25 * (j + 1.0)); | |
229 double p1 = 1.0, p2 = 1.0; | |
230 | |
231 if (i > 0) { | |
232 if (i & 1) | |
233 p1 = pow(base, (i + 1.0) * 0.5); | |
234 else | |
235 p2 = pow(base, i * 0.5); | |
236 } | |
237 pow1_1[j][i] = p1; | |
238 pow2_1[j][i] = p2; | |
239 pow1_2[j][i] = M_SQRT2 * p1; | |
240 pow2_2[j][i] = M_SQRT2 * p2; | |
241 } | |
242 } | |
243 | |
244 for (j = 0; j < 9; j++) { | |
245 struct bandInfoStruct *bi = &bandInfo[j]; | |
246 int *mp; | |
247 int cb, lwin; | |
248 int *bdf; | |
249 | |
250 mp = map[j][0] = mapbuf0[j]; | |
251 bdf = bi->longDiff; | |
252 for (i = 0, cb = 0; cb < 8; cb++, i += *bdf++) { | |
253 *mp++ = (*bdf) >> 1; | |
254 *mp++ = i; | |
255 *mp++ = 3; | |
256 *mp++ = cb; | |
257 } | |
258 bdf = bi->shortDiff + 3; | |
259 for (cb = 3; cb < 13; cb++) { | |
260 int l = (*bdf++) >> 1; | |
261 | |
262 for (lwin = 0; lwin < 3; lwin++) { | |
263 *mp++ = l; | |
264 *mp++ = i + lwin; | |
265 *mp++ = lwin; | |
266 *mp++ = cb; | |
267 } | |
268 i += 6 * l; | |
269 } | |
270 mapend[j][0] = mp; | |
271 | |
272 mp = map[j][1] = mapbuf1[j]; | |
273 bdf = bi->shortDiff + 0; | |
274 for (i = 0, cb = 0; cb < 13; cb++) { | |
275 int l = (*bdf++) >> 1; | |
276 | |
277 for (lwin = 0; lwin < 3; lwin++) { | |
278 *mp++ = l; | |
279 *mp++ = i + lwin; | |
280 *mp++ = lwin; | |
281 *mp++ = cb; | |
282 } | |
283 i += 6 * l; | |
284 } | |
285 mapend[j][1] = mp; | |
286 | |
287 mp = map[j][2] = mapbuf2[j]; | |
288 bdf = bi->longDiff; | |
289 for (cb = 0; cb < 22; cb++) { | |
290 *mp++ = (*bdf++) >> 1; | |
291 *mp++ = cb; | |
292 } | |
293 mapend[j][2] = mp; | |
294 | |
295 } | |
296 | |
297 for (j = 0; j < 9; j++) { | |
298 for (i = 0; i < 23; i++) { | |
299 longLimit[j][i] = (bandInfo[j].longIdx[i] - 1 + 8) / 18 + 1; | |
300 if (longLimit[j][i] > (down_sample_sblimit)) | |
301 longLimit[j][i] = down_sample_sblimit; | |
302 } | |
303 for (i = 0; i < 14; i++) { | |
304 shortLimit[j][i] = (bandInfo[j].shortIdx[i] - 1) / 18 + 1; | |
305 if (shortLimit[j][i] > (down_sample_sblimit)) | |
306 shortLimit[j][i] = down_sample_sblimit; | |
307 } | |
308 } | |
309 | |
310 for (i = 0; i < 5; i++) { | |
311 for (j = 0; j < 6; j++) { | |
312 for (k = 0; k < 6; k++) { | |
313 int n = k + j * 6 + i * 36; | |
314 | |
315 i_slen2[n] = i | (j << 3) | (k << 6) | (3 << 12); | |
316 } | |
317 } | |
318 } | |
319 for (i = 0; i < 4; i++) { | |
320 for (j = 0; j < 4; j++) { | |
321 for (k = 0; k < 4; k++) { | |
322 int n = k + j * 4 + i * 16; | |
323 | |
324 i_slen2[n + 180] = i | (j << 3) | (k << 6) | (4 << 12); | |
325 } | |
326 } | |
327 } | |
328 for (i = 0; i < 4; i++) { | |
329 for (j = 0; j < 3; j++) { | |
330 int n = j + i * 3; | |
331 | |
332 i_slen2[n + 244] = i | (j << 3) | (5 << 12); | |
333 n_slen2[n + 500] = i | (j << 3) | (2 << 12) | (1 << 15); | |
334 } | |
335 } | |
336 | |
337 for (i = 0; i < 5; i++) { | |
338 for (j = 0; j < 5; j++) { | |
339 for (k = 0; k < 4; k++) { | |
340 for (l = 0; l < 4; l++) { | |
341 int n = l + k * 4 + j * 16 + i * 80; | |
342 | |
343 n_slen2[n] = | |
344 i | (j << 3) | (k << 6) | (l << 9) | (0 << 12); | |
345 } | |
346 } | |
347 } | |
348 } | |
349 for (i = 0; i < 5; i++) { | |
350 for (j = 0; j < 5; j++) { | |
351 for (k = 0; k < 4; k++) { | |
352 int n = k + j * 4 + i * 20; | |
353 | |
354 n_slen2[n + 400] = i | (j << 3) | (k << 6) | (1 << 12); | |
355 } | |
356 } | |
357 } | |
358 } | |
359 | |
360 /* | |
361 * read additional side information (for MPEG 1 and MPEG 2) | |
362 */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
363 static int III_get_side_info(struct III_sideinfo *si,int stereo, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
364 int ms_stereo,long sfreq,int single,int lsf) |
61 | 365 { |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
366 int ch, gr; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
367 int powdiff = (single == 3) ? 4 : 0; |
61 | 368 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
369 static const int tabs[2][5] = { { 2,9,5,3,4 } , { 1,8,1,2,9 } }; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
370 const int *tab = tabs[lsf]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
371 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
372 si->main_data_begin = mpg123_getbits(&bsi,tab[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
373 if (stereo == 1) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
374 si->private_bits = mpg123_getbits_fast(&bsi,tab[2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
375 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
376 si->private_bits = mpg123_getbits_fast(&bsi,tab[3]); |
61 | 377 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
378 if(!lsf) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
379 for (ch=0; ch<stereo; ch++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
380 si->ch[ch].gr[0].scfsi = -1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
381 si->ch[ch].gr[1].scfsi = mpg123_getbits_fast(&bsi,4); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
382 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
383 } |
61 | 384 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
385 for (gr=0; gr<tab[0]; gr++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
386 for (ch=0; ch<stereo; ch++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
387 register struct gr_info_s *gr_info = &(si->ch[ch].gr[gr]); |
61 | 388 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
389 gr_info->part2_3_length = mpg123_getbits(&bsi,12); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
390 gr_info->big_values = mpg123_getbits(&bsi,9); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
391 if(gr_info->big_values > 288) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
392 gr_info->big_values = 288; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
393 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
394 gr_info->pow2gain = gainpow2+256 - mpg123_getbits_fast(&bsi,8) + powdiff; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
395 if(ms_stereo) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
396 gr_info->pow2gain += 2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
397 gr_info->scalefac_compress = mpg123_getbits(&bsi,tab[4]); |
61 | 398 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
399 if(mpg123_get1bit(&bsi)) { /* window switch flag */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
400 int i; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
401 #ifdef L3_DEBUG |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
402 if(2*gr_info->big_values > bandInfo[sfreq].shortIdx[12]) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
403 fprintf(stderr,"L3: BigValues too large, doesn't make sense %d %d\n",2*gr_info->big_values,bandInfo[sfreq].shortIdx[12]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
404 #endif |
61 | 405 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
406 gr_info->block_type = mpg123_getbits_fast(&bsi,2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
407 gr_info->mixed_block_flag = mpg123_get1bit(&bsi); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
408 gr_info->table_select[0] = mpg123_getbits_fast(&bsi,5); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
409 gr_info->table_select[1] = mpg123_getbits_fast(&bsi,5); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
410 /* |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
411 * table_select[2] not needed, because there is no region2, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
412 * but to satisfy some verifications tools we set it either. |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
413 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
414 gr_info->table_select[2] = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
415 for(i=0;i<3;i++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
416 gr_info->full_gain[i] = gr_info->pow2gain + (mpg123_getbits_fast(&bsi,3)<<3); |
61 | 417 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
418 if(gr_info->block_type == 0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
419 return 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
420 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
421 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
422 /* region_count/start parameters are implicit in this case. */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
423 if(!lsf || gr_info->block_type == 2) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
424 gr_info->region1start = 36>>1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
425 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
426 /* check this again for 2.5 and sfreq=8 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
427 if(sfreq == 8) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
428 gr_info->region1start = 108>>1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
429 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
430 gr_info->region1start = 54>>1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
431 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
432 gr_info->region2start = 576>>1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
433 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
434 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
435 int i,r0c,r1c; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
436 #ifdef L3_DEBUG |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
437 if(2*gr_info->big_values > bandInfo[sfreq].longIdx[21]) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
438 fprintf(stderr,"L3: BigValues too large, doesn't make sense %d %d\n",2*gr_info->big_values,bandInfo[sfreq].longIdx[21]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
439 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
440 for (i=0; i<3; i++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
441 gr_info->table_select[i] = mpg123_getbits_fast(&bsi,5); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
442 r0c = mpg123_getbits_fast(&bsi,4); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
443 r1c = mpg123_getbits_fast(&bsi,3); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
444 gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
445 if(r0c + r1c + 2 > 22) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
446 gr_info->region2start = 576>>1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
447 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
448 gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
449 gr_info->block_type = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
450 gr_info->mixed_block_flag = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
451 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
452 if(!lsf) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
453 gr_info->preflag = mpg123_get1bit(&bsi); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
454 gr_info->scalefac_scale = mpg123_get1bit(&bsi); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
455 gr_info->count1table_select = mpg123_get1bit(&bsi); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
456 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
457 } |
61 | 458 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
459 return !0; |
61 | 460 } |
461 | |
462 /* | |
463 * read scalefactors | |
464 */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
465 static int III_get_scale_factors_1(int *scf,struct gr_info_s *gr_info) |
61 | 466 { |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
467 static const unsigned char slen[2][16] = { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
468 {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4}, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
469 {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3} |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
470 }; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
471 int numbits; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
472 int num0 = slen[0][gr_info->scalefac_compress]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
473 int num1 = slen[1][gr_info->scalefac_compress]; |
61 | 474 |
475 if (gr_info->block_type == 2) { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
476 int i=18; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
477 numbits = (num0 + num1) * 18; |
61 | 478 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
479 if (gr_info->mixed_block_flag) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
480 for (i=8;i;i--) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
481 *scf++ = mpg123_getbits_fast(&bsi,num0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
482 i = 9; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
483 numbits -= num0; /* num0 * 17 + num1 * 18 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
484 } |
61 | 485 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
486 for (;i;i--) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
487 *scf++ = mpg123_getbits_fast(&bsi,num0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
488 for (i = 18; i; i--) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
489 *scf++ = mpg123_getbits_fast(&bsi,num1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
490 *scf++ = 0; *scf++ = 0; *scf++ = 0; /* short[13][0..2] = 0 */ |
61 | 491 } |
492 else { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
493 int i; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
494 int scfsi = gr_info->scfsi; |
61 | 495 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
496 if(scfsi < 0) { /* scfsi < 0 => granule == 0 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
497 for(i=11;i;i--) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
498 *scf++ = mpg123_getbits_fast(&bsi,num0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
499 for(i=10;i;i--) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
500 *scf++ = mpg123_getbits_fast(&bsi,num1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
501 numbits = (num0 + num1) * 10 + num0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
502 *scf++ = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
503 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
504 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
505 numbits = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
506 if(!(scfsi & 0x8)) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
507 for (i=0;i<6;i++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
508 *scf++ = mpg123_getbits_fast(&bsi,num0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
509 numbits += num0 * 6; |
61 | 510 } |
511 else { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
512 scf += 6; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
513 } |
61 | 514 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
515 if(!(scfsi & 0x4)) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
516 for (i=0;i<5;i++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
517 *scf++ = mpg123_getbits_fast(&bsi,num0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
518 numbits += num0 * 5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
519 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
520 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
521 scf += 5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
522 } |
61 | 523 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
524 if(!(scfsi & 0x2)) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
525 for(i=0;i<5;i++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
526 *scf++ = mpg123_getbits_fast(&bsi,num1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
527 numbits += num1 * 5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
528 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
529 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
530 scf += 5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
531 } |
61 | 532 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
533 if(!(scfsi & 0x1)) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
534 for (i=0;i<5;i++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
535 *scf++ = mpg123_getbits_fast(&bsi,num1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
536 numbits += num1 * 5; |
61 | 537 } |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
538 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
539 scf += 5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
540 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
541 *scf++ = 0; /* no l[21] in original sources */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
542 } |
61 | 543 } |
544 return numbits; | |
545 } | |
546 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
547 static int III_get_scale_factors_2(int *scf,struct gr_info_s *gr_info,int i_stereo) |
61 | 548 { |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
549 unsigned char *pnt; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
550 int i,j,n=0,numbits=0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
551 unsigned int slen; |
61 | 552 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
553 static unsigned char stab[3][6][4] = { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
554 { { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
555 { 7, 7, 7,0 } , { 6, 6, 6,3 } , { 8, 8,5,0} } , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
556 { { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
557 {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0} } , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
558 { { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0} , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
559 { 6,15,12,0 } , { 6,12, 9,6 } , { 6,18,9,0} } }; |
61 | 560 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
561 if(i_stereo) /* i_stereo AND second channel -> do_layer3() checks this */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
562 slen = i_slen2[gr_info->scalefac_compress>>1]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
563 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
564 slen = n_slen2[gr_info->scalefac_compress]; |
61 | 565 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
566 gr_info->preflag = (slen>>15) & 0x1; |
61 | 567 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
568 n = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
569 if( gr_info->block_type == 2 ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
570 n++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
571 if(gr_info->mixed_block_flag) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
572 n++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
573 } |
61 | 574 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
575 pnt = stab[n][(slen>>12)&0x7]; |
61 | 576 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
577 for(i=0;i<4;i++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
578 int num = slen & 0x7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
579 slen >>= 3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
580 if(num) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
581 for(j=0;j<(int)(pnt[i]);j++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
582 *scf++ = mpg123_getbits_fast(&bsi,num); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
583 numbits += pnt[i] * num; |
61 | 584 } |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
585 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
586 for(j=0;j<(int)(pnt[i]);j++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
587 *scf++ = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
588 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
589 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
590 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
591 n = (n << 1) + 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
592 for(i=0;i<n;i++) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
593 *scf++ = 0; |
61 | 594 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
595 return numbits; |
61 | 596 } |
597 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
598 static int pretab1[22] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0}; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
599 static int pretab2[22] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; |
61 | 600 |
601 /* | |
602 * Dequantize samples (includes huffman decoding) | |
603 */ | |
604 /* 24 is enough because tab13 has max. a 19 bit huffvector */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
605 #define BITSHIFT ((sizeof(long)-1)*8) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
606 #define REFRESH_MASK \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
607 while(num < BITSHIFT) { \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
608 mask |= ((unsigned long)mpg123_getbyte(&bsi))<<(BITSHIFT-num); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
609 num += 8; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
610 part2remain -= 8; } |
61 | 611 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
612 static int III_dequantize_sample(real xr[SBLIMIT][SSLIMIT],int *scf, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
613 struct gr_info_s *gr_info,int sfreq,int part2bits) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
614 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
615 int shift = 1 + gr_info->scalefac_scale; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
616 real *xrpnt = (real *) xr; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
617 int l[3],l3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
618 int part2remain = gr_info->part2_3_length - part2bits; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
619 int *me; |
61 | 620 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
621 int num = mpg123_getbitoffset(&bsi); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
622 long mask; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
623 /* we must split this, because for num==0 the shift is undefined if you do it in one step */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
624 mask = ((unsigned long) mpg123_getbits(&bsi,num))<<BITSHIFT; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
625 mask <<= 8-num; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
626 part2remain -= num; |
61 | 627 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
628 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
629 int bv = gr_info->big_values; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
630 int region1 = gr_info->region1start; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
631 int region2 = gr_info->region2start; |
61 | 632 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
633 l3 = ((576>>1)-bv)>>1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
634 /* |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
635 * we may lose the 'odd' bit here !! |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
636 * check this later again |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
637 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
638 if(bv <= region1) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
639 l[0] = bv; l[1] = l[2] = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
640 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
641 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
642 l[0] = region1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
643 if(bv <= region2) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
644 l[1] = bv - l[0]; l[2] = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
645 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
646 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
647 l[1] = region2 - l[0]; l[2] = bv - region2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
648 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
649 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
650 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
651 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
652 if(gr_info->block_type == 2) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
653 /* |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
654 * decoding with short or mixed mode BandIndex table |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
655 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
656 int i,max[4]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
657 int step=0,lwin=3,cb=0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
658 register real v = 0.0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
659 register int *m,mc; |
61 | 660 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
661 if(gr_info->mixed_block_flag) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
662 max[3] = -1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
663 max[0] = max[1] = max[2] = 2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
664 m = map[sfreq][0]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
665 me = mapend[sfreq][0]; |
61 | 666 } |
667 else { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
668 max[0] = max[1] = max[2] = max[3] = -1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
669 /* max[3] not really needed in this case */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
670 m = map[sfreq][1]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
671 me = mapend[sfreq][1]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
672 } |
61 | 673 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
674 mc = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
675 for(i=0;i<2;i++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
676 int lp = l[i]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
677 struct newhuff *h = ht+gr_info->table_select[i]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
678 for(;lp;lp--,mc--) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
679 register int x,y; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
680 if( (!mc) ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
681 mc = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
682 xrpnt = ((real *) xr) + (*m++); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
683 lwin = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
684 cb = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
685 if(lwin == 3) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
686 v = gr_info->pow2gain[(*scf++) << shift]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
687 step = 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
688 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
689 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
690 v = gr_info->full_gain[lwin][(*scf++) << shift]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
691 step = 3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
692 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
693 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
694 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
695 register short *val = h->table; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
696 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
697 while((y=*val++)<0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
698 if (mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
699 val -= y; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
700 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
701 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
702 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
703 x = y >> 4; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
704 y &= 0xf; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
705 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
706 if(x == 15 && h->linbits) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
707 max[lwin] = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
708 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
709 x += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
710 num -= h->linbits+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
711 mask <<= h->linbits; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
712 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
713 *xrpnt = REAL_MUL(-ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
714 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
715 *xrpnt = REAL_MUL(ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
716 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
717 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
718 else if(x) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
719 max[lwin] = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
720 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
721 *xrpnt = REAL_MUL(-ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
722 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
723 *xrpnt = REAL_MUL(ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
724 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
725 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
726 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
727 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
728 *xrpnt = DOUBLE_TO_REAL(0.0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
729 xrpnt += step; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
730 if(y == 15 && h->linbits) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
731 max[lwin] = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
732 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
733 y += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
734 num -= h->linbits+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
735 mask <<= h->linbits; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
736 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
737 *xrpnt = REAL_MUL(-ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
738 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
739 *xrpnt = REAL_MUL(ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
740 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
741 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
742 else if(y) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
743 max[lwin] = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
744 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
745 *xrpnt = REAL_MUL(-ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
746 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
747 *xrpnt = REAL_MUL(ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
748 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
749 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
750 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
751 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
752 *xrpnt = DOUBLE_TO_REAL(0.0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
753 xrpnt += step; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
754 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
755 } |
61 | 756 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
757 for(;l3 && (part2remain+num > 0);l3--) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
758 struct newhuff *h = htc+gr_info->count1table_select; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
759 register short *val = h->table,a; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
760 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
761 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
762 while((a=*val++)<0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
763 if (mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
764 val -= a; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
765 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
766 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
767 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
768 if(part2remain+num <= 0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
769 num -= part2remain+num; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
770 break; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
771 } |
61 | 772 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
773 for(i=0;i<4;i++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
774 if(!(i & 1)) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
775 if(!mc) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
776 mc = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
777 xrpnt = ((real *) xr) + (*m++); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
778 lwin = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
779 cb = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
780 if(lwin == 3) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
781 v = gr_info->pow2gain[(*scf++) << shift]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
782 step = 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
783 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
784 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
785 v = gr_info->full_gain[lwin][(*scf++) << shift]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
786 step = 3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
787 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
788 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
789 mc--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
790 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
791 if( (a & (0x8>>i)) ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
792 max[lwin] = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
793 if(part2remain+num <= 0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
794 break; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
795 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
796 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
797 *xrpnt = -v; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
798 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
799 *xrpnt = v; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
800 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
801 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
802 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
803 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
804 *xrpnt = DOUBLE_TO_REAL(0.0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
805 xrpnt += step; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
806 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
807 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
808 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
809 if(lwin < 3) { /* short band? */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
810 while(1) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
811 for(;mc > 0;mc--) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
812 *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; /* short band -> step=3 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
813 *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
814 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
815 if(m >= me) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
816 break; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
817 mc = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
818 xrpnt = ((real *) xr) + *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
819 if(*m++ == 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
820 break; /* optimize: field will be set to zero at the end of the function */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
821 m++; /* cb */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
822 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
823 } |
61 | 824 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
825 gr_info->maxband[0] = max[0]+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
826 gr_info->maxband[1] = max[1]+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
827 gr_info->maxband[2] = max[2]+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
828 gr_info->maxbandl = max[3]+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
829 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
830 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
831 int rmax = max[0] > max[1] ? max[0] : max[1]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
832 rmax = (rmax > max[2] ? rmax : max[2]) + 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
833 gr_info->maxb = rmax ? shortLimit[sfreq][rmax] : longLimit[sfreq][max[3]+1]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
834 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
835 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
836 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
837 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
838 /* |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
839 * decoding with 'long' BandIndex table (block_type != 2) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
840 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
841 int *pretab = gr_info->preflag ? pretab1 : pretab2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
842 int i,max = -1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
843 int cb = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
844 int *m = map[sfreq][2]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
845 register real v = 0.0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
846 int mc = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
847 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
848 /* |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
849 * long hash table values |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
850 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
851 for(i=0;i<3;i++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
852 int lp = l[i]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
853 struct newhuff *h = ht+gr_info->table_select[i]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
854 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
855 for(;lp;lp--,mc--) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
856 int x,y; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
857 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
858 if(!mc) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
859 mc = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
860 cb = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
861 #ifdef CUT_HF |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
862 if(cb == 21) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
863 fprintf(stderr,"c"); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
864 v = 0.0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
865 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
866 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
867 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
868 v = gr_info->pow2gain[((*scf++) + (*pretab++)) << shift]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
869 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
870 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
871 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
872 register short *val = h->table; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
873 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
874 while((y=*val++)<0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
875 if (mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
876 val -= y; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
877 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
878 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
879 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
880 x = y >> 4; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
881 y &= 0xf; |
61 | 882 } |
883 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
884 if (x == 15 && h->linbits) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
885 max = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
886 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
887 x += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
888 num -= h->linbits+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
889 mask <<= h->linbits; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
890 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
891 *xrpnt++ = REAL_MUL(-ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
892 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
893 *xrpnt++ = REAL_MUL(ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
894 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
895 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
896 else if(x) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
897 max = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
898 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
899 *xrpnt++ = REAL_MUL(-ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
900 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
901 *xrpnt++ = REAL_MUL(ispow[x], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
902 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
903 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
904 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
905 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
906 *xrpnt++ = DOUBLE_TO_REAL(0.0); |
61 | 907 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
908 if (y == 15 && h->linbits) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
909 max = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
910 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
911 y += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
912 num -= h->linbits+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
913 mask <<= h->linbits; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
914 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
915 *xrpnt++ = REAL_MUL(-ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
916 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
917 *xrpnt++ = REAL_MUL(ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
918 mask <<= 1; |
61 | 919 } |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
920 else if(y) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
921 max = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
922 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
923 *xrpnt++ = REAL_MUL(-ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
924 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
925 *xrpnt++ = REAL_MUL(ispow[y], v); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
926 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
927 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
928 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
929 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
930 *xrpnt++ = DOUBLE_TO_REAL(0.0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
931 } |
61 | 932 } |
933 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
934 /* |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
935 * short (count1table) values |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
936 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
937 for(;l3 && (part2remain+num > 0);l3--) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
938 struct newhuff *h = htc+gr_info->count1table_select; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
939 register short *val = h->table,a; |
61 | 940 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
941 REFRESH_MASK; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
942 while((a=*val++)<0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
943 if (mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
944 val -= a; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
945 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
946 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
947 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
948 if(part2remain+num <= 0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
949 num -= part2remain+num; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
950 break; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
951 } |
61 | 952 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
953 for(i=0;i<4;i++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
954 if(!(i & 1)) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
955 if(!mc) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
956 mc = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
957 cb = *m++; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
958 #ifdef CUT_HF |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
959 if(cb == 21) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
960 fprintf(stderr,"c"); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
961 v = 0.0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
962 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
963 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
964 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
965 v = gr_info->pow2gain[((*scf++) + (*pretab++)) << shift]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
966 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
967 mc--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
968 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
969 if ( (a & (0x8>>i)) ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
970 max = cb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
971 if(part2remain+num <= 0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
972 break; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
973 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
974 if(mask < 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
975 *xrpnt++ = -v; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
976 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
977 *xrpnt++ = v; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
978 num--; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
979 mask <<= 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
980 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
981 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
982 *xrpnt++ = DOUBLE_TO_REAL(0.0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
983 } |
61 | 984 } |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
985 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
986 gr_info->maxbandl = max+1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
987 gr_info->maxb = longLimit[sfreq][gr_info->maxbandl]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
988 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
989 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
990 part2remain += num; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
991 mpg123_backbits(&bsi,num); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
992 num = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
993 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
994 while(xrpnt < &xr[SBLIMIT][0]) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
995 *xrpnt++ = DOUBLE_TO_REAL(0.0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
996 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
997 while( part2remain > 16 ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
998 mpg123_getbits(&bsi,16); /* Dismiss stuffing Bits */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
999 part2remain -= 16; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1000 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1001 if(part2remain > 0) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1002 mpg123_getbits(&bsi,part2remain); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1003 #if 0 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1004 else if(part2remain < 0) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1005 g_warn("Can't rewind stream by %d bits!\n",-part2remain); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1006 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1007 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1008 return 0; |
61 | 1009 } |
1010 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1011 /* |
61 | 1012 * III_stereo: calculate real channel values for Joint-I-Stereo-mode |
1013 */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1014 static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1015 struct gr_info_s *gr_info,int sfreq,int ms_stereo,int lsf) |
61 | 1016 { |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1017 real (*xr)[SBLIMIT*SSLIMIT] = (real (*)[SBLIMIT*SSLIMIT] ) xr_buf; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1018 struct bandInfoStruct *bi = &bandInfo[sfreq]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1019 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1020 const real *tab1,*tab2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1021 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1022 int tab; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1023 static const real *tabs[3][2][2] = { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1024 { { tan1_1,tan2_1 } , { tan1_2,tan2_2 } }, |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1025 { { pow1_1[0],pow2_1[0] } , { pow1_2[0],pow2_2[0] } } , |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1026 { { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1027 }; |
61 | 1028 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1029 tab = lsf + (gr_info->scalefac_compress & lsf); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1030 tab1 = tabs[tab][ms_stereo][0]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1031 tab2 = tabs[tab][ms_stereo][1]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1032 #if 0 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1033 if(lsf) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1034 int p = gr_info->scalefac_compress & 0x1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1035 if(ms_stereo) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1036 tab1 = pow1_2[p]; tab2 = pow2_2[p]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1037 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1038 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1039 tab1 = pow1_1[p]; tab2 = pow2_1[p]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1040 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1041 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1042 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1043 if(ms_stereo) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1044 tab1 = tan1_2; tab2 = tan2_2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1045 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1046 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1047 tab1 = tan1_1; tab2 = tan2_1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1048 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1049 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1050 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1051 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1052 if (gr_info->block_type == 2) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1053 int lwin,do_l = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1054 if( gr_info->mixed_block_flag ) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1055 do_l = 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1056 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1057 for (lwin=0;lwin<3;lwin++) { /* process each window */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1058 /* get first band with zero values */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1059 int is_p,sb,idx,sfb = gr_info->maxband[lwin]; /* sfb is minimal 3 for mixed mode */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1060 if(sfb > 3) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1061 do_l = 0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1062 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1063 for(;sfb<12;sfb++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1064 is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1065 if(is_p != 7) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1066 real t1,t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1067 sb = bi->shortDiff[sfb]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1068 idx = bi->shortIdx[sfb] + lwin; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1069 t1 = tab1[is_p]; t2 = tab2[is_p]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1070 for (; sb > 0; sb--,idx+=3) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1071 real v = xr[0][idx]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1072 xr[0][idx] = REAL_MUL(v, t1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1073 xr[1][idx] = REAL_MUL(v, t2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1074 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1075 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1076 } |
61 | 1077 |
413
97ba91ee699e
[svn] Change copying of scaling properties from factor 11 -> 12, to factor 12
nenolod
parents:
177
diff
changeset
|
1078 is_p = scalefac[12*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ |
97ba91ee699e
[svn] Change copying of scaling properties from factor 11 -> 12, to factor 12
nenolod
parents:
177
diff
changeset
|
1079 sb = bi->shortDiff[13]; |
97ba91ee699e
[svn] Change copying of scaling properties from factor 11 -> 12, to factor 12
nenolod
parents:
177
diff
changeset
|
1080 idx = bi->shortIdx[13] + lwin; |
97ba91ee699e
[svn] Change copying of scaling properties from factor 11 -> 12, to factor 12
nenolod
parents:
177
diff
changeset
|
1081 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1082 if(is_p != 7) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1083 real t1,t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1084 t1 = tab1[is_p]; t2 = tab2[is_p]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1085 for ( ; sb > 0; sb--,idx+=3 ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1086 real v = xr[0][idx]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1087 xr[0][idx] = REAL_MUL(v, t1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1088 xr[1][idx] = REAL_MUL(v, t2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1089 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1090 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1091 } /* end for(lwin; .. ; . ) */ |
61 | 1092 |
1093 /* also check l-part, if ALL bands in the three windows are 'empty' | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1094 * and mode = mixed_mode |
61 | 1095 */ |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1096 if (do_l) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1097 int sfb = gr_info->maxbandl; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1098 int idx = bi->longIdx[sfb]; |
61 | 1099 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1100 for ( ; sfb<8; sfb++ ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1101 int sb = bi->longDiff[sfb]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1102 int is_p = scalefac[sfb]; /* scale: 0-15 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1103 if(is_p != 7) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1104 real t1,t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1105 t1 = tab1[is_p]; t2 = tab2[is_p]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1106 for ( ; sb > 0; sb--,idx++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1107 real v = xr[0][idx]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1108 xr[0][idx] = REAL_MUL(v, t1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1109 xr[1][idx] = REAL_MUL(v, t2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1110 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1111 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1112 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1113 idx += sb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1114 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1115 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1116 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1117 else { /* ((gr_info->block_type != 2)) */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1118 int sfb = gr_info->maxbandl; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1119 int is_p,idx = bi->longIdx[sfb]; |
61 | 1120 |
1121 /* hmm ... maybe the maxbandl stuff for i-stereo is buggy? */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1122 if(sfb <= 21) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1123 for ( ; sfb<21; sfb++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1124 int sb = bi->longDiff[sfb]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1125 is_p = scalefac[sfb]; /* scale: 0-15 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1126 if(is_p != 7) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1127 real t1,t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1128 t1 = tab1[is_p]; t2 = tab2[is_p]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1129 for ( ; sb > 0; sb--,idx++) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1130 real v = xr[0][idx]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1131 xr[0][idx] = REAL_MUL(v, t1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1132 xr[1][idx] = REAL_MUL(v, t2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1133 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1134 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1135 else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1136 idx += sb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1137 } |
61 | 1138 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1139 is_p = scalefac[20]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1140 if(is_p != 7) { /* copy l-band 20 to l-band 21 */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1141 int sb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1142 real t1 = tab1[is_p],t2 = tab2[is_p]; |
61 | 1143 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1144 for ( sb = bi->longDiff[21]; sb > 0; sb--,idx++ ) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1145 real v = xr[0][idx]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1146 xr[0][idx] = REAL_MUL(v, t1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1147 xr[1][idx] = REAL_MUL(v, t2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1148 } |
61 | 1149 } |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1150 } /* end: if(sfb <= 21) */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1151 } /* ... */ |
61 | 1152 } |
1153 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1154 static void III_antialias(real xr[SBLIMIT][SSLIMIT],struct gr_info_s *gr_info) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1155 int sblim; |
61 | 1156 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1157 if(gr_info->block_type == 2) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1158 if(!gr_info->mixed_block_flag) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1159 return; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1160 sblim = 1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1161 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1162 else { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1163 sblim = gr_info->maxb-1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1164 } |
61 | 1165 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1166 /* 31 alias-reduction operations between each pair of sub-bands */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1167 /* with 8 butterflies between each pair */ |
61 | 1168 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1169 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1170 int sb; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1171 real *xr1=(real *) xr[1]; |
61 | 1172 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1173 for(sb=sblim;sb;sb--,xr1+=10) { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1174 int ss; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1175 real *cs=aa_cs,*ca=aa_ca; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1176 real *xr2 = xr1; |
61 | 1177 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1178 for(ss=7;ss>=0;ss--) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1179 { /* upper and lower butterfly inputs */ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1180 register real bu = *--xr2,bd = *xr1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1181 *xr2 = REAL_MUL(bu, *cs) - REAL_MUL(bd, *ca); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1182 *xr1++ = REAL_MUL(bd, *cs++) + REAL_MUL(bu, *ca++); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1183 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1184 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1185 } |
61 | 1186 } |
1187 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1188 /* |
61 | 1189 This is an optimized DCT from Jeff Tsay's maplay 1.2+ package. |
1190 Saved one multiplication by doing the 'twiddle factor' stuff | |
1191 together with the window mul. (MH) | |
1192 | |
1193 This uses Byeong Gi Lee's Fast Cosine Transform algorithm, but the | |
1194 9 point IDCT needs to be reduced further. Unfortunately, I don't | |
1195 know how to do that, because 9 is not an even number. - Jeff. | |
1196 | |
1197 **************************************************************** | |
1198 | |
1199 9 Point Inverse Discrete Cosine Transform | |
1200 | |
1201 This piece of code is Copyright 1997 Mikko Tommila and is freely usable | |
1202 by anybody. The algorithm itself is of course in the public domain. | |
1203 | |
1204 Again derived heuristically from the 9-point WFTA. | |
1205 | |
1206 The algorithm is optimized (?) for speed, not for small rounding errors or | |
1207 good readability. | |
1208 | |
1209 36 additions, 11 multiplications | |
1210 | |
1211 Again this is very likely sub-optimal. | |
1212 | |
1213 The code is optimized to use a minimum number of temporary variables, | |
1214 so it should compile quite well even on 8-register Intel x86 processors. | |
1215 This makes the code quite obfuscated and very difficult to understand. | |
1216 | |
1217 References: | |
1218 [1] S. Winograd: "On Computing the Discrete Fourier Transform", | |
1219 Mathematics of Computation, Volume 32, Number 141, January 1978, | |
1220 Pages 175-199 | |
1221 */ | |
1222 | |
1223 /*------------------------------------------------------------------*/ | |
1224 /* */ | |
1225 /* Function: Calculation of the inverse MDCT */ | |
1226 /* */ | |
1227 /*------------------------------------------------------------------*/ | |
1228 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1229 void dct36(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf) |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1230 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1231 #ifdef NEW_DCT9 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1232 real tmp[18]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1233 #endif |
61 | 1234 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1235 { |
61 | 1236 register real *in = inbuf; |
1237 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1238 in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1239 in[14]+=in[13]; in[13]+=in[12]; in[12]+=in[11]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1240 in[11]+=in[10]; in[10]+=in[9]; in[9] +=in[8]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1241 in[8] +=in[7]; in[7] +=in[6]; in[6] +=in[5]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1242 in[5] +=in[4]; in[4] +=in[3]; in[3] +=in[2]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1243 in[2] +=in[1]; in[1] +=in[0]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1244 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1245 in[17]+=in[15]; in[15]+=in[13]; in[13]+=in[11]; in[11]+=in[9]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1246 in[9] +=in[7]; in[7] +=in[5]; in[5] +=in[3]; in[3] +=in[1]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1247 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1248 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1249 #ifdef NEW_DCT9 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1250 #if 1 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1251 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1252 real t3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1253 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1254 real t0, t1, t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1255 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1256 t0 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1257 t1 = REAL_MUL(COS6_2, in[12]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1258 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1259 t3 = in[0]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1260 t2 = t3 - t1 - t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1261 tmp[1] = tmp[7] = t2 - t0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1262 tmp[4] = t2 + t0 + t0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1263 t3 += t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1264 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1265 t2 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1266 tmp[1] -= t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1267 tmp[7] += t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1268 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1269 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1270 real t0, t1, t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1271 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1272 t0 = REAL_MUL(cos9[0], (in[4] + in[8] )); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1273 t1 = REAL_MUL(cos9[1], (in[8] - in[16])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1274 t2 = REAL_MUL(cos9[2], (in[4] + in[16])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1275 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1276 tmp[2] = tmp[6] = t3 - t0 - t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1277 tmp[0] = tmp[8] = t3 + t0 + t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1278 tmp[3] = tmp[5] = t3 - t1 + t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1279 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1280 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1281 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1282 real t1, t2, t3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1283 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1284 t1 = REAL_MUL(cos18[0], (in[2] + in[10])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1285 t2 = REAL_MUL(cos18[1], (in[10] - in[14])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1286 t3 = REAL_MUL(COS6_1, in[6]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1287 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1288 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1289 real t0 = t1 + t2 + t3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1290 tmp[0] += t0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1291 tmp[8] -= t0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1292 } |
61 | 1293 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1294 t2 -= t3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1295 t1 -= t3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1296 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1297 t3 = REAL_MUL(cos18[2], (in[2] + in[14])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1298 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1299 t1 += t3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1300 tmp[3] += t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1301 tmp[5] -= t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1302 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1303 t2 -= t3; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1304 tmp[2] += t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1305 tmp[6] -= t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1306 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1307 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1308 #else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1309 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1310 real t0, t1, t2, t3, t4, t5, t6, t7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1311 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1312 t1 = REAL_MUL(COS6_2, in[12]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1313 t2 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1314 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1315 t3 = in[0] + t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1316 t4 = in[0] - t1 - t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1317 t5 = t4 - t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1318 tmp[4] = t4 + t2 + t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1319 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1320 t0 = REAL_MUL(cos9[0], (in[4] + in[8])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1321 t1 = REAL_MUL(cos9[1], (in[8] - in[16])); |
61 | 1322 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1323 t2 = REAL_MUL(cos9[2], (in[4] + in[16])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1324 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1325 t6 = t3 - t0 - t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1326 t0 += t3 + t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1327 t3 += t2 - t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1328 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1329 t2 = REAL_MUL(cos18[0], (in[2] + in[10])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1330 t4 = REAL_MUL(cos18[1], (in[10] - in[14])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1331 t7 = REAL_MUL(COS6_1, in[6]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1332 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1333 t1 = t2 + t4 + t7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1334 tmp[0] = t0 + t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1335 tmp[8] = t0 - t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1336 t1 = REAL_MUL(cos18[2], (in[2] + in[14])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1337 t2 += t1 - t7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1338 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1339 tmp[3] = t3 + t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1340 t0 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1341 tmp[5] = t3 - t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1342 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1343 t4 -= t1 + t7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1344 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1345 tmp[1] = t5 - t0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1346 tmp[7] = t5 + t0; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1347 tmp[2] = t6 + t4; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1348 tmp[6] = t6 - t4; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1349 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1350 #endif |
61 | 1351 |
1352 { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1353 real t0, t1, t2, t3, t4, t5, t6, t7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1354 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1355 t1 = REAL_MUL(COS6_2, in[13]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1356 t2 = REAL_MUL(COS6_2, (in[9] + in[17] - in[5])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1357 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1358 t3 = in[1] + t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1359 t4 = in[1] - t1 - t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1360 t5 = t4 - t2; |
61 | 1361 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1362 t0 = REAL_MUL(cos9[0], (in[5] + in[9])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1363 t1 = REAL_MUL(cos9[1], (in[9] - in[17])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1364 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1365 tmp[13] = REAL_MUL((t4 + t2 + t2), tfcos36[17-13]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1366 t2 = REAL_MUL(cos9[2], (in[5] + in[17])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1367 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1368 t6 = t3 - t0 - t2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1369 t0 += t3 + t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1370 t3 += t2 - t1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1371 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1372 t2 = REAL_MUL(cos18[0], (in[3] + in[11])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1373 t4 = REAL_MUL(cos18[1], (in[11] - in[15])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1374 t7 = REAL_MUL(COS6_1, in[7]); |
61 | 1375 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1376 t1 = t2 + t4 + t7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1377 tmp[17] = REAL_MUL((t0 + t1), tfcos36[17-17]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1378 tmp[9] = REAL_MUL((t0 - t1), tfcos36[17-9]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1379 t1 = REAL_MUL(cos18[2], (in[3] + in[15])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1380 t2 += t1 - t7; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1381 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1382 tmp[14] = REAL_MUL((t3 + t2), tfcos36[17-14]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1383 t0 = REAL_MUL(COS6_1, (in[11] + in[15] - in[3])); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1384 tmp[12] = REAL_MUL((t3 - t2), tfcos36[17-12]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1385 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1386 t4 -= t1 + t7; |
61 | 1387 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1388 tmp[16] = REAL_MUL((t5 - t0), tfcos36[17-16]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1389 tmp[10] = REAL_MUL((t5 + t0), tfcos36[17-10]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1390 tmp[15] = REAL_MUL((t6 + t4), tfcos36[17-15]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1391 tmp[11] = REAL_MUL((t6 - t4), tfcos36[17-11]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1392 } |
61 | 1393 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1394 #define MACRO(v) { \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1395 real tmpval; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1396 tmpval = tmp[(v)] + tmp[17-(v)]; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1397 out2[9+(v)] = REAL_MUL(tmpval, w[27+(v)]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1398 out2[8-(v)] = REAL_MUL(tmpval, w[26-(v)]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1399 tmpval = tmp[(v)] - tmp[17-(v)]; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1400 ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(tmpval, w[8-(v)]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1401 ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(tmpval, w[9+(v)]); } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1402 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1403 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1404 register real *out2 = o2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1405 register real *w = wintab; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1406 register real *out1 = o1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1407 register real *ts = tsbuf; |
61 | 1408 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1409 MACRO(0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1410 MACRO(1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1411 MACRO(2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1412 MACRO(3); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1413 MACRO(4); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1414 MACRO(5); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1415 MACRO(6); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1416 MACRO(7); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1417 MACRO(8); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1418 } |
61 | 1419 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1420 #else |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1421 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1422 { |
61 | 1423 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1424 #define MACRO0(v) { \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1425 real tmp; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1426 out2[9+(v)] = REAL_MUL((tmp = sum0 + sum1), w[27+(v)]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1427 out2[8-(v)] = REAL_MUL(tmp, w[26-(v)]); } \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1428 sum0 -= sum1; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1429 ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(sum0, w[8-(v)]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1430 ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(sum0, w[9+(v)]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1431 #define MACRO1(v) { \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1432 real sum0,sum1; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1433 sum0 = tmp1a + tmp2a; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1434 sum1 = REAL_MUL((tmp1b + tmp2b), tfcos36[(v)]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1435 MACRO0(v); } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1436 #define MACRO2(v) { \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1437 real sum0,sum1; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1438 sum0 = tmp2a - tmp1a; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1439 sum1 = REAL_MUL((tmp2b - tmp1b), tfcos36[(v)]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1440 MACRO0(v); } |
61 | 1441 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1442 register const real *c = COS9; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1443 register real *out2 = o2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1444 register real *w = wintab; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1445 register real *out1 = o1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1446 register real *ts = tsbuf; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1447 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1448 real ta33,ta66,tb33,tb66; |
61 | 1449 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1450 ta33 = REAL_MUL(in[2*3+0], c[3]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1451 ta66 = REAL_MUL(in[2*6+0], c[6]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1452 tb33 = REAL_MUL(in[2*3+1], c[3]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1453 tb66 = REAL_MUL(in[2*6+1], c[6]); |
61 | 1454 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1455 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1456 real tmp1a,tmp2a,tmp1b,tmp2b; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1457 tmp1a = REAL_MUL(in[2*1+0], c[1]) + ta33 + REAL_MUL(in[2*5+0], c[5]) + REAL_MUL(in[2*7+0], c[7]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1458 tmp1b = REAL_MUL(in[2*1+1], c[1]) + tb33 + REAL_MUL(in[2*5+1], c[5]) + REAL_MUL(in[2*7+1], c[7]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1459 tmp2a = REAL_MUL(in[2*2+0], c[2]) + REAL_MUL(in[2*4+0], c[4]) + ta66 + REAL_MUL(in[2*8+0], c[8]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1460 tmp2b = REAL_MUL(in[2*2+1], c[2]) + REAL_MUL(in[2*4+1], c[4]) + tb66 + REAL_MUL(in[2*8+1], c[8]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1461 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1462 MACRO1(0); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1463 MACRO2(8); |
61 | 1464 } |
1465 | |
1466 { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1467 real tmp1a,tmp2a,tmp1b,tmp2b; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1468 tmp1a = REAL_MUL(( in[2*1+0] - in[2*5+0] - in[2*7+0] ), c[3]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1469 tmp1b = REAL_MUL(( in[2*1+1] - in[2*5+1] - in[2*7+1] ), c[3]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1470 tmp2a = REAL_MUL(( in[2*2+0] - in[2*4+0] - in[2*8+0] ), c[6]) - in[2*6+0] + in[2*0+0]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1471 tmp2b = REAL_MUL(( in[2*2+1] - in[2*4+1] - in[2*8+1] ), c[6]) - in[2*6+1] + in[2*0+1]; |
61 | 1472 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1473 MACRO1(1); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1474 MACRO2(7); |
61 | 1475 } |
1476 | |
1477 { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1478 real tmp1a,tmp2a,tmp1b,tmp2b; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1479 tmp1a = REAL_MUL(in[2*1+0], c[5]) - ta33 - REAL_MUL(in[2*5+0], c[7]) + REAL_MUL(in[2*7+0], c[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1480 tmp1b = REAL_MUL(in[2*1+1], c[5]) - tb33 - REAL_MUL(in[2*5+1], c[7]) + REAL_MUL(in[2*7+1], c[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1481 tmp2a = - REAL_MUL(in[2*2+0], c[8]) - REAL_MUL(in[2*4+0], c[2]) + ta66 + REAL_MUL(in[2*8+0], c[4]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1482 tmp2b = - REAL_MUL(in[2*2+1], c[8]) - REAL_MUL(in[2*4+1], c[2]) + tb66 + REAL_MUL(in[2*8+1], c[4]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1483 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1484 MACRO1(2); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1485 MACRO2(6); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1486 } |
61 | 1487 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1488 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1489 real tmp1a,tmp2a,tmp1b,tmp2b; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1490 tmp1a = REAL_MUL(in[2*1+0], c[7]) - ta33 + REAL_MUL(in[2*5+0], c[1]) - REAL_MUL(in[2*7+0], c[5]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1491 tmp1b = REAL_MUL(in[2*1+1], c[7]) - tb33 + REAL_MUL(in[2*5+1], c[1]) - REAL_MUL(in[2*7+1], c[5]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1492 tmp2a = - REAL_MUL(in[2*2+0], c[4]) + REAL_MUL(in[2*4+0], c[8]) + ta66 - REAL_MUL(in[2*8+0], c[2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1493 tmp2b = - REAL_MUL(in[2*2+1], c[4]) + REAL_MUL(in[2*4+1], c[8]) + tb66 - REAL_MUL(in[2*8+1], c[2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1494 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1495 MACRO1(3); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1496 MACRO2(5); |
61 | 1497 } |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1498 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1499 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1500 real sum0,sum1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1501 sum0 = in[2*0+0] - in[2*2+0] + in[2*4+0] - in[2*6+0] + in[2*8+0]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1502 sum1 = REAL_MUL((in[2*0+1] - in[2*2+1] + in[2*4+1] - in[2*6+1] + in[2*8+1] ), tfcos36[4]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1503 MACRO0(4); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1504 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1505 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1506 #endif |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1507 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1508 } |
61 | 1509 } |
1510 | |
1511 /* | |
1512 * new DCT12 | |
1513 */ | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1514 static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,register real *ts) |
61 | 1515 { |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1516 #define DCT12_PART1 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1517 in5 = in[5*3]; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1518 in5 += (in4 = in[4*3]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1519 in4 += (in3 = in[3*3]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1520 in3 += (in2 = in[2*3]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1521 in2 += (in1 = in[1*3]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1522 in1 += (in0 = in[0*3]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1523 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1524 in5 += in3; in3 += in1; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1525 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1526 in2 = REAL_MUL(in2, COS6_1); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1527 in3 = REAL_MUL(in3, COS6_1); \ |
61 | 1528 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1529 #define DCT12_PART2 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1530 in0 += REAL_MUL(in4, COS6_2); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1531 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1532 in4 = in0 + in2; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1533 in0 -= in2; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1534 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1535 in1 += REAL_MUL(in5, COS6_2); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1536 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1537 in5 = REAL_MUL((in1 + in3), tfcos12[0]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1538 in1 = REAL_MUL((in1 - in3), tfcos12[2]); \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1539 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1540 in3 = in4 + in5; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1541 in4 -= in5; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1542 \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1543 in2 = in0 + in1; \ |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1544 in0 -= in1; |
61 | 1545 |
1546 | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1547 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1548 real in0,in1,in2,in3,in4,in5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1549 register real *out1 = rawout1; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1550 ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1551 ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5]; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1552 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1553 DCT12_PART1 |
61 | 1554 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1555 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1556 real tmp0,tmp1 = (in0 - in4); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1557 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1558 real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1559 tmp0 = tmp1 + tmp2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1560 tmp1 -= tmp2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1561 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1562 ts[(17-1)*SBLIMIT] = out1[17-1] + REAL_MUL(tmp0, wi[11-1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1563 ts[(12+1)*SBLIMIT] = out1[12+1] + REAL_MUL(tmp0, wi[6+1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1564 ts[(6 +1)*SBLIMIT] = out1[6 +1] + REAL_MUL(tmp1, wi[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1565 ts[(11-1)*SBLIMIT] = out1[11-1] + REAL_MUL(tmp1, wi[5-1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1566 } |
61 | 1567 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1568 DCT12_PART2 |
61 | 1569 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1570 ts[(17-0)*SBLIMIT] = out1[17-0] + REAL_MUL(in2, wi[11-0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1571 ts[(12+0)*SBLIMIT] = out1[12+0] + REAL_MUL(in2, wi[6+0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1572 ts[(12+2)*SBLIMIT] = out1[12+2] + REAL_MUL(in3, wi[6+2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1573 ts[(17-2)*SBLIMIT] = out1[17-2] + REAL_MUL(in3, wi[11-2]); |
61 | 1574 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1575 ts[(6 +0)*SBLIMIT] = out1[6+0] + REAL_MUL(in0, wi[0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1576 ts[(11-0)*SBLIMIT] = out1[11-0] + REAL_MUL(in0, wi[5-0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1577 ts[(6 +2)*SBLIMIT] = out1[6+2] + REAL_MUL(in4, wi[2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1578 ts[(11-2)*SBLIMIT] = out1[11-2] + REAL_MUL(in4, wi[5-2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1579 } |
61 | 1580 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1581 in++; |
61 | 1582 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1583 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1584 real in0,in1,in2,in3,in4,in5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1585 register real *out2 = rawout2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1586 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1587 DCT12_PART1 |
61 | 1588 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1589 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1590 real tmp0,tmp1 = (in0 - in4); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1591 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1592 real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1593 tmp0 = tmp1 + tmp2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1594 tmp1 -= tmp2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1595 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1596 out2[5-1] = REAL_MUL(tmp0, wi[11-1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1597 out2[0+1] = REAL_MUL(tmp0, wi[6+1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1598 ts[(12+1)*SBLIMIT] += REAL_MUL(tmp1, wi[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1599 ts[(17-1)*SBLIMIT] += REAL_MUL(tmp1, wi[5-1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1600 } |
61 | 1601 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1602 DCT12_PART2 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1603 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1604 out2[5-0] = REAL_MUL(in2, wi[11-0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1605 out2[0+0] = REAL_MUL(in2, wi[6+0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1606 out2[0+2] = REAL_MUL(in3, wi[6+2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1607 out2[5-2] = REAL_MUL(in3, wi[11-2]); |
61 | 1608 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1609 ts[(12+0)*SBLIMIT] += REAL_MUL(in0, wi[0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1610 ts[(17-0)*SBLIMIT] += REAL_MUL(in0, wi[5-0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1611 ts[(12+2)*SBLIMIT] += REAL_MUL(in4, wi[2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1612 ts[(17-2)*SBLIMIT] += REAL_MUL(in4, wi[5-2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1613 } |
61 | 1614 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1615 in++; |
61 | 1616 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1617 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1618 real in0,in1,in2,in3,in4,in5; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1619 register real *out2 = rawout2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1620 out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0; |
61 | 1621 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1622 DCT12_PART1 |
61 | 1623 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1624 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1625 real tmp0,tmp1 = (in0 - in4); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1626 { |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1627 real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1628 tmp0 = tmp1 + tmp2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1629 tmp1 -= tmp2; |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1630 } |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1631 out2[11-1] = REAL_MUL(tmp0, wi[11-1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1632 out2[6 +1] = REAL_MUL(tmp0, wi[6+1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1633 out2[0+1] += REAL_MUL(tmp1, wi[1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1634 out2[5-1] += REAL_MUL(tmp1, wi[5-1]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1635 } |
61 | 1636 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1637 DCT12_PART2 |
61 | 1638 |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1639 out2[11-0] = REAL_MUL(in2, wi[11-0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1640 out2[6 +0] = REAL_MUL(in2, wi[6+0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1641 out2[6 +2] = REAL_MUL(in3, wi[6+2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1642 out2[11-2] = REAL_MUL(in3, wi[11-2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1643 |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1644 out2[0+0] += REAL_MUL(in0, wi[0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1645 out2[5-0] += REAL_MUL(in0, wi[5-0]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1646 out2[0+2] += REAL_MUL(in4, wi[2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1647 out2[5-2] += REAL_MUL(in4, wi[5-2]); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1648 } |
61 | 1649 } |
1650 | |
1651 /* | |
1652 * III_hybrid | |
1653 */ | |
1654 static void | |
1655 III_hybrid(real fsIn[SBLIMIT][SSLIMIT], | |
1656 real tsOut[SSLIMIT][SBLIMIT], int ch, | |
1657 struct gr_info_s *gr_info, struct frame *fr) | |
1658 { | |
1659 static real block[2][2][SBLIMIT * SSLIMIT] = { {{0,}} }; | |
1660 static int blc[2] = { 0, 0 }; | |
1661 | |
1662 real *tspnt = (real *) tsOut; | |
1663 real *rawout1, *rawout2; | |
1664 int bt, sb = 0; | |
1665 | |
1666 { | |
1667 int b = blc[ch]; | |
1668 rawout1 = block[b][ch]; | |
1669 b = -b + 1; | |
1670 rawout2 = block[b][ch]; | |
1671 blc[ch] = b; | |
1672 } | |
1673 | |
1674 if (gr_info->mixed_block_flag) { | |
1675 sb = 2; | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1676 dct36(fsIn[0], rawout1, rawout2, win[0], tspnt); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1677 dct36(fsIn[1], rawout1 + 18, rawout2 + 18, win1[0], tspnt + 1); |
61 | 1678 rawout1 += 36; |
1679 rawout2 += 36; | |
1680 tspnt += 2; | |
1681 } | |
1682 | |
1683 bt = gr_info->block_type; | |
1684 if (bt == 2) { | |
1685 for (; sb < gr_info->maxb; | |
1686 sb += 2, tspnt += 2, rawout1 += 36, rawout2 += 36) { | |
1687 dct12(fsIn[sb], rawout1, rawout2, win[2], tspnt); | |
1688 dct12(fsIn[sb + 1], rawout1 + 18, rawout2 + 18, win1[2], | |
1689 tspnt + 1); | |
1690 } | |
1691 } | |
1692 else { | |
1693 for (; sb < gr_info->maxb; | |
1694 sb += 2, tspnt += 2, rawout1 += 36, rawout2 += 36) { | |
127
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1695 dct36(fsIn[sb], rawout1, rawout2, win[bt], tspnt); |
05d824e30afd
[svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents:
61
diff
changeset
|
1696 dct36(fsIn[sb + 1], rawout1 + 18, rawout2 + 18, win1[bt], |
61 | 1697 tspnt + 1); |
1698 } | |
1699 } | |
1700 | |
1701 for (; sb < SBLIMIT; sb++, tspnt++) { | |
1702 int i; | |
1703 for (i = 0; i < SSLIMIT; i++) { | |
1704 tspnt[i * SBLIMIT] = *rawout1++; | |
1705 *rawout2++ = 0.0; | |
1706 } | |
1707 } | |
1708 } | |
1709 int | |
1710 mpg123_do_layer3(struct frame *fr) | |
1711 { | |
1712 int gr, ch, ss; | |
1713 int scalefacs[2][39]; /* max 39 for short[13][3] mode, mixed: 38, long: 22 */ | |
1714 struct III_sideinfo sideinfo; | |
1715 int stereo = fr->stereo; | |
1716 int single = fr->single; | |
1717 int ms_stereo, i_stereo; | |
1718 int sfreq = fr->sampling_frequency; | |
1719 int stereo1, granules; | |
1720 | |
1721 if (stereo == 1) { /* stream is mono */ | |
1722 stereo1 = 1; | |
1723 single = 0; | |
1724 } | |
1725 else if (single >= 0) /* stream is stereo, but force to mono */ | |
1726 stereo1 = 1; | |
1727 else | |
1728 stereo1 = 2; | |
1729 | |
1730 if (fr->mode == MPG_MD_JOINT_STEREO) { | |
1731 ms_stereo = (fr->mode_ext & 0x2) >> 1; | |
1732 i_stereo = fr->mode_ext & 0x1; | |
1733 } | |
1734 else | |
1735 ms_stereo = i_stereo = 0; | |
1736 | |
1737 granules = fr->lsf ? 1 : 2; | |
1738 if (!III_get_side_info | |
1739 (&sideinfo, stereo, ms_stereo, sfreq, single, fr->lsf)) | |
1740 return 0; | |
1741 | |
1742 mpg123_set_pointer(sideinfo.main_data_begin); | |
1743 | |
1744 for (gr = 0; gr < granules; gr++) { | |
1745 real hybridIn[2][SBLIMIT][SSLIMIT]; | |
1746 real hybridOut[2][SSLIMIT][SBLIMIT]; | |
1747 | |
1748 { | |
1749 struct gr_info_s *gr_info = &(sideinfo.ch[0].gr[gr]); | |
1750 long part2bits; | |
1751 | |
1752 if (fr->lsf) | |
1753 part2bits = III_get_scale_factors_2(scalefacs[0], gr_info, 0); | |
1754 else | |
1755 part2bits = III_get_scale_factors_1(scalefacs[0], gr_info); | |
1756 | |
1757 if (III_dequantize_sample | |
1758 (hybridIn[0], scalefacs[0], gr_info, sfreq, part2bits)) | |
1759 return 0; | |
1760 } | |
1761 | |
1762 if (stereo == 2) { | |
1763 struct gr_info_s *gr_info = &(sideinfo.ch[1].gr[gr]); | |
1764 long part2bits; | |
1765 | |
1766 if (fr->lsf) | |
1767 part2bits = | |
1768 III_get_scale_factors_2(scalefacs[1], gr_info, i_stereo); | |
1769 else | |
1770 part2bits = III_get_scale_factors_1(scalefacs[1], gr_info); | |
1771 | |
1772 if (III_dequantize_sample | |
1773 (hybridIn[1], scalefacs[1], gr_info, sfreq, part2bits)) | |
1774 return 0; | |
1775 | |
1776 if (ms_stereo) { | |
1777 int i; | |
1778 int maxb = sideinfo.ch[0].gr[gr].maxb; | |
1779 | |
1780 if (sideinfo.ch[1].gr[gr].maxb > maxb) | |
1781 maxb = sideinfo.ch[1].gr[gr].maxb; | |
1782 for (i = 0; i < SSLIMIT * maxb; i++) { | |
1783 real tmp0 = ((real *) hybridIn[0])[i]; | |
1784 real tmp1 = ((real *) hybridIn[1])[i]; | |
1785 ((real *) hybridIn[0])[i] = tmp0 + tmp1; | |
1786 ((real *) hybridIn[1])[i] = tmp0 - tmp1; | |
1787 } | |
1788 } | |
1789 | |
1790 if (i_stereo) | |
1791 III_i_stereo(hybridIn, scalefacs[1], gr_info, sfreq, | |
1792 ms_stereo, fr->lsf); | |
1793 | |
1794 if (ms_stereo || i_stereo || (single == 3)) { | |
1795 if (gr_info->maxb > sideinfo.ch[0].gr[gr].maxb) | |
1796 sideinfo.ch[0].gr[gr].maxb = gr_info->maxb; | |
1797 else | |
1798 gr_info->maxb = sideinfo.ch[0].gr[gr].maxb; | |
1799 } | |
1800 | |
1801 switch (single) { | |
1802 case 3: | |
1803 { | |
1804 register int i; | |
1805 register real *in0 = (real *) hybridIn[0], | |
1806 *in1 = (real *) hybridIn[1]; | |
1807 for (i = 0; i < SSLIMIT * gr_info->maxb; i++, in0++) | |
1808 *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */ | |
1809 } | |
1810 break; | |
1811 case 1: | |
1812 { | |
1813 register int i; | |
1814 register real *in0 = (real *) hybridIn[0], | |
1815 *in1 = (real *) hybridIn[1]; | |
1816 for (i = 0; i < SSLIMIT * gr_info->maxb; i++) | |
1817 *in0++ = *in1++; | |
1818 } | |
1819 break; | |
1820 } | |
1821 } | |
1822 | |
1823 #ifdef XMMS_EQ | |
1824 if (mpg123_info->eq_active) { | |
1825 int i, sb; | |
1826 | |
1827 if (single < 0) { | |
1828 for (sb = 0, i = 0; sb < SBLIMIT; sb++) { | |
1829 for (ss = 0; ss < SSLIMIT; ss++) { | |
1830 hybridIn[0][sb][ss] *= mpg123_info->eq_mul[i]; | |
1831 hybridIn[1][sb][ss] *= mpg123_info->eq_mul[i++]; | |
1832 } | |
1833 } | |
1834 } | |
1835 else { | |
1836 for (sb = 0, i = 0; sb < SBLIMIT; sb++) { | |
1837 for (ss = 0; ss < SSLIMIT; ss++) | |
1838 hybridIn[0][sb][ss] *= mpg123_info->eq_mul[i++]; | |
1839 } | |
1840 } | |
1841 } | |
1842 #endif | |
1843 | |
1844 for (ch = 0; ch < stereo1; ch++) { | |
1845 struct gr_info_s *gr_info = &(sideinfo.ch[ch].gr[gr]); | |
1846 | |
1847 III_antialias(hybridIn[ch], gr_info); | |
1848 if (gr_info->maxb < 1 || gr_info->maxb > SBLIMIT) | |
1849 return 0; | |
1850 III_hybrid(hybridIn[ch], hybridOut[ch], ch, gr_info, fr); | |
1851 } | |
1852 | |
1853 for (ss = 0; ss < SSLIMIT; ss++) { | |
1854 if (single >= 0) { | |
1855 (fr->synth_mono) (hybridOut[0][ss], mpg123_pcm_sample, | |
1856 &mpg123_pcm_point); | |
1857 } | |
1858 else { | |
1859 int p1 = mpg123_pcm_point; | |
1860 | |
1861 (fr->synth) (hybridOut[0][ss], 0, mpg123_pcm_sample, &p1); | |
1862 (fr->synth) (hybridOut[1][ss], 1, mpg123_pcm_sample, | |
1863 &mpg123_pcm_point); | |
1864 } | |
1865 } | |
1866 | |
448
15481b4017cc
[svn] Revert hack that had no effect. The blips apparently occur on the output side of things.
nenolod
parents:
447
diff
changeset
|
1867 if (mpg123_info->output_audio && mpg123_info->jump_to_time == -1) { |
61 | 1868 produce_audio(mpg123_ip.output->written_time(), |
1869 mpg123_cfg.resolution == | |
1870 16 ? FMT_S16_NE : FMT_U8, | |
1871 mpg123_cfg.channels == | |
1872 2 ? fr->stereo : 1, mpg123_pcm_point, | |
1873 mpg123_pcm_sample, &mpg123_info->going); | |
1874 } | |
1875 | |
1876 mpg123_pcm_point = 0; | |
1877 } | |
1878 return 1; | |
1879 } |