Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.c

Issue 2293843002: iLBC: Some const annotations (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 /****************************************************************** 11 /******************************************************************
12 12
13 iLBC Speech Coder ANSI-C Source Code 13 iLBC Speech Coder ANSI-C Source Code
14 14
15 WebRtcIlbcfix_CreateAugmentedVec.c 15 WebRtcIlbcfix_CreateAugmentedVec.c
16 16
17 ******************************************************************/ 17 ******************************************************************/
18 18
19 #include "defines.h" 19 #include "defines.h"
20 #include "constants.h" 20 #include "constants.h"
21 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h" 21 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar y.h"
22 22
23 /*----------------------------------------------------------------* 23 /*----------------------------------------------------------------*
24 * Recreate a specific codebook vector from the augmented part. 24 * Recreate a specific codebook vector from the augmented part.
25 * 25 *
26 *----------------------------------------------------------------*/ 26 *----------------------------------------------------------------*/
27 27
28 void WebRtcIlbcfix_CreateAugmentedVec( 28 void WebRtcIlbcfix_CreateAugmentedVec(
29 size_t index, /* (i) Index for the augmented vector to be created */ 29 size_t index, /* (i) Index for the augmented vector to be
30 int16_t *buffer, /* (i) Pointer to the end of the codebook memory that 30 created */
31 is used for creation of the augmented codebook */ 31 const int16_t* buffer, /* (i) Pointer to the end of the codebook memory
32 int16_t *cbVec /* (o) The constructed codebook vector */ 32 that is used for creation of the augmented
33 ) { 33 codebook */
34 int16_t* cbVec) { /* (o) The constructed codebook vector */
34 size_t ilow; 35 size_t ilow;
35 int16_t *ppo, *ppi; 36 const int16_t *ppo, *ppi;
36 int16_t cbVecTmp[4]; 37 int16_t cbVecTmp[4];
37 /* Interpolation starts 4 elements before cbVec+index, but must not start 38 /* Interpolation starts 4 elements before cbVec+index, but must not start
38 outside |cbVec|; clamping interp_len to stay within |cbVec|. 39 outside |cbVec|; clamping interp_len to stay within |cbVec|.
39 */ 40 */
40 size_t interp_len = WEBRTC_SPL_MIN(index, 4); 41 size_t interp_len = WEBRTC_SPL_MIN(index, 4);
41 42
42 ilow = index - interp_len; 43 ilow = index - interp_len;
43 44
44 /* copy the first noninterpolated part */ 45 /* copy the first noninterpolated part */
45 ppo = buffer-index; 46 ppo = buffer-index;
(...skipping 21 matching lines...) Expand all
67 tempbuff2+SUBL+5. Since ppo=buffer-index, we cannot read any more than 68 tempbuff2+SUBL+5. Since ppo=buffer-index, we cannot read any more than
68 |index| elements from |ppo|. 69 |index| elements from |ppo|.
69 70
70 |cbVec| is declared to be SUBL elements long in WebRtcIlbcfix_CbConstruct. 71 |cbVec| is declared to be SUBL elements long in WebRtcIlbcfix_CbConstruct.
71 Therefore, we can only write SUBL-index elements to cbVec+index. 72 Therefore, we can only write SUBL-index elements to cbVec+index.
72 73
73 These two conditions limit the number of elements to copy. 74 These two conditions limit the number of elements to copy.
74 */ 75 */
75 WEBRTC_SPL_MEMCPY_W16(cbVec+index, ppo, WEBRTC_SPL_MIN(SUBL-index, index)); 76 WEBRTC_SPL_MEMCPY_W16(cbVec+index, ppo, WEBRTC_SPL_MIN(SUBL-index, index));
76 } 77 }
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/ilbc/create_augmented_vec.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698