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