shithub: opus

Download patch

ref: a2a4662f447220dbe8f03e31a78d8509ff29f32d
parent: b7f2a3439c2dc1a39de24bbf104601c508303462
author: Jan Buethe <jbuethe@amazon.de>
date: Tue Oct 25 09:26:43 EDT 2022

addressed compiler warnings

--- a/silk/dred_coding.c
+++ b/silk/dred_coding.c
@@ -32,6 +32,7 @@
 #include "config.h"
 #endif
 
+#include "celt/entenc.h"
 #include "celt/vq.h"
 #include "celt/cwrs.h"
 #include "celt/laplace.h"
@@ -60,7 +61,6 @@
 }
 
 void dred_encode_state(ec_enc *enc, float *x) {
-    int k;
     int iy[PVQ_DIM];
     op_pvq_search_c(x, iy, PVQ_K, PVQ_DIM, 0);
     encode_pvq(iy, PVQ_DIM, PVQ_K, enc);
@@ -69,7 +69,6 @@
 void dred_encode_latents(ec_enc *enc, const float *x, const opus_int16 *scale, const opus_int16 *dzone, const opus_int16 *r, const opus_int16 *p0) {
     int i;
     float eps = .1f;
-    int tell1 = ec_tell(enc);
     for (i=0;i<LATENT_DIM;i++) {
         float delta;
         float xq;
@@ -105,7 +104,6 @@
     int k;
     int iy[PVQ_DIM];
     float norm = 0;
-    int tell1 = ec_tell(dec);
     decode_pvq(iy, PVQ_DIM, PVQ_K, dec);
     /*printf("tell: %d\n", ec_tell(dec)-tell1);*/
     for (k = 0; k < PVQ_DIM; k++)
@@ -123,7 +121,6 @@
 void dred_decode_latents(ec_dec *dec, float *x, const opus_int16 *scale, const opus_int16 *r, const opus_int16 *p0) {
     int i;
     for (i=0;i<LATENT_DIM;i++) {
-        float xq;
         int q;
         q = ec_laplace_decode_p0(dec, p0[i], r[i]);
         x[i] = q*256.f/(scale[i] == 0 ? 1 : scale[i]);
--- a/silk/dred_encoder.c
+++ b/silk/dred_encoder.c
@@ -9,8 +9,8 @@
 
 #include "dred_encoder.h"
 #include "dred_coding.h"
+#include "celt/entenc.h"
 
-
 void init_dred_encoder(DREDEnc* enc)
 {
     memset(enc, 0, sizeof(*enc));
@@ -20,10 +20,10 @@
 
 void dred_encode_silk_frame(DREDEnc *enc, const opus_int16 *silk_frame)
 {
-    opus_int16 *dead_zone       = DRED_rdovae_get_dead_zone_pointer();
-    opus_int16 *p0              = DRED_rdovae_get_p0_pointer();
-    opus_int16 *quant_scales    = DRED_rdovae_get_quant_scales_pointer();
-    opus_int16 *r               = DRED_rdovae_get_r_pointer();
+    const opus_int16 *dead_zone       = DRED_rdovae_get_dead_zone_pointer();
+    const opus_int16 *p0              = DRED_rdovae_get_p0_pointer();
+    const opus_int16 *quant_scales    = DRED_rdovae_get_quant_scales_pointer();
+    const opus_int16 *r               = DRED_rdovae_get_r_pointer();
     
     float input_buffer[2*DRED_NUM_FEATURES] = {0};
 
--