[xiph-cvs] cvs commit: vorbis-tools/oggenc audio.c encode.h oggenc.c

Michael Smith msmith at xiph.org
Wed Mar 20 23:37:24 PST 2002



msmith      02/03/20 23:37:23

  Modified:    oggenc   audio.c encode.h oggenc.c
  Log:
  Raw endianness option

Revision  Changes    Path
1.23      +1 -1      vorbis-tools/oggenc/audio.c

Index: audio.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/audio.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- audio.c	2002/01/28 05:38:14	1.22
+++ audio.c	2002/03/21 07:37:21	1.23
@@ -568,7 +568,7 @@
         format.align =       format.bytespersec;
         wav->f =             in;
         wav->samplesread =   0;
-	wav->bigendian =     0;
+	wav->bigendian =     opt->endianness;
         wav->channels =      format.channels;
         wav->samplesize =    opt->samplesize;
     wav->totalsamples =  0;

<p><p>1.17      +2 -0      vorbis-tools/oggenc/encode.h

Index: encode.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/encode.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- encode.h	2002/01/28 06:29:22	1.16
+++ encode.h	2002/03/21 07:37:21	1.17
@@ -57,6 +57,7 @@
         int raw_samplesize;
         int raw_samplerate;
         int raw_channels;
+    int raw_endianness;
 
         char *namefmt;
     char *namefmt_remove;
@@ -92,6 +93,7 @@
         int channels;
         long rate;
         int samplesize;
+    int endianness;
 
         /* Various bitrate/quality options */
     int managed;

<p><p>1.51      +13 -1     vorbis-tools/oggenc/oggenc.c

Index: oggenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/oggenc.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- oggenc.c	2002/02/17 06:36:02	1.50
+++ oggenc.c	2002/03/21 07:37:21	1.51
@@ -47,6 +47,7 @@
         {"raw-bits",1,0,'B'},
         {"raw-chan",1,0,'C'},
         {"raw-rate",1,0,'R'},
+    {"raw-endianness",1,0, 0},
         {"bitrate",1,0,'b'},
         {"min-bitrate",1,0,'m'},
         {"max-bitrate",1,0,'M'},
@@ -71,7 +72,7 @@
 {
         /* Default values */
         oe_options opt = {NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 
-		0, NULL, 0, NULL, 0, 0, 0,16,44100,2, NULL,DEFAULT_NAMEFMT_REMOVE, 
+		0, NULL, 0, NULL, 0, 0, 0,16,44100,2, 0, NULL,DEFAULT_NAMEFMT_REMOVE, 
         DEFAULT_NAMEFMT_REPLACE, NULL, 0, -1,128,-1,0.3,0};
         int i;
 
@@ -181,6 +182,7 @@
                         enc_opts.rate=opt.raw_samplerate;
                         enc_opts.channels=opt.raw_channels;
                         enc_opts.samplesize=opt.raw_samplesize;
+            enc_opts.endianness=opt.raw_endianness;
                         raw_open(in, &enc_opts);
                         foundformat=1;
                 }
@@ -339,6 +341,7 @@
                 " -B, --raw-bits=n     Set bits/sample for raw input. Default is 16\n"
                 " -C, --raw-chan=n     Set number of channels for raw input. Default is 2\n"
                 " -R, --raw-rate=n     Set samples/sec for raw input. Default is 44100\n"
+        " --raw-endianness     1 for bigendian, 0 for little (defaults to 0)\n"
                 " -b, --bitrate        Choose a nominal bitrate to encode at. Attempt\n"
                 "                      to encode at a bitrate averaging this. Takes an\n"
                 "                      argument in kbps.\n"
@@ -517,6 +520,15 @@
                 if(!strcmp(long_options[option_index].name, "managed")) {
                     fprintf(stderr, _("Enabling bitrate management engine\n"));
                     opt->managed = 1;
+                }
+                else if(!strcmp(long_options[option_index].name, 
+                            "raw-endianness")) {
+				    if (opt->rawmode != 1)
+    				{
+	    				opt->rawmode = 1;
+		    			fprintf(stderr, _("WARNING: Raw endianness specified for non-raw data. Assuming input is raw.\n"));
+			    	}
+                    opt->raw_endianness = atoi(optarg);
                 }
                 else {
                                     fprintf(stderr, _("Internal error parsing command line options\n"));

<p><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 '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