[5] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[56] | 6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
[5] | 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file ContextTables.h |
---|
| 35 | \brief Defines constants and tables for SBAC |
---|
| 36 | \todo number of context models is not matched to actual use, should be fixed |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | #ifndef __CONTEXTTABLES__ |
---|
| 40 | #define __CONTEXTTABLES__ |
---|
| 41 | |
---|
[56] | 42 | //! \ingroup TLibCommon |
---|
| 43 | //! \{ |
---|
| 44 | |
---|
[2] | 45 | // ==================================================================================================================== |
---|
| 46 | // Constants |
---|
| 47 | // ==================================================================================================================== |
---|
| 48 | |
---|
[56] | 49 | #define MAX_NUM_CTX_MOD 512 ///< maximum number of supported contexts |
---|
| 50 | |
---|
[2] | 51 | #define NUM_SPLIT_FLAG_CTX 3 ///< number of context models for split flag |
---|
| 52 | #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag |
---|
| 53 | |
---|
[56] | 54 | #define NUM_MERGE_FLAG_EXT_CTX 1 ///< number of context models for merge flag of merge extended |
---|
| 55 | #if MRG_IDX_CTX_RED |
---|
| 56 | #define NUM_MERGE_IDX_EXT_CTX 1 ///< number of context models for merge index of merge extended |
---|
| 57 | #else |
---|
[2] | 58 | #define NUM_MERGE_IDX_EXT_CTX 4 ///< number of context models for merge index of merge extended |
---|
[56] | 59 | #endif |
---|
[2] | 60 | |
---|
[56] | 61 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
| 62 | #define NUM_RES_PRED_FLAG_CTX 4 ///< number of context for residual prediction flag |
---|
| 63 | #endif |
---|
| 64 | |
---|
| 65 | #define NUM_ALF_CTRL_FLAG_CTX 1 ///< number of context models for ALF control flag |
---|
| 66 | #define NUM_PART_SIZE_CTX 4 ///< number of context models for partition size |
---|
| 67 | #if AMP_CTX |
---|
| 68 | #define NUM_CU_AMP_CTX 1 ///< number of context models for partition size (AMP) |
---|
[2] | 69 | #else |
---|
[56] | 70 | #define NUM_CU_X_POS_CTX 2 ///< number of context models for partition size (AMP) |
---|
| 71 | #define NUM_CU_Y_POS_CTX 2 ///< number of context models for partition size (AMP) |
---|
[2] | 72 | #endif |
---|
[56] | 73 | #define NUM_PRED_MODE_CTX 1 ///< number of context models for prediction mode |
---|
[2] | 74 | |
---|
[56] | 75 | #define NUM_ADI_CTX 1 ///< number of context models for intra prediction |
---|
| 76 | |
---|
| 77 | #define NUM_CHROMA_PRED_CTX 2 ///< number of context models for intra prediction (chroma) |
---|
[2] | 78 | #define NUM_INTER_DIR_CTX 4 ///< number of context models for inter prediction direction |
---|
[56] | 79 | #define NUM_MV_RES_CTX 2 ///< number of context models for motion vector difference |
---|
[2] | 80 | |
---|
[56] | 81 | #define NUM_REF_NO_CTX 4 ///< number of context models for reference index |
---|
[2] | 82 | #define NUM_TRANS_SUBDIV_FLAG_CTX 10 ///< number of context models for transform subdivision flags |
---|
[56] | 83 | #define NUM_QT_CBF_CTX 5 ///< number of context models for QT CBF |
---|
| 84 | #define NUM_QT_ROOT_CBF_CTX 1 ///< number of context models for QT ROOT CBF |
---|
| 85 | #define NUM_DELTA_QP_CTX 3 ///< number of context models for dQP |
---|
[2] | 86 | |
---|
[56] | 87 | #define NUM_SIG_CG_FLAG_CTX 2 ///< number of context models for MULTI_LEVEL_SIGNIFICANCE |
---|
| 88 | |
---|
| 89 | #define NUM_SIG_FLAG_CTX 48 ///< number of context models for sig flag |
---|
| 90 | |
---|
| 91 | #define NUM_SIG_FLAG_CTX_LUMA 27 ///< number of context models for luma sig flag |
---|
| 92 | #define NUM_SIG_FLAG_CTX_CHROMA 21 ///< number of context models for chroma sig flag |
---|
| 93 | #if LAST_CTX_REDUCTION |
---|
| 94 | #define NUM_CTX_LAST_FLAG_XY 15 ///< number of context models for last coefficient position |
---|
[2] | 95 | #else |
---|
[56] | 96 | #define NUM_CTX_LAST_FLAG_XY 18 ///< number of context models for last coefficient position |
---|
[2] | 97 | #endif |
---|
| 98 | |
---|
[56] | 99 | #if LEVEL_CTX_LUMA_RED |
---|
| 100 | #define NUM_ONE_FLAG_CTX 24 ///< number of context models for greater than 1 flag |
---|
| 101 | #define NUM_ONE_FLAG_CTX_LUMA 16 ///< number of context models for greater than 1 flag of luma |
---|
| 102 | #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma |
---|
| 103 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
| 104 | #define NUM_ABS_FLAG_CTX 6 ///< number of context models for greater than 2 flag |
---|
| 105 | #define NUM_ABS_FLAG_CTX_LUMA 4 ///< number of context models for greater than 2 flag of luma |
---|
| 106 | #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma |
---|
| 107 | #else |
---|
| 108 | #define NUM_ABS_FLAG_CTX 18 ///< number of context models for greater than 2 flag |
---|
| 109 | #define NUM_ABS_FLAG_CTX_LUMA 12 ///< number of context models for greater than 2 flag of luma |
---|
| 110 | #define NUM_ABS_FLAG_CTX_CHROMA 6 ///< number of context models for greater than 2 flag of chroma |
---|
| 111 | #endif |
---|
| 112 | #else |
---|
| 113 | #define NUM_ONE_FLAG_CTX 32 ///< number of context models for greater than 1 flag |
---|
| 114 | #define NUM_ONE_FLAG_CTX_LUMA 24 ///< number of context models for greater than 1 flag of luma |
---|
| 115 | #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma |
---|
| 116 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
| 117 | #define NUM_ABS_FLAG_CTX 8 ///< number of context models for greater than 2 flag |
---|
| 118 | #define NUM_ABS_FLAG_CTX_LUMA 6 ///< number of context models for greater than 2 flag of luma |
---|
| 119 | #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma |
---|
| 120 | #else |
---|
| 121 | #define NUM_ABS_FLAG_CTX 24 ///< number of context models for greater than 2 flag |
---|
| 122 | #define NUM_ABS_FLAG_CTX_LUMA 18 ///< number of context models for greater than 2 flag of luma |
---|
| 123 | #define NUM_ABS_FLAG_CTX_CHROMA 6 ///< number of context models for greater than 2 flag of chroma |
---|
| 124 | #endif |
---|
| 125 | #endif |
---|
| 126 | |
---|
[2] | 127 | #define NUM_MVP_IDX_CTX 2 ///< number of context models for MVP index |
---|
| 128 | |
---|
| 129 | #define NUM_ALF_FLAG_CTX 1 ///< number of context models for ALF flag |
---|
| 130 | #define NUM_ALF_UVLC_CTX 2 ///< number of context models for ALF UVLC (filter length) |
---|
| 131 | #define NUM_ALF_SVLC_CTX 3 ///< number of context models for ALF SVLC (filter coeff.) |
---|
| 132 | |
---|
[56] | 133 | #define NUM_SAO_FLAG_CTX 1 ///< number of context models for SAO flag |
---|
| 134 | #define NUM_SAO_UVLC_CTX 2 ///< number of context models for SAO UVLC |
---|
| 135 | #define NUM_SAO_SVLC_CTX 3 ///< number of context models for SAO SVLC |
---|
| 136 | #if SAO_UNIT_INTERLEAVING |
---|
| 137 | #define NUM_SAO_RUN_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
| 138 | #define NUM_SAO_MERGE_LEFT_FLAG_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
| 139 | #define NUM_SAO_MERGE_UP_FLAG_CTX 1 ///< number of context models for AO SVLC (filter coeff.) |
---|
| 140 | #define NUM_SAO_TYPE_IDX_CTX 2 ///< number of context models for AO SVLC (filter coeff.) |
---|
[2] | 141 | #endif |
---|
[56] | 142 | #if CABAC_LINEAR_INIT |
---|
| 143 | #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' |
---|
| 144 | #else |
---|
| 145 | #define CNU 119 ///< dummy initialization value for unused context models 'Context model Not Used' |
---|
| 146 | #endif |
---|
[2] | 147 | |
---|
[5] | 148 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[56] | 149 | #define NUM_DMM_FLAG_CTX 1 ///< number of context models for DMM flag |
---|
| 150 | #define NUM_DMM_MODE_CTX 1 ///< number of context models for DMM mode |
---|
| 151 | #define NUM_DMM_DATA_CTX 3 ///< number of context models for DMM data |
---|
[2] | 152 | #endif |
---|
| 153 | |
---|
[100] | 154 | #if LGE_EDGE_INTRA |
---|
| 155 | #define NUM_EDGE_INTRA_CTX 1 |
---|
| 156 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
| 157 | #define NUM_EDGE_INTRA_DELTA_DC_CTX 2 // one for Delta_DC flag, another for Delta_DC value |
---|
| 158 | #endif |
---|
| 159 | #endif |
---|
| 160 | |
---|
[2] | 161 | // ==================================================================================================================== |
---|
| 162 | // Tables |
---|
| 163 | // ==================================================================================================================== |
---|
| 164 | |
---|
[56] | 165 | // initial probability for split flag |
---|
| 166 | #if CABAC_LINEAR_INIT |
---|
| 167 | static const UChar |
---|
| 168 | INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = |
---|
[2] | 169 | { |
---|
[56] | 170 | { 139, 141, 157, }, |
---|
| 171 | { 107, 139, 126, }, |
---|
| 172 | { 107, 139, 126, }, |
---|
[2] | 173 | }; |
---|
| 174 | |
---|
[56] | 175 | static const UChar |
---|
| 176 | INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] = |
---|
[2] | 177 | { |
---|
[56] | 178 | { CNU, CNU, CNU, }, |
---|
| 179 | { 197, 185, 201, }, |
---|
| 180 | { 197, 185, 201, }, |
---|
[2] | 181 | }; |
---|
| 182 | |
---|
[56] | 183 | static const UChar |
---|
| 184 | INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = |
---|
[2] | 185 | { |
---|
[56] | 186 | { 200, }, |
---|
| 187 | { 139, }, |
---|
| 188 | { 169, }, |
---|
[2] | 189 | }; |
---|
| 190 | |
---|
[56] | 191 | static const UChar |
---|
| 192 | INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = |
---|
| 193 | { |
---|
| 194 | { CNU, }, |
---|
| 195 | { 110, }, |
---|
| 196 | { 154, }, |
---|
| 197 | }; |
---|
[2] | 198 | |
---|
[56] | 199 | static const UChar |
---|
| 200 | INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = |
---|
[2] | 201 | { |
---|
[56] | 202 | #if MRG_IDX_CTX_RED |
---|
| 203 | { CNU, }, |
---|
| 204 | { 122, }, |
---|
| 205 | { 137, }, |
---|
| 206 | #else |
---|
| 207 | { CNU, CNU, CNU, CNU, }, |
---|
| 208 | { 122, 138, 153, 182, }, |
---|
| 209 | { 137, 139, 154, 139, }, |
---|
| 210 | #endif |
---|
| 211 | }; |
---|
| 212 | |
---|
| 213 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
| 214 | static const UChar |
---|
| 215 | INIT_RES_PRED_FLAG[3][NUM_RES_PRED_FLAG_CTX] = |
---|
| 216 | { |
---|
| 217 | { CNU, CNU, CNU, CNU }, |
---|
| 218 | { 154, 154, 154, 154 }, |
---|
| 219 | { 154, 154, 154, 154 }, |
---|
| 220 | }; |
---|
| 221 | #endif |
---|
| 222 | |
---|
| 223 | static const UChar |
---|
| 224 | INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = |
---|
| 225 | { |
---|
| 226 | { 184, CNU, CNU, CNU, }, |
---|
| 227 | { 154, 139, CNU, CNU, }, |
---|
| 228 | { 154, 139, CNU, CNU, }, |
---|
| 229 | }; |
---|
| 230 | |
---|
| 231 | #if AMP_CTX |
---|
| 232 | static const UChar |
---|
| 233 | INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = |
---|
| 234 | { |
---|
| 235 | { CNU, }, |
---|
| 236 | { 154, }, |
---|
| 237 | { 154, }, |
---|
| 238 | }; |
---|
| 239 | #else |
---|
| 240 | static const UChar |
---|
| 241 | INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] = |
---|
| 242 | { |
---|
| 243 | { CNU, CNU, }, |
---|
| 244 | { 154, 139, }, |
---|
| 245 | { 154, 139, }, |
---|
| 246 | }; |
---|
| 247 | |
---|
| 248 | static const UChar |
---|
| 249 | INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] = |
---|
| 250 | { |
---|
| 251 | { CNU, CNU, }, |
---|
| 252 | { 154, 154, }, |
---|
| 253 | { 154, 139, }, |
---|
| 254 | }; |
---|
| 255 | #endif |
---|
| 256 | |
---|
| 257 | static const UChar |
---|
| 258 | INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = |
---|
| 259 | { |
---|
| 260 | { CNU, }, |
---|
| 261 | { 149, }, |
---|
| 262 | { 134, }, |
---|
| 263 | }; |
---|
| 264 | |
---|
| 265 | static const UChar |
---|
| 266 | INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = |
---|
| 267 | { |
---|
| 268 | { 184, }, |
---|
| 269 | { 154, }, |
---|
| 270 | { 183, }, |
---|
| 271 | }; |
---|
| 272 | |
---|
| 273 | static const UChar |
---|
| 274 | INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = |
---|
| 275 | { |
---|
| 276 | { 63, 139, }, |
---|
| 277 | { 152, 139, }, |
---|
| 278 | { 152, 139, }, |
---|
| 279 | }; |
---|
| 280 | |
---|
| 281 | static const UChar |
---|
| 282 | INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = |
---|
| 283 | { |
---|
| 284 | { CNU, CNU, CNU, CNU, }, |
---|
| 285 | #if CABAC_INIT_FLAG |
---|
| 286 | { 95, 79, 63, 31, }, |
---|
| 287 | #else |
---|
| 288 | { CNU, CNU, CNU, CNU, }, |
---|
| 289 | #endif |
---|
| 290 | { 95, 79, 63, 31, }, |
---|
| 291 | }; |
---|
| 292 | |
---|
| 293 | static const UChar |
---|
| 294 | INIT_MVD[3][NUM_MV_RES_CTX] = |
---|
| 295 | { |
---|
| 296 | { CNU, CNU, }, |
---|
| 297 | { 140, 198, }, |
---|
| 298 | { 169, 198, }, |
---|
| 299 | }; |
---|
| 300 | |
---|
| 301 | static const UChar |
---|
| 302 | INIT_REF_PIC[3][NUM_REF_NO_CTX] = |
---|
| 303 | { |
---|
| 304 | { CNU, CNU, CNU, CNU, }, |
---|
| 305 | { 153, 153, 139, CNU, }, |
---|
| 306 | { 153, 153, 168, CNU, }, |
---|
| 307 | }; |
---|
| 308 | |
---|
| 309 | static const UChar |
---|
| 310 | INIT_DQP[3][NUM_DELTA_QP_CTX] = |
---|
| 311 | { |
---|
| 312 | { 154, 154, 154, }, |
---|
| 313 | { 154, 154, 154, }, |
---|
| 314 | { 154, 154, 154, }, |
---|
| 315 | }; |
---|
| 316 | |
---|
| 317 | static const UChar |
---|
| 318 | INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = |
---|
| 319 | { |
---|
| 320 | { 111, 141, CNU, CNU, CNU, 94, 138, 182, CNU, CNU, }, |
---|
| 321 | { 153, 111, CNU, CNU, CNU, 149, 107, 167, CNU, CNU, }, |
---|
| 322 | { 153, 111, CNU, CNU, CNU, 149, 92, 167, CNU, CNU, }, |
---|
| 323 | }; |
---|
| 324 | |
---|
| 325 | static const UChar |
---|
| 326 | INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = |
---|
| 327 | { |
---|
| 328 | { CNU, }, |
---|
| 329 | { 79, }, |
---|
| 330 | { 79, }, |
---|
| 331 | }; |
---|
| 332 | |
---|
| 333 | #if LAST_CTX_REDUCTION |
---|
| 334 | static const UChar |
---|
| 335 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
| 336 | { |
---|
| 337 | { 110, 110, 124, 110, 140, 111, 125, 111, 127, 111, 111, 156, 127, 127, 111, |
---|
| 338 | 108, 123, 63, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 339 | }, |
---|
| 340 | { 125, 110, 94, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
| 341 | 108, 123, 108, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 342 | }, |
---|
| 343 | { 125, 110, 124, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
| 344 | 108, 123, 93, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 345 | }, |
---|
| 346 | }; |
---|
| 347 | #else |
---|
| 348 | static const UChar |
---|
| 349 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
| 350 | { |
---|
| 351 | { 110, 110, 124, 110, 140, 111, 124, 125, 111, 127, 111, 138, 111, 156, 127, 127, 111, 94, |
---|
| 352 | 108, 123, 63, 63, 139, 124, 93, 108, 125, 111, 110, 63, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 353 | }, |
---|
| 354 | { 125, 110, 124, 110, 125, 110, 153, 125, 111, 111, 110, 153, 139, 111, 111, 111, 125, 139, |
---|
| 355 | 108, 123, 108, 152, 124, 94, 123, 137, 139, 110, 110, 154, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 356 | }, |
---|
| 357 | { 125, 110, 124, 110, 125, 110, 153, 125, 111, 111, 110, 153, 139, 111, 111, 111, 125, 139, |
---|
| 358 | 108, 123, 93, 152, 124, 94, 123, 152, 139, 110, 110, 154, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 359 | }, |
---|
| 360 | }; |
---|
| 361 | #endif |
---|
| 362 | |
---|
| 363 | static const UChar |
---|
| 364 | INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = |
---|
| 365 | { |
---|
| 366 | { 91, 171, |
---|
| 367 | 134, 141, |
---|
| 368 | }, |
---|
| 369 | { 121, 140, |
---|
| 370 | 61, 154, |
---|
| 371 | }, |
---|
| 372 | { 121, 140, |
---|
| 373 | 61, 154, |
---|
| 374 | }, |
---|
| 375 | }; |
---|
| 376 | |
---|
| 377 | static const UChar |
---|
| 378 | INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = |
---|
| 379 | { |
---|
| 380 | { 141, 111, 125, 110, 110, 94, 124, 108, 124, 125, 139, 124, 63, 139, 168, 138, 107, 123, 92, 111, 141, 107, 125, 141, 179, 153, 125, 140, 139, 182, 123, 47, 153, 182, 137, 149, 192, 152, 224, 136, 31, 136, 74, 140, 141, 136, 139, 111, }, |
---|
| 381 | { 170, 154, 139, 153, 139, 123, 123, 63, 153, 168, 153, 152, 92, 152, 152, 137, 122, 92, 61, 155, 185, 166, 183, 140, 136, 153, 154, 155, 153, 123, 63, 61, 167, 153, 167, 136, 149, 107, 136, 121, 122, 91, 149, 170, 185, 151, 183, 140, }, |
---|
| 382 | { 170, 154, 139, 153, 139, 123, 123, 63, 124, 139, 153, 152, 92, 152, 152, 137, 137, 92, 61, 170, 185, 166, 183, 140, 136, 153, 154, 155, 153, 138, 107, 61, 167, 153, 167, 136, 121, 122, 136, 121, 122, 91, 149, 170, 170, 151, 183, 140, }, |
---|
| 383 | }; |
---|
| 384 | |
---|
| 385 | #if LEVEL_CTX_LUMA_RED |
---|
| 386 | static const UChar |
---|
| 387 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
| 388 | { |
---|
| 389 | { 140, 92, 137, 138, 140, 152, 138, 139, 153, 74, 149, 92, 139, 107, 122, 152, 140, 179, 166, 182, 140, 227, 122, 197, }, |
---|
| 390 | { 154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 137, 169, 194, 166, 167, 154, 167, 137, 182, }, |
---|
| 391 | { 154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 122, 169, 208, 166, 167, 154, 152, 167, 182, }, |
---|
| 392 | }; |
---|
| 393 | |
---|
| 394 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
| 395 | static const UChar |
---|
| 396 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
| 397 | { |
---|
| 398 | { 138, 153, 136, 167, 152, 152, }, |
---|
| 399 | { 107, 167, 91, 122, 107, 167, }, |
---|
| 400 | { 107, 167, 91, 107, 107, 167, }, |
---|
| 401 | }; |
---|
| 402 | #else |
---|
| 403 | static const UChar |
---|
| 404 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
| 405 | { |
---|
| 406 | { 138, 139, 111, 153, 139, 111, 136, 167, 139, 167, 153, 139, 152, 139, 140, 152, 184, 141, }, |
---|
| 407 | { 107, 153, 125, 167, 153, 140, 91, 137, 153, 122, 167, 139, 107, 153, 140, 167, 183, 140, }, |
---|
| 408 | { 107, 153, 125, 167, 153, 140, 91, 137, 153, 107, 167, 139, 107, 153, 140, 167, 183, 140, }, |
---|
| 409 | }; |
---|
| 410 | #endif |
---|
| 411 | #else |
---|
| 412 | static const UChar |
---|
| 413 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
| 414 | { |
---|
| 415 | { 140, 92, 137, 138, 140, 152, 138, 139, 126, 168, 139, 139, 153, 74, 149, 92, 139, 107, 122, 152, 110, 93, 152, 138, 140, 179, 166, 182, 140, 227, 122, 197, }, |
---|
| 416 | { 154, 196, 196, 167, 154, 152, 167, 182, 155, 139, 139, 139, 182, 134, 149, 136, 153, 121, 136, 137, 139, 122, 152, 167, 169, 194, 166, 167, 154, 167, 137, 182, }, |
---|
| 417 | { 154, 196, 167, 167, 154, 152, 167, 182, 155, 139, 139, 139, 182, 134, 149, 136, 153, 121, 136, 122, 139, 107, 152, 152, 169, 208, 166, 167, 154, 152, 167, 182, }, |
---|
| 418 | }; |
---|
| 419 | |
---|
| 420 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
| 421 | static const UChar |
---|
| 422 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
| 423 | { |
---|
| 424 | { 138, 153, 139, 136, 167, 153, 152, 152, }, |
---|
| 425 | { 107, 167, 139, 91, 122, 152, 107, 167, }, |
---|
| 426 | { 107, 167, 139, 91, 107, 93, 107, 167, }, |
---|
| 427 | }; |
---|
| 428 | #else |
---|
| 429 | static const UChar |
---|
| 430 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
| 431 | { |
---|
| 432 | { 138, 139, 111, 153, 139, 111, 139, 125, 111, 136, 167, 139, 167, 153, 139, 153, 139, 110, 152, 139, 140, 152, 184, 141, }, |
---|
| 433 | { 107, 153, 125, 167, 153, 140, 139, 154, 155, 91, 137, 153, 122, 167, 139, 152, 138, 139, 107, 153, 140, 167, 183, 140, }, |
---|
| 434 | { 107, 153, 125, 167, 153, 140, 139, 154, 155, 91, 137, 153, 107, 167, 139, 93, 138, 139, 107, 153, 140, 167, 183, 140, }, |
---|
| 435 | }; |
---|
| 436 | #endif |
---|
| 437 | #endif |
---|
| 438 | |
---|
| 439 | static const UChar |
---|
| 440 | INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = |
---|
| 441 | { |
---|
| 442 | { CNU, CNU, }, |
---|
| 443 | { 168, CNU, }, |
---|
| 444 | { 168, CNU, }, |
---|
| 445 | }; |
---|
| 446 | |
---|
| 447 | static const UChar |
---|
| 448 | INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] = |
---|
| 449 | { |
---|
| 450 | { 153, }, |
---|
| 451 | { 153, }, |
---|
| 452 | { 153, }, |
---|
| 453 | }; |
---|
| 454 | |
---|
| 455 | static const UChar |
---|
| 456 | INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] = |
---|
| 457 | { |
---|
| 458 | { 140, 154, }, |
---|
| 459 | { 154, 154, }, |
---|
| 460 | { 154, 154, }, |
---|
| 461 | }; |
---|
| 462 | |
---|
| 463 | static const UChar |
---|
| 464 | INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] = |
---|
| 465 | { |
---|
| 466 | { 187, 154, 159, }, |
---|
| 467 | { 141, 154, 189, }, |
---|
| 468 | { 141, 154, 159, }, |
---|
| 469 | }; |
---|
| 470 | |
---|
| 471 | static const UChar |
---|
| 472 | INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = |
---|
| 473 | { |
---|
| 474 | { 154, }, |
---|
| 475 | { 153, }, |
---|
| 476 | { 153, }, |
---|
| 477 | }; |
---|
| 478 | |
---|
| 479 | static const UChar |
---|
| 480 | INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] = |
---|
| 481 | { |
---|
| 482 | { 143, 140, }, |
---|
| 483 | { 185, 140, }, |
---|
| 484 | { 200, 140, }, |
---|
| 485 | }; |
---|
| 486 | |
---|
| 487 | static const UChar |
---|
| 488 | INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] = |
---|
| 489 | { |
---|
| 490 | { 247, 154, 244, }, |
---|
| 491 | { 215, 154, 169, }, |
---|
| 492 | { 215, 154, 169, }, |
---|
| 493 | }; |
---|
| 494 | |
---|
| 495 | #if SAO_UNIT_INTERLEAVING |
---|
| 496 | static const UChar |
---|
| 497 | INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = |
---|
| 498 | { |
---|
| 499 | { 153, 153, 153, }, |
---|
| 500 | { 153, 153, 153, }, |
---|
| 501 | { 153, 153, 153, }, |
---|
| 502 | }; |
---|
| 503 | |
---|
| 504 | static const UChar |
---|
| 505 | INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = |
---|
| 506 | { |
---|
| 507 | { 175, }, |
---|
| 508 | { 153, }, |
---|
| 509 | { 153, }, |
---|
| 510 | }; |
---|
| 511 | |
---|
| 512 | static const UChar |
---|
| 513 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
| 514 | { |
---|
| 515 | { 160, 140, }, |
---|
| 516 | { 185, 140, }, |
---|
| 517 | { 200, 140, }, |
---|
| 518 | }; |
---|
| 519 | #endif |
---|
| 520 | |
---|
| 521 | static const UChar |
---|
| 522 | INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = |
---|
| 523 | { |
---|
| 524 | { CNU, 224, 167, 122, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
| 525 | { CNU, 124, 138, 94, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
| 526 | { CNU, 153, 138, 138, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
| 527 | }; |
---|
| 528 | #else |
---|
| 529 | static const UChar |
---|
| 530 | INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = |
---|
| 531 | { |
---|
[2] | 532 | { |
---|
[56] | 533 | 87, 74, 107, |
---|
| 534 | |
---|
[2] | 535 | }, |
---|
| 536 | { |
---|
[56] | 537 | 84, 103, 105, |
---|
| 538 | |
---|
[2] | 539 | }, |
---|
| 540 | { |
---|
[56] | 541 | 84, 103, 105, |
---|
| 542 | |
---|
| 543 | }, |
---|
[2] | 544 | }; |
---|
| 545 | |
---|
| 546 | // initial probability for skip flag |
---|
[56] | 547 | static const UChar |
---|
| 548 | INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] = |
---|
[2] | 549 | { |
---|
| 550 | { |
---|
[56] | 551 | CNU, CNU, CNU, |
---|
| 552 | |
---|
[2] | 553 | }, |
---|
| 554 | { |
---|
[56] | 555 | 165, 168, 154, |
---|
| 556 | |
---|
[2] | 557 | }, |
---|
| 558 | { |
---|
[56] | 559 | 165, 168, 154, |
---|
| 560 | |
---|
| 561 | }, |
---|
[2] | 562 | }; |
---|
| 563 | |
---|
| 564 | // initial probability for skip flag |
---|
[56] | 565 | static const UChar |
---|
| 566 | INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = |
---|
[2] | 567 | { |
---|
| 568 | { |
---|
[56] | 569 | 153, |
---|
| 570 | |
---|
[2] | 571 | }, |
---|
| 572 | { |
---|
[56] | 573 | 87, |
---|
| 574 | |
---|
[2] | 575 | }, |
---|
| 576 | { |
---|
[56] | 577 | 135, |
---|
| 578 | |
---|
| 579 | }, |
---|
[2] | 580 | }; |
---|
| 581 | |
---|
| 582 | // initial probability for merge flag |
---|
[56] | 583 | static const UChar |
---|
| 584 | INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = |
---|
[2] | 585 | { |
---|
| 586 | { |
---|
[56] | 587 | CNU, |
---|
| 588 | |
---|
[2] | 589 | }, |
---|
| 590 | { |
---|
[56] | 591 | 72, |
---|
| 592 | |
---|
[2] | 593 | }, |
---|
| 594 | { |
---|
[56] | 595 | 119, |
---|
| 596 | |
---|
| 597 | }, |
---|
[2] | 598 | }; |
---|
| 599 | |
---|
[56] | 600 | static const UChar |
---|
| 601 | INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = |
---|
[2] | 602 | { |
---|
[56] | 603 | #if MRG_IDX_CTX_RED |
---|
[2] | 604 | { |
---|
[56] | 605 | CNU, |
---|
| 606 | |
---|
[2] | 607 | }, |
---|
| 608 | { |
---|
[56] | 609 | 100, |
---|
| 610 | |
---|
[2] | 611 | }, |
---|
| 612 | { |
---|
[56] | 613 | 116, |
---|
| 614 | }, |
---|
| 615 | #else |
---|
| 616 | { |
---|
| 617 | CNU, CNU, CNU, CNU, |
---|
| 618 | |
---|
| 619 | }, |
---|
| 620 | { |
---|
| 621 | 100, 86, 102, 133, |
---|
| 622 | |
---|
| 623 | }, |
---|
| 624 | { |
---|
| 625 | 116, 87, 119, 103, |
---|
| 626 | |
---|
| 627 | }, |
---|
| 628 | #endif |
---|
[2] | 629 | }; |
---|
| 630 | |
---|
[56] | 631 | // initial probability for PU size |
---|
| 632 | static const UChar |
---|
| 633 | INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = |
---|
[2] | 634 | { |
---|
| 635 | { |
---|
[56] | 636 | 167, CNU, CNU, CNU, |
---|
| 637 | |
---|
[2] | 638 | }, |
---|
| 639 | { |
---|
[56] | 640 | 119, 87, CNU, CNU, |
---|
| 641 | |
---|
[2] | 642 | }, |
---|
| 643 | { |
---|
[56] | 644 | 119, 87, CNU, CNU, |
---|
| 645 | |
---|
| 646 | }, |
---|
[2] | 647 | }; |
---|
[56] | 648 | #if AMP_CTX |
---|
| 649 | static const UChar |
---|
| 650 | INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = |
---|
[2] | 651 | { |
---|
| 652 | { |
---|
[56] | 653 | CNU, |
---|
[2] | 654 | }, |
---|
| 655 | { |
---|
[56] | 656 | 119, |
---|
[2] | 657 | }, |
---|
| 658 | { |
---|
[56] | 659 | 119, |
---|
| 660 | }, |
---|
[2] | 661 | }; |
---|
[56] | 662 | #else |
---|
| 663 | // initial probability for AMP split position (X) |
---|
| 664 | static const UChar |
---|
| 665 | INIT_CU_X_POS[3][NUM_CU_X_POS_CTX] = |
---|
| 666 | { |
---|
| 667 | { |
---|
| 668 | CNU, CNU, |
---|
| 669 | |
---|
| 670 | }, |
---|
| 671 | { |
---|
| 672 | 119, 103, |
---|
| 673 | |
---|
| 674 | }, |
---|
| 675 | { |
---|
| 676 | 119, 103, |
---|
| 677 | |
---|
| 678 | }, |
---|
| 679 | }; |
---|
[2] | 680 | |
---|
[56] | 681 | // initial probability for AMP split position (Y) |
---|
| 682 | static const UChar |
---|
| 683 | INIT_CU_Y_POS[3][NUM_CU_Y_POS_CTX] = |
---|
[2] | 684 | { |
---|
| 685 | { |
---|
[56] | 686 | CNU, CNU, |
---|
| 687 | |
---|
[2] | 688 | }, |
---|
| 689 | { |
---|
[56] | 690 | 119, 119, |
---|
| 691 | |
---|
[2] | 692 | }, |
---|
| 693 | { |
---|
[56] | 694 | 119, 103, |
---|
| 695 | |
---|
| 696 | }, |
---|
[2] | 697 | }; |
---|
[56] | 698 | #endif |
---|
[2] | 699 | // initial probability for prediction mode |
---|
[56] | 700 | static const UChar |
---|
| 701 | INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = |
---|
[2] | 702 | { |
---|
| 703 | { |
---|
[56] | 704 | CNU, |
---|
| 705 | |
---|
[2] | 706 | }, |
---|
| 707 | { |
---|
[56] | 708 | 114, |
---|
| 709 | |
---|
[2] | 710 | }, |
---|
| 711 | { |
---|
[56] | 712 | 98, |
---|
| 713 | |
---|
| 714 | }, |
---|
[2] | 715 | }; |
---|
| 716 | |
---|
| 717 | // initial probability for intra direction of luma |
---|
[56] | 718 | static const UChar |
---|
| 719 | INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = |
---|
[2] | 720 | { |
---|
| 721 | { |
---|
[56] | 722 | 167, |
---|
| 723 | |
---|
[2] | 724 | }, |
---|
| 725 | { |
---|
[56] | 726 | 119, |
---|
| 727 | |
---|
[2] | 728 | }, |
---|
| 729 | { |
---|
[56] | 730 | 150, |
---|
| 731 | |
---|
| 732 | }, |
---|
[2] | 733 | }; |
---|
[56] | 734 | |
---|
| 735 | // initial probability for intra direction of chroma |
---|
| 736 | static const UChar |
---|
| 737 | INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = |
---|
[2] | 738 | { |
---|
| 739 | { |
---|
[56] | 740 | 53, 103, |
---|
| 741 | |
---|
[2] | 742 | }, |
---|
| 743 | { |
---|
[56] | 744 | 85, 87, |
---|
| 745 | |
---|
[2] | 746 | }, |
---|
| 747 | { |
---|
[56] | 748 | 101, 87, |
---|
| 749 | |
---|
| 750 | }, |
---|
[2] | 751 | }; |
---|
| 752 | |
---|
[56] | 753 | // initial probability for temporal direction |
---|
| 754 | static const UChar |
---|
| 755 | INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = |
---|
[2] | 756 | { |
---|
| 757 | { |
---|
[56] | 758 | CNU, CNU, CNU, CNU, |
---|
| 759 | |
---|
[2] | 760 | }, |
---|
| 761 | { |
---|
[56] | 762 | CNU, CNU, CNU, CNU, |
---|
| 763 | |
---|
[2] | 764 | }, |
---|
| 765 | { |
---|
[56] | 766 | 41, 39, 38, 36, |
---|
| 767 | |
---|
| 768 | }, |
---|
[2] | 769 | }; |
---|
| 770 | |
---|
[56] | 771 | // initial probability for motion vector difference |
---|
| 772 | static const UChar |
---|
| 773 | INIT_MVD[3][NUM_MV_RES_CTX] = |
---|
[2] | 774 | { |
---|
| 775 | { |
---|
[56] | 776 | CNU, CNU, |
---|
| 777 | |
---|
[2] | 778 | }, |
---|
| 779 | { |
---|
[56] | 780 | 120, 166, |
---|
| 781 | |
---|
[2] | 782 | }, |
---|
| 783 | { |
---|
[56] | 784 | 135, 166, |
---|
| 785 | |
---|
| 786 | }, |
---|
| 787 | }; |
---|
| 788 | |
---|
| 789 | // initial probability for reference frame index |
---|
| 790 | static const UChar |
---|
| 791 | INIT_REF_PIC[3][NUM_REF_NO_CTX] = |
---|
| 792 | { |
---|
[2] | 793 | { |
---|
[56] | 794 | CNU, CNU, CNU, CNU, |
---|
| 795 | |
---|
[2] | 796 | }, |
---|
| 797 | { |
---|
[56] | 798 | 102, 118, 103, CNU, |
---|
| 799 | |
---|
[2] | 800 | }, |
---|
| 801 | { |
---|
[56] | 802 | 118, 118, 134, CNU, |
---|
| 803 | |
---|
| 804 | }, |
---|
[2] | 805 | }; |
---|
| 806 | |
---|
[56] | 807 | // initial probability for dQP |
---|
| 808 | static const UChar |
---|
| 809 | INIT_DQP[3][NUM_DELTA_QP_CTX] = |
---|
[2] | 810 | { |
---|
| 811 | { |
---|
[56] | 812 | CNU, CNU, CNU, |
---|
| 813 | |
---|
[2] | 814 | }, |
---|
| 815 | { |
---|
[56] | 816 | CNU, CNU, CNU, |
---|
| 817 | |
---|
[2] | 818 | }, |
---|
| 819 | { |
---|
[56] | 820 | CNU, CNU, CNU, |
---|
| 821 | |
---|
| 822 | }, |
---|
[2] | 823 | }; |
---|
| 824 | |
---|
[56] | 825 | static const UChar |
---|
| 826 | INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = |
---|
[2] | 827 | { |
---|
| 828 | { |
---|
[56] | 829 | 73, 74, CNU, CNU, CNU, |
---|
| 830 | 55, 86, 133, CNU, CNU, |
---|
| 831 | |
---|
[2] | 832 | }, |
---|
| 833 | { |
---|
[56] | 834 | 102, 89, CNU, CNU, CNU, |
---|
| 835 | 114, 84, 117, CNU, CNU, |
---|
| 836 | |
---|
[2] | 837 | }, |
---|
| 838 | { |
---|
[56] | 839 | 102, 89, CNU, CNU, CNU, |
---|
| 840 | 114, 68, 117, CNU, CNU, |
---|
| 841 | |
---|
| 842 | }, |
---|
[2] | 843 | }; |
---|
| 844 | |
---|
[56] | 845 | static const UChar |
---|
| 846 | INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = |
---|
[2] | 847 | { |
---|
| 848 | { |
---|
[56] | 849 | CNU, |
---|
| 850 | |
---|
[2] | 851 | }, |
---|
| 852 | { |
---|
[56] | 853 | 39, |
---|
| 854 | |
---|
[2] | 855 | }, |
---|
| 856 | { |
---|
[56] | 857 | 39, |
---|
| 858 | |
---|
| 859 | }, |
---|
[2] | 860 | }; |
---|
| 861 | |
---|
[56] | 862 | #if LAST_CTX_REDUCTION |
---|
| 863 | static const UChar |
---|
| 864 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
[2] | 865 | { |
---|
[56] | 866 | { |
---|
| 867 | 72, 72, 71, 72, 104, 89, 88, 89, 59, 73, 89, 106, 60, 59, 43, |
---|
| 868 | 54, 70, 53, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 869 | }, |
---|
| 870 | { |
---|
| 871 | 57, 72, 55, 72, 57, 72, 88, 73, 73, 72, 103, 73, 89, 73, 57, |
---|
| 872 | 54, 70, 54, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 873 | }, |
---|
| 874 | { |
---|
| 875 | 88, 72, 71, 72, 57, 72, 88, 73, 73, 72, 103, 73, 89, 73, 57, |
---|
| 876 | 54, 70, 69, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 877 | }, |
---|
[2] | 878 | }; |
---|
[56] | 879 | #else |
---|
| 880 | static const UChar |
---|
| 881 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
[2] | 882 | { |
---|
| 883 | { |
---|
[56] | 884 | 72, 72, 71, 72, 104, 89, 71, 88, 89, 59, 73, 86, 89, 106, 60, 59, 43, 55, |
---|
| 885 | 54, 70, 53, 53, 87, 71, 69, 54, 88, 73, 72, 53, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 886 | |
---|
[2] | 887 | }, |
---|
| 888 | { |
---|
[56] | 889 | 57, 72, 71, 72, 57, 72, 102, 88, 73, 73, 72, 102, 103, 73, 89, 73, 57, 87, |
---|
| 890 | 54, 70, 54, 101, 71, 55, 70, 116, 103, 72, 72, 119, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 891 | |
---|
[2] | 892 | }, |
---|
| 893 | { |
---|
[56] | 894 | 88, 72, 71, 72, 57, 72, 102, 88, 73, 73, 72, 118, 103, 73, 89, 73, 57, 87, |
---|
| 895 | 54, 70, 69, 85, 71, 55, 70, 85, 103, 72, 72, 119, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 896 | |
---|
| 897 | }, |
---|
[2] | 898 | }; |
---|
[56] | 899 | #endif |
---|
[2] | 900 | |
---|
[56] | 901 | static const UChar |
---|
| 902 | INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = |
---|
[2] | 903 | { |
---|
| 904 | { |
---|
[56] | 905 | 83, 122, |
---|
| 906 | 98, 121, |
---|
| 907 | |
---|
[2] | 908 | }, |
---|
| 909 | { |
---|
[56] | 910 | 99, 120, |
---|
| 911 | 67, 119, |
---|
| 912 | |
---|
[2] | 913 | }, |
---|
| 914 | { |
---|
[56] | 915 | 99, 120, |
---|
| 916 | 67, 119, |
---|
| 917 | |
---|
| 918 | }, |
---|
[2] | 919 | }; |
---|
| 920 | |
---|
[56] | 921 | static const UChar |
---|
| 922 | INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = |
---|
[2] | 923 | { |
---|
| 924 | { |
---|
[56] | 925 | 74, 73, 88, 72, 72, 55, 71, 54, 71, 88, 103, 71, 53, 87, 134, 86, 84, 70, 68, 89, 90, 84, 88, 74, 130, 118, 88, |
---|
| 926 | 120, 87, 149, 70, 52, 118, 133, 116, 114, 129, 132, 162, 115, 51, 115, 66, 120, 74, 115, 87, 89, |
---|
[2] | 927 | }, |
---|
| 928 | { |
---|
[56] | 929 | 152, 119, 103, 118, 87, 70, 70, 53, 118, 134, 118, 101, 68, 85, 101, 116, 100, 68, 67, 136, 168, 147, 150, 120, 115, 118, 119, |
---|
| 930 | 136, 102, 70, 53, 67, 117, 102, 117, 115, 114, 84, 115, 99, 100, 83, 114, 152, 168, 131, 150, 120, |
---|
[2] | 931 | }, |
---|
| 932 | { |
---|
[56] | 933 | 152, 119, 103, 118, 87, 70, 70, 53, 71, 103, 118, 101, 68, 85, 101, 116, 116, 68, 67, 152, 168, 147, 150, 120, 115, 118, 119, |
---|
| 934 | 136, 102, 86, 84, 67, 117, 102, 117, 115, 99, 100, 115, 99, 100, 83, 114, 152, 152, 131, 150, 120, |
---|
| 935 | }, |
---|
[2] | 936 | }; |
---|
| 937 | |
---|
[56] | 938 | #if LEVEL_CTX_LUMA_RED |
---|
| 939 | static const UChar |
---|
| 940 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
[2] | 941 | { |
---|
| 942 | { |
---|
[56] | 943 | 104, 68, 116, 86, 104, 132, 86, 87, 102, 66, 114, 68, 87, 84, 100, 101, |
---|
| 944 | 104, 130, 147, 149, 104, 196, 100, 165, |
---|
[2] | 945 | }, |
---|
| 946 | { |
---|
[56] | 947 | 119, 179, 179, 164, 119, 85, 117, 149, 133, 98, 114, 115, 118, 99, 115, 116, |
---|
| 948 | 135, 146, 147, 164, 119, 148, 116, 133, |
---|
[2] | 949 | }, |
---|
| 950 | { |
---|
[56] | 951 | 119, 179, 148, 164, 119, 85, 117, 149, 133, 98, 114, 115, 118, 99, 115, 100, |
---|
| 952 | 135, 177, 147, 164, 119, 132, 148, 149, |
---|
| 953 | }, |
---|
[2] | 954 | }; |
---|
| 955 | |
---|
[56] | 956 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
| 957 | static const UChar |
---|
| 958 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
[2] | 959 | { |
---|
| 960 | { |
---|
[56] | 961 | 86, 102, 115, 117, 101, 101, |
---|
[2] | 962 | }, |
---|
| 963 | { |
---|
[56] | 964 | 84, 117, 83, 100, 84, 117, |
---|
[2] | 965 | }, |
---|
| 966 | { |
---|
[56] | 967 | 84, 117, 83, 84, 84, 117, |
---|
| 968 | }, |
---|
[2] | 969 | }; |
---|
[56] | 970 | #else |
---|
| 971 | static const UChar |
---|
| 972 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
| 973 | { |
---|
| 974 | { |
---|
| 975 | 86, 103, 73, 102, 103, 73, 115, 117, 103, 117, 118, 103, |
---|
| 976 | 101, 103, 104, 101, 167, 121, |
---|
| 977 | }, |
---|
| 978 | { |
---|
| 979 | 84, 102, 88, 117, 118, 104, 83, 116, 118, 100, 117, 87, |
---|
| 980 | 84, 118, 120, 117, 150, 120, |
---|
| 981 | }, |
---|
| 982 | { |
---|
| 983 | 84, 102, 88, 117, 118, 104, 83, 116, 118, 84, 117, 87, |
---|
| 984 | 84, 118, 120, 117, 150, 120, |
---|
| 985 | }, |
---|
| 986 | }; |
---|
[2] | 987 | #endif |
---|
[56] | 988 | #else |
---|
| 989 | static const UChar |
---|
| 990 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
| 991 | { |
---|
| 992 | { |
---|
| 993 | 104, 68, 116, 86, 104, 132, 86, 87, 105, 134, 87, 103, 102, 66, 114, 68, 87, 84, 100, 101, 72, 69, 101, 86, |
---|
| 994 | 104, 130, 147, 149, 104, 196, 100, 165, |
---|
| 995 | }, |
---|
| 996 | { |
---|
| 997 | 119, 179, 179, 164, 119, 85, 117, 149, 136, 103, 103, 103, 133, 98, 114, 115, 118, 99, 115, 116, 87, 100, 85, 117, |
---|
| 998 | 135, 146, 147, 164, 119, 148, 116, 133, |
---|
| 999 | }, |
---|
| 1000 | { |
---|
| 1001 | 119, 179, 148, 164, 119, 85, 117, 149, 136, 87, 103, 103, 133, 98, 114, 115, 118, 99, 115, 100, 87, 84, 85, 85, |
---|
| 1002 | 135, 177, 147, 164, 119, 132, 148, 149, |
---|
| 1003 | }, |
---|
| 1004 | }; |
---|
[2] | 1005 | |
---|
[56] | 1006 | #if RESTRICT_GR1GR2FLAG_NUMBER |
---|
| 1007 | static const UChar |
---|
| 1008 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
[2] | 1009 | { |
---|
| 1010 | { |
---|
[56] | 1011 | 86, 102, 103, 115, 117, 102, 101, 101, |
---|
[2] | 1012 | }, |
---|
| 1013 | { |
---|
[56] | 1014 | 84, 117, 103, 83, 100, 85, 84, 117, |
---|
[2] | 1015 | }, |
---|
| 1016 | { |
---|
[56] | 1017 | 84, 117, 87, 83, 84, 69, 84, 117, |
---|
| 1018 | }, |
---|
[2] | 1019 | }; |
---|
| 1020 | #else |
---|
[56] | 1021 | static const UChar |
---|
| 1022 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
[2] | 1023 | { |
---|
| 1024 | { |
---|
[56] | 1025 | 86, 103, 73, 102, 103, 73, 103, 88, 89, 115, 117, 103, 117, 118, 103, 102, 103, 72, |
---|
| 1026 | 101, 103, 104, 101, 167, 121, |
---|
[2] | 1027 | }, |
---|
| 1028 | { |
---|
[56] | 1029 | 84, 102, 88, 117, 118, 104, 103, 119, 136, 83, 116, 118, 100, 117, 87, 85, 86, 103, |
---|
| 1030 | 84, 118, 120, 117, 150, 120, |
---|
[2] | 1031 | }, |
---|
| 1032 | { |
---|
[56] | 1033 | 84, 102, 88, 117, 118, 104, 87, 119, 136, 83, 116, 118, 84, 117, 87, 69, 86, 87, |
---|
| 1034 | 84, 118, 120, 117, 150, 120, |
---|
| 1035 | }, |
---|
[2] | 1036 | }; |
---|
| 1037 | #endif |
---|
[56] | 1038 | #endif |
---|
| 1039 | // initial probability for motion vector predictor index |
---|
| 1040 | static const UChar |
---|
| 1041 | INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = |
---|
[2] | 1042 | { |
---|
| 1043 | { |
---|
[56] | 1044 | CNU, CNU, |
---|
| 1045 | |
---|
[2] | 1046 | }, |
---|
| 1047 | { |
---|
[56] | 1048 | 134, CNU, |
---|
| 1049 | |
---|
[2] | 1050 | }, |
---|
| 1051 | { |
---|
[56] | 1052 | 134, CNU, |
---|
| 1053 | |
---|
| 1054 | }, |
---|
[2] | 1055 | }; |
---|
| 1056 | |
---|
[56] | 1057 | // initial probability for ALF flag |
---|
| 1058 | static const UChar |
---|
| 1059 | INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] = |
---|
[2] | 1060 | { |
---|
| 1061 | { |
---|
[56] | 1062 | 118, |
---|
| 1063 | |
---|
[2] | 1064 | }, |
---|
| 1065 | { |
---|
[56] | 1066 | 102, |
---|
| 1067 | |
---|
[2] | 1068 | }, |
---|
| 1069 | { |
---|
[56] | 1070 | 102, |
---|
| 1071 | |
---|
| 1072 | }, |
---|
[2] | 1073 | }; |
---|
| 1074 | |
---|
[56] | 1075 | // initial probability for ALF side information (unsigned) |
---|
| 1076 | static const UChar |
---|
| 1077 | INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] = |
---|
[2] | 1078 | { |
---|
| 1079 | { |
---|
[56] | 1080 | 120, 119, |
---|
| 1081 | |
---|
[2] | 1082 | }, |
---|
| 1083 | { |
---|
[56] | 1084 | 119, 119, |
---|
| 1085 | |
---|
[2] | 1086 | }, |
---|
| 1087 | { |
---|
[56] | 1088 | 119, 119, |
---|
| 1089 | |
---|
| 1090 | }, |
---|
[2] | 1091 | }; |
---|
| 1092 | |
---|
[56] | 1093 | // initial probability for ALF side information (signed) |
---|
| 1094 | static const UChar |
---|
| 1095 | INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] = |
---|
[2] | 1096 | { |
---|
| 1097 | { |
---|
[56] | 1098 | 139, 119, 124, |
---|
| 1099 | |
---|
[2] | 1100 | }, |
---|
| 1101 | { |
---|
[56] | 1102 | 90, 119, 140, |
---|
| 1103 | |
---|
[2] | 1104 | }, |
---|
| 1105 | { |
---|
[56] | 1106 | 90, 119, 124, |
---|
| 1107 | |
---|
| 1108 | }, |
---|
[2] | 1109 | }; |
---|
| 1110 | |
---|
[56] | 1111 | // initial probability for SAO flag |
---|
| 1112 | static const UChar |
---|
| 1113 | INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = |
---|
[2] | 1114 | { |
---|
| 1115 | { |
---|
[56] | 1116 | 119, |
---|
| 1117 | |
---|
[2] | 1118 | }, |
---|
| 1119 | { |
---|
[56] | 1120 | 102, |
---|
| 1121 | |
---|
[2] | 1122 | }, |
---|
| 1123 | { |
---|
[56] | 1124 | 102, |
---|
| 1125 | |
---|
| 1126 | }, |
---|
[2] | 1127 | }; |
---|
| 1128 | |
---|
[56] | 1129 | // initial probability for SAO side information (unsigned) |
---|
| 1130 | static const UChar |
---|
| 1131 | INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] = |
---|
[2] | 1132 | { |
---|
| 1133 | { |
---|
[56] | 1134 | 61, 104, |
---|
| 1135 | |
---|
[2] | 1136 | }, |
---|
| 1137 | { |
---|
[56] | 1138 | 168, 120, |
---|
| 1139 | |
---|
[2] | 1140 | }, |
---|
| 1141 | { |
---|
[56] | 1142 | 184, 120, |
---|
| 1143 | |
---|
| 1144 | }, |
---|
[2] | 1145 | }; |
---|
| 1146 | |
---|
[56] | 1147 | // initial probability for SAO side information (signed) |
---|
| 1148 | static const UChar |
---|
| 1149 | INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] = |
---|
[2] | 1150 | { |
---|
| 1151 | { |
---|
[56] | 1152 | 171, 119, 199, |
---|
| 1153 | |
---|
[2] | 1154 | }, |
---|
| 1155 | { |
---|
[56] | 1156 | 169, 119, 151, |
---|
| 1157 | |
---|
[2] | 1158 | }, |
---|
| 1159 | { |
---|
[56] | 1160 | 169, 119, 151, |
---|
| 1161 | |
---|
| 1162 | }, |
---|
[2] | 1163 | }; |
---|
[56] | 1164 | |
---|
| 1165 | #if SAO_UNIT_INTERLEAVING |
---|
| 1166 | static const UChar |
---|
| 1167 | INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = |
---|
[2] | 1168 | { |
---|
| 1169 | { |
---|
[56] | 1170 | 118, 118, 118, |
---|
[2] | 1171 | }, |
---|
| 1172 | { |
---|
[56] | 1173 | 102, 102, 102, |
---|
| 1174 | }, |
---|
| 1175 | { |
---|
| 1176 | 102, 102, 102, |
---|
| 1177 | }, |
---|
| 1178 | }; |
---|
| 1179 | |
---|
| 1180 | static const UChar |
---|
| 1181 | INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = |
---|
| 1182 | { |
---|
| 1183 | { |
---|
| 1184 | 109, |
---|
[2] | 1185 | }, |
---|
| 1186 | { |
---|
[56] | 1187 | 102, |
---|
| 1188 | }, |
---|
| 1189 | { |
---|
| 1190 | 102, |
---|
| 1191 | }, |
---|
[2] | 1192 | }; |
---|
[56] | 1193 | static const UChar |
---|
| 1194 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
[2] | 1195 | { |
---|
| 1196 | { |
---|
[56] | 1197 | 64, 104 |
---|
[2] | 1198 | }, |
---|
| 1199 | { |
---|
[56] | 1200 | 168, 120 |
---|
[2] | 1201 | }, |
---|
| 1202 | { |
---|
[56] | 1203 | 184, 120 |
---|
| 1204 | }, |
---|
[2] | 1205 | }; |
---|
| 1206 | static const Short |
---|
[56] | 1207 | INIT_SAO_RUN[3][NUM_SAO_RUN_CTX][2] = |
---|
[2] | 1208 | { |
---|
| 1209 | { |
---|
| 1210 | { 11, 57 }, { -1, 62 }, { 0, 64 } |
---|
| 1211 | }, |
---|
| 1212 | { |
---|
| 1213 | { 6, 66 }, { -1, 64 }, { 0, 64 } |
---|
| 1214 | }, |
---|
| 1215 | { |
---|
| 1216 | { 1, 73 }, { 2, 61 }, { 0, 64 } |
---|
| 1217 | } |
---|
| 1218 | }; |
---|
| 1219 | #endif |
---|
| 1220 | |
---|
[56] | 1221 | static const UChar |
---|
| 1222 | INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = |
---|
| 1223 | { |
---|
| 1224 | { |
---|
| 1225 | CNU, 162, 148, 100, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 1226 | |
---|
| 1227 | }, |
---|
| 1228 | { |
---|
| 1229 | CNU, 71, 86, 55, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 1230 | |
---|
| 1231 | }, |
---|
| 1232 | { |
---|
| 1233 | CNU, 102, 86, 86, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 1234 | |
---|
| 1235 | }, |
---|
| 1236 | }; |
---|
| 1237 | #endif |
---|
| 1238 | |
---|
| 1239 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[2] | 1240 | static const Short |
---|
[56] | 1241 | INIT_DMM_FLAG[3][NUM_DMM_FLAG_CTX] = |
---|
[2] | 1242 | { |
---|
| 1243 | { |
---|
[56] | 1244 | CNU |
---|
[2] | 1245 | }, |
---|
| 1246 | { |
---|
[56] | 1247 | CNU |
---|
[2] | 1248 | }, |
---|
| 1249 | { |
---|
[56] | 1250 | CNU |
---|
[2] | 1251 | } |
---|
| 1252 | }; |
---|
| 1253 | |
---|
| 1254 | static const Short |
---|
[56] | 1255 | INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] = |
---|
[2] | 1256 | { |
---|
[56] | 1257 | { |
---|
| 1258 | CNU |
---|
| 1259 | }, |
---|
| 1260 | { |
---|
| 1261 | CNU |
---|
| 1262 | }, |
---|
| 1263 | { |
---|
| 1264 | CNU |
---|
| 1265 | } |
---|
[2] | 1266 | }; |
---|
| 1267 | |
---|
| 1268 | static const Short |
---|
[56] | 1269 | INIT_DMM_DATA[3][NUM_DMM_DATA_CTX] = |
---|
[2] | 1270 | { |
---|
| 1271 | { |
---|
[56] | 1272 | CNU, CNU, CNU |
---|
[2] | 1273 | }, |
---|
| 1274 | { |
---|
[56] | 1275 | CNU, CNU, CNU |
---|
[2] | 1276 | }, |
---|
| 1277 | { |
---|
[56] | 1278 | CNU, CNU, CNU |
---|
[2] | 1279 | } |
---|
| 1280 | }; |
---|
[100] | 1281 | |
---|
| 1282 | #if LGE_EDGE_INTRA |
---|
| 1283 | static const Short |
---|
| 1284 | INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] = |
---|
| 1285 | { |
---|
| 1286 | { |
---|
| 1287 | CNU |
---|
| 1288 | }, |
---|
| 1289 | { |
---|
| 1290 | CNU |
---|
| 1291 | }, |
---|
| 1292 | { |
---|
| 1293 | CNU |
---|
| 1294 | } |
---|
| 1295 | }; |
---|
| 1296 | |
---|
| 1297 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
| 1298 | static const Short |
---|
| 1299 | INIT_EDGE_INTRA_DELTA_DC[3][NUM_EDGE_INTRA_DELTA_DC_CTX] = |
---|
| 1300 | { |
---|
| 1301 | { |
---|
| 1302 | CNU, CNU |
---|
| 1303 | }, |
---|
| 1304 | { |
---|
| 1305 | CNU, CNU |
---|
| 1306 | }, |
---|
| 1307 | { |
---|
| 1308 | CNU, CNU |
---|
| 1309 | } |
---|
| 1310 | }; |
---|
[2] | 1311 | #endif |
---|
[100] | 1312 | #endif |
---|
[56] | 1313 | |
---|
[100] | 1314 | #endif |
---|
| 1315 | |
---|
[56] | 1316 | //! \} |
---|
| 1317 | |
---|
[2] | 1318 | #endif |
---|
| 1319 | |
---|