shithub: opus

Download patch

ref: 0e490591b7af4208df68b33af853216393a1a5c1
parent: 7315b35e13a3a7c504ed6b1fe2d28ad500eb2701
author: Jean-Marc Valin <[email protected]>
date: Tue Oct 9 09:43:54 EDT 2012

Gets rid of unused boost analysis code that never worked anyway.

Also removes the -exp_analysis suffix from opus_get_version_string()
and fixes a "ISO C90 forbids mixed declarations and code" warning.

--- a/celt/celt.c
+++ b/celt/celt.c
@@ -322,7 +322,7 @@
    opus_val16 follower;
    int metric=0;
    int fmetric=0, bmetric=0;
-   int count1, count2, count3, count4, count5;;
+   int count1, count2, count3, count4, count5;
 
    SAVE_STACK;
    ALLOC(tmp, len, opus_val16);
@@ -3180,7 +3180,6 @@
 const char *opus_get_version_string(void)
 {
     return "libopus " OPUS_VERSION
-          "-exp_analysis"
 #ifdef FIXED_POINT
           "-fixed"
 #endif
--- a/celt/celt.h
+++ b/celt/celt.h
@@ -56,8 +56,6 @@
    opus_val16 tonality_slope;
    opus_val16 noisiness;
    opus_val16 activity;
-   int boost_band[2];
-   opus_val16 boost_amount[2];
    opus_val16 music_prob;
 }AnalysisInfo;
 
--- a/src/analysis.c
+++ b/src/analysis.c
@@ -249,8 +249,6 @@
        }
     }
     relativeE = 0;
-    info->boost_amount[0]=info->boost_amount[1]=0;
-    info->boost_band[0]=info->boost_band[1]=0;
     frame_loudness = 0;
     bandwidth_mask = 0;
     for (b=0;b<NB_TBANDS;b++)
@@ -316,19 +314,6 @@
        max_frame_tonality = MAX16(max_frame_tonality, (1+.03*(b-NB_TBANDS))*frame_tonality);
        slope += band_tonality[b]*(b-8);
        /*printf("%f %f ", band_tonality[b], stationarity);*/
-       if (band_tonality[b] > info->boost_amount[1] && b>=7 && b < NB_TBANDS-1)
-       {
-          if (band_tonality[b] > info->boost_amount[0])
-          {
-             info->boost_amount[1] = info->boost_amount[0];
-             info->boost_band[1] = info->boost_band[0];
-             info->boost_amount[0] = band_tonality[b];
-             info->boost_band[0] = b;
-          } else {
-             info->boost_amount[1] = band_tonality[b];
-             info->boost_band[1] = b;
-          }
-       }
        tonal->prev_band_tonality[b] = band_tonality[b];
     }
 
@@ -359,14 +344,6 @@
     frame_tonality = (max_frame_tonality/(NB_TBANDS-NB_TONAL_SKIP_BANDS));
     frame_tonality = MAX16(frame_tonality, tonal->prev_tonality*.8);
     tonal->prev_tonality = frame_tonality;
-    info->boost_amount[0] -= frame_tonality+.2;
-    info->boost_amount[1] -= frame_tonality+.2;
-    if (band_tonality[info->boost_band[0]] < band_tonality[info->boost_band[0]+1]+.15
-        || band_tonality[info->boost_band[0]] < band_tonality[info->boost_band[0]-1]+.15)
-       info->boost_amount[0]=0;
-    if (band_tonality[info->boost_band[1]] < band_tonality[info->boost_band[1]+1]+.15
-        || band_tonality[info->boost_band[1]] < band_tonality[info->boost_band[1]-1]+.15)
-       info->boost_amount[1]=0;
 
     slope /= 8*8;
     info->tonality_slope = slope;