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

Jean-Marc Valin jm at xiph.org
Fri May 30 23:00:07 PDT 2003



jm          03/05/31 02:00:07

  Modified:    libspeex Tag: rel-1-0-branch bits.c speex_bits.h
               src      Tag: rel-1-0-branch speexdec.c speexenc.c
  Log:
  merged from trunk (speex_bits_insert_terminator)

Revision  Changes    Path
No                   revision

<p>No                   revision

<p>1.27.2.1  +8 -0      speex/libspeex/bits.c

Index: bits.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/bits.c,v
retrieving revision 1.27
retrieving revision 1.27.2.1
diff -u -r1.27 -r1.27.2.1
--- bits.c	18 Mar 2003 06:13:30 -0000	1.27
+++ bits.c	31 May 2003 06:00:07 -0000	1.27.2.1
@@ -342,3 +342,11 @@
 {
    return ((bits->nbBits+7)>>3);
 }
+
+void speex_bits_insert_terminator(SpeexBits *bits)
+{
+   if (bits->bitPtr<7)
+      speex_bits_pack(bits, 0, 1);
+   while (bits->bitPtr<7)
+      speex_bits_pack(bits, 1, 1);
+}

<p><p>1.20.2.1  +7 -0      speex/libspeex/speex_bits.h

Index: speex_bits.h
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/speex_bits.h,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -u -r1.20 -r1.20.2.1
--- speex_bits.h	3 Mar 2003 06:52:41 -0000	1.20
+++ speex_bits.h	31 May 2003 06:00:07 -0000	1.20.2.1
@@ -140,6 +140,13 @@
  */
 int speex_bits_remaining(SpeexBits *bits);
 
+/** Insert a terminator so that the data can be sent as a packet while auto-detecting 
+ * the number of frames in each packet 
+ *
+ * @param bits Bit-stream to operate on
+ */
+void speex_bits_insert_terminator(SpeexBits *bits);
+
 #ifdef __cplusplus
 }
 #endif

<p><p>No                   revision

<p>No                   revision

<p>1.74.2.2  +1 -1      speex/src/speexdec.c

Index: speexdec.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexdec.c,v
retrieving revision 1.74.2.1
retrieving revision 1.74.2.2
diff -u -r1.74.2.1 -r1.74.2.2
--- speexdec.c	7 May 2003 03:09:00 -0000	1.74.2.1
+++ speexdec.c	31 May 2003 06:00:07 -0000	1.74.2.2
@@ -571,7 +571,7 @@
 
                /*Copy Ogg packet to Speex bitstream*/
                speex_bits_read_from(&bits, (char*)op.packet, op.bytes);
-               for (j=0;j<nframes;j++)
+               for (j=0;j!=nframes;j++)
                {
                   int ret;
                   /*Decode frame*/

<p><p>1.76.2.2  +1 -0      speex/src/speexenc.c

Index: speexenc.c
===================================================================
RCS file: /usr/local/cvsroot/speex/src/speexenc.c,v
retrieving revision 1.76.2.1
retrieving revision 1.76.2.2
diff -u -r1.76.2.1 -r1.76.2.2
--- speexenc.c	5 May 2003 03:42:22 -0000	1.76.2.1
+++ speexenc.c	31 May 2003 06:00:07 -0000	1.76.2.2
@@ -672,6 +672,7 @@
 
       if ((id+1)%nframes!=0)
          continue;
+      speex_bits_insert_terminator(&bits);
       nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES);
       speex_bits_reset(&bits);
       op.packet = (unsigned char *)cbits;

<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