Avoiding problems with x87
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 12 Feb 2019 21:13:04 +0000 (16:13 -0500)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 12 Feb 2019 21:13:04 +0000 (16:13 -0500)
logE[b] can end up slightly larger than tonal->highE[b] due to rounding

src/analysis.c

index b192ae4..23f6fa5 100644 (file)
@@ -654,7 +654,7 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt
           tonal->lowE[b] = logE[b];
           tonal->highE[b] = MIN32(tonal->lowE[b]+15, tonal->highE[b]);
        }
-       relativeE += (logE[b]-tonal->lowE[b])/(1e-15f + (tonal->highE[b]-tonal->lowE[b]));
+       relativeE += (logE[b]-tonal->lowE[b])/(1e-5f + (tonal->highE[b]-tonal->lowE[b]));
 
        L1=L2=0;
        for (i=0;i<NB_FRAMES;i++)