diff options
author | Koen Vos <koen.vos@skype.net> | 2011-10-26 08:03:31 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-26 08:03:31 -0400 |
commit | 7f3caf941e1c3cdcf09491a16c857a0cfc3a8415 (patch) | |
tree | 1bdfa6377cf0861947b978427bc6a4928ec60808 /silk/float/encode_frame_FLP.c | |
parent | 56a3b9534399e5be3d5514dfec787bb6c9ca8bad (diff) | |
download | opus-7f3caf941e1c3cdcf09491a16c857a0cfc3a8415.tar.gz |
Fixes another minor bug introduced in 43a0de4af15
Diffstat (limited to 'silk/float/encode_frame_FLP.c')
-rw-r--r-- | silk/float/encode_frame_FLP.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/silk/float/encode_frame_FLP.c b/silk/float/encode_frame_FLP.c index 635b964b..717b1e0a 100644 --- a/silk/float/encode_frame_FLP.c +++ b/silk/float/encode_frame_FLP.c @@ -201,6 +201,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 */ /*****************************************/ @@ -309,13 +318,6 @@ TOC(ENCODE_PULSES) for( i = 0; i < psEnc->sCmn.nb_subfr; i++ ) { sEncCtrl.Gains[ i ] = pGains_Q16[ i ] / 65536.0f; } - - /* 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; } } |