shithub: opus-tools

Download patch

ref: a067c89c1d8e9ce79e151be7f7804ae32d841bd3
parent: 928caaf62b46f6fcae0a9216d2f7cf3766430b97
author: Mark Harris <mark.hsj@gmail.com>
date: Wed Feb 21 19:38:02 EST 2018

Use consistent formatting of units

--- a/man/opusenc.1
+++ b/man/opusenc.1
@@ -18,7 +18,7 @@
 .B --quiet
 ] [
 .B --bitrate
-.I kbit/sec
+.I kbit/s
 ] [
 .B --vbr
 ] [
@@ -122,13 +122,14 @@
 
 .SS "Encoding options"
 .IP "--bitrate N.nnn"
-Set target bitrate in kbit/sec (6-256 per channel)
+Set target bitrate in kbit/s (6-256 per channel)
 
 In VBR mode this specifies the average rate for a large and diverse
 collection of audio. In CVBR and Hard-CBR mode it specifies the specific
 output bitrate.
 
-Default for >=44.1kHz input is 64kbps per mono stream, 96kbps per coupled pair.
+The default for input with a sample rate of 44.1 kHz or higher is
+64 kbit/s per mono stream and 96 kbit/s per coupled pair.
 .IP "--vbr"
 Use variable bitrate encoding (default)
 In VBR mode the bitrate may go up and down freely depending on the content
@@ -324,7 +325,7 @@
 .RE
 .PP
 
-Produce a very high quality encode with a target rate of 160kbps:
+Produce a very high quality encode with a target rate of 160 kbit/s:
 .RS
 opusenc --bitrate 160 input.wav output.opus
 .RE
--- a/src/info_opus.c
+++ b/src/info_opus.c
@@ -281,7 +281,7 @@
         oi_info(_("\tPre-skip: %d\n"),inf->oh.preskip);
         oi_info(_("\tPlayback gain: %g dB\n"),inf->oh.gain/256.);
         oi_info(_("\tChannels: %d\n"),inf->oh.channels);
-        if(inf->oh.input_sample_rate)oi_info(_("\tOriginal sample rate: %dHz\n"),inf->oh.input_sample_rate);
+        if(inf->oh.input_sample_rate)oi_info(_("\tOriginal sample rate: %d Hz\n"),inf->oh.input_sample_rate);
         if(inf->oh.nb_streams>1)oi_info(_("\tStreams: %d, Coupled: %d\n"),inf->oh.nb_streams,inf->oh.nb_coupled);
         if(inf->oh.channel_mapping>0) {
           oi_info(_("\tChannel Mapping family: %d Map:"),inf->oh.channel_mapping);
@@ -293,7 +293,7 @@
             inf->max_page_duration/48.,inf->total_samples/(double)inf->total_pages/48.,inf->min_page_duration/48.);
         oi_info(_("\tTotal data length: %" PRId64 " bytes (overhead: %0.3g%%)\n"),inf->bytes,(double)inf->overhead_bytes/inf->bytes*100.);
         oi_info(_("\tPlayback length: %ldm:%02ld.%03lds\n"), minutes, seconds, milliseconds);
-        oi_info(_("\tAverage bitrate: %0.4g kb/s, w/o overhead: %.04g kb/s%s\n"),time<=0?0:inf->bytes*8/time/1000.0,
+        oi_info(_("\tAverage bitrate: %0.4g kbit/s, w/o overhead: %.04g kbit/s%s\n"),time<=0?0:inf->bytes*8/time/1000.0,
             time<=0?0:(inf->bytes-inf->overhead_bytes)*8/time/1000.0,
             (inf->min_packet_duration==inf->max_packet_duration)&&(inf->min_packet_bytes==inf->max_packet_bytes)?" (hard-CBR)":"");
     } else {
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -143,7 +143,7 @@
   printf(" --help-picture     Show help on attaching album art\n");
   printf(" --quiet            Enable quiet mode\n");
   printf("\nEncoding options:\n");
-  printf(" --bitrate n.nnn    Set target bitrate in kbit/sec (6-256/channel)\n");
+  printf(" --bitrate n.nnn    Set target bitrate in kbit/s (6-256/channel)\n");
   printf(" --vbr              Use variable bitrate encoding (default)\n");
   printf(" --cvbr             Use constrained variable bitrate encoding\n");
   printf(" --hard-cbr         Use hard constant bitrate encoding\n");
@@ -773,7 +773,7 @@
   }
 
   if(downmix==0&&inopt.channels>2&&bitrate>0&&bitrate<(16000*inopt.channels)){
-    if(!quiet)fprintf(stderr,"Notice: Surround bitrate less than 16kbit/sec/channel, downmixing.\n");
+    if(!quiet)fprintf(stderr,"Notice: Surround bitrate less than 16 kbit/s per channel, downmixing.\n");
     downmix=inopt.channels>8?1:2;
   }
 
@@ -832,7 +832,7 @@
 
   if(bitrate>(1024000*chan)||bitrate<500){
     fatal("Error: bitrate %d bits/sec is insane\n%s"
-      "--bitrate values from 6 to 256 kbit/sec per channel are meaningful.\n",
+      "--bitrate values from 6 to 256 kbit/s per channel are meaningful.\n",
       bitrate, bitrate>=1000000 ? "Did you mistake bits for kilobits?\n" : "");
   }
   bitrate=IMIN(chan*256000,bitrate);
@@ -910,7 +910,7 @@
     else if(opus_app==OPUS_APPLICATION_RESTRICTED_LOWDELAY)fprintf(stderr," (low-delay)\n");
     else fprintf(stderr," (unknown application)\n");
     fprintf(stderr,"-----------------------------------------------------\n");
-    fprintf(stderr,"   Input: %0.6gkHz %d channel%s\n",
+    fprintf(stderr,"   Input: %0.6g kHz, %d channel%s\n",
             rate/1000.,chan,chan<2?"":"s");
     fprintf(stderr,"  Output: %d channel%s (",chan,chan<2?"":"s");
     if(nb_coupled>0)fprintf(stderr,"%d coupled",nb_coupled*2);
@@ -917,7 +917,7 @@
     if(nb_streams-nb_coupled>0)fprintf(stderr,
        "%s%d uncoupled",nb_coupled>0?", ":"",
        nb_streams-nb_coupled);
-    fprintf(stderr,")\n          %0.2gms packets, %0.6gkbit/sec%s\n",
+    fprintf(stderr,")\n          %0.2gms packets, %0.6g kbit/s%s\n",
        frame_size/(48000/1000.), bitrate/1000.,
        with_hard_cbr?" CBR":with_cvbr?" CVBR":" VBR");
     fprintf(stderr," Preskip: %d\n",lookahead);
@@ -990,7 +990,7 @@
         }
         last_spin_len=strlen(sbuf);
         snprintf(sbuf+last_spin_len,54-last_spin_len,
-          "%02d:%02d:%02d.%02d %4.3gx realtime, %5.4gkbit/s",
+          "%02d:%02d:%02d.%02d %4.3gx realtime, %5.4g kbit/s",
           (int)(coded_seconds/3600),(int)(coded_seconds/60)%60,
           (int)(coded_seconds)%60,(int)(coded_seconds*100)%100,
           coded_seconds/(wall_time>0?wall_time:1e-6),
@@ -1029,9 +1029,9 @@
     fprintf(stderr,"         Wrote: %" I64FORMAT " bytes, %" I64FORMAT " packets, "
       "%" I64FORMAT " pages\n",data.bytes_written,data.packets_out,data.pages_out);
     if(data.nb_encoded>0){
-      fprintf(stderr,"       Bitrate: %0.6gkbit/s (without overhead)\n",
+      fprintf(stderr,"       Bitrate: %0.6g kbit/s (without overhead)\n",
               data.total_bytes*8.0/(coded_seconds)/1000.0);
-      fprintf(stderr," Instant rates: %0.6gkbit/s to %0.6gkbit/s\n"
+      fprintf(stderr," Instant rates: %0.6g to %0.6g kbit/s\n"
                      "                (%d to %d bytes per packet)\n",
               data.min_bytes*(8*48000./frame_size/1000.),
               data.peak_bytes*(8*48000./frame_size/1000.),data.min_bytes,data.peak_bytes);