math: Remove usage of Infinity that leads to undefined beahior using fast-math

This commit is contained in:
Antoine Soulier
2024-06-06 17:21:46 -07:00
committed by Antoine SOULIER
parent ac02cce7c3
commit bb85f7dde4
2 changed files with 3 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
#define __LC3_FASTMATH_H
#include <stdint.h>
#include <float.h>
#include <math.h>

View File

@@ -547,12 +547,12 @@ LC3_HOT static void quantize(const float *scf, int lfcb_idx, int hfcb_idx,
/* --- Determe shape & gain index ---
* Search the Mean Square Error, within (shape, gain) combinations */
float mse_min = INFINITY;
float mse_min = FLT_MAX;
*shape_idx = *gain_idx = 0;
for (int ic = 0; ic < 4; ic++) {
const struct lc3_sns_vq_gains *cgains = lc3_sns_vq_gains + ic;
float cmse_min = INFINITY;
float cmse_min = FLT_MAX;
int cgain_idx = 0;
for (int ig = 0; ig < cgains->count; ig++) {