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
path: root/silk
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2022-12-07 00:09:39 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-06-16 20:01:21 +0300
commit8623012b30035dae057ef91dc4438f18a2c9801d (patch)
tree93d7391602e058302ac4e35ebe8012d80854bee9 /silk
parent0edb3954e863218f756cc637ecd10eb742b115b6 (diff)
DRED integration work in progress
Diffstat (limited to 'silk')
-rw-r--r--silk/dred_decoder.c6
-rw-r--r--silk/dred_decoder.h2
-rw-r--r--silk/structs.h7
3 files changed, 11 insertions, 4 deletions
diff --git a/silk/dred_decoder.c b/silk/dred_decoder.c
index ee56e9e9..a8e0abbd 100644
--- a/silk/dred_decoder.c
+++ b/silk/dred_decoder.c
@@ -47,7 +47,7 @@ void dred_deinit_decoder(DREDDec *dec)
DRED_rdovae_destroy_decoder(dec->rdovae_dec);
}
-void dred_decode_redundancy_package(DREDDec *dec, float *features, opus_uint8 *bytes, int num_bytes)
+void dred_decode_redundancy_package(DREDDec *dec, float *features, const opus_uint8 *bytes, int num_bytes)
{
const opus_uint16 *p0 = DRED_rdovae_get_p0_pointer();
const opus_uint16 *quant_scales = DRED_rdovae_get_quant_scales_pointer();
@@ -64,7 +64,7 @@ void dred_decode_redundancy_package(DREDDec *dec, float *features, opus_uint8 *b
celt_assert(DRED_NUM_REDUNDANCY_FRAMES % 2 == 0);
/* decode initial state and initialize RDOVAE decoder */
- ec_dec_init(&dec->ec_dec, bytes, num_bytes);
+ ec_dec_init(&dec->ec_dec, (unsigned char*)bytes, num_bytes);
dred_decode_state(&dec->ec_dec, state);
DRED_rdovae_dec_init_states(dec->rdovae_dec, state);
@@ -87,4 +87,4 @@ void dred_decode_redundancy_package(DREDDec *dec, float *features, opus_uint8 *b
features + offset,
latents);
}
-} \ No newline at end of file
+}
diff --git a/silk/dred_decoder.h b/silk/dred_decoder.h
index f2df6fd0..15b5182b 100644
--- a/silk/dred_decoder.h
+++ b/silk/dred_decoder.h
@@ -39,4 +39,4 @@ void init_dred_decoder(DREDDec *dec);
void dred_deinit_decoder(DREDDec *dec);
-void dred_decode_redundancy_package(DREDDec *dec, float *features, opus_uint8 *bytes, int num_bytes);
+void dred_decode_redundancy_package(DREDDec *dec, float *features, const opus_uint8 *bytes, int num_bytes);
diff --git a/silk/structs.h b/silk/structs.h
index 61ede13c..c1b95379 100644
--- a/silk/structs.h
+++ b/silk/structs.h
@@ -38,7 +38,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include "lpcnet.h"
#endif
+#ifdef ENABLE_NEURAL_FEC
#include "dred_encoder.h"
+#include "dred_decoder.h"
+#endif
#ifdef __cplusplus
extern "C"
@@ -258,6 +261,10 @@ typedef struct {
#ifdef NEURAL_PLC
/* FIXME: We should include the state struct directly to preserve the state shadow copy property. */
LPCNetPLCState *lpcnet;
+#ifdef ENABLE_NEURAL_FEC
+ DREDDec dred_decoder;
+ float fec_features[2*DRED_NUM_REDUNDANCY_FRAMES*DRED_NUM_FEATURES];
+#endif
#endif
} silk_PLC_struct;