[vorbis] vbr / cbr / abr API calls

Michael Smith msmith at labyrinth.net.au
Sat Aug 3 06:49:52 PDT 2002



At 03:27 PM 8/3/02 +0200, you wrote:
>Michael Smith wrote:
>> vorbis_encode_init_vbr() does all mode initialisation in a single call.
>> vorbis_encode_setup_vbr() only does partial mode setup, allowing you
>> to fine-tune the encoder mode using vorbis_encode_ctl() before calling
>> vorbis_encode_setup_init() to finalise the mode. This is useful for,
>> for example, setting hard min/max on a quality-based mode.
>
>then I need something like this:
>
>
>vorbis_encode_setup_vbr( &vorbisInfo,
>                          getInChannel(),
>                          getOutSampleRate(),
>                          getOutQuality() );
>
>if ( setMaxBitrate ) {
>   struct ovectl_ratemanage_arg ai;
>   vorbis_encode_ctl(&vi, OV_ECTL_RATEMANAGE_GET, &ai);
>   ai.bitrate_hard_max = max_bitrate; // You only care about max, most
>                                      // likely. You can also set min,
>                                      // but it's probably not useful.
>   ai.management_active = 1; // turn management on, so the above takes
>                             // effect.
>   vorbis_encode_ctl(&vorbisInfo, OV_ECTL_RATEMANAGE_SET, &ai);
>}
>
>vorbis_encode_setup_init( &vorbisInfo);
>
>
>Right?

Right. Remember to call vorbis_info_init(&vorbisInfo) before all of that.

Mike

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list