From c31446f49e331ecb9e85190289e57ba21ae195cd Mon Sep 17 00:00:00 2001 From: kwiberg Date: Tue, 30 Aug 2016 05:36:56 -0700 Subject: [PATCH] iLBC: Some const annotations NOTRY=true BUG=chromium:617124 Review-Url: https://codereview.webrtc.org/2293843002 Cr-Commit-Position: refs/heads/master@{#13972} --- .../modules/audio_coding/codecs/ilbc/cb_construct.c | 13 ++++++------- .../modules/audio_coding/codecs/ilbc/cb_construct.h | 12 ++++++------ .../audio_coding/codecs/ilbc/create_augmented_vec.c | 13 +++++++------ .../audio_coding/codecs/ilbc/create_augmented_vec.h | 11 ++++++----- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.c b/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.c index 4c72a6e72f..c19818ee37 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.c +++ b/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.c @@ -27,13 +27,12 @@ *---------------------------------------------------------------*/ bool WebRtcIlbcfix_CbConstruct( - int16_t *decvector, /* (o) Decoded vector */ - int16_t *index, /* (i) Codebook indices */ - int16_t *gain_index, /* (i) Gain quantization indices */ - int16_t *mem, /* (i) Buffer for codevector construction */ - size_t lMem, /* (i) Length of buffer */ - size_t veclen /* (i) Length of vector */ - ){ + int16_t* decvector, /* (o) Decoded vector */ + const int16_t* index, /* (i) Codebook indices */ + const int16_t* gain_index, /* (i) Gain quantization indices */ + int16_t* mem, /* (i) Buffer for codevector construction */ + size_t lMem, /* (i) Length of buffer */ + size_t veclen) { /* (i) Length of vector */ size_t j; int16_t gain[CB_NSTAGES]; /* Stack based */ diff --git a/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.h b/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.h index 45db85e4e3..34c0d1b777 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.h +++ b/webrtc/modules/audio_coding/codecs/ilbc/cb_construct.h @@ -28,12 +28,12 @@ // Returns true on success, false on failure. bool WebRtcIlbcfix_CbConstruct( - int16_t* decvector, /* (o) Decoded vector */ - int16_t* index, /* (i) Codebook indices */ - int16_t* gain_index, /* (i) Gain quantization indices */ - int16_t* mem, /* (i) Buffer for codevector construction */ - size_t lMem, /* (i) Length of buffer */ - size_t veclen /* (i) Length of vector */ + int16_t* decvector, /* (o) Decoded vector */ + const int16_t* index, /* (i) Codebook indices */ + const int16_t* gain_index, /* (i) Gain quantization indices */ + int16_t* mem, /* (i) Buffer for codevector construction */ + size_t lMem, /* (i) Length of buffer */ + size_t veclen /* (i) Length of vector */ ) WARN_UNUSED_RESULT; #endif diff --git a/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.c b/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.c index 5e1c217e26..4dcf49b6e7 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.c +++ b/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.c @@ -26,13 +26,14 @@ *----------------------------------------------------------------*/ void WebRtcIlbcfix_CreateAugmentedVec( - size_t index, /* (i) Index for the augmented vector to be created */ - int16_t *buffer, /* (i) Pointer to the end of the codebook memory that - is used for creation of the augmented codebook */ - int16_t *cbVec /* (o) The constructed codebook vector */ - ) { + size_t index, /* (i) Index for the augmented vector to be + created */ + const int16_t* buffer, /* (i) Pointer to the end of the codebook memory + that is used for creation of the augmented + codebook */ + int16_t* cbVec) { /* (o) The constructed codebook vector */ size_t ilow; - int16_t *ppo, *ppi; + const int16_t *ppo, *ppi; int16_t cbVecTmp[4]; /* Interpolation starts 4 elements before cbVec+index, but must not start outside |cbVec|; clamping interp_len to stay within |cbVec|. diff --git a/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.h b/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.h index 430dfe9b9d..f2582cd532 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.h +++ b/webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.h @@ -27,10 +27,11 @@ *----------------------------------------------------------------*/ void WebRtcIlbcfix_CreateAugmentedVec( - size_t index, /* (i) Index for the augmented vector to be created */ - int16_t *buffer, /* (i) Pointer to the end of the codebook memory that - is used for creation of the augmented codebook */ - int16_t *cbVec /* (o) The construced codebook vector */ - ); + size_t index, /* (i) Index for the augmented vector to be + created */ + const int16_t* buffer, /* (i) Pointer to the end of the codebook memory + that is used for creation of the augmented + codebook */ + int16_t* cbVec); /* (o) The construced codebook vector */ #endif