Browse Source

Mark input pointer arguments with const.

It indicates that the library is not going to modify input data. This helps
using the library in C++ projects, where const is essential.
keep-around/176be6f49d4b5e342919d44a0989db7094af3642
Andrey Semashev 7 years ago
committed by Johan Pascal
parent
commit
454d2bb5dc
10 changed files with 10 additions and 10 deletions
  1. +1
    -1
      include/bcg729/decoder.h
  2. +1
    -1
      include/bcg729/encoder.h
  3. +1
    -1
      src/cng.c
  4. +1
    -1
      src/cng.h
  5. +1
    -1
      src/decoder.c
  6. +1
    -1
      src/encoder.c
  7. +1
    -1
      src/preProcessing.c
  8. +1
    -1
      src/preProcessing.h
  9. +1
    -1
      src/utils.c
  10. +1
    -1
      src/utils.h

+ 1
- 1
include/bcg729/decoder.h View File

@ -67,5 +67,5 @@ BCG729_VISIBILITY void closeBcg729DecoderChannel(bcg729DecoderChannelContextStru
/* -(o) signal : a decoded frame 80 samples (16 bits PCM) */
/* */
/*****************************************************************************/
BCG729_VISIBILITY void bcg729Decoder(bcg729DecoderChannelContextStruct *decoderChannelContext, uint8_t bitStream[], uint8_t bitStreamLength, uint8_t frameErasureFlag, uint8_t SIDFrameFlag, uint8_t rfc3389PayloadFlag, int16_t signal[]);
BCG729_VISIBILITY void bcg729Decoder(bcg729DecoderChannelContextStruct *decoderChannelContext, const uint8_t bitStream[], uint8_t bitStreamLength, uint8_t frameErasureFlag, uint8_t SIDFrameFlag, uint8_t rfc3389PayloadFlag, int16_t signal[]);
#endif /* ifndef DECODER_H */

+ 1
- 1
include/bcg729/encoder.h View File

@ -65,7 +65,7 @@ BCG729_VISIBILITY void closeBcg729EncoderChannel(bcg729EncoderChannelContextStru
/* if VAD/DTX is enabled */
/* */
/*****************************************************************************/
BCG729_VISIBILITY void bcg729Encoder(bcg729EncoderChannelContextStruct *encoderChannelContext, int16_t inputFrame[], uint8_t bitStream[], uint8_t *bitStreamLength);
BCG729_VISIBILITY void bcg729Encoder(bcg729EncoderChannelContextStruct *encoderChannelContext, const int16_t inputFrame[], uint8_t bitStream[], uint8_t *bitStreamLength);
/*****************************************************************************/
/* bcg729GetRFC3389Payload : return the comfort noise payload according to */


+ 1
- 1
src/cng.c View File

@ -239,7 +239,7 @@ void computeComfortNoiseExcitationVector(word16_t targetGain, uint16_t *randomGe
/* used to compute the current qLSF */
/* */
/*******************************************************************************************/
void decodeSIDframe(bcg729CNGChannelContextStruct *CNGChannelContext, uint8_t previousFrameIsActiveFlag, uint8_t *bitStream, uint8_t bitStreamLength, word16_t *excitationVector, word16_t *previousqLSP, word16_t *LP, uint16_t *pseudoRandomSeed, word16_t previousLCodeWord[MA_MAX_K][NB_LSP_COEFF], uint8_t rfc3389PayloadFlag) {
void decodeSIDframe(bcg729CNGChannelContextStruct *CNGChannelContext, uint8_t previousFrameIsActiveFlag, const uint8_t *bitStream, uint8_t bitStreamLength, word16_t *excitationVector, word16_t *previousqLSP, word16_t *LP, uint16_t *pseudoRandomSeed, word16_t previousLCodeWord[MA_MAX_K][NB_LSP_COEFF], uint8_t rfc3389PayloadFlag) {
int i;
word16_t interpolatedqLSP[NB_LSP_COEFF]; /* interpolated qLSP in Q0.15 */
/* if this is a SID frame, decode received parameters */


+ 1
- 1
src/cng.h View File

@ -50,5 +50,5 @@ void computeComfortNoiseExcitationVector(word16_t targetGain, uint16_t *randomGe
/* -(i) rfc3389PayloadFlag: true when CN payload follow rfc3389 */
/* */
/*******************************************************************************************/
void decodeSIDframe(bcg729CNGChannelContextStruct *CNGChannelContext, uint8_t previousFrameIsActiveFlag, uint8_t *bitStream, uint8_t bitStreamLength, word16_t *excitationVector, word16_t *previousqLSP, word16_t *LP, uint16_t *pseudoRandomSeed, word16_t previousLCodeWord[MA_MAX_K][NB_LSP_COEFF], uint8_t rfc3389PayloadFlag);
void decodeSIDframe(bcg729CNGChannelContextStruct *CNGChannelContext, uint8_t previousFrameIsActiveFlag, const uint8_t *bitStream, uint8_t bitStreamLength, word16_t *excitationVector, word16_t *previousqLSP, word16_t *LP, uint16_t *pseudoRandomSeed, word16_t previousLCodeWord[MA_MAX_K][NB_LSP_COEFF], uint8_t rfc3389PayloadFlag);
#endif /* ifndef CNG_H */

+ 1
- 1
src/decoder.c View File

@ -105,7 +105,7 @@ void closeBcg729DecoderChannel(bcg729DecoderChannelContextStruct *decoderChannel
/* -(o) signal : a decoded frame 80 samples (16 bits PCM) */
/* */
/*****************************************************************************/
void bcg729Decoder(bcg729DecoderChannelContextStruct *decoderChannelContext, uint8_t bitStream[], uint8_t bitStreamLength, uint8_t frameErasureFlag, uint8_t SIDFrameFlag, uint8_t rfc3389PayloadFlag, int16_t signal[])
void bcg729Decoder(bcg729DecoderChannelContextStruct *decoderChannelContext, const uint8_t bitStream[], uint8_t bitStreamLength, uint8_t frameErasureFlag, uint8_t SIDFrameFlag, uint8_t rfc3389PayloadFlag, int16_t signal[])
{
int i;
uint16_t parameters[NB_PARAMETERS];


+ 1
- 1
src/encoder.c View File

@ -112,7 +112,7 @@ void closeBcg729EncoderChannel(bcg729EncoderChannelContextStruct *encoderChannel
/* on 80 bits (10 8bits words) */
/* */
/*****************************************************************************/
void bcg729Encoder(bcg729EncoderChannelContextStruct *encoderChannelContext, int16_t inputFrame[], uint8_t bitStream[], uint8_t *bitStreamLength)
void bcg729Encoder(bcg729EncoderChannelContextStruct *encoderChannelContext, const int16_t inputFrame[], uint8_t bitStream[], uint8_t *bitStreamLength)
{
int i;
uint16_t parameters[NB_PARAMETERS]; /* the output parameters in an array */


+ 1
- 1
src/preProcessing.c View File

@ -63,7 +63,7 @@ void initPreProcessing(bcg729EncoderChannelContextStruct *encoderChannelContext)
/* -(o) preProcessedSignal : 80 values in Q0 */
/* */
/*****************************************************************************/
void preProcessing(bcg729EncoderChannelContextStruct *encoderChannelContext, word16_t signal[], word16_t preProcessedSignal[]) {
void preProcessing(bcg729EncoderChannelContextStruct *encoderChannelContext, const word16_t signal[], word16_t preProcessedSignal[]) {
int i;
word16_t inputX2;
word32_t acc; /* in Q12 */


+ 1
- 1
src/preProcessing.h View File

@ -31,5 +31,5 @@ void initPreProcessing(bcg729EncoderChannelContextStruct *encoderChannelContext)
/* -(o) preProcessedSignal : 80 values in Q0 */
/* */
/*****************************************************************************/
void preProcessing(bcg729EncoderChannelContextStruct *encoderChannelContext, word16_t signal[], word16_t preProcessedSignal[]);
void preProcessing(bcg729EncoderChannelContextStruct *encoderChannelContext, const word16_t signal[], word16_t preProcessedSignal[]);
#endif /* ifndef PREPROCESSING_H */

+ 1
- 1
src/utils.c View File

@ -345,7 +345,7 @@ void CNGparametersArray2BitStream(uint16_t parameters[], uint8_t bitStream[]) {
/* -(o) parameters : 16 values parameters array */
/* */
/*****************************************************************************/
void parametersBitStream2Array(uint8_t bitStream[], uint16_t parameters[])
void parametersBitStream2Array(const uint8_t bitStream[], uint16_t parameters[])
{
parameters[0] = (bitStream[0]>>7)&(uint16_t)0x1;
parameters[1] = bitStream[0]&(uint16_t)0x7f;


+ 1
- 1
src/utils.h View File

@ -210,7 +210,7 @@ void CNGparametersArray2BitStream(uint16_t parameters[], uint8_t bitStream[]);
/* -(o) parameters : 16 values parameters array */
/* */
/*****************************************************************************/
void parametersBitStream2Array(uint8_t bitStream[], uint16_t parameters[]);
void parametersBitStream2Array(const uint8_t bitStream[], uint16_t parameters[]);
/*****************************************************************************/
/* pseudoRandom : generate pseudo random number as in spec 4.4.4 eq96 */


Loading…
Cancel
Save