Jefferson Stonier
2005-Aug-01 07:05 UTC
[Vorbis-dev] How do you set the encoder bit reservoir size?
Hi; In the Vorbis 1.1 release notes from July 7, 2004, Monty says "The 1.1 libvorbisenc allows setting the fixed reservoir size (in bits, defaulting to two seconds worth of requested bitrate) and 'hoarding' behavior (whether the encoder tends to keep the bit reservoir more full or more empty) as well as the other encoding heuristics available through the API of 1.0.1." I'm sorry to be so obtuse, but I do not see where in the API to set the reservoir size or hoarding behavior. I checked out http://svn.xiph.org/trunk/vorbis, and am looking at vorbisenc.h. Is that the wrong place to look? Thanks, Jeff Jefferson Stonier Broadcast Devices, LLC -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20050801/da2eba79/attachment.html
Michael Smith
2005-Aug-01 07:12 UTC
[Vorbis-dev] How do you set the encoder bit reservoir size?
On 8/1/05, Jefferson Stonier <jeffstonier@yahoo.com> wrote:> Hi; In the Vorbis 1.1 release notes from July 7, 2004, Monty says > > "The 1.1 libvorbisenc allows setting the fixed reservoir size (in bits, > defaulting to two seconds worth of requested bitrate) and 'hoarding' > behavior (whether the encoder tends to keep the bit reservoir more > full or more empty) as well as the other encoding heuristics available > through the API of 1.0.1." > > I'm sorry to be so obtuse, but I do not see where in the API to set the > reservoir size or hoarding behavior. I checked out > http://svn.xiph.org/trunk/vorbis, and am looking at > vorbisenc.h. Is that the wrong place to look?That's the right place to look, and indeed the neccesary constants, structures, and API calls are defined there, but they're not terribly helpfully documented. You probably want to do something like this: Set up an encoder as normal, using, presumably, vorbis_encode_setup_managed(), then: struct ovectl_ratemanage2_arg ai; vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_GET, &ai); Then change ai.bitrate_limit_reservoir_bias and ai.bitrate_limit_reservoir_bits, then finally set these with: vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_SET, &ai)) Then finalise encoder configuration with vorbis_encode_setup_init(). Patches to improve documentation would be welcomed! Mike