Well, the only thing I have to go off of is that I have tried bladeenc and lame and they both die in the code that is doing the same thing. They both die in the fft code in the loop that actually calculates the transforms, from what I can tell.

I don't think big endian is the problem either. I have tested endian-ness issues and they all come out correct.

I'm including the actual function that I have tracked the issue to in lame at the bottom of this e-mail. I have tried to access the memory defined below as gi[k3] earlier in the program and it causes a segmentation fault as well. So, it's something to do with going off in the weeds at that memory location.

If anyone has any advice on where to look next, or debugging procedures for this type of issue, I'd be happy to hear them.

Thanks,

Casey

Takehiro Tominaga wrote:
I think BIG endian is not problem. I can compile/run LAME on MacOSX and
SPARC Solaris successfully and they're also big endian.


Code: bad PC value.


Is it Ok ???
Is it really in FFT ?


Output:

LAME version 3.94 (beta 1, Jan  7 2004) (http://www.mp3dev.org/)
Using polyphase lowpass  filter, transition band: 17249 Hz - 17782 Hz
Encoding track01.wav to shrek.wav
Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
     0/7969   ( 0%)|    0:00/    0:00|    0:00/    0:00|   0.0000x|    0:00
Dies right here second time.
 Dies right here second time.
Segmentation fault



Traced to the following code:

static void fht(FLOAT *fz, int n)
{
    const FLOAT *tri = costab;
    int           k4;
    FLOAT *fi, *fn, *gi;

n <<= 1; /* to get BLKSIZE, because of 3DNow! ASM routine */
fn = fz + n;
k4 = 4;
do {
FLOAT s1, c1;
int i, k1, k2, k3, kx;
kx = k4 >> 1;
k1 = k4;
k2 = k4 << 1;
k3 = k2 + k1;
k4 = k2 << 1;
fi = fz;
gi = fi + kx;
do {
FLOAT f0,f1,f2,f3;
f1 = fi[0] - fi[k1];
f0 = fi[0] + fi[k1];
f3 = fi[k2] - fi[k3];
f2 = fi[k2] + fi[k3];
fi[k2] = f0 - f2;
fi[0 ] = f0 + f2;
fi[k3] = f1 - f3;
fi[k1] = f1 + f3;
f1 = gi[0] - gi[k1];
f0 = gi[0] + gi[k1];
printf(" Dies right here second time.\n"); // <== Here is the print out, never gets to the next line. From what I can tell gi[k3] is the issue, if I try to access the memory at gi[k3] earlier in the program I can cause the segmentation fault earlier.
f3 = SQRT2 * gi[k3];
f2 = SQRT2 * gi[k2];
gi[k2] = f0 - f2;
gi[0 ] = f0 + f2;
gi[k3] = f1 - f3;
gi[k1] = f1 + f3;
gi += k4;
fi += k4;
} while (fi<fn);
c1 = tri[0];
s1 = tri[1];
for (i = 1; i < kx; i++) {
FLOAT c2,s2;
c2 = 1 - (2*s1)*s1;
s2 = (2*s1)*c1;
fi = fz + i;
gi = fz + k1 - i;
do {
FLOAT a,b,g0,f0,f1,g1,f2,g2,f3,g3;
b = s2*fi[k1] - c2*gi[k1];
a = c2*fi[k1] + s2*gi[k1];
f1 = fi[0 ] - a;
f0 = fi[0 ] + a;
g1 = gi[0 ] - b;
g0 = gi[0 ] + b;
b = s2*fi[k3] - c2*gi[k3];
a = c2*fi[k3] + s2*gi[k3];
f3 = fi[k2] - a;
f2 = fi[k2] + a;
g3 = gi[k2] - b;
g2 = gi[k2] + b;
b = s1*f2 - c1*g3;
a = c1*f2 + s1*g3;
fi[k2] = f0 - a;
fi[0 ] = f0 + a;
gi[k3] = g1 - b;
gi[k1] = g1 + b;
b = c1*g2 - s1*f3;
a = s1*g2 + c1*f3;
gi[k2] = g0 - a;
gi[0 ] = g0 + a;
fi[k3] = f1 - b;
fi[k1] = f1 + b;
gi += k4;
fi += k4;
} while (fi<fn);
c2 = c1;
c1 = c2 * tri[0] - s1 * tri[1];
s1 = c2 * tri[1] + s1 * tri[0];
}
tri += 2;
} while (k4<n);
}


_______________________________________________
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder

Reply via email to