diff options
author | Koen Vos <koen.vos@skype.net> | 2011-10-26 16:03:31 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-26 16:03:31 +0400 |
commit | 7f3caf941e1c3cdcf09491a16c857a0cfc3a8415 (patch) | |
tree | 1bdfa6377cf0861947b978427bc6a4928ec60808 /silk/fixed | |
parent | 56a3b9534399e5be3d5514dfec787bb6c9ca8bad (diff) |
Fixes another minor bug introduced in 43a0de4af15
Diffstat (limited to 'silk/fixed')
-rw-r--r-- | silk/fixed/encode_frame_FIX.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/silk/fixed/encode_frame_FIX.c b/silk/fixed/encode_frame_FIX.c index 34a480c2..1f27131b 100644 --- a/silk/fixed/encode_frame_FIX.c +++ b/silk/fixed/encode_frame_FIX.c @@ -199,6 +199,15 @@ TOC(NSQ) } else if( gainsID == gainsID_upper ) { nBits = nBits_upper; } else { + /* Restore part of the input state */ + if( iter > 0 ) { + silk_memcpy( psRangeEnc, &sRangeEnc_copy, sizeof( ec_enc ) ); + silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy, sizeof( silk_nsq_state ) ); + psEnc->sCmn.indices.Seed = seed_copy; + psEnc->sCmn.ec_prevLagIndex = ec_prevLagIndex_copy; + psEnc->sCmn.ec_prevSignalType = ec_prevSignalType_copy; + } + /*****************************************/ /* Noise shaping quantization */ /*****************************************/ @@ -310,13 +319,6 @@ TOC(ENCODE_PULSES) /* Unique identifier of gains vector */ gainsID = silk_gains_ID( psEnc->sCmn.indices.GainsIndices, psEnc->sCmn.nb_subfr ); - - /* Restore part of the input state */ - silk_memcpy( psRangeEnc, &sRangeEnc_copy, sizeof( ec_enc ) ); - silk_memcpy( &psEnc->sCmn.sNSQ, &sNSQ_copy, sizeof( silk_nsq_state ) ); - psEnc->sCmn.indices.Seed = seed_copy; - psEnc->sCmn.ec_prevLagIndex = ec_prevLagIndex_copy; - psEnc->sCmn.ec_prevSignalType = ec_prevSignalType_copy; } } |