Simplifying PLC switching to have an overlap of 2.5 ms too
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Fri, 18 Mar 2011 20:41:40 +0000 (16:41 -0400)
committerJean-Marc Valin <jean-marc.valin@octasic.com>
Fri, 18 Mar 2011 20:42:42 +0000 (16:42 -0400)
src/opus_decoder.c

index b18ef3c..8057ffe 100644 (file)
@@ -298,13 +298,10 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
     }
     if (transition)
     {
-       int plc_length, overlap;
-       plc_length = IMIN(audiosize, 10+F2_5);
-       for (i=0;i<plc_length;i++)
+       for (i=0;i<F2_5;i++)
                pcm[i] = pcm_transition[i];
-
-       overlap = IMIN(F2_5, IMAX(0, audiosize-plc_length));
-       smooth_fade(pcm_transition+plc_length, pcm+plc_length, pcm+plc_length, overlap, st->channels);
+       if (audiosize >= F5)
+           smooth_fade(pcm_transition+F2_5, pcm+F2_5, pcm+F2_5, F2_5, st->channels);
     }
 #if OPUS_TEST_RANGE_CODER_STATE
     st->rangeFinal = dec.rng;