Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Harris <mark.hsj@gmail.com>2013-10-13 09:12:35 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-10-13 09:16:00 +0400
commit101c8c874e11f5fc0d52319de62af251a6a3fb81 (patch)
tree24ae525ac422fdfe59cab6ad0e24340913d13d57 /src/opus_decoder.c
parent98a8baa4ef9def4358a8678fca7819a344ecee6c (diff)
Fixes PLC for sizes that don't match basic Opus frame sizes.
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Diffstat (limited to 'src/opus_decoder.c')
-rw-r--r--src/opus_decoder.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index 5e39bd44..76f55a80 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -268,7 +268,9 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
return audiosize;
}
- if (mode != MODE_SILK_ONLY && audiosize > F20)
+ /* Avoids trying to run the PLC on sizes other than 2.5 (CELT), 5 (CELT),
+ 10, or 20 (e.g. 12.5 or 30 ms). */
+ if (audiosize > F20)
{
do {
int ret = opus_decode_frame(st, NULL, 0, pcm, IMIN(audiosize, F20), 0);
@@ -282,6 +284,12 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
} while (audiosize > 0);
RESTORE_STACK;
return frame_size;
+ } else if (audiosize < F20)
+ {
+ if (audiosize > F10)
+ audiosize = F10;
+ else if (mode != MODE_SILK_ONLY && audiosize > F5 && audiosize < F10)
+ audiosize = F5;
}
}