shithub: opus

Download patch

ref: d006b781ca528fa7d9da7b02480846fedd3b82a1
parent: d509e9f2a82ed39465b9ae864c69e4fde70c3042
author: Diego Elio Pettenò <[email protected]>
date: Sun Sep 9 21:48:22 EDT 2012

Mark functions static if they are only used in their own translation unit.

This allows the compiler to perform more optimization on them as it
knows how the functions are being called.

Signed-off-by: Diego Elio Pettenò <[email protected]>

--- a/silk/API.h
+++ b/silk/API.h
@@ -67,14 +67,6 @@
     silk_EncControlStruct           *encStatus          /* O    Encoder Status                                  */
 );
 
-/***************************************/
-/* Read control structure from encoder */
-/***************************************/
-opus_int silk_QueryEncoder(                             /* O    Returns error code                              */
-    const void                      *encState,          /* I    State                                           */
-    silk_EncControlStruct           *encStatus          /* O    Encoder Status                                  */
-);
-
 /**************************/
 /* Encode frame with Silk */
 /**************************/
--- a/silk/control_codec.c
+++ b/silk/control_codec.c
@@ -38,18 +38,18 @@
 #include "tuning_parameters.h"
 #include "pitch_est_defines.h"
 
-opus_int silk_setup_resamplers(
+static opus_int silk_setup_resamplers(
     silk_encoder_state_Fxx          *psEnc,             /* I/O                      */
     opus_int                        fs_kHz              /* I                        */
 );
 
-opus_int silk_setup_fs(
+static opus_int silk_setup_fs(
     silk_encoder_state_Fxx          *psEnc,             /* I/O                      */
     opus_int                        fs_kHz,             /* I                        */
     opus_int                        PacketSize_ms       /* I                        */
 );
 
-opus_int silk_setup_complexity(
+static opus_int silk_setup_complexity(
     silk_encoder_state              *psEncC,            /* I/O                      */
     opus_int                        Complexity          /* I                        */
 );
@@ -131,7 +131,7 @@
     return ret;
 }
 
-opus_int silk_setup_resamplers(
+static opus_int silk_setup_resamplers(
     silk_encoder_state_Fxx          *psEnc,             /* I/O                      */
     opus_int                         fs_kHz              /* I                        */
 )
@@ -186,7 +186,7 @@
     return ret;
 }
 
-opus_int silk_setup_fs(
+static opus_int silk_setup_fs(
     silk_encoder_state_Fxx          *psEnc,             /* I/O                      */
     opus_int                        fs_kHz,             /* I                        */
     opus_int                        PacketSize_ms       /* I                        */
@@ -299,7 +299,7 @@
     return ret;
 }
 
-opus_int silk_setup_complexity(
+static opus_int silk_setup_complexity(
     silk_encoder_state              *psEncC,            /* I/O                      */
     opus_int                        Complexity          /* I                        */
 )
--- a/silk/enc_API.c
+++ b/silk/enc_API.c
@@ -40,6 +40,14 @@
 #include "main_FLP.h"
 #endif
 
+/***************************************/
+/* Read control structure from encoder */
+/***************************************/
+static opus_int silk_QueryEncoder(                      /* O    Returns error code                              */
+    const void                      *encState,          /* I    State                                           */
+    silk_EncControlStruct           *encStatus          /* O    Encoder Status                                  */
+);
+
 /****************************************/
 /* Encoder functions                    */
 /****************************************/
@@ -90,7 +98,7 @@
 /***************************************/
 /* Read control structure from encoder */
 /***************************************/
-opus_int silk_QueryEncoder(                             /* O    Returns error code                              */
+static opus_int silk_QueryEncoder(                      /* O    Returns error code                              */
     const void                      *encState,          /* I    State                                           */
     silk_EncControlStruct           *encStatus          /* O    Encoder Status                                  */
 )
--- a/silk/float/prefilter_FLP.c
+++ b/silk/float/prefilter_FLP.c
@@ -47,7 +47,7 @@
     opus_int                    length              /* I */
 );
 
-void silk_warped_LPC_analysis_filter_FLP(
+static void silk_warped_LPC_analysis_filter_FLP(
           silk_float                 state[],            /* I/O  State [order + 1]                       */
           silk_float                 res[],              /* O    Residual signal [length]                */
     const silk_float                 coef[],             /* I    Coefficients [order]                    */
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -291,7 +291,7 @@
 }
 
 #ifndef FIXED_POINT
-void silk_biquad_float(
+static void silk_biquad_float(
     const opus_val16      *in,            /* I:    Input signal                   */
     const opus_int32      *B_Q28,         /* I:    MA coefficients [3]            */
     const opus_int32      *A_Q28,         /* I:    AR coefficients [2]            */