shithub: opus

Download patch

ref: a4c2512aa4fbd49142e2026ab5cdeacaa1e1e394
parent: f5645f5c72fc214d60c297881d771d27af56c4bf
author: Jean-Marc Valin <[email protected]>
date: Sat Sep 28 13:22:41 EDT 2013

run_analysis() doesn't need to return the frame size anymore

--- a/src/analysis.c
+++ b/src/analysis.c
@@ -618,7 +618,7 @@
     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 @@
       they're in CELT-only mode. */
    analysis_info->valid = 0;
    tonality_get_info(analysis, analysis_info, frame_size);
-
-   return frame_size;
 }
--- a/src/analysis.h
+++ b/src/analysis.h
@@ -83,7 +83,7 @@
 
 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);
 
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1016,19 +1016,11 @@
     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;