diff options
author | Jean-Marc Valin <jean-marc.valin@octasic.com> | 2010-07-05 22:35:05 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@octasic.com> | 2010-07-05 22:35:05 +0400 |
commit | 6c3b0658204f3f8f217a3c33e14657dd780c0a73 (patch) | |
tree | da4968ec26dc03a19a042bc85b8af8703e73ebad /src | |
parent | 0437c4cae303909e0c25babc9e66476af0019d65 (diff) |
Fixed some more allocation issue -- there's now a basic codec working
Diffstat (limited to 'src')
-rw-r--r-- | src/hybrid_encoder.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/hybrid_encoder.c b/src/hybrid_encoder.c index 7644c7d4..85201ade 100644 --- a/src/hybrid_encoder.c +++ b/src/hybrid_encoder.c @@ -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 ) { |