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