Hi Arne,

Thanks for finding this.  This was a subtle & rare bug in CBR,
triggered by the -k option.

(-k, by the way, is *always* a bad idea.  It overrides LAME's
default lowpass filters. It will cause ringing and twinking
at 128kbs)


Note to developers and -X6 fans:

The problem is in frame 2326, side channel.  It has a lot
of energy > 15khz.  Trying to encode these frequencies 
got LAME stuck in the following loop:

1.  increase scalefactor for bands with distortion by 1.
2.  decrease global_gain so bits < targ_bits
    (decrease in global_gain exactly offsets change in scalefactor)
   
    net effect on bands with distortion:  NO CHANGE!
    Thus over, over_noise, max_noise are all unchanged,
    but tot_noise is increasing.

    In this case, -X0 would accept the newer quantization as better.
    So LAME just kept increasing the scalefactor bands
    and decreasing global_gain until it got into a 
    bizzare configuation.  The fact that scalefac_scale
    is now enabled, allowed LAME to further aggravate the
    situation and create an audible glitch in the mp3 file.


I just committed the following fix:

If over == best->over, and over_noise == best->over_noise,
then use tot_noise to decide on the best quantization.

This makes -X0 (the default) very close to -X6,
although -X0 still gives precedence to 'over'.  Changing
that would be too radical at this time :-)

Mark






> 
> Hi Mark,
> 
> I accidentially discoverd a bug in lame which I really can't understand. I
> have one wav audio track to which, when encoded, a short period of noise is
> added. I'm not able to describe this, listen yourself:
> http://www.home.unix-ag.org/arne/x/cdda.wav.mp3 (1.1MB)
> the original wav-file is at
> http://www.home.unix-ag.org/arne/x/cdda.wav (12MB)
> The noise appears between time offset 1:00 and 1:01 and is clearly audible.
> What I consider strange is that it doesn't seem to appear when
> * encoding with other parameters than -h -k -b 128
> * only a part of this track is used, i.e. I tried this with a rip which
>   started at 0:50 in order to save bandwidth -> no noise
> 
> I used cvs-lame, one of today, 2 hours ago and one with 2 days of age.
> 
> I'm writing directly to you because the part of the track is too long to be
> considered legal. Please don't pass it unnecessarily around. I guess it's ok
> for technical examination.
> 
> Of course I still consider lame the best MP3 encoder around, nice work...
> 
> cu arne
> -- 
> Arne Zellentin
> [EMAIL PROTECTED]
> 
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to