summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-02-06 23:48:09 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-03-12 13:19:02 -0400
commitf74ab71ec9c03642bdbb89609b73f396be5e2d89 (patch)
tree73214f63b758427301fbea4058005a79cdc645fe
parentaa77e946b5c9cdbc15d2e94b4632720027e0e8b7 (diff)
downloadopus-ietf-draft.tar.gz
Fixes a minor CELT->SILK switching glitch in the decoderietf-draft
By not reinitializing the stereo state during a switch, the old stereo memory would create a false impulse (i.e. single sample) in the decoded audio. This change affects the normative part of the decoder. Fortunately, the modified decoder is still compliant with the specification because it still easily passes the testvectors. For example, for the float decoder at 48 kHz, the opus_compare (arbitrary) "quality score" changes from from 99.9333% to 99.925%.
-rw-r--r--silk/dec_API.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/silk/dec_API.c b/silk/dec_API.c
index efd79183..21bb7e0c 100644
--- a/silk/dec_API.c
+++ b/silk/dec_API.c
@@ -72,6 +72,9 @@ opus_int silk_InitDecoder( /* O Returns error co
for( n = 0; n < DECODER_NUM_CHANNELS; n++ ) {
ret = silk_init_decoder( &channel_state[ n ] );
}
+ silk_memset(&((silk_decoder *)decState)->sStereo, 0, sizeof(((silk_decoder *)decState)->sStereo));
+ /* Not strictly needed, but it's cleaner that way */
+ ((silk_decoder *)decState)->prev_decode_only_middle = 0;
return ret;
}