Fixed some more allocation issue -- there's now a basic codec working
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Mon, 5 Jul 2010 18:35:05 +0000 (14:35 -0400)
committerJean-Marc Valin <jean-marc.valin@octasic.com>
Mon, 5 Jul 2010 18:35:05 +0000 (14:35 -0400)
celt
src/hybrid_encoder.c

diff --git a/celt b/celt
index bdcaaf7..c7bcf38 160000 (submodule)
--- a/celt
+++ b/celt
@@ -1 +1 @@
-Subproject commit bdcaaf73c62844f7971b946ae19d641e58a8afad
+Subproject commit c7bcf389da1d5537cd66ae552f0dfe164834bd3d
index 7644c7d..85201ad 100644 (file)
@@ -65,7 +65,7 @@ HybridEncoder *hybrid_encoder_create()
     st->encControl.useInBandFEC          = 0;
     st->encControl.useDTX                = 0;
     st->encControl.complexity            = 2;
-    st->encControl.bitRate               = 20000;
+    st->encControl.bitRate               = 18000;
 
     /* Create CELT encoder */
        /* We should not have to create a CELT mode for each encoder state */
@@ -87,6 +87,10 @@ int hybrid_encode(HybridEncoder *st, const short *pcm, int frame_size,
        ec_byte_writeinit_buffer(&buf, data, bytes_per_packet);
        ec_enc_init(&enc,&buf);
 
+    st->encControl.bitRate               = (bytes_per_packet*50*8+4000)/2;
+    if (st->encControl.bitRate>30000)
+       st->encControl.bitRate = 30000;
+
        /* Call SILK encoder for the low band */
        silk_ret = SKP_Silk_SDK_Encode( st->silk_enc, &st->encControl, pcm, 960, &enc, &nBytes );
     if( silk_ret ) {