[xiph-cvs] cvs commit: win32-tools/oggdrop encode.c encode.h encthread.c oggdrop.opt

Chris Wolf cwolf at xiph.org
Thu Jan 3 01:12:14 PST 2002



cwolf       02/01/03 01:12:14

  Modified:    oggdrop  encode.c encode.h encthread.c oggdrop.opt
  Log:
  tie in most of the bitrate selection code (not working yet)

Revision  Changes    Path
1.4       +7 -3      win32-tools/oggdrop/encode.c

Index: encode.c
===================================================================
RCS file: /usr/local/cvsroot/win32-tools/oggdrop/encode.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- encode.c	2001/12/31 04:26:52	1.3
+++ encode.c	2002/01/03 09:12:13	1.4
@@ -47,11 +47,15 @@
 
         /* Have vorbisenc choose a mode for us */
         vorbis_info_init(&vi);
-  /*
-	vorbis_encode_init(&vi, opt->channels, opt->rate, -1, 
+  
+  /* Not yet...
+  if (opt->oeMode == OE_MODE_BITRATE)
+	  vorbis_encode_init(&vi, opt->channels, opt->rate, -1, 
                         opt->bitrate*1000, -1);
+  else
   */
-  vorbis_encode_init_vbr(&vi, opt->channels, opt->rate, opt->quality_coefficient);
+    vorbis_encode_init_vbr(&vi, opt->channels, opt->rate, 
+                                opt->quality_coefficient);
 
         /* Now, set up the analysis engine, stream encoder, and other
            preparation before the encoding begins.

1.4       +10 -0     win32-tools/oggdrop/encode.h

Index: encode.h
===================================================================
RCS file: /usr/local/cvsroot/win32-tools/oggdrop/encode.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- encode.h	2001/12/31 04:26:52	1.3
+++ encode.h	2002/01/03 09:12:13	1.4
@@ -27,6 +27,12 @@
                 long bytes);
 void encode_error(char *errmsg);
 
+typedef enum
+{
+  OE_MODE_QUALITY,
+  OE_MODE_BITRATE
+} OE_MODE;
+
 typedef struct
 {
         char **title;
@@ -49,8 +55,11 @@
         char *outfile;
         int kbps;
   float quality_coefficient;
+  OE_MODE oeMode;
 } oe_options;
 
+
+
 typedef struct
 {
         vorbis_comment *comments;
@@ -68,6 +77,7 @@
         long rate;
         int bitrate;
   float quality_coefficient;
+  OE_MODE oeMode;
 
         FILE *out;
         char *filename;

1.8       +6 -2      win32-tools/oggdrop/encthread.c

Index: encthread.c
===================================================================
RCS file: /usr/local/cvsroot/win32-tools/oggdrop/encthread.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- encthread.c	2001/12/31 04:26:52	1.7
+++ encthread.c	2002/01/03 09:12:13	1.8
@@ -19,7 +19,7 @@
 enclist_t *head = NULL;
 
 oe_options opt = {NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, 
-		0, 0, NULL,NULL, 0, 1.0}; /* Default values */
+		0, 0, NULL,NULL, 0, 1.0, OE_MODE_QUALITY}; /* Default values */
 
 /* Define supported formats here */
 input_format formats[] = {
@@ -108,6 +108,7 @@
 void encthread_setbitrate(int kbps)
 {
         opt.kbps = kbps;
+  opt.oeMode = OE_MODE_BITRATE;
 }
 
 void encthread_setquality(int quality)
@@ -118,6 +119,8 @@
     quality = 100;
 
   opt.quality_coefficient = (float)(((float)quality)/100.0);
+
+  opt.oeMode = OE_MODE_QUALITY;
 }
 
 void _nothing_prog(char *fn, long total, long done, double time)
@@ -226,8 +229,9 @@
                         enc_opts.comments = &vc;
                         enc_opts.filename = out_fn;
 
-			//enc_opts.bitrate = opt.kbps * enc_opts.channels / 2; /* Olaf: Scale to match channel count */
+			enc_opts.bitrate = opt.kbps * enc_opts.channels / 2; /* Olaf: Scale to match channel count */
       enc_opts.quality_coefficient = opt.quality_coefficient;
+      enc_opts.oeMode = opt.oeMode;
 
                         if (!enc_opts.total_samples_per_channel)
                                 enc_opts.progress_update = _nothing_prog;

1.6       +16 -322   win32-tools/oggdrop/oggdrop.opt

Index: oggdrop.opt
===================================================================
RCS file: /usr/local/cvsroot/win32-tools/oggdrop/oggdrop.opt,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
Binary files /tmp/cvs3txjbw and /tmp/cvsibdVzW differ

--- >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 'cvs-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 commits mailing list