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

Paul Kelly paul
Sat Feb 9 16:28:16 CET 2008

On Fri, 8 Feb 2008, Michael Niedermayer wrote:

> On Fri, Feb 08, 2008 at 09:57:47PM +0000, Paul Kelly wrote:
> Everything else is disabled by default and has enable flags.
> I definitly want the flag to be an enable flag. The default is a seperate
> issue, we might choose to leave it enabled.
> "-flags2 -reservoir" would disable it
> "-flags2 +reservoir" would enable it
> this is much cleaner than a +disable_reservoir
>> So I'm not sure what to do about the WMA encoder. Would it be acceptable
>> to put in some code that prints a warning that the bit reservoir will not
>> be used even though it is specified? I mean just so there is some
>> reference to this AVCodecContext disable bit reservoir flag there so
>> someone hacking the code in the future will be reminded to use it.
> If you want to add that ...

OK, I've attached two patches for consideration. The first, flags2.patch, 
re-arranges the code for setting WMA flags in wmaenc.c to make it clearer. 
It seemed to be a copy and paste of the code in wmadec.c, otherwise it 
doesn't make much sense. It should be clear from the patch my 
understanding of what the code is supposed to do, and I hope my changes 
are acceptable. This patch also adds the warning if the bit reservoir flag 
is set, and unsets it.

The second patch, bitres.patch, adds the new flag 
CODEC_FLAG2_BIT_RESERVOIR, sets it by default to on, and increases the 
micro version number of libavcodec to indicate the new feature. It also 
changes libavcodec/libmp3lame.c and libavcodec/wmaenc.c to use the new 

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: flags2.patch
Type: text/x-diff
Size: 1191 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080209/15ff64dd/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bitres.patch
Type: text/x-diff
Size: 3869 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080209/15ff64dd/attachment-0001.patch>

More information about the ffmpeg-devel mailing list