summaryrefslogtreecommitdiff
path: root/silk
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2011-10-19 00:20:46 -0400
committerGregory Maxwell <greg@xiph.org>2011-10-19 00:20:46 -0400
commit52de536fed9288b6ecd7d9f2672c07b1c78ea3d2 (patch)
treea67552608f2fd9c158f400de1c6954b2e4257d97 /silk
parent9a0568869600a2e00589ce19f0d5c4bd85b633a4 (diff)
downloadopus-52de536fed9288b6ecd7d9f2672c07b1c78ea3d2.tar.gz
Correct encoder/decoder state mismatch and spurious state resetting in the encoder when side is reset.
Patch from Tim which corrects a glitch during mode switching tests.
Diffstat (limited to 'silk')
-rw-r--r--silk/dec_API.c1
-rw-r--r--silk/enc_API.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/silk/dec_API.c b/silk/dec_API.c
index d979e5be..a5510771 100644
--- a/silk/dec_API.c
+++ b/silk/dec_API.c
@@ -233,6 +233,7 @@ opus_int silk_Decode(
psDec->channel_state[ 1 ].lagPrev = 100;
psDec->channel_state[ 1 ].LastGainIndex = 10;
psDec->channel_state[ 1 ].prevSignalType = TYPE_NO_VOICE_ACTIVITY;
+ psDec->channel_state[ 1 ].first_frame_after_reset = 1;
}
/* Call decoder for one frame */
diff --git a/silk/enc_API.c b/silk/enc_API.c
index 1984a6da..fb4b717e 100644
--- a/silk/enc_API.c
+++ b/silk/enc_API.c
@@ -393,12 +393,12 @@ opus_int silk_Encode(
silk_memset( &psEnc->state_Fxx[ 1 ].sCmn.sNSQ, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.sNSQ ) );
silk_memset( psEnc->state_Fxx[ 1 ].sCmn.prev_NLSFq_Q15, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.prev_NLSFq_Q15 ) );
silk_memset( &psEnc->state_Fxx[ 1 ].sCmn.sLP.In_LP_State, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.sLP.In_LP_State ) );
- silk_memset( &psEnc->state_Fxx[ 1 ].sCmn.inputBuf, 0, sizeof( psEnc->state_Fxx[ 1 ].sCmn.inputBuf ) );
psEnc->state_Fxx[ 1 ].sCmn.prevLag = 100;
psEnc->state_Fxx[ 1 ].sCmn.sNSQ.lagPrev = 100;
psEnc->state_Fxx[ 1 ].sShape.LastGainIndex = 10;
psEnc->state_Fxx[ 1 ].sCmn.prevSignalType = TYPE_NO_VOICE_ACTIVITY;
psEnc->state_Fxx[ 1 ].sCmn.sNSQ.prev_inv_gain_Q16 = 65536;
+ psEnc->state_Fxx[ 1 ].sCmn.first_frame_after_reset = 1;
}
silk_encode_do_VAD_Fxx( &psEnc->state_Fxx[ 1 ] );
} else {