diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-01-05 22:35:39 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-01-05 23:28:02 +0100 |
commit | 9845bdde8dc3005185dc43c493380858d717596a (patch) | |
tree | 82f7c4e18ded15007934203cef5e77c761997a3e /thirdparty/opus/analysis.c | |
parent | 2ca0337f5f8564b62920087d898f8f4a580d7b3b (diff) | |
download | redot-engine-9845bdde8dc3005185dc43c493380858d717596a.tar.gz |
opus: Update to upstream libopus 1.1.3
Diffstat (limited to 'thirdparty/opus/analysis.c')
-rw-r--r-- | thirdparty/opus/analysis.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/thirdparty/opus/analysis.c b/thirdparty/opus/analysis.c index 360ebcc8dd..663431a436 100644 --- a/thirdparty/opus/analysis.c +++ b/thirdparty/opus/analysis.c @@ -540,17 +540,14 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt /* Instantaneous probability of speech and music, with beta pre-applied. */ float speech0; float music0; + float p, q; /* One transition every 3 minutes of active audio */ tau = .00005f*frame_probs[1]; - beta = .05f; - if (1) { - /* Adapt beta based on how "unexpected" the new prob is */ - float p, q; - p = MAX16(.05f,MIN16(.95f,frame_probs[0])); - q = MAX16(.05f,MIN16(.95f,tonal->music_prob)); - beta = .01f+.05f*ABS16(p-q)/(p*(1-q)+q*(1-p)); - } + /* Adapt beta based on how "unexpected" the new prob is */ + p = MAX16(.05f,MIN16(.95f,frame_probs[0])); + q = MAX16(.05f,MIN16(.95f,tonal->music_prob)); + beta = .01f+.05f*ABS16(p-q)/(p*(1-q)+q*(1-p)); /* p0 and p1 are the probabilities of speech and music at this frame using only information from previous frame and applying the state transition model */ |