shithub: opus

Download patch

ref: 6c3b0658204f3f8f217a3c33e14657dd780c0a73
parent: 0437c4cae303909e0c25babc9e66476af0019d65
author: Jean-Marc Valin <[email protected]>
date: Mon Jul 5 10:35:05 EDT 2010

Fixed some more allocation issue -- there's now a basic codec working

--- a/src/hybrid_encoder.c
+++ b/src/hybrid_encoder.c
@@ -65,7 +65,7 @@
     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 */
@@ -86,6 +86,10 @@
 
 	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 );