Skip to content
Snippets Groups Projects
Unverified Commit ab2ab570 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

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.
parent 5c857638
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include "arch.h"
#include "burg.h" #include "burg.h"
#define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384*/ #define MAX_FRAME_SIZE 384 /* subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384*/
...@@ -241,5 +242,5 @@ float silk_burg_analysis( /* O returns residual energy ...@@ -241,5 +242,5 @@ float silk_burg_analysis( /* O returns residual energy
} }
/* Return residual energy */ /* Return residual energy */
return (float)nrg_f; return MAX32(0, (float)nrg_f);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment