1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libopus/silk/tables_pulses_per_block.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,264 @@ 1.4 +/*********************************************************************** 1.5 +Copyright (c) 2006-2011, Skype Limited. All rights reserved. 1.6 +Redistribution and use in source and binary forms, with or without 1.7 +modification, are permitted provided that the following conditions 1.8 +are met: 1.9 +- Redistributions of source code must retain the above copyright notice, 1.10 +this list of conditions and the following disclaimer. 1.11 +- Redistributions in binary form must reproduce the above copyright 1.12 +notice, this list of conditions and the following disclaimer in the 1.13 +documentation and/or other materials provided with the distribution. 1.14 +- Neither the name of Internet Society, IETF or IETF Trust, nor the 1.15 +names of specific contributors, may be used to endorse or promote 1.16 +products derived from this software without specific prior written 1.17 +permission. 1.18 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1.19 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1.20 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1.21 +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1.22 +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 1.23 +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 1.24 +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1.25 +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 1.26 +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1.27 +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 1.28 +POSSIBILITY OF SUCH DAMAGE. 1.29 +***********************************************************************/ 1.30 + 1.31 +#ifdef HAVE_CONFIG_H 1.32 +#include "config.h" 1.33 +#endif 1.34 + 1.35 +#include "tables.h" 1.36 + 1.37 +const opus_uint8 silk_max_pulses_table[ 4 ] = { 1.38 + 8, 10, 12, 16 1.39 +}; 1.40 + 1.41 +const opus_uint8 silk_pulses_per_block_iCDF[ 10 ][ 18 ] = { 1.42 +{ 1.43 + 125, 51, 26, 18, 15, 12, 11, 10, 1.44 + 9, 8, 7, 6, 5, 4, 3, 2, 1.45 + 1, 0 1.46 +}, 1.47 +{ 1.48 + 198, 105, 45, 22, 15, 12, 11, 10, 1.49 + 9, 8, 7, 6, 5, 4, 3, 2, 1.50 + 1, 0 1.51 +}, 1.52 +{ 1.53 + 213, 162, 116, 83, 59, 43, 32, 24, 1.54 + 18, 15, 12, 9, 7, 6, 5, 3, 1.55 + 2, 0 1.56 +}, 1.57 +{ 1.58 + 239, 187, 116, 59, 28, 16, 11, 10, 1.59 + 9, 8, 7, 6, 5, 4, 3, 2, 1.60 + 1, 0 1.61 +}, 1.62 +{ 1.63 + 250, 229, 188, 135, 86, 51, 30, 19, 1.64 + 13, 10, 8, 6, 5, 4, 3, 2, 1.65 + 1, 0 1.66 +}, 1.67 +{ 1.68 + 249, 235, 213, 185, 156, 128, 103, 83, 1.69 + 66, 53, 42, 33, 26, 21, 17, 13, 1.70 + 10, 0 1.71 +}, 1.72 +{ 1.73 + 254, 249, 235, 206, 164, 118, 77, 46, 1.74 + 27, 16, 10, 7, 5, 4, 3, 2, 1.75 + 1, 0 1.76 +}, 1.77 +{ 1.78 + 255, 253, 249, 239, 220, 191, 156, 119, 1.79 + 85, 57, 37, 23, 15, 10, 6, 4, 1.80 + 2, 0 1.81 +}, 1.82 +{ 1.83 + 255, 253, 251, 246, 237, 223, 203, 179, 1.84 + 152, 124, 98, 75, 55, 40, 29, 21, 1.85 + 15, 0 1.86 +}, 1.87 +{ 1.88 + 255, 254, 253, 247, 220, 162, 106, 67, 1.89 + 42, 28, 18, 12, 9, 6, 4, 3, 1.90 + 2, 0 1.91 +} 1.92 +}; 1.93 + 1.94 +const opus_uint8 silk_pulses_per_block_BITS_Q5[ 9 ][ 18 ] = { 1.95 +{ 1.96 + 31, 57, 107, 160, 205, 205, 255, 255, 1.97 + 255, 255, 255, 255, 255, 255, 255, 255, 1.98 + 255, 255 1.99 +}, 1.100 +{ 1.101 + 69, 47, 67, 111, 166, 205, 255, 255, 1.102 + 255, 255, 255, 255, 255, 255, 255, 255, 1.103 + 255, 255 1.104 +}, 1.105 +{ 1.106 + 82, 74, 79, 95, 109, 128, 145, 160, 1.107 + 173, 205, 205, 205, 224, 255, 255, 224, 1.108 + 255, 224 1.109 +}, 1.110 +{ 1.111 + 125, 74, 59, 69, 97, 141, 182, 255, 1.112 + 255, 255, 255, 255, 255, 255, 255, 255, 1.113 + 255, 255 1.114 +}, 1.115 +{ 1.116 + 173, 115, 85, 73, 76, 92, 115, 145, 1.117 + 173, 205, 224, 224, 255, 255, 255, 255, 1.118 + 255, 255 1.119 +}, 1.120 +{ 1.121 + 166, 134, 113, 102, 101, 102, 107, 118, 1.122 + 125, 138, 145, 155, 166, 182, 192, 192, 1.123 + 205, 150 1.124 +}, 1.125 +{ 1.126 + 224, 182, 134, 101, 83, 79, 85, 97, 1.127 + 120, 145, 173, 205, 224, 255, 255, 255, 1.128 + 255, 255 1.129 +}, 1.130 +{ 1.131 + 255, 224, 192, 150, 120, 101, 92, 89, 1.132 + 93, 102, 118, 134, 160, 182, 192, 224, 1.133 + 224, 224 1.134 +}, 1.135 +{ 1.136 + 255, 224, 224, 182, 155, 134, 118, 109, 1.137 + 104, 102, 106, 111, 118, 131, 145, 160, 1.138 + 173, 131 1.139 +} 1.140 +}; 1.141 + 1.142 +const opus_uint8 silk_rate_levels_iCDF[ 2 ][ 9 ] = 1.143 +{ 1.144 +{ 1.145 + 241, 190, 178, 132, 87, 74, 41, 14, 1.146 + 0 1.147 +}, 1.148 +{ 1.149 + 223, 193, 157, 140, 106, 57, 39, 18, 1.150 + 0 1.151 +} 1.152 +}; 1.153 + 1.154 +const opus_uint8 silk_rate_levels_BITS_Q5[ 2 ][ 9 ] = 1.155 +{ 1.156 +{ 1.157 + 131, 74, 141, 79, 80, 138, 95, 104, 1.158 + 134 1.159 +}, 1.160 +{ 1.161 + 95, 99, 91, 125, 93, 76, 123, 115, 1.162 + 123 1.163 +} 1.164 +}; 1.165 + 1.166 +const opus_uint8 silk_shell_code_table0[ 152 ] = { 1.167 + 128, 0, 214, 42, 0, 235, 128, 21, 1.168 + 0, 244, 184, 72, 11, 0, 248, 214, 1.169 + 128, 42, 7, 0, 248, 225, 170, 80, 1.170 + 25, 5, 0, 251, 236, 198, 126, 54, 1.171 + 18, 3, 0, 250, 238, 211, 159, 82, 1.172 + 35, 15, 5, 0, 250, 231, 203, 168, 1.173 + 128, 88, 53, 25, 6, 0, 252, 238, 1.174 + 216, 185, 148, 108, 71, 40, 18, 4, 1.175 + 0, 253, 243, 225, 199, 166, 128, 90, 1.176 + 57, 31, 13, 3, 0, 254, 246, 233, 1.177 + 212, 183, 147, 109, 73, 44, 23, 10, 1.178 + 2, 0, 255, 250, 240, 223, 198, 166, 1.179 + 128, 90, 58, 33, 16, 6, 1, 0, 1.180 + 255, 251, 244, 231, 210, 181, 146, 110, 1.181 + 75, 46, 25, 12, 5, 1, 0, 255, 1.182 + 253, 248, 238, 221, 196, 164, 128, 92, 1.183 + 60, 35, 18, 8, 3, 1, 0, 255, 1.184 + 253, 249, 242, 229, 208, 180, 146, 110, 1.185 + 76, 48, 27, 14, 7, 3, 1, 0 1.186 +}; 1.187 + 1.188 +const opus_uint8 silk_shell_code_table1[ 152 ] = { 1.189 + 129, 0, 207, 50, 0, 236, 129, 20, 1.190 + 0, 245, 185, 72, 10, 0, 249, 213, 1.191 + 129, 42, 6, 0, 250, 226, 169, 87, 1.192 + 27, 4, 0, 251, 233, 194, 130, 62, 1.193 + 20, 4, 0, 250, 236, 207, 160, 99, 1.194 + 47, 17, 3, 0, 255, 240, 217, 182, 1.195 + 131, 81, 41, 11, 1, 0, 255, 254, 1.196 + 233, 201, 159, 107, 61, 20, 2, 1, 1.197 + 0, 255, 249, 233, 206, 170, 128, 86, 1.198 + 50, 23, 7, 1, 0, 255, 250, 238, 1.199 + 217, 186, 148, 108, 70, 39, 18, 6, 1.200 + 1, 0, 255, 252, 243, 226, 200, 166, 1.201 + 128, 90, 56, 30, 13, 4, 1, 0, 1.202 + 255, 252, 245, 231, 209, 180, 146, 110, 1.203 + 76, 47, 25, 11, 4, 1, 0, 255, 1.204 + 253, 248, 237, 219, 194, 163, 128, 93, 1.205 + 62, 37, 19, 8, 3, 1, 0, 255, 1.206 + 254, 250, 241, 226, 205, 177, 145, 111, 1.207 + 79, 51, 30, 15, 6, 2, 1, 0 1.208 +}; 1.209 + 1.210 +const opus_uint8 silk_shell_code_table2[ 152 ] = { 1.211 + 129, 0, 203, 54, 0, 234, 129, 23, 1.212 + 0, 245, 184, 73, 10, 0, 250, 215, 1.213 + 129, 41, 5, 0, 252, 232, 173, 86, 1.214 + 24, 3, 0, 253, 240, 200, 129, 56, 1.215 + 15, 2, 0, 253, 244, 217, 164, 94, 1.216 + 38, 10, 1, 0, 253, 245, 226, 189, 1.217 + 132, 71, 27, 7, 1, 0, 253, 246, 1.218 + 231, 203, 159, 105, 56, 23, 6, 1, 1.219 + 0, 255, 248, 235, 213, 179, 133, 85, 1.220 + 47, 19, 5, 1, 0, 255, 254, 243, 1.221 + 221, 194, 159, 117, 70, 37, 12, 2, 1.222 + 1, 0, 255, 254, 248, 234, 208, 171, 1.223 + 128, 85, 48, 22, 8, 2, 1, 0, 1.224 + 255, 254, 250, 240, 220, 189, 149, 107, 1.225 + 67, 36, 16, 6, 2, 1, 0, 255, 1.226 + 254, 251, 243, 227, 201, 166, 128, 90, 1.227 + 55, 29, 13, 5, 2, 1, 0, 255, 1.228 + 254, 252, 246, 234, 213, 183, 147, 109, 1.229 + 73, 43, 22, 10, 4, 2, 1, 0 1.230 +}; 1.231 + 1.232 +const opus_uint8 silk_shell_code_table3[ 152 ] = { 1.233 + 130, 0, 200, 58, 0, 231, 130, 26, 1.234 + 0, 244, 184, 76, 12, 0, 249, 214, 1.235 + 130, 43, 6, 0, 252, 232, 173, 87, 1.236 + 24, 3, 0, 253, 241, 203, 131, 56, 1.237 + 14, 2, 0, 254, 246, 221, 167, 94, 1.238 + 35, 8, 1, 0, 254, 249, 232, 193, 1.239 + 130, 65, 23, 5, 1, 0, 255, 251, 1.240 + 239, 211, 162, 99, 45, 15, 4, 1, 1.241 + 0, 255, 251, 243, 223, 186, 131, 74, 1.242 + 33, 11, 3, 1, 0, 255, 252, 245, 1.243 + 230, 202, 158, 105, 57, 24, 8, 2, 1.244 + 1, 0, 255, 253, 247, 235, 214, 179, 1.245 + 132, 84, 44, 19, 7, 2, 1, 0, 1.246 + 255, 254, 250, 240, 223, 196, 159, 112, 1.247 + 69, 36, 15, 6, 2, 1, 0, 255, 1.248 + 254, 253, 245, 231, 209, 176, 136, 93, 1.249 + 55, 27, 11, 3, 2, 1, 0, 255, 1.250 + 254, 253, 252, 239, 221, 194, 158, 117, 1.251 + 76, 42, 18, 4, 3, 2, 1, 0 1.252 +}; 1.253 + 1.254 +const opus_uint8 silk_shell_code_table_offsets[ 17 ] = { 1.255 + 0, 0, 2, 5, 9, 14, 20, 27, 1.256 + 35, 44, 54, 65, 77, 90, 104, 119, 1.257 + 135 1.258 +}; 1.259 + 1.260 +const opus_uint8 silk_sign_iCDF[ 42 ] = { 1.261 + 254, 49, 67, 77, 82, 93, 99, 1.262 + 198, 11, 18, 24, 31, 36, 45, 1.263 + 255, 46, 66, 78, 87, 94, 104, 1.264 + 208, 14, 21, 32, 42, 51, 66, 1.265 + 255, 94, 104, 109, 112, 115, 118, 1.266 + 248, 53, 69, 80, 88, 95, 102 1.267 +};