From ebfa29c7e1a435bb6a85a64a317272506359cea2 Mon Sep 17 00:00:00 2001
From: Jean-Marc Valin <jmvalin@amazon.com>
Date: Sat, 13 May 2023 00:56:00 -0400
Subject: [PATCH] Remove opus_dred_init()

---
 include/opus.h      |  2 --
 silk/dred_decoder.c | 15 ---------------
 src/opus_decoder.c  |  6 ------
 3 files changed, 23 deletions(-)

diff --git a/include/opus.h b/include/opus.h
index 58c9f8f3e..e1d0aca2d 100644
--- a/include/opus.h
+++ b/include/opus.h
@@ -516,8 +516,6 @@ OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st);
 
 OPUS_EXPORT int opus_dred_get_size(void);
 
-OPUS_EXPORT int opus_dred_init(OpusDRED *dec);
-
 OPUS_EXPORT OpusDRED *opus_dred_create(int *error);
 
 OPUS_EXPORT void opus_dred_destroy(OpusDRED *dec);
diff --git a/silk/dred_decoder.c b/silk/dred_decoder.c
index ca505bb3a..ec1bef9dd 100644
--- a/silk/dred_decoder.c
+++ b/silk/dred_decoder.c
@@ -37,12 +37,6 @@
 #include "celt/entdec.h"
 
 
-int opus_dred_init(OpusDRED *dec)
-{
-    memset(dec, 0, sizeof(*dec));
-    return OPUS_OK;
-}
-
 int opus_dred_get_size(void)
 {
   return sizeof(OpusDRED);
@@ -50,7 +44,6 @@ int opus_dred_get_size(void)
 
 OpusDRED *opus_dred_create(int *error)
 {
-  int ret;
   OpusDRED *dec;
   dec = (OpusDRED *)opus_alloc(opus_dred_get_size());
   if (dec == NULL)
@@ -59,14 +52,6 @@ OpusDRED *opus_dred_create(int *error)
       *error = OPUS_ALLOC_FAIL;
     return NULL;
   }
-  ret = opus_dred_init(dec);
-  if (error)
-    *error = ret;
-  if (ret != OPUS_OK)
-  {
-    opus_free(dec);
-    dec = NULL;
-  }
   return dec;
 
 }
diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index e5480941c..a47f6118b 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -155,9 +155,6 @@ int opus_decoder_init(OpusDecoder *st, opus_int32 Fs, int channels)
 
    celt_decoder_ctl(celt_dec, CELT_SET_SIGNALLING(0));
 
-#ifdef ENABLE_NEURAL_FEC
-   opus_dred_init(&st->dred_decoder);
-#endif
    st->prev_mode = 0;
    st->frame_size = Fs/400;
    st->arch = opus_select_arch();
@@ -912,9 +909,6 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...)
       silk_InitDecoder( silk_dec );
       st->stream_channels = st->channels;
       st->frame_size = st->Fs/400;
-#ifdef ENABLE_NEURAL_FEC
-      opus_dred_init(&st->dred_decoder);
-#endif
    }
    break;
    case OPUS_GET_SAMPLE_RATE_REQUEST:
-- 
GitLab