diff options
author | Koen Vos <koen.vos@skype.net> | 2011-10-24 09:10:58 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-24 09:10:58 -0400 |
commit | 43a0de4af15b6cf61938d5c442e3b689773d085b (patch) | |
tree | 3e35faaa84a93d1f2f752a6fe34ed2b1ec2a4d30 /silk/gain_quant.c | |
parent | 3b2aee062d08fc72f12a4379ce2d6e2b444d5021 (diff) | |
download | opus-43a0de4af15b6cf61938d5c442e3b689773d085b.tar.gz |
Optimization of the CBR loop
Also some comment/warning fixes
Diffstat (limited to 'silk/gain_quant.c')
-rw-r--r-- | silk/gain_quant.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/silk/gain_quant.c b/silk/gain_quant.c index 9b52a32e..189f5fdd 100644 --- a/silk/gain_quant.c +++ b/silk/gain_quant.c @@ -121,3 +121,20 @@ void silk_gains_dequant( gain_Q16[ k ] = silk_log2lin( silk_min_32( silk_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3967 = 31 in Q7 */ } } + +/* Compute unique identifier of gain indices vector */ +opus_int32 silk_gains_ID( /* O returns unique identifier of gains */ + const opus_int8 ind[ MAX_NB_SUBFR ], /* I gain indices */ + const opus_int nb_subfr /* I number of subframes */ +) +{ + opus_int k; + opus_int32 gainsID; + + gainsID = 0; + for( k = 0; k < nb_subfr; k++ ) { + gainsID = silk_ADD_LSHIFT32( ind[ k ], gainsID, 8 ); + } + + return gainsID; +} |