diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-02-06 23:48:09 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-03-12 13:19:02 -0400 |
commit | f74ab71ec9c03642bdbb89609b73f396be5e2d89 (patch) | |
tree | 73214f63b758427301fbea4058005a79cdc645fe | |
parent | aa77e946b5c9cdbc15d2e94b4632720027e0e8b7 (diff) | |
download | opus-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.c | 3 |
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; } |