********************************************************************
function: simple example encoder
- last mod: $Id: encoder_example.c,v 1.41 2002/06/28 22:19:34 xiphmont Exp $
+ last mod: $Id: encoder_example.c,v 1.42 2002/06/30 08:45:02 xiphmont Exp $
********************************************************************/
/* (quality mode .4: 44kHz stereo coupled, roughly 128kbps VBR) */
vorbis_info_init(&vi);
- //vorbis_encode_init(&vi,2,44100,-1,82000,-1);
- vorbis_encode_init_vbr(&vi,2,44100,.9);
+ vorbis_encode_setup_managed(&vi,2,44100,-1,128000,-1);
+ //vorbis_encode_init(&vi,2,44100,-1,128000,-1);
+ //vorbis_encode_init_vbr(&vi,2,44100,.45);
+ vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE_AVG,NULL);
+ vorbis_encode_setup_init(&vi);
/* add a comment */
vorbis_comment_init(&vc);
********************************************************************
function: vorbis encode-engine setup
- last mod: $Id: vorbisenc.h,v 1.8 2001/12/20 01:00:25 segher Exp $
+ last mod: $Id: vorbisenc.h,v 1.9 2002/06/30 08:45:03 xiphmont Exp $
********************************************************************/
extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
+#define OV_ECTL_RATEMANAGE_GET 0x10
+#define OV_ECTL_RATEMANAGE_SET 0x11
+#define OV_ECTL_RATEMANAGE_AVG 0x12
+#define OV_ECTL_RATEMANAGE_HARD 0x13
+
+struct ovectl_ratemanage_arg {
+ int management_active;
+
+ long bitrate_hard_min;
+ long bitrate_hard_max;
+ double bitrate_hard_window;
+
+ long bitrate_av_lo;
+ long bitrate_av_hi;
+ double bitrate_av_window;
+ double bitrate_av_window_center;
+};
#ifdef __cplusplus
}