shithub: opus

Download patch

ref: 69f9dea7c5d67f63b0ad602ee0cf46c2bedb5119
parent: 96dec06380a3a9399d138af415ac03fc4d6f8b7e
author: Jean-Marc Valin <[email protected]>
date: Fri Feb 1 18:25:05 EST 2008

couple fixes to Ogg encoder/decoder

--- a/tools/celtdec.c
+++ b/tools/celtdec.c
@@ -264,11 +264,6 @@
    printf ("  (nothing)            Will be played to soundcard\n");
    printf ("\n");  
    printf ("Options:\n");
-   printf (" --enh                 Enable perceptual enhancement (default)\n");
-   printf (" --no-enh              Disable perceptual enhancement\n");
-   printf (" --force-nb            Force decoding in narrowband\n");
-   printf (" --force-wb            Force decoding in wideband\n");
-   printf (" --force-uwb           Force decoding in ultra-wideband\n");
    printf (" --mono                Force decoding in mono\n");
    printf (" --stereo              Force decoding in stereo\n");
    printf (" --rate n              Force decoding at sampling rate n Hz\n");
@@ -276,8 +271,6 @@
    printf (" -V                    Verbose mode (show bit-rate)\n"); 
    printf (" -h, --help            This help\n");
    printf (" -v, --version         Version information\n");
-   printf (" --pf                  Deprecated, use --enh instead\n");
-   printf (" --no-pf               Deprecated, use --no-enh instead\n");
    printf ("\n");
 }
 
--- a/tools/celtenc.c
+++ b/tools/celtenc.c
@@ -210,7 +210,7 @@
    printf ("  -                 stdout\n");
    printf ("\n");  
    printf ("Options:\n");
-   printf (" --bitrate n        Encoding bit-rate (use bit-rate n or lower)\n"); 
+   printf (" --bitrate n        Encoding bit-rate\n"); 
    printf (" --skeleton         Outputs ogg skeleton metadata (may cause incompatibilities)\n");
    printf (" --comment          Add the given string as an extra comment. This may be\n");
    printf ("                     used multiple times\n");
@@ -440,6 +440,10 @@
    }
    celt_mode_info(mode, CELT_GET_FRAME_SIZE, &frame_size);
    
+   if (bitrate>250)
+      bitrate = 150;
+   if (bitrate<40)
+      bitrate = 40;
    bytes_per_packet = (bitrate*1000*frame_size/rate+4)/8;
    
    celt_header_init(&header, rate, 1, mode);