shithub: opus

Download patch

ref: c871c8de387617799c243d65aaf67a213087c43c
parent: 39710536fc806fdb83a369e0932cbdd5e8973201
author: Jean-Marc Valin <[email protected]>
date: Mon Jun 8 20:57:00 EDT 2009

The 010101 end of stream pattern is no longer needed now that we use the
remaining bits for fine energy

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -902,28 +902,8 @@
       }
    }
 
-   /* Finishing the stream with a 0101... pattern so that the 
-      decoder can check is everything's right */
-   {
-      int val = 0;
-      while (ec_enc_tell(&enc, 0) < nbCompressedBytes*8)
-      {
-         ec_enc_uint(&enc, val, 2);
-         val = 1-val;
-      }
-   }
    ec_enc_done(&enc);
-   {
-      /*unsigned char *data;*/
-      int nbBytes = ec_byte_bytes(&buf);
-      if (nbBytes > nbCompressedBytes)
-      {
-         celt_warning_int ("got too many bytes:", nbBytes);
-         RESTORE_STACK;
-         return CELT_INTERNAL_ERROR;
-      }
-   }
-
+   
    RESTORE_STACK;
    return nbCompressedBytes;
 }
@@ -1438,20 +1418,6 @@
                                 preemph,st->preemph_memD[c]);
          st->preemph_memD[c] = tmp;
          pcm[C*j+c] = SCALEOUT(SIG2WORD16(tmp));
-      }
-   }
-
-   {
-      unsigned int val = 0;
-      while (ec_dec_tell(&dec, 0) < len*8)
-      {
-         if (ec_dec_uint(&dec, 2) != val)
-         {
-            celt_warning("decode error");
-            RESTORE_STACK;
-            return CELT_CORRUPTED_DATA;
-         }
-         val = 1-val;
       }
    }