diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-20 08:39:41 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-20 08:39:41 +0400 |
commit | 294bfec27b82f879e3c3004d31bb91bcb34014f4 (patch) | |
tree | 94a6332cc1df41ec84b453ef76ee8118b95bfd8f /silk/fixed/process_gains_FIX.c | |
parent | dbf2ea841e5b022f0b6d15a606dd7288f25c35dd (diff) |
Implements hard CBR for SILK
This is achieved by running the encoding process in a loop and
padding when we don't reach the exact rate. It also implements
VBR-with-cap, which means we no longer need to artificially decrease
the SILK bandwidth when it's close to the cap.
Diffstat (limited to 'silk/fixed/process_gains_FIX.c')
-rw-r--r-- | silk/fixed/process_gains_FIX.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/silk/fixed/process_gains_FIX.c b/silk/fixed/process_gains_FIX.c index 25a13a57..c3d5664d 100644 --- a/silk/fixed/process_gains_FIX.c +++ b/silk/fixed/process_gains_FIX.c @@ -86,6 +86,10 @@ void silk_process_gains_FIX( } } + /* Save unquantized gains and gain Index */ + silk_memcpy( psEncCtrl->GainsUnq_Q16, psEncCtrl->Gains_Q16, psEnc->sCmn.nb_subfr * sizeof( opus_int32 ) ); + psEncCtrl->lastGainIndexPrev = psShapeSt->LastGainIndex; + /* Noise shaping quantization */ silk_gains_quant( psEnc->sCmn.indices.GainsIndices, psEncCtrl->Gains_Q16, &psShapeSt->LastGainIndex, condCoding == CODE_CONDITIONALLY, psEnc->sCmn.nb_subfr ); |