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ò <flameeyes@flameeyes.eu>
This commit is contained in:
Diego Elio Pettenò 2012-09-10 01:48:22 -07:00 committed by Jean-Marc Valin
parent d509e9f2a8
commit d006b781ca
5 changed files with 17 additions and 17 deletions

View file

@ -67,14 +67,6 @@ opus_int silk_InitEncoder( /* O Returns error co
silk_EncControlStruct *encStatus /* O Encoder Status */ 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 */ /* Encode frame with Silk */
/**************************/ /**************************/

View file

@ -38,18 +38,18 @@ POSSIBILITY OF SUCH DAMAGE.
#include "tuning_parameters.h" #include "tuning_parameters.h"
#include "pitch_est_defines.h" #include "pitch_est_defines.h"
opus_int silk_setup_resamplers( static opus_int silk_setup_resamplers(
silk_encoder_state_Fxx *psEnc, /* I/O */ silk_encoder_state_Fxx *psEnc, /* I/O */
opus_int fs_kHz /* I */ opus_int fs_kHz /* I */
); );
opus_int silk_setup_fs( static opus_int silk_setup_fs(
silk_encoder_state_Fxx *psEnc, /* I/O */ silk_encoder_state_Fxx *psEnc, /* I/O */
opus_int fs_kHz, /* I */ opus_int fs_kHz, /* I */
opus_int PacketSize_ms /* I */ opus_int PacketSize_ms /* I */
); );
opus_int silk_setup_complexity( static opus_int silk_setup_complexity(
silk_encoder_state *psEncC, /* I/O */ silk_encoder_state *psEncC, /* I/O */
opus_int Complexity /* I */ opus_int Complexity /* I */
); );
@ -131,7 +131,7 @@ opus_int silk_control_encoder(
return ret; return ret;
} }
opus_int silk_setup_resamplers( static opus_int silk_setup_resamplers(
silk_encoder_state_Fxx *psEnc, /* I/O */ silk_encoder_state_Fxx *psEnc, /* I/O */
opus_int fs_kHz /* I */ opus_int fs_kHz /* I */
) )
@ -186,7 +186,7 @@ opus_int silk_setup_resamplers(
return ret; return ret;
} }
opus_int silk_setup_fs( static opus_int silk_setup_fs(
silk_encoder_state_Fxx *psEnc, /* I/O */ silk_encoder_state_Fxx *psEnc, /* I/O */
opus_int fs_kHz, /* I */ opus_int fs_kHz, /* I */
opus_int PacketSize_ms /* I */ opus_int PacketSize_ms /* I */
@ -299,7 +299,7 @@ opus_int silk_setup_fs(
return ret; return ret;
} }
opus_int silk_setup_complexity( static opus_int silk_setup_complexity(
silk_encoder_state *psEncC, /* I/O */ silk_encoder_state *psEncC, /* I/O */
opus_int Complexity /* I */ opus_int Complexity /* I */
) )

View file

@ -40,6 +40,14 @@ POSSIBILITY OF SUCH DAMAGE.
#include "main_FLP.h" #include "main_FLP.h"
#endif #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 */ /* Encoder functions */
/****************************************/ /****************************************/
@ -90,7 +98,7 @@ opus_int silk_InitEncoder( /* O Returns error co
/***************************************/ /***************************************/
/* Read control structure from encoder */ /* 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 */ const void *encState, /* I State */
silk_EncControlStruct *encStatus /* O Encoder Status */ silk_EncControlStruct *encStatus /* O Encoder Status */
) )

View file

@ -47,7 +47,7 @@ static inline void silk_prefilt_FLP(
opus_int length /* I */ 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 state[], /* I/O State [order + 1] */
silk_float res[], /* O Residual signal [length] */ silk_float res[], /* O Residual signal [length] */
const silk_float coef[], /* I Coefficients [order] */ const silk_float coef[], /* I Coefficients [order] */

View file

@ -291,7 +291,7 @@ static unsigned char gen_toc(int mode, int framerate, int bandwidth, int channel
} }
#ifndef FIXED_POINT #ifndef FIXED_POINT
void silk_biquad_float( static void silk_biquad_float(
const opus_val16 *in, /* I: Input signal */ const opus_val16 *in, /* I: Input signal */
const opus_int32 *B_Q28, /* I: MA coefficients [3] */ const opus_int32 *B_Q28, /* I: MA coefficients [3] */
const opus_int32 *A_Q28, /* I: AR coefficients [2] */ const opus_int32 *A_Q28, /* I: AR coefficients [2] */