Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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_NB_MB_Q8[ 320 ] = { |
michael@0 | 35 | 12, 35, 60, 83, 108, 132, 157, 180, |
michael@0 | 36 | 206, 228, 15, 32, 55, 77, 101, 125, |
michael@0 | 37 | 151, 175, 201, 225, 19, 42, 66, 89, |
michael@0 | 38 | 114, 137, 162, 184, 209, 230, 12, 25, |
michael@0 | 39 | 50, 72, 97, 120, 147, 172, 200, 223, |
michael@0 | 40 | 26, 44, 69, 90, 114, 135, 159, 180, |
michael@0 | 41 | 205, 225, 13, 22, 53, 80, 106, 130, |
michael@0 | 42 | 156, 180, 205, 228, 15, 25, 44, 64, |
michael@0 | 43 | 90, 115, 142, 168, 196, 222, 19, 24, |
michael@0 | 44 | 62, 82, 100, 120, 145, 168, 190, 214, |
michael@0 | 45 | 22, 31, 50, 79, 103, 120, 151, 170, |
michael@0 | 46 | 203, 227, 21, 29, 45, 65, 106, 124, |
michael@0 | 47 | 150, 171, 196, 224, 30, 49, 75, 97, |
michael@0 | 48 | 121, 142, 165, 186, 209, 229, 19, 25, |
michael@0 | 49 | 52, 70, 93, 116, 143, 166, 192, 219, |
michael@0 | 50 | 26, 34, 62, 75, 97, 118, 145, 167, |
michael@0 | 51 | 194, 217, 25, 33, 56, 70, 91, 113, |
michael@0 | 52 | 143, 165, 196, 223, 21, 34, 51, 72, |
michael@0 | 53 | 97, 117, 145, 171, 196, 222, 20, 29, |
michael@0 | 54 | 50, 67, 90, 117, 144, 168, 197, 221, |
michael@0 | 55 | 22, 31, 48, 66, 95, 117, 146, 168, |
michael@0 | 56 | 196, 222, 24, 33, 51, 77, 116, 134, |
michael@0 | 57 | 158, 180, 200, 224, 21, 28, 70, 87, |
michael@0 | 58 | 106, 124, 149, 170, 194, 217, 26, 33, |
michael@0 | 59 | 53, 64, 83, 117, 152, 173, 204, 225, |
michael@0 | 60 | 27, 34, 65, 95, 108, 129, 155, 174, |
michael@0 | 61 | 210, 225, 20, 26, 72, 99, 113, 131, |
michael@0 | 62 | 154, 176, 200, 219, 34, 43, 61, 78, |
michael@0 | 63 | 93, 114, 155, 177, 205, 229, 23, 29, |
michael@0 | 64 | 54, 97, 124, 138, 163, 179, 209, 229, |
michael@0 | 65 | 30, 38, 56, 89, 118, 129, 158, 178, |
michael@0 | 66 | 200, 231, 21, 29, 49, 63, 85, 111, |
michael@0 | 67 | 142, 163, 193, 222, 27, 48, 77, 103, |
michael@0 | 68 | 133, 158, 179, 196, 215, 232, 29, 47, |
michael@0 | 69 | 74, 99, 124, 151, 176, 198, 220, 237, |
michael@0 | 70 | 33, 42, 61, 76, 93, 121, 155, 174, |
michael@0 | 71 | 207, 225, 29, 53, 87, 112, 136, 154, |
michael@0 | 72 | 170, 188, 208, 227, 24, 30, 52, 84, |
michael@0 | 73 | 131, 150, 166, 186, 203, 229, 37, 48, |
michael@0 | 74 | 64, 84, 104, 118, 156, 177, 201, 230 |
michael@0 | 75 | }; |
michael@0 | 76 | |
michael@0 | 77 | static const opus_uint8 silk_NLSF_CB1_iCDF_NB_MB[ 64 ] = { |
michael@0 | 78 | 212, 178, 148, 129, 108, 96, 85, 82, |
michael@0 | 79 | 79, 77, 61, 59, 57, 56, 51, 49, |
michael@0 | 80 | 48, 45, 42, 41, 40, 38, 36, 34, |
michael@0 | 81 | 31, 30, 21, 12, 10, 3, 1, 0, |
michael@0 | 82 | 255, 245, 244, 236, 233, 225, 217, 203, |
michael@0 | 83 | 190, 176, 175, 161, 149, 136, 125, 114, |
michael@0 | 84 | 102, 91, 81, 71, 60, 52, 43, 35, |
michael@0 | 85 | 28, 20, 19, 18, 12, 11, 5, 0 |
michael@0 | 86 | }; |
michael@0 | 87 | |
michael@0 | 88 | static const opus_uint8 silk_NLSF_CB2_SELECT_NB_MB[ 160 ] = { |
michael@0 | 89 | 16, 0, 0, 0, 0, 99, 66, 36, |
michael@0 | 90 | 36, 34, 36, 34, 34, 34, 34, 83, |
michael@0 | 91 | 69, 36, 52, 34, 116, 102, 70, 68, |
michael@0 | 92 | 68, 176, 102, 68, 68, 34, 65, 85, |
michael@0 | 93 | 68, 84, 36, 116, 141, 152, 139, 170, |
michael@0 | 94 | 132, 187, 184, 216, 137, 132, 249, 168, |
michael@0 | 95 | 185, 139, 104, 102, 100, 68, 68, 178, |
michael@0 | 96 | 218, 185, 185, 170, 244, 216, 187, 187, |
michael@0 | 97 | 170, 244, 187, 187, 219, 138, 103, 155, |
michael@0 | 98 | 184, 185, 137, 116, 183, 155, 152, 136, |
michael@0 | 99 | 132, 217, 184, 184, 170, 164, 217, 171, |
michael@0 | 100 | 155, 139, 244, 169, 184, 185, 170, 164, |
michael@0 | 101 | 216, 223, 218, 138, 214, 143, 188, 218, |
michael@0 | 102 | 168, 244, 141, 136, 155, 170, 168, 138, |
michael@0 | 103 | 220, 219, 139, 164, 219, 202, 216, 137, |
michael@0 | 104 | 168, 186, 246, 185, 139, 116, 185, 219, |
michael@0 | 105 | 185, 138, 100, 100, 134, 100, 102, 34, |
michael@0 | 106 | 68, 68, 100, 68, 168, 203, 221, 218, |
michael@0 | 107 | 168, 167, 154, 136, 104, 70, 164, 246, |
michael@0 | 108 | 171, 137, 139, 137, 155, 218, 219, 139 |
michael@0 | 109 | }; |
michael@0 | 110 | |
michael@0 | 111 | static const opus_uint8 silk_NLSF_CB2_iCDF_NB_MB[ 72 ] = { |
michael@0 | 112 | 255, 254, 253, 238, 14, 3, 2, 1, |
michael@0 | 113 | 0, 255, 254, 252, 218, 35, 3, 2, |
michael@0 | 114 | 1, 0, 255, 254, 250, 208, 59, 4, |
michael@0 | 115 | 2, 1, 0, 255, 254, 246, 194, 71, |
michael@0 | 116 | 10, 2, 1, 0, 255, 252, 236, 183, |
michael@0 | 117 | 82, 8, 2, 1, 0, 255, 252, 235, |
michael@0 | 118 | 180, 90, 17, 2, 1, 0, 255, 248, |
michael@0 | 119 | 224, 171, 97, 30, 4, 1, 0, 255, |
michael@0 | 120 | 254, 236, 173, 95, 37, 7, 1, 0 |
michael@0 | 121 | }; |
michael@0 | 122 | |
michael@0 | 123 | static const opus_uint8 silk_NLSF_CB2_BITS_NB_MB_Q5[ 72 ] = { |
michael@0 | 124 | 255, 255, 255, 131, 6, 145, 255, 255, |
michael@0 | 125 | 255, 255, 255, 236, 93, 15, 96, 255, |
michael@0 | 126 | 255, 255, 255, 255, 194, 83, 25, 71, |
michael@0 | 127 | 221, 255, 255, 255, 255, 162, 73, 34, |
michael@0 | 128 | 66, 162, 255, 255, 255, 210, 126, 73, |
michael@0 | 129 | 43, 57, 173, 255, 255, 255, 201, 125, |
michael@0 | 130 | 71, 48, 58, 130, 255, 255, 255, 166, |
michael@0 | 131 | 110, 73, 57, 62, 104, 210, 255, 255, |
michael@0 | 132 | 251, 123, 65, 55, 68, 100, 171, 255 |
michael@0 | 133 | }; |
michael@0 | 134 | |
michael@0 | 135 | static const opus_uint8 silk_NLSF_PRED_NB_MB_Q8[ 18 ] = { |
michael@0 | 136 | 179, 138, 140, 148, 151, 149, 153, 151, |
michael@0 | 137 | 163, 116, 67, 82, 59, 92, 72, 100, |
michael@0 | 138 | 89, 92 |
michael@0 | 139 | }; |
michael@0 | 140 | |
michael@0 | 141 | static const opus_int16 silk_NLSF_DELTA_MIN_NB_MB_Q15[ 11 ] = { |
michael@0 | 142 | 250, 3, 6, 3, 3, 3, 4, 3, |
michael@0 | 143 | 3, 3, 461 |
michael@0 | 144 | }; |
michael@0 | 145 | |
michael@0 | 146 | const silk_NLSF_CB_struct silk_NLSF_CB_NB_MB = |
michael@0 | 147 | { |
michael@0 | 148 | 32, |
michael@0 | 149 | 10, |
michael@0 | 150 | SILK_FIX_CONST( 0.18, 16 ), |
michael@0 | 151 | SILK_FIX_CONST( 1.0 / 0.18, 6 ), |
michael@0 | 152 | silk_NLSF_CB1_NB_MB_Q8, |
michael@0 | 153 | silk_NLSF_CB1_iCDF_NB_MB, |
michael@0 | 154 | silk_NLSF_PRED_NB_MB_Q8, |
michael@0 | 155 | silk_NLSF_CB2_SELECT_NB_MB, |
michael@0 | 156 | silk_NLSF_CB2_iCDF_NB_MB, |
michael@0 | 157 | silk_NLSF_CB2_BITS_NB_MB_Q5, |
michael@0 | 158 | silk_NLSF_DELTA_MIN_NB_MB_Q15, |
michael@0 | 159 | }; |