shithub: opus

Download patch

ref: ab2ab570946e5d15b16491219f23a05446f628c3
parent: 5c8576383b7613dc8ff3d69dd435e56811da82ed
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Fri Mar 1 18:49:29 EST 2024

Fix NaN in Deep PLC

silk_burg_analysis() could return a slightly negative value on zero
input, which would cause a negative, which the log didn't like.

--- a/dnn/burg.c
+++ b/dnn/burg.c
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <assert.h>
 
+#include "arch.h"
 #include "burg.h"
 
 #define MAX_FRAME_SIZE              384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384*/
@@ -241,5 +242,5 @@
     }
 
     /* Return residual energy */
-    return (float)nrg_f;
+    return MAX32(0, (float)nrg_f);
 }
--