diff options
author | Timothy B. Terriberry <tterribe@xiph.org> | 2011-10-15 03:14:36 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-18 00:03:41 +0400 |
commit | 1e03a6eb0472cc78e33541af11733f4f27ed3219 (patch) | |
tree | 55e7478f507e7d803ae1ba577d65bc935015e5b4 /silk/fixed/encode_frame_FIX.c | |
parent | 53cc1a033a3183c9d137b03446db58d2e58c0e0a (diff) |
Fix side-channel index for VAD/LBRR flags.
Neither the encoder nor decoder were incrementing the side-channel
index for a mid-only frame.
Unfortunately, they used that index to index the VAD flags and LBRR
flags.
This made the VAD flags for the side channel particularly useless,
as you couldn't tell which frame a flag belonged to without
decoding most of the packet.
It also desynched the LBRR information, as look at the wrong LBRR
flags to decide when it had to code a mid-only flag.
If some frames were skipped in the side channel, then the last few
VAD flags and LBRR flags would be garbage, but still get encoded.
This patch fixes this by continuing to increment nFramesDecoded or
nFramesEncoded, even when skipping a frame in the side channel.
This makes the side-channel VAD and LBRR flags correspond to the
correct time periods for frames greater than 20 ms.
It also fixes a bug where if DTX was not used on the packet where
the side channel got turned off, it would never get used again
until the encoder attempted to encode something in the side
channel again.
Diffstat (limited to 'silk/fixed/encode_frame_FIX.c')
-rw-r--r-- | silk/fixed/encode_frame_FIX.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/silk/fixed/encode_frame_FIX.c b/silk/fixed/encode_frame_FIX.c index c3da9bcf..8899c267 100644 --- a/silk/fixed/encode_frame_FIX.c +++ b/silk/fixed/encode_frame_FIX.c @@ -69,9 +69,6 @@ TOC(VAD) /**************************************************/ /* Convert speech activity into VAD and DTX flags */ /**************************************************/ - if( psEnc->sCmn.nFramesEncoded == 0 ) { - psEnc->sCmn.inDTX = psEnc->sCmn.useDTX; - } if( psEnc->sCmn.speech_activity_Q8 < SILK_FIX_CONST( SPEECH_ACTIVITY_DTX_THRES, 8 ) ) { psEnc->sCmn.indices.signalType = TYPE_NO_VOICE_ACTIVITY; psEnc->sCmn.noSpeechCounter++; |