Missed the encode ctl headers
authorMonty <xiphmont@xiph.org>
Sun, 30 Jun 2002 08:45:03 +0000 (08:45 +0000)
committerMonty <xiphmont@xiph.org>
Sun, 30 Jun 2002 08:45:03 +0000 (08:45 +0000)
svn path=/trunk/vorbis/; revision=3452

examples/encoder_example.c
include/vorbis/vorbisenc.h

index 10d80ea..62daf84 100644 (file)
@@ -11,7 +11,7 @@
  ********************************************************************
 
  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 $
 
  ********************************************************************/
 
@@ -97,8 +97,11 @@ int main(){
   /* (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);
index 9982bd4..ec9ee8c 100644 (file)
@@ -11,7 +11,7 @@
  ********************************************************************
 
  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 $
 
  ********************************************************************/
 
@@ -59,7 +59,24 @@ extern int vorbis_encode_setup_init(vorbis_info *vi);
 
 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
 }