Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /*********************************************************************** |
michael@0 | 2 | Copyright (c) 2006-2011, Skype Limited. All rights reserved. |
michael@0 | 3 | Redistribution and use in source and binary forms, with or without |
michael@0 | 4 | modification, are permitted provided that the following conditions |
michael@0 | 5 | are met: |
michael@0 | 6 | - Redistributions of source code must retain the above copyright notice, |
michael@0 | 7 | this list of conditions and the following disclaimer. |
michael@0 | 8 | - Redistributions in binary form must reproduce the above copyright |
michael@0 | 9 | notice, this list of conditions and the following disclaimer in the |
michael@0 | 10 | documentation and/or other materials provided with the distribution. |
michael@0 | 11 | - Neither the name of Internet Society, IETF or IETF Trust, nor the |
michael@0 | 12 | names of specific contributors, may be used to endorse or promote |
michael@0 | 13 | products derived from this software without specific prior written |
michael@0 | 14 | permission. |
michael@0 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
michael@0 | 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
michael@0 | 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
michael@0 | 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
michael@0 | 19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
michael@0 | 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
michael@0 | 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
michael@0 | 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
michael@0 | 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
michael@0 | 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
michael@0 | 25 | POSSIBILITY OF SUCH DAMAGE. |
michael@0 | 26 | ***********************************************************************/ |
michael@0 | 27 | |
michael@0 | 28 | #ifdef HAVE_CONFIG_H |
michael@0 | 29 | #include "config.h" |
michael@0 | 30 | #endif |
michael@0 | 31 | |
michael@0 | 32 | #include "tables.h" |
michael@0 | 33 | |
michael@0 | 34 | static const opus_uint8 silk_NLSF_CB1_WB_Q8[ 512 ] = { |
michael@0 | 35 | 7, 23, 38, 54, 69, 85, 100, 116, |
michael@0 | 36 | 131, 147, 162, 178, 193, 208, 223, 239, |
michael@0 | 37 | 13, 25, 41, 55, 69, 83, 98, 112, |
michael@0 | 38 | 127, 142, 157, 171, 187, 203, 220, 236, |
michael@0 | 39 | 15, 21, 34, 51, 61, 78, 92, 106, |
michael@0 | 40 | 126, 136, 152, 167, 185, 205, 225, 240, |
michael@0 | 41 | 10, 21, 36, 50, 63, 79, 95, 110, |
michael@0 | 42 | 126, 141, 157, 173, 189, 205, 221, 237, |
michael@0 | 43 | 17, 20, 37, 51, 59, 78, 89, 107, |
michael@0 | 44 | 123, 134, 150, 164, 184, 205, 224, 240, |
michael@0 | 45 | 10, 15, 32, 51, 67, 81, 96, 112, |
michael@0 | 46 | 129, 142, 158, 173, 189, 204, 220, 236, |
michael@0 | 47 | 8, 21, 37, 51, 65, 79, 98, 113, |
michael@0 | 48 | 126, 138, 155, 168, 179, 192, 209, 218, |
michael@0 | 49 | 12, 15, 34, 55, 63, 78, 87, 108, |
michael@0 | 50 | 118, 131, 148, 167, 185, 203, 219, 236, |
michael@0 | 51 | 16, 19, 32, 36, 56, 79, 91, 108, |
michael@0 | 52 | 118, 136, 154, 171, 186, 204, 220, 237, |
michael@0 | 53 | 11, 28, 43, 58, 74, 89, 105, 120, |
michael@0 | 54 | 135, 150, 165, 180, 196, 211, 226, 241, |
michael@0 | 55 | 6, 16, 33, 46, 60, 75, 92, 107, |
michael@0 | 56 | 123, 137, 156, 169, 185, 199, 214, 225, |
michael@0 | 57 | 11, 19, 30, 44, 57, 74, 89, 105, |
michael@0 | 58 | 121, 135, 152, 169, 186, 202, 218, 234, |
michael@0 | 59 | 12, 19, 29, 46, 57, 71, 88, 100, |
michael@0 | 60 | 120, 132, 148, 165, 182, 199, 216, 233, |
michael@0 | 61 | 17, 23, 35, 46, 56, 77, 92, 106, |
michael@0 | 62 | 123, 134, 152, 167, 185, 204, 222, 237, |
michael@0 | 63 | 14, 17, 45, 53, 63, 75, 89, 107, |
michael@0 | 64 | 115, 132, 151, 171, 188, 206, 221, 240, |
michael@0 | 65 | 9, 16, 29, 40, 56, 71, 88, 103, |
michael@0 | 66 | 119, 137, 154, 171, 189, 205, 222, 237, |
michael@0 | 67 | 16, 19, 36, 48, 57, 76, 87, 105, |
michael@0 | 68 | 118, 132, 150, 167, 185, 202, 218, 236, |
michael@0 | 69 | 12, 17, 29, 54, 71, 81, 94, 104, |
michael@0 | 70 | 126, 136, 149, 164, 182, 201, 221, 237, |
michael@0 | 71 | 15, 28, 47, 62, 79, 97, 115, 129, |
michael@0 | 72 | 142, 155, 168, 180, 194, 208, 223, 238, |
michael@0 | 73 | 8, 14, 30, 45, 62, 78, 94, 111, |
michael@0 | 74 | 127, 143, 159, 175, 192, 207, 223, 239, |
michael@0 | 75 | 17, 30, 49, 62, 79, 92, 107, 119, |
michael@0 | 76 | 132, 145, 160, 174, 190, 204, 220, 235, |
michael@0 | 77 | 14, 19, 36, 45, 61, 76, 91, 108, |
michael@0 | 78 | 121, 138, 154, 172, 189, 205, 222, 238, |
michael@0 | 79 | 12, 18, 31, 45, 60, 76, 91, 107, |
michael@0 | 80 | 123, 138, 154, 171, 187, 204, 221, 236, |
michael@0 | 81 | 13, 17, 31, 43, 53, 70, 83, 103, |
michael@0 | 82 | 114, 131, 149, 167, 185, 203, 220, 237, |
michael@0 | 83 | 17, 22, 35, 42, 58, 78, 93, 110, |
michael@0 | 84 | 125, 139, 155, 170, 188, 206, 224, 240, |
michael@0 | 85 | 8, 15, 34, 50, 67, 83, 99, 115, |
michael@0 | 86 | 131, 146, 162, 178, 193, 209, 224, 239, |
michael@0 | 87 | 13, 16, 41, 66, 73, 86, 95, 111, |
michael@0 | 88 | 128, 137, 150, 163, 183, 206, 225, 241, |
michael@0 | 89 | 17, 25, 37, 52, 63, 75, 92, 102, |
michael@0 | 90 | 119, 132, 144, 160, 175, 191, 212, 231, |
michael@0 | 91 | 19, 31, 49, 65, 83, 100, 117, 133, |
michael@0 | 92 | 147, 161, 174, 187, 200, 213, 227, 242, |
michael@0 | 93 | 18, 31, 52, 68, 88, 103, 117, 126, |
michael@0 | 94 | 138, 149, 163, 177, 192, 207, 223, 239, |
michael@0 | 95 | 16, 29, 47, 61, 76, 90, 106, 119, |
michael@0 | 96 | 133, 147, 161, 176, 193, 209, 224, 240, |
michael@0 | 97 | 15, 21, 35, 50, 61, 73, 86, 97, |
michael@0 | 98 | 110, 119, 129, 141, 175, 198, 218, 237 |
michael@0 | 99 | }; |
michael@0 | 100 | |
michael@0 | 101 | static const opus_uint8 silk_NLSF_CB1_iCDF_WB[ 64 ] = { |
michael@0 | 102 | 225, 204, 201, 184, 183, 175, 158, 154, |
michael@0 | 103 | 153, 135, 119, 115, 113, 110, 109, 99, |
michael@0 | 104 | 98, 95, 79, 68, 52, 50, 48, 45, |
michael@0 | 105 | 43, 32, 31, 27, 18, 10, 3, 0, |
michael@0 | 106 | 255, 251, 235, 230, 212, 201, 196, 182, |
michael@0 | 107 | 167, 166, 163, 151, 138, 124, 110, 104, |
michael@0 | 108 | 90, 78, 76, 70, 69, 57, 45, 34, |
michael@0 | 109 | 24, 21, 11, 6, 5, 4, 3, 0 |
michael@0 | 110 | }; |
michael@0 | 111 | |
michael@0 | 112 | static const opus_uint8 silk_NLSF_CB2_SELECT_WB[ 256 ] = { |
michael@0 | 113 | 0, 0, 0, 0, 0, 0, 0, 1, |
michael@0 | 114 | 100, 102, 102, 68, 68, 36, 34, 96, |
michael@0 | 115 | 164, 107, 158, 185, 180, 185, 139, 102, |
michael@0 | 116 | 64, 66, 36, 34, 34, 0, 1, 32, |
michael@0 | 117 | 208, 139, 141, 191, 152, 185, 155, 104, |
michael@0 | 118 | 96, 171, 104, 166, 102, 102, 102, 132, |
michael@0 | 119 | 1, 0, 0, 0, 0, 16, 16, 0, |
michael@0 | 120 | 80, 109, 78, 107, 185, 139, 103, 101, |
michael@0 | 121 | 208, 212, 141, 139, 173, 153, 123, 103, |
michael@0 | 122 | 36, 0, 0, 0, 0, 0, 0, 1, |
michael@0 | 123 | 48, 0, 0, 0, 0, 0, 0, 32, |
michael@0 | 124 | 68, 135, 123, 119, 119, 103, 69, 98, |
michael@0 | 125 | 68, 103, 120, 118, 118, 102, 71, 98, |
michael@0 | 126 | 134, 136, 157, 184, 182, 153, 139, 134, |
michael@0 | 127 | 208, 168, 248, 75, 189, 143, 121, 107, |
michael@0 | 128 | 32, 49, 34, 34, 34, 0, 17, 2, |
michael@0 | 129 | 210, 235, 139, 123, 185, 137, 105, 134, |
michael@0 | 130 | 98, 135, 104, 182, 100, 183, 171, 134, |
michael@0 | 131 | 100, 70, 68, 70, 66, 66, 34, 131, |
michael@0 | 132 | 64, 166, 102, 68, 36, 2, 1, 0, |
michael@0 | 133 | 134, 166, 102, 68, 34, 34, 66, 132, |
michael@0 | 134 | 212, 246, 158, 139, 107, 107, 87, 102, |
michael@0 | 135 | 100, 219, 125, 122, 137, 118, 103, 132, |
michael@0 | 136 | 114, 135, 137, 105, 171, 106, 50, 34, |
michael@0 | 137 | 164, 214, 141, 143, 185, 151, 121, 103, |
michael@0 | 138 | 192, 34, 0, 0, 0, 0, 0, 1, |
michael@0 | 139 | 208, 109, 74, 187, 134, 249, 159, 137, |
michael@0 | 140 | 102, 110, 154, 118, 87, 101, 119, 101, |
michael@0 | 141 | 0, 2, 0, 36, 36, 66, 68, 35, |
michael@0 | 142 | 96, 164, 102, 100, 36, 0, 2, 33, |
michael@0 | 143 | 167, 138, 174, 102, 100, 84, 2, 2, |
michael@0 | 144 | 100, 107, 120, 119, 36, 197, 24, 0 |
michael@0 | 145 | }; |
michael@0 | 146 | |
michael@0 | 147 | static const opus_uint8 silk_NLSF_CB2_iCDF_WB[ 72 ] = { |
michael@0 | 148 | 255, 254, 253, 244, 12, 3, 2, 1, |
michael@0 | 149 | 0, 255, 254, 252, 224, 38, 3, 2, |
michael@0 | 150 | 1, 0, 255, 254, 251, 209, 57, 4, |
michael@0 | 151 | 2, 1, 0, 255, 254, 244, 195, 69, |
michael@0 | 152 | 4, 2, 1, 0, 255, 251, 232, 184, |
michael@0 | 153 | 84, 7, 2, 1, 0, 255, 254, 240, |
michael@0 | 154 | 186, 86, 14, 2, 1, 0, 255, 254, |
michael@0 | 155 | 239, 178, 91, 30, 5, 1, 0, 255, |
michael@0 | 156 | 248, 227, 177, 100, 19, 2, 1, 0 |
michael@0 | 157 | }; |
michael@0 | 158 | |
michael@0 | 159 | static const opus_uint8 silk_NLSF_CB2_BITS_WB_Q5[ 72 ] = { |
michael@0 | 160 | 255, 255, 255, 156, 4, 154, 255, 255, |
michael@0 | 161 | 255, 255, 255, 227, 102, 15, 92, 255, |
michael@0 | 162 | 255, 255, 255, 255, 213, 83, 24, 72, |
michael@0 | 163 | 236, 255, 255, 255, 255, 150, 76, 33, |
michael@0 | 164 | 63, 214, 255, 255, 255, 190, 121, 77, |
michael@0 | 165 | 43, 55, 185, 255, 255, 255, 245, 137, |
michael@0 | 166 | 71, 43, 59, 139, 255, 255, 255, 255, |
michael@0 | 167 | 131, 66, 50, 66, 107, 194, 255, 255, |
michael@0 | 168 | 166, 116, 76, 55, 53, 125, 255, 255 |
michael@0 | 169 | }; |
michael@0 | 170 | |
michael@0 | 171 | static const opus_uint8 silk_NLSF_PRED_WB_Q8[ 30 ] = { |
michael@0 | 172 | 175, 148, 160, 176, 178, 173, 174, 164, |
michael@0 | 173 | 177, 174, 196, 182, 198, 192, 182, 68, |
michael@0 | 174 | 62, 66, 60, 72, 117, 85, 90, 118, |
michael@0 | 175 | 136, 151, 142, 160, 142, 155 |
michael@0 | 176 | }; |
michael@0 | 177 | |
michael@0 | 178 | static const opus_int16 silk_NLSF_DELTA_MIN_WB_Q15[ 17 ] = { |
michael@0 | 179 | 100, 3, 40, 3, 3, 3, 5, 14, |
michael@0 | 180 | 14, 10, 11, 3, 8, 9, 7, 3, |
michael@0 | 181 | 347 |
michael@0 | 182 | }; |
michael@0 | 183 | |
michael@0 | 184 | const silk_NLSF_CB_struct silk_NLSF_CB_WB = |
michael@0 | 185 | { |
michael@0 | 186 | 32, |
michael@0 | 187 | 16, |
michael@0 | 188 | SILK_FIX_CONST( 0.15, 16 ), |
michael@0 | 189 | SILK_FIX_CONST( 1.0 / 0.15, 6 ), |
michael@0 | 190 | silk_NLSF_CB1_WB_Q8, |
michael@0 | 191 | silk_NLSF_CB1_iCDF_WB, |
michael@0 | 192 | silk_NLSF_PRED_WB_Q8, |
michael@0 | 193 | silk_NLSF_CB2_SELECT_WB, |
michael@0 | 194 | silk_NLSF_CB2_iCDF_WB, |
michael@0 | 195 | silk_NLSF_CB2_BITS_WB_Q5, |
michael@0 | 196 | silk_NLSF_DELTA_MIN_WB_Q15, |
michael@0 | 197 | }; |
michael@0 | 198 |