From 26c0becdd9c35dd1a52e0202ac5129a524645e04 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin <jmvalin@amazon.com> Date: Wed, 11 Jan 2023 03:58:28 -0500 Subject: [PATCH] Fixes build when ENABLE_NEURAL_FEC is off --- src/opus_decoder.c | 3 ++- src/opus_encoder.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/opus_decoder.c b/src/opus_decoder.c index 670a898d1..555eed28f 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -904,7 +904,6 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...) break; case OPUS_RESET_STATE: { - dred_deinit_decoder(&st->dred_decoder); OPUS_CLEAR((char*)&st->OPUS_DECODER_RESET_START, sizeof(OpusDecoder)- ((char*)&st->OPUS_DECODER_RESET_START - (char*)st)); @@ -1075,6 +1074,7 @@ int opus_decoder_get_nb_samples(const OpusDecoder *dec, int opus_decoder_dred_input(OpusDecoder *st, const unsigned char *data, opus_int32 len, int offset) { +#ifdef ENABLE_NEURAL_FEC const unsigned char *data0; int len0; const unsigned char *payload = NULL; @@ -1128,5 +1128,6 @@ int opus_decoder_dred_input(OpusDecoder *st, const unsigned char *data, lpcnet_plc_fec_clear(silk_dec->sPLC.lpcnet); return st->nb_fec_frames; } +#endif return 0; } diff --git a/src/opus_encoder.c b/src/opus_encoder.c index f05b38292..67200da81 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -1884,10 +1884,12 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ st->silk_bw_switch = 1; } } else { +#ifdef ENABLE_NEURAL_FEC /* If we're not in SILK mode, delete all the processed DRED. TODO: Remove this if/when DRED gets encoded for CELT. */ DREDEnc *dred = &((silk_encoder*)silk_enc)->state_Fxx[0].sCmn.dred_encoder; dred->latents_buffer_fill = 0; +#endif } /* CELT processing */ -- GitLab