From 79d4f126775743836278818fc810c7e6b89658f9 Mon Sep 17 00:00:00 2001
From: Jan Buethe <jbuethe@amazon.de>
Date: Mon, 24 Oct 2022 11:00:02 +0000
Subject: [PATCH] added api functions for retrieving pointers to statistical
 model parameters

---
 dnn/dred_rdovae.c         | 22 ++++++++++++++++++++++
 dnn/include/dred_rdovae.h |  8 +++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/dnn/dred_rdovae.c b/dnn/dred_rdovae.c
index 74a97ec19..3f6e738c3 100644
--- a/dnn/dred_rdovae.c
+++ b/dnn/dred_rdovae.c
@@ -2,6 +2,7 @@
 
 #include "dred_rdovae_enc.h"
 #include "dred_rdovae_dec.h"
+#include "dred_rdovae_stats_data.h"
 
 size_t DRED_rdovae_get_enc_size()
 {
@@ -54,4 +55,25 @@ void DRED_rdovae_dec_init_states(RDOVAEDec *h, const float * initial_state)
 void DRED_rdovae_decode_qframe(RDOVAEDec *h, float *qframe, const float *z)
 {
     dred_rdovae_decode_qframe(h, qframe, z);
+}
+
+
+const opus_int16 * DRED_rdovae_get_p0_pointer(void)
+{
+    return &dred_p0_q15[0];
+}
+
+const opus_int16 * DRED_rdovae_get_dead_zone_pointer(void)
+{
+    return &dred_dead_zone_q10[0];
+}
+
+const opus_int16 * DRED_rdovae_get_r_pointer(void)
+{
+    return &dred_r_q15[0];
+}
+
+const opus_int16 * DRED_rdovae_get_quant_scales_pointer(void)
+{
+    return &dred_quant_scales_q8[0];
 }
\ No newline at end of file
diff --git a/dnn/include/dred_rdovae.h b/dnn/include/dred_rdovae.h
index 3e781a0d7..a5b5cc0c7 100644
--- a/dnn/include/dred_rdovae.h
+++ b/dnn/include/dred_rdovae.h
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 
+#include "opus_types.h"
 
 typedef struct RDOVAEDecStruct RDOVAEDec;
 typedef struct RDOVAEEncStruct RDOVAEEnc;
@@ -18,4 +19,9 @@ void DRED_rdovae_encode_dframe(RDOVAEEnc *enc_state, float *latents, float *init
 
 void DRED_rdovae_dec_init_states(RDOVAEDec *h, const float * initial_state);
 
-void DRED_rdovae_decode_qframe(RDOVAEDec *h, float *qframe, const float * z);
\ No newline at end of file
+void DRED_rdovae_decode_qframe(RDOVAEDec *h, float *qframe, const float * z);
+
+const opus_int16 * DRED_rdovae_get_p0_pointer(void);
+const opus_int16 * DRED_rdovae_get_dead_zone_pointer(void);
+const opus_int16 * DRED_rdovae_get_r_pointer(void);
+const opus_int16 * DRED_rdovae_get_quant_scales_pointer(void);
-- 
GitLab