shithub: opus-tools

Download patch

ref: ceb46c225fd9967cc346c7aede2d4f436ab162c0
parent: c9d0ef50a1283d2a3be9c4572c35884e31308713
author: Gregory Maxwell <greg@xiph.org>
date: Sun Aug 19 12:13:51 EDT 2012

Remove --speech and --music arguments from opusenc.

All these options do is bias the automatic mode selection in libopus,
but it seems that many people believe they select between LP and
MDCT modes, and it's very hard to convince them otherwise. As is they
aren't very useful, and they're creating a lot of confusion which
is distracting people from actually useful testing.

--- a/man/opusenc.1
+++ b/man/opusenc.1
@@ -13,10 +13,6 @@
 ] [
 .B -h
 ] [
-.B --speech
-] [
-.B --music
-] [
 .B --bitrate
 .I kbit/sec
 ] [
@@ -99,6 +95,8 @@
 Optimize for music
 .IP "--bitrate N.nnn"
 Encoding bitrate in kbit/sec (6-256 per channel)
+.br
+Default is 64kbps per mono stream, 96kbps per coupled pair.
 .IP "--vbr"
 Use variable bitrate encoding (default)
 .IP "--cvbr"
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -124,8 +124,6 @@
   printf("  filename.opus     compressed file\n");
   printf("  -                 stdout\n");
   printf("\nEncoding options:\n");
-  printf(" --speech           Optimize for speech\n");
-  printf(" --music            Optimize for music\n");
   printf(" --bitrate n.nnn    Encoding bitrate in kbit/sec (6-256 per channel)\n");
   printf(" --vbr              Use variable bitrate encoding (default)\n");
   printf(" --cvbr             Use constrained variable bitrate encoding\n");
@@ -202,8 +200,6 @@
     {"raw-endianness", required_argument, NULL, 0},
     {"ignorelength", no_argument, NULL, 0},
     {"rate", required_argument, NULL, 0},
-    {"music", no_argument, NULL, 0},
-    {"speech", no_argument, NULL, 0},
     {"version", no_argument, NULL, 0},
     {"version-short", no_argument, NULL, 0},
     {"comment", required_argument, NULL, 0},
@@ -262,7 +258,6 @@
   int                chan=2;
   int                with_hard_cbr=0;
   int                with_cvbr=0;
-  int                signaltype=OPUS_AUTO;
   int                expect_loss=0;
   int                complexity=10;
   int                downmix=0;
@@ -363,10 +358,6 @@
         }else if(strcmp(long_options[option_index].name,"raw-endianness")==0){
           inopt.rawmode=1;
           inopt.endianness=atoi(optarg);
-        }else if(strcmp(long_options[option_index].name,"music")==0){
-          signaltype=OPUS_SIGNAL_MUSIC;
-        }else if(strcmp(long_options[option_index].name,"speech")==0){
-          signaltype=OPUS_SIGNAL_VOICE;
         }else if(strcmp(long_options[option_index].name,"downmix-mono")==0){
           downmix=1;
         }else if(strcmp(long_options[option_index].name,"downmix-stereo")==0){
@@ -576,12 +567,6 @@
      mapping, frame_size<480/(48000/coding_rate)?OPUS_APPLICATION_RESTRICTED_LOWDELAY:OPUS_APPLICATION_AUDIO, &ret);
   if(ret!=OPUS_OK){
     fprintf(stderr, "Error cannot create encoder: %s\n", opus_strerror(ret));
-    exit(1);
-  }
-
-  ret=opus_multistream_encoder_ctl(st, OPUS_SET_SIGNAL(signaltype));
-  if(ret!=OPUS_OK){
-    fprintf(stderr,"Error OPUS_SET_SIGNAL returned: %s\n",opus_strerror(ret));
     exit(1);
   }