diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2017-06-04 17:45:06 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2017-06-04 17:45:06 -0400 |
commit | 1d7dea17d56be2a4a79725dd3ab7c906e2793c2b (patch) | |
tree | 503c0c2394941a54308c4e055def42071769bb5f /src/analysis.c | |
parent | 55507f19668afe68fbb5d9f4bbbae1fde36df9ce (diff) | |
download | libopus-1d7dea17d56be2a4a79725dd3ab7c906e2793c2b.tar.gz |
Initialize speech/music prob based on application
Diffstat (limited to 'src/analysis.c')
-rw-r--r-- | src/analysis.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/analysis.c b/src/analysis.c index 8f13d93b..75289102 100644 --- a/src/analysis.c +++ b/src/analysis.c @@ -360,8 +360,12 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt offset = 3*offset/2; } - if (tonal->count<4) - tonal->music_prob = .5; + if (tonal->count<4) { + if (tonal->application == OPUS_APPLICATION_VOIP) + tonal->music_prob = .1; + else + tonal->music_prob = .625; + } kfft = celt_mode->mdct.kfft[0]; if (tonal->count==0) tonal->mem_fill = 240; @@ -820,8 +824,11 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt music0 = (float)pow(frame_probs[0], beta); if (tonal->count==1) { - tonal->pspeech[0]=.5; - tonal->pmusic [0]=.5; + if (tonal->application == OPUS_APPLICATION_VOIP) + tonal->pmusic[0] = .1; + else + tonal->pmusic[0] = .625; + tonal->pspeech[0] = 1-tonal->pmusic[0]; } /* Updated probability of having only speech (s0) or only music (m0), before considering the new observation. */ |