Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-20 08:39:41 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2011-10-20 08:39:41 +0400
commit294bfec27b82f879e3c3004d31bb91bcb34014f4 (patch)
tree94a6332cc1df41ec84b453ef76ee8118b95bfd8f /silk/fixed/process_gains_FIX.c
parentdbf2ea841e5b022f0b6d15a606dd7288f25c35dd (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.c4
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 );