[FFmpeg-devel] Patch - Allow disabling of bit reservoir when encoding MP3 audio

Michael Niedermayer michaelni
Tue Feb 5 13:14:34 CET 2008

On Tue, Feb 05, 2008 at 08:47:11AM +0000, Paul Kelly wrote:
> On Tue, 5 Feb 2008, Michael Niedermayer wrote:
>> Splitting mp3 at frame boundaries should not cause artifacts. If it does
>> submit a bugreport to whatever decoder you use. If its libavcodec, ill fix
>> that if you provide such a file with artifacts at the start.
> It was in mplayer; perhaps libavcodec doesn't exhibit the artefacts but 
> IMHO that is not really the point because some data (i.e. the bits 
> belonging to the first frame after the split that had been encoded in 
> previous frames) is still lost and that is because of the encoder's 
> behaviour, not the decoder. Quoting from the lame manpage:
> "--nores
>         Disable the bit reservoir.  Each frame will then become independent
>  from previous ones, but the quality will be lower."
> I think the lower quality (how much, really?) 

I dont know, but i would guess if its insignificant it wouldnt have been
included in the mp3 spec.

> is irrelevant with constant 
> bitrate as a higher bitrate could simply be used if quality was important. 

If using higher bitrate is not a problem for you, why dont you use PCM or
some lossless compression?

> Having each frame independent from previous ones is (as you suggest) an 
> important advantage.
> On Tue, 5 Feb 2008, Rich Felker wrote:
>> Personally I would say just always disable bit reservoir. 

You can, but we cant, due to quality loss.

>> It's a dumb
>> [mis-]feature. 

Yes, the design stinks.

>> If VBR is desired then use honest VBR mode, not this
>> ugly hack of coding bits into the wrong frames...

While true variable size frames would be a perfect replacement for the bit
reservoir. Mp3 does not really have true variable size frames, just a small
number of fixed sizes. This inevitable leads to some wasted bits per frame.
And not few ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080205/0bc4de69/attachment.pgp>

More information about the ffmpeg-devel mailing list