annotate Plugins/Input/mpg123/decode.c @ 228:08973a746a3e trunk

[svn] GCC2 fixes.
author nenolod
date Fri, 25 Nov 2005 23:14:41 -0800
parents 0a2963adefab
children 0f294f2b0a9b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 * Mpeg Layer-1,2,3 audio decoder
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 * ------------------------------
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * copyright (c) 1995,1996,1997 by Michael Hipp, All rights reserved.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 * See also 'README'
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 #include <stdlib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 #include <math.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 #include <string.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 #include "mpg123.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 #define WRITE_SAMPLE(samples,sum,clip) \
127
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( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
17 else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
151
0a2963adefab [svn] Remove REAL_TO_SHORT from generic decoder.
nenolod
parents: 127
diff changeset
18 else { *(samples) = sum; }
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
20 int mpg123_synth_1to1_8bit(real *bandPtr,int channel,unsigned char *samples,int *pnt)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 {
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 short samples_tmp[64];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
23 short *tmp1 = samples_tmp + channel;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
24 int i,ret;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
25 int pnt1=0;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
27 ret = mpg123_synth_1to1(bandPtr,channel,(unsigned char *) samples_tmp,&pnt1);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
28 samples += channel + *pnt;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
30 for(i=0;i<32;i++) {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
31 *samples = mpg123_conv16to8[*tmp1>>AUSHIFT];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
32 samples += 2;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
33 tmp1 += 2;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
34 }
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
35 *pnt += 64;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
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
37 return ret;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
40 int mpg123_synth_1to1_8bit_mono(real *bandPtr,unsigned char *samples,int *pnt)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 {
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
42 short samples_tmp[64];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
43 short *tmp1 = samples_tmp;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
44 int i,ret;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
45 int pnt1 = 0;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
46
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
47 ret = mpg123_synth_1to1(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
48 samples += *pnt;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
49
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
50 for(i=0;i<32;i++) {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
51 *samples++ = mpg123_conv16to8[*tmp1>>AUSHIFT];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
52 tmp1 += 2;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
53 }
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
54 *pnt += 32;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
55
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
56 return ret;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
57 }
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
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 int mpg123_synth_1to1_8bit_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
60 {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
61 short samples_tmp[64];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
62 short *tmp1 = samples_tmp;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
63 int i,ret;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
64 int pnt1 = 0;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
66 ret = mpg123_synth_1to1(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
67 samples += *pnt;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
69 for(i=0;i<32;i++) {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
70 *samples++ = mpg123_conv16to8[*tmp1>>AUSHIFT];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
71 *samples++ = mpg123_conv16to8[*tmp1>>AUSHIFT];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
72 tmp1 += 2;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
73 }
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
74 *pnt += 64;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
75
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
76 return ret;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
79 int mpg123_synth_1to1_mono(real *bandPtr,unsigned char *samples,int *pnt)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
80 {
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
81 short samples_tmp[64];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
82 short *tmp1 = samples_tmp;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
83 int i,ret;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
84 int pnt1 = 0;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
85
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
86 ret = mpg123_synth_1to1(bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
87 samples += *pnt;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
88
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
89 for(i=0;i<32;i++) {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
90 *( (short *)samples) = *tmp1;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
91 samples += 2;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
92 tmp1 += 2;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
93 }
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
94 *pnt += 64;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
95
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
96 return ret;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
97 }
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
98
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
99
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
100 int mpg123_synth_1to1_mono2stereo(real *bandPtr,unsigned char *samples,int *pnt)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
101 {
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
102 int i,ret;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
103
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
104 ret = mpg123_synth_1to1(bandPtr,0,samples,pnt);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
105 samples = samples + *pnt - 128;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
106
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
107 for(i=0;i<32;i++) {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
108 ((short *)samples)[1] = ((short *)samples)[0];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
109 samples+=4;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
110 }
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
111
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
112 return ret;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
113 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
114
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
115
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
116 int mpg123_synth_1to1(real *bandPtr,int channel,unsigned char *out,int *pnt)
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
117 {
127
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 real buffs[2][2][0x110];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
119 static const int step = 2;
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 int bo = 1;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
121 short *samples = (short *) (out+*pnt);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
122
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
123 real *b0,(*buf)[0x110];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
124 int clip = 0;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
125 int bo1;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
126
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
127 if(!channel) {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
128 bo--;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
129 bo &= 0xf;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
130 buf = buffs[0];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
131 }
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
132 else {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
133 samples++;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
134 buf = buffs[1];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
135 }
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
136
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
137 if(bo & 0x1) {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
138 b0 = buf[0];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
139 bo1 = bo;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
140 mpg123_dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
141 }
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
142 else {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
143 b0 = buf[1];
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
144 bo1 = bo+1;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
145 mpg123_dct64(buf[0]+bo,buf[1]+bo+1,bandPtr);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
146 }
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
147
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
148
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
149 {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
150 register int j;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
151 real *window = mpg123_decwin + 16 - bo1;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
152
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
153 for (j=16;j;j--,window+=0x10,samples+=step)
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
154 {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
155 real sum;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
156 sum = REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
157 sum -= REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
158 sum += REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
159 sum -= REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
160 sum += REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
161 sum -= REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
162 sum += REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
163 sum -= REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
164 sum += REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
165 sum -= REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
166 sum += REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
167 sum -= REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
168 sum += REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
169 sum -= REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
170 sum += REAL_MUL(*window++, *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
171 sum -= REAL_MUL(*window++, *b0++);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
172
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
173 WRITE_SAMPLE(samples,sum,clip);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
174 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
175
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
176 {
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
177 real sum;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
178 sum = REAL_MUL(window[0x0], b0[0x0]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
179 sum += REAL_MUL(window[0x2], b0[0x2]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
180 sum += REAL_MUL(window[0x4], b0[0x4]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
181 sum += REAL_MUL(window[0x6], b0[0x6]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
182 sum += REAL_MUL(window[0x8], b0[0x8]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
183 sum += REAL_MUL(window[0xA], b0[0xA]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
184 sum += REAL_MUL(window[0xC], b0[0xC]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
185 sum += REAL_MUL(window[0xE], b0[0xE]);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
186 WRITE_SAMPLE(samples,sum,clip);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
187 b0-=0x10,window-=0x20,samples+=step;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
188 }
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
189 window += bo1<<1;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
190
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
191 for (j=15;j;j--,b0-=0x20,window-=0x10,samples+=step)
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
192 {
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
193 real sum;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
194 sum = -REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
195 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
196 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
197 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
198 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
199 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
200 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
201 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
202 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
203 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
204 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
205 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
206 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
207 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
208 sum -= REAL_MUL(*(--window), *b0++);
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
209 sum -= REAL_MUL(*(--window), *b0++);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
210
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
211 WRITE_SAMPLE(samples,sum,clip);
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
212 }
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
213 }
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
214
127
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
215 *pnt += 128;
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
216
05d824e30afd [svn] Synchronize mpg123 code with mpg123-0.59s.mc3. This brings us superior accuracy to libMAD, apparently.
nenolod
parents: 61
diff changeset
217 return clip;
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
218 }