[xiph-cvs] cvs commit: speex/src speexenc.c

Jean-Marc Valin jm at xiph.org
Thu Dec 19 09:53:00 PST 2002



jm          02/12/19 12:52:59

  Modified:    src      speexenc.c
  Log:
  Pseudo-DTX in encoder

Revision  Changes    Path
1.64      +8 -0      speex/src/speexenc.c

Index: speexenc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexenc.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- speexenc.c	15 Dec 2002 19:32:21 -0000	1.63
+++ speexenc.c	19 Dec 2002 17:52:59 -0000	1.64
@@ -146,6 +146,7 @@
    printf (" --vbr              Enable variable bit-rate (VBR)\n"); 
    printf (" --abr rate         Enable average bit-rate (ABR) at rate bps\n"); 
    printf (" --vad              Enable voice activity detection (VAD)\n"); 
+   printf (" --dtx              Enable file-based discontinuous transmission (DTX)\n"); 
    printf (" --comp n           Set encoding complexity (0-10), default 3\n"); 
    printf (" --nframes n        Number of frames per Ogg packet (1-10), default 1\n"); 
    printf (" --comment          Add the given string as an extra comment. This may be\n");
@@ -181,6 +182,7 @@
    int vbr_enabled=0;
    int abr_enabled=0;
    int vad_enabled=0;
+   int dtx_enabled=0;
    int nbBytes;
    SpeexMode *mode=NULL;
    void *st;
@@ -194,6 +196,7 @@
       {"vbr", no_argument, NULL, 0},
       {"abr", required_argument, NULL, 0},
       {"vad", no_argument, NULL, 0},
+      {"dtx", no_argument, NULL, 0},
       {"quality", required_argument, NULL, 0},
       {"bitrate", required_argument, NULL, 0},
       {"nframes", required_argument, NULL, 0},
@@ -270,6 +273,9 @@
          } else if (strcmp(long_options[option_index].name,"vad")==0)
          {
             vad_enabled=1;
+         } else if (strcmp(long_options[option_index].name,"dtx")==0)
+         {
+            dtx_enabled=1;
          } else if (strcmp(long_options[option_index].name,"quality")==0)
          {
             quality = atoi (optarg);
@@ -569,6 +575,8 @@
       int tmp;
       tmp=1;
       speex_encoder_ctl(st, SPEEX_SET_VAD, &tmp);
+      if (dtx_enabled)
+         speex_encoder_ctl(st, SPEEX_SET_DTX, &tmp);
    }
    if (abr_enabled)
    {

<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