>
>> There is such thing as phase shift between two channels. You are always
>> getting it while recording from an audiocassete, or from any other audio
>> tape, from some CDs, etc. That's there JointStereo does Bad Thing. We
>> are loosing too many important information in side channel in this case.
>
> It would be intresting to consider test delaying a channel by n samples
> (where n is small) to see if it minimizes energy in the side channel.
> :)
>
in the function lame_encode, you take the input buffer with
for (ch=0; ch<stereo; ch++)
for (i=0; i<samplesPerFrame; i++)
mfbuf[ch][i+576+EXTRADELAY]=Buffer[ch][i];
and if there is joint stereo you apply to the input buffer
if (force_ms)
for (i=0; i< samplesPerFrame; i++) {
/* dont overflow the short int */
double mid = ((int)mfbuf[0][576+i]+(int)mfbuf[1][576+i])/(2.0);
double side= ((int)mfbuf[0][576+i]-(int)mfbuf[1][576+i])/(2.0);
mfbuf[0][576+i]=mid;
mfbuf[1][576+i]=side;
}
Where has EXTRADELAY disappeared between the two operations on the input
buffer?
Lionel
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )