From c871c8de387617799c243d65aaf67a213087c43c Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 9 Jun 2009 00:57:00 -0400 Subject: [PATCH] The 010101 end of stream pattern is no longer needed now that we use the remaining bits for fine energy --- libcelt/celt.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/libcelt/celt.c b/libcelt/celt.c index 5975be59..779a0866 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -902,28 +902,8 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig_t * pcm, celt_si } } - /* 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; } @@ -1441,20 +1421,6 @@ int celt_decode_float(CELTDecoder * restrict st, const unsigned char *data, int } } - { - 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; - } - } - RESTORE_STACK; return 0; /*printf ("\n");*/