diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2022-12-07 09:43:29 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-06-16 20:01:22 +0300 |
commit | c4cb071f7512b00b940524c785f92c4545ed91d2 (patch) | |
tree | bc0ea4428847cc096ad53a4c49fae87eb4499fe0 /src/opus_decoder.c | |
parent | 634defacdca0e5b701ae3967154248fa886734b4 (diff) |
DRED: Decode variable number of frames
Diffstat (limited to 'src/opus_decoder.c')
-rw-r--r-- | src/opus_decoder.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/opus_decoder.c b/src/opus_decoder.c index ac308754..c7ae597a 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -1090,11 +1090,13 @@ int opus_decoder_dred_input(OpusDecoder *st, const unsigned char *data, } if (payload != NULL) { + int max_fec_frames; silk_decoder_state *silk_dec; silk_dec = (silk_decoder_state*)((char*)st+st->silk_dec_offset); /*printf("Found: %p of size %d\n", payload, payload_len);*/ - dred_decode_redundancy_package(&silk_dec->sPLC.dred_decoder, silk_dec->sPLC.fec_features, payload, payload_len); - /* Found something -- do the decoding. */ + max_fec_frames = IMIN(2 + offset, 2*DRED_NUM_REDUNDANCY_FRAMES); + silk_dec->sPLC.nb_fec_frames = dred_decode_redundancy_package(&silk_dec->sPLC.dred_decoder, silk_dec->sPLC.fec_features, payload, payload_len, max_fec_frames); + /*printf("%d\n", silk_dec->sPLC.nb_fec_frames);*/ return 1; } return 0; |