OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include <string.h> | 35 #include <string.h> |
36 | 36 |
37 static const uint16_t kLpcVecPerSegmentUb12 = 5; | 37 static const uint16_t kLpcVecPerSegmentUb12 = 5; |
38 static const uint16_t kLpcVecPerSegmentUb16 = 4; | 38 static const uint16_t kLpcVecPerSegmentUb16 = 4; |
39 | 39 |
40 /* CDF array for encoder bandwidth (12 vs 16 kHz) indicator. */ | 40 /* CDF array for encoder bandwidth (12 vs 16 kHz) indicator. */ |
41 static const uint16_t kOneBitEqualProbCdf[3] = { | 41 static const uint16_t kOneBitEqualProbCdf[3] = { |
42 0, 32768, 65535 }; | 42 0, 32768, 65535 }; |
43 | 43 |
44 /* Pointer to cdf array for encoder bandwidth (12 vs 16 kHz) indicator. */ | 44 /* Pointer to cdf array for encoder bandwidth (12 vs 16 kHz) indicator. */ |
45 static const uint16_t* kOneBitEqualProbCdf_ptr[1] = { | 45 static const uint16_t* const kOneBitEqualProbCdf_ptr[1] = { |
46 kOneBitEqualProbCdf }; | 46 kOneBitEqualProbCdf }; |
47 | 47 |
48 /* | 48 /* |
49 * Initial cdf index for decoder of encoded bandwidth | 49 * Initial cdf index for decoder of encoded bandwidth |
50 * (12 vs 16 kHz) indicator. | 50 * (12 vs 16 kHz) indicator. |
51 */ | 51 */ |
52 static const uint16_t kOneBitEqualProbInitIndex[1] = { 1 }; | 52 static const uint16_t kOneBitEqualProbInitIndex[1] = { 1 }; |
53 | 53 |
54 | 54 |
55 static const int kIsSWB12 = 1; | 55 static const int kIsSWB12 = 1; |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1836 return status; | 1836 return status; |
1837 } | 1837 } |
1838 | 1838 |
1839 /* cdf array for estimated bandwidth */ | 1839 /* cdf array for estimated bandwidth */ |
1840 static const uint16_t kBwCdf[25] = { | 1840 static const uint16_t kBwCdf[25] = { |
1841 0, 2731, 5461, 8192, 10923, 13653, 16384, 19114, 21845, 24576, 27306, 30037, | 1841 0, 2731, 5461, 8192, 10923, 13653, 16384, 19114, 21845, 24576, 27306, 30037, |
1842 32768, 35498, 38229, 40959, 43690, 46421, 49151, 51882, 54613, 57343, 60074, | 1842 32768, 35498, 38229, 40959, 43690, 46421, 49151, 51882, 54613, 57343, 60074, |
1843 62804, 65535 }; | 1843 62804, 65535 }; |
1844 | 1844 |
1845 /* pointer to cdf array for estimated bandwidth */ | 1845 /* pointer to cdf array for estimated bandwidth */ |
1846 static const uint16_t* kBwCdfPtr[1] = { kBwCdf }; | 1846 static const uint16_t* const kBwCdfPtr[1] = { kBwCdf }; |
1847 | 1847 |
1848 /* initial cdf index for decoder of estimated bandwidth*/ | 1848 /* initial cdf index for decoder of estimated bandwidth*/ |
1849 static const uint16_t kBwInitIndex[1] = { 7 }; | 1849 static const uint16_t kBwInitIndex[1] = { 7 }; |
1850 | 1850 |
1851 | 1851 |
1852 int WebRtcIsac_DecodeSendBW(Bitstr* streamdata, int16_t* BWno) { | 1852 int WebRtcIsac_DecodeSendBW(Bitstr* streamdata, int16_t* BWno) { |
1853 int BWno32, err; | 1853 int BWno32, err; |
1854 | 1854 |
1855 /* entropy decoding of sender's BW estimation [0..23] */ | 1855 /* entropy decoding of sender's BW estimation [0..23] */ |
1856 err = WebRtcIsac_DecHistOneStepMulti(&BWno32, streamdata, kBwCdfPtr, | 1856 err = WebRtcIsac_DecHistOneStepMulti(&BWno32, streamdata, kBwCdfPtr, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2057 /* Use the same CDF table as for bandwidth | 2057 /* Use the same CDF table as for bandwidth |
2058 * both take two values with equal probability. */ | 2058 * both take two values with equal probability. */ |
2059 if (WebRtcIsac_DecHistOneStepMulti(&intVar, streamData, | 2059 if (WebRtcIsac_DecHistOneStepMulti(&intVar, streamData, |
2060 kOneBitEqualProbCdf_ptr, | 2060 kOneBitEqualProbCdf_ptr, |
2061 kOneBitEqualProbInitIndex, 1) < 0) { | 2061 kOneBitEqualProbInitIndex, 1) < 0) { |
2062 return -ISAC_RANGE_ERROR_DECODE_BANDWITH; | 2062 return -ISAC_RANGE_ERROR_DECODE_BANDWITH; |
2063 } | 2063 } |
2064 *jitterInfo = (int16_t)(intVar); | 2064 *jitterInfo = (int16_t)(intVar); |
2065 return 0; | 2065 return 0; |
2066 } | 2066 } |
OLD | NEW |