michael@0: /*********************************************************************** michael@0: Copyright (c) 2006-2011, Skype Limited. All rights reserved. michael@0: Redistribution and use in source and binary forms, with or without michael@0: modification, are permitted provided that the following conditions michael@0: are met: michael@0: - Redistributions of source code must retain the above copyright notice, michael@0: this list of conditions and the following disclaimer. michael@0: - Redistributions in binary form must reproduce the above copyright michael@0: notice, this list of conditions and the following disclaimer in the michael@0: documentation and/or other materials provided with the distribution. michael@0: - Neither the name of Internet Society, IETF or IETF Trust, nor the michael@0: names of specific contributors, may be used to endorse or promote michael@0: products derived from this software without specific prior written michael@0: permission. michael@0: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" michael@0: AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE michael@0: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE michael@0: ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE michael@0: LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR michael@0: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF michael@0: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS michael@0: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN michael@0: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) michael@0: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE michael@0: POSSIBILITY OF SUCH DAMAGE. michael@0: ***********************************************************************/ michael@0: michael@0: #ifdef HAVE_CONFIG_H michael@0: #include "config.h" michael@0: #endif michael@0: michael@0: #include "tables.h" michael@0: michael@0: const opus_uint8 silk_LTP_per_index_iCDF[3] = { michael@0: 179, 99, 0 michael@0: }; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_iCDF_0[8] = { michael@0: 71, 56, 43, 30, 21, 12, 6, 0 michael@0: }; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_iCDF_1[16] = { michael@0: 199, 165, 144, 124, 109, 96, 84, 71, michael@0: 61, 51, 42, 32, 23, 15, 8, 0 michael@0: }; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_iCDF_2[32] = { michael@0: 241, 225, 211, 199, 187, 175, 164, 153, michael@0: 142, 132, 123, 114, 105, 96, 88, 80, michael@0: 72, 64, 57, 50, 44, 38, 33, 29, michael@0: 24, 20, 16, 12, 9, 5, 2, 0 michael@0: }; michael@0: michael@0: const opus_int16 silk_LTP_gain_middle_avg_RD_Q14 = 12304; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_BITS_Q5_0[8] = { michael@0: 15, 131, 138, 138, 155, 155, 173, 173 michael@0: }; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_BITS_Q5_1[16] = { michael@0: 69, 93, 115, 118, 131, 138, 141, 138, michael@0: 150, 150, 155, 150, 155, 160, 166, 160 michael@0: }; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_BITS_Q5_2[32] = { michael@0: 131, 128, 134, 141, 141, 141, 145, 145, michael@0: 145, 150, 155, 155, 155, 155, 160, 160, michael@0: 160, 160, 166, 166, 173, 173, 182, 192, michael@0: 182, 192, 192, 192, 205, 192, 205, 224 michael@0: }; michael@0: michael@0: const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[NB_LTP_CBKS] = { michael@0: silk_LTP_gain_iCDF_0, michael@0: silk_LTP_gain_iCDF_1, michael@0: silk_LTP_gain_iCDF_2 michael@0: }; michael@0: michael@0: const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[NB_LTP_CBKS] = { michael@0: silk_LTP_gain_BITS_Q5_0, michael@0: silk_LTP_gain_BITS_Q5_1, michael@0: silk_LTP_gain_BITS_Q5_2 michael@0: }; michael@0: michael@0: static const opus_int8 silk_LTP_gain_vq_0[8][5] = michael@0: { michael@0: { michael@0: 4, 6, 24, 7, 5 michael@0: }, michael@0: { michael@0: 0, 0, 2, 0, 0 michael@0: }, michael@0: { michael@0: 12, 28, 41, 13, -4 michael@0: }, michael@0: { michael@0: -9, 15, 42, 25, 14 michael@0: }, michael@0: { michael@0: 1, -2, 62, 41, -9 michael@0: }, michael@0: { michael@0: -10, 37, 65, -4, 3 michael@0: }, michael@0: { michael@0: -6, 4, 66, 7, -8 michael@0: }, michael@0: { michael@0: 16, 14, 38, -3, 33 michael@0: } michael@0: }; michael@0: michael@0: static const opus_int8 silk_LTP_gain_vq_1[16][5] = michael@0: { michael@0: { michael@0: 13, 22, 39, 23, 12 michael@0: }, michael@0: { michael@0: -1, 36, 64, 27, -6 michael@0: }, michael@0: { michael@0: -7, 10, 55, 43, 17 michael@0: }, michael@0: { michael@0: 1, 1, 8, 1, 1 michael@0: }, michael@0: { michael@0: 6, -11, 74, 53, -9 michael@0: }, michael@0: { michael@0: -12, 55, 76, -12, 8 michael@0: }, michael@0: { michael@0: -3, 3, 93, 27, -4 michael@0: }, michael@0: { michael@0: 26, 39, 59, 3, -8 michael@0: }, michael@0: { michael@0: 2, 0, 77, 11, 9 michael@0: }, michael@0: { michael@0: -8, 22, 44, -6, 7 michael@0: }, michael@0: { michael@0: 40, 9, 26, 3, 9 michael@0: }, michael@0: { michael@0: -7, 20, 101, -7, 4 michael@0: }, michael@0: { michael@0: 3, -8, 42, 26, 0 michael@0: }, michael@0: { michael@0: -15, 33, 68, 2, 23 michael@0: }, michael@0: { michael@0: -2, 55, 46, -2, 15 michael@0: }, michael@0: { michael@0: 3, -1, 21, 16, 41 michael@0: } michael@0: }; michael@0: michael@0: static const opus_int8 silk_LTP_gain_vq_2[32][5] = michael@0: { michael@0: { michael@0: -6, 27, 61, 39, 5 michael@0: }, michael@0: { michael@0: -11, 42, 88, 4, 1 michael@0: }, michael@0: { michael@0: -2, 60, 65, 6, -4 michael@0: }, michael@0: { michael@0: -1, -5, 73, 56, 1 michael@0: }, michael@0: { michael@0: -9, 19, 94, 29, -9 michael@0: }, michael@0: { michael@0: 0, 12, 99, 6, 4 michael@0: }, michael@0: { michael@0: 8, -19, 102, 46, -13 michael@0: }, michael@0: { michael@0: 3, 2, 13, 3, 2 michael@0: }, michael@0: { michael@0: 9, -21, 84, 72, -18 michael@0: }, michael@0: { michael@0: -11, 46, 104, -22, 8 michael@0: }, michael@0: { michael@0: 18, 38, 48, 23, 0 michael@0: }, michael@0: { michael@0: -16, 70, 83, -21, 11 michael@0: }, michael@0: { michael@0: 5, -11, 117, 22, -8 michael@0: }, michael@0: { michael@0: -6, 23, 117, -12, 3 michael@0: }, michael@0: { michael@0: 3, -8, 95, 28, 4 michael@0: }, michael@0: { michael@0: -10, 15, 77, 60, -15 michael@0: }, michael@0: { michael@0: -1, 4, 124, 2, -4 michael@0: }, michael@0: { michael@0: 3, 38, 84, 24, -25 michael@0: }, michael@0: { michael@0: 2, 13, 42, 13, 31 michael@0: }, michael@0: { michael@0: 21, -4, 56, 46, -1 michael@0: }, michael@0: { michael@0: -1, 35, 79, -13, 19 michael@0: }, michael@0: { michael@0: -7, 65, 88, -9, -14 michael@0: }, michael@0: { michael@0: 20, 4, 81, 49, -29 michael@0: }, michael@0: { michael@0: 20, 0, 75, 3, -17 michael@0: }, michael@0: { michael@0: 5, -9, 44, 92, -8 michael@0: }, michael@0: { michael@0: 1, -3, 22, 69, 31 michael@0: }, michael@0: { michael@0: -6, 95, 41, -12, 5 michael@0: }, michael@0: { michael@0: 39, 67, 16, -4, 1 michael@0: }, michael@0: { michael@0: 0, -6, 120, 55, -36 michael@0: }, michael@0: { michael@0: -13, 44, 122, 4, -24 michael@0: }, michael@0: { michael@0: 81, 5, 11, 3, 7 michael@0: }, michael@0: { michael@0: 2, 0, 9, 10, 88 michael@0: } michael@0: }; michael@0: michael@0: const opus_int8 * const silk_LTP_vq_ptrs_Q7[NB_LTP_CBKS] = { michael@0: (opus_int8 *)&silk_LTP_gain_vq_0[0][0], michael@0: (opus_int8 *)&silk_LTP_gain_vq_1[0][0], michael@0: (opus_int8 *)&silk_LTP_gain_vq_2[0][0] michael@0: }; michael@0: michael@0: /* Maximum frequency-dependent response of the pitch taps above, michael@0: computed as max(abs(freqz(taps))) */ michael@0: static const opus_uint8 silk_LTP_gain_vq_0_gain[8] = { michael@0: 46, 2, 90, 87, 93, 91, 82, 98 michael@0: }; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_vq_1_gain[16] = { michael@0: 109, 120, 118, 12, 113, 115, 117, 119, michael@0: 99, 59, 87, 111, 63, 111, 112, 80 michael@0: }; michael@0: michael@0: static const opus_uint8 silk_LTP_gain_vq_2_gain[32] = { michael@0: 126, 124, 125, 124, 129, 121, 126, 23, michael@0: 132, 127, 127, 127, 126, 127, 122, 133, michael@0: 130, 134, 101, 118, 119, 145, 126, 86, michael@0: 124, 120, 123, 119, 170, 173, 107, 109 michael@0: }; michael@0: michael@0: const opus_uint8 * const silk_LTP_vq_gain_ptrs_Q7[NB_LTP_CBKS] = { michael@0: &silk_LTP_gain_vq_0_gain[0], michael@0: &silk_LTP_gain_vq_1_gain[0], michael@0: &silk_LTP_gain_vq_2_gain[0] michael@0: }; michael@0: michael@0: const opus_int8 silk_LTP_vq_sizes[NB_LTP_CBKS] = { michael@0: 8, 16, 32 michael@0: };