> 
> 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?
> 

The first block of code copies data into mfbuf, adding a delay so
lame will sync with fhg.  

The second block of code applies the m/s conversion to the exact 1152 
samples that are going to be processed for this frame.  Adding EXTRADELAY
to this block should have no effect - it would just perform the m/s
conversion for some samples before they are used by the MDCT transform.

Mark



--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to