run_analysis() doesn't need to return the frame size anymore
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Sat, 28 Sep 2013 21:22:41 +0000 (17:22 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Sat, 28 Sep 2013 21:22:41 +0000 (17:22 -0400)
src/analysis.c
src/analysis.h
src/opus_encoder.c

index e078b4c..c130e3a 100644 (file)
@@ -618,7 +618,7 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info_out, con
     RESTORE_STACK;
 }
 
-int run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *analysis_pcm,
+void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *analysis_pcm,
                  int analysis_frame_size, int frame_size, int c1, int c2, int C, opus_int32 Fs,
                  int lsb_depth, downmix_func downmix, AnalysisInfo *analysis_info)
 {
@@ -643,6 +643,4 @@ int run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, con
       they're in CELT-only mode. */
    analysis_info->valid = 0;
    tonality_get_info(analysis, analysis_info, frame_size);
-
-   return frame_size;
 }
index a4a22ca..cf37792 100644 (file)
@@ -83,7 +83,7 @@ void tonality_analysis(TonalityAnalysisState *tonal, AnalysisInfo *info,
 
 void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, int len);
 
-int run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *analysis_pcm,
+void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *analysis_pcm,
                  int analysis_frame_size, int frame_size, int c1, int c2, int C, opus_int32 Fs,
                  int lsb_depth, downmix_func downmix, AnalysisInfo *analysis_info);
 
index 6db6d5d..906ca37 100644 (file)
@@ -1016,19 +1016,11 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
     if (analysis_pcm != NULL && st->silk_mode.complexity >= 7 && st->Fs==48000)
 #endif
     {
-       frame_size = run_analysis(&st->analysis, celt_mode, analysis_pcm, analysis_size, frame_size,
+       run_analysis(&st->analysis, celt_mode, analysis_pcm, analysis_size, frame_size,
              c1, c2, analysis_channels, st->Fs,
              lsb_depth, downmix, &analysis_info);
-    } else
-#endif
-    {
-       frame_size = frame_size_select(frame_size, st->variable_duration, st->Fs);
     }
-    if(frame_size<0)
-    {
-       return OPUS_BAD_ARG;
-    }
-
+#endif
 
     st->voice_ratio = -1;