Gets rid of unused boost analysis code that never worked anyway.
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 9 Oct 2012 17:43:54 +0000 (13:43 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 9 Oct 2012 17:51:44 +0000 (13:51 -0400)
Also removes the -exp_analysis suffix from opus_get_version_string()
and fixes a "ISO C90 forbids mixed declarations and code" warning.

celt/celt.c
celt/celt.h
src/analysis.c

index 7580fa2..0a212db 100644 (file)
@@ -322,7 +322,7 @@ static int transient_analysis(const opus_val32 * OPUS_RESTRICT in, int len, int
    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_strerror(int error)
 const char *opus_get_version_string(void)
 {
     return "libopus " OPUS_VERSION
-          "-exp_analysis"
 #ifdef FIXED_POINT
           "-fixed"
 #endif
index 4c04ddb..023925c 100644 (file)
@@ -56,8 +56,6 @@ typedef struct {
    opus_val16 tonality_slope;
    opus_val16 noisiness;
    opus_val16 activity;
-   int boost_band[2];
-   opus_val16 boost_amount[2];
    opus_val16 music_prob;
 }AnalysisInfo;
 
index fde6549..70850d4 100644 (file)
@@ -249,8 +249,6 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
        }
     }
     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 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
        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 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info, CELTEnc
     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;