[vorbis] vbr / cbr / abr API calls

Akos Maroy darkeye at tyrell.hu
Sat Aug 3 06:08:56 PDT 2002



Michael,

Thanks for the detailed explanations.

> No, this is a VBR mode because, after configuring an ABR mode using
> vorbis_encode_setup_managed(), you disable management entirely with
> the call to vorbis_encode_ctl() - the reason for allowing this is so
> that you can get the encoding quality available from fully VBR modes,
> but with a more traditional (and perhaps more intuitive to some users)
> bitrate interface.

I see.

> If you fill out ai to turn management on, and to set nominal and maximum
> bitrates to the right values (as for your call to vorbis_encode_init(),
> then these should be equivalent. 

Great.

> management_active is a boolean (0 for off, 1 for on). I'm not sure what
> the "don't care" value is (it's probably either -1 or 0) - if you don't
> care, then you should just be not setting these (i.e. get ai using
> OV_ECTL_RATEMANAGE_GET, then only change the bits you're interested in.

Oh, OK, much clearer now.

> I didn't say that, see above for what I _was_ saying.

Sorry, it was my misunderstaning.

> For this purpose, the best approach (generally speaking) is to do this:
> vorbis_encode_init(&vi);

well, vorbis_encode_init() looks like:

extern int vorbis_encode_init(vorbis_info *vi,
                   long channels,
                   long rate,

                   long max_bitrate,
                   long nominal_bitrate,
                   long min_bitrate);

where it seems one has to supply bitrate functions as well.

> vorbis_encode_setup_vbr(&vi, ... );

what is the difference between vorbis_encode_setup_vbr() and 
vorbis_encode_init_vbr()?

> 
> Then _optionally_ (for example, my machine doesn't have sufficient cpu
> to do cd-rate audio with management turned on, so I'd prefer to have
> full VBR encoding, even though it's not ideal for some streaming
> purposes - experience shows that it's good enough for most users), do this:
> 
> {
>   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(&vi, OV_ECTL_RATEMANAGE_SET, &ai);
> }
> 
> Finally,
> 
> vorbis_encode_setup_init(&vi);
> 
> will finish mode configuration. 

Great, thanks!

<p>Akos

<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