[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 | |
---|
[189] | 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 | #define NUM_MERGE_IDX_EXT_CTX 1 ///< number of context models for merge index of merge extended |
---|
[2] | 60 | |
---|
[296] | 61 | #if H3D_IVRP |
---|
[56] | 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 | #define NUM_CU_AMP_CTX 1 ///< number of context models for partition size (AMP) |
---|
| 68 | #define NUM_PRED_MODE_CTX 1 ///< number of context models for prediction mode |
---|
[2] | 69 | |
---|
[56] | 70 | #define NUM_ADI_CTX 1 ///< number of context models for intra prediction |
---|
| 71 | |
---|
| 72 | #define NUM_CHROMA_PRED_CTX 2 ///< number of context models for intra prediction (chroma) |
---|
[2] | 73 | #define NUM_INTER_DIR_CTX 4 ///< number of context models for inter prediction direction |
---|
[56] | 74 | #define NUM_MV_RES_CTX 2 ///< number of context models for motion vector difference |
---|
[2] | 75 | |
---|
[56] | 76 | #define NUM_REF_NO_CTX 4 ///< number of context models for reference index |
---|
[2] | 77 | #define NUM_TRANS_SUBDIV_FLAG_CTX 10 ///< number of context models for transform subdivision flags |
---|
[56] | 78 | #define NUM_QT_CBF_CTX 5 ///< number of context models for QT CBF |
---|
| 79 | #define NUM_QT_ROOT_CBF_CTX 1 ///< number of context models for QT ROOT CBF |
---|
| 80 | #define NUM_DELTA_QP_CTX 3 ///< number of context models for dQP |
---|
[2] | 81 | |
---|
[56] | 82 | #define NUM_SIG_CG_FLAG_CTX 2 ///< number of context models for MULTI_LEVEL_SIGNIFICANCE |
---|
| 83 | |
---|
| 84 | #define NUM_SIG_FLAG_CTX 48 ///< number of context models for sig flag |
---|
| 85 | |
---|
| 86 | #define NUM_SIG_FLAG_CTX_LUMA 27 ///< number of context models for luma sig flag |
---|
| 87 | #define NUM_SIG_FLAG_CTX_CHROMA 21 ///< number of context models for chroma sig flag |
---|
| 88 | #define NUM_CTX_LAST_FLAG_XY 15 ///< number of context models for last coefficient position |
---|
[2] | 89 | |
---|
[56] | 90 | #define NUM_ONE_FLAG_CTX 24 ///< number of context models for greater than 1 flag |
---|
| 91 | #define NUM_ONE_FLAG_CTX_LUMA 16 ///< number of context models for greater than 1 flag of luma |
---|
| 92 | #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma |
---|
| 93 | #define NUM_ABS_FLAG_CTX 6 ///< number of context models for greater than 2 flag |
---|
| 94 | #define NUM_ABS_FLAG_CTX_LUMA 4 ///< number of context models for greater than 2 flag of luma |
---|
| 95 | #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma |
---|
| 96 | |
---|
[2] | 97 | #define NUM_MVP_IDX_CTX 2 ///< number of context models for MVP index |
---|
| 98 | |
---|
| 99 | #define NUM_ALF_FLAG_CTX 1 ///< number of context models for ALF flag |
---|
| 100 | #define NUM_ALF_UVLC_CTX 2 ///< number of context models for ALF UVLC (filter length) |
---|
| 101 | #define NUM_ALF_SVLC_CTX 3 ///< number of context models for ALF SVLC (filter coeff.) |
---|
| 102 | |
---|
[443] | 103 | #if LGE_SAO_MIGRATION_D0091 |
---|
| 104 | #define NUM_SAO_MERGE_FLAG_CTX 1 ///< number of context models for SAO merge flags |
---|
| 105 | #define NUM_SAO_TYPE_IDX_CTX 1 ///< number of context models for SAO type index |
---|
| 106 | #else |
---|
[56] | 107 | #define NUM_SAO_FLAG_CTX 1 ///< number of context models for SAO flag |
---|
| 108 | #define NUM_SAO_UVLC_CTX 2 ///< number of context models for SAO UVLC |
---|
| 109 | #define NUM_SAO_SVLC_CTX 3 ///< number of context models for SAO SVLC |
---|
| 110 | #define NUM_SAO_RUN_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
| 111 | #define NUM_SAO_MERGE_LEFT_FLAG_CTX 3 ///< number of context models for AO SVLC (filter coeff.) |
---|
| 112 | #define NUM_SAO_MERGE_UP_FLAG_CTX 1 ///< number of context models for AO SVLC (filter coeff.) |
---|
| 113 | #define NUM_SAO_TYPE_IDX_CTX 2 ///< number of context models for AO SVLC (filter coeff.) |
---|
[443] | 114 | #endif |
---|
[56] | 115 | #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' |
---|
[2] | 116 | |
---|
[5] | 117 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[56] | 118 | #define NUM_DMM_FLAG_CTX 1 ///< number of context models for DMM flag |
---|
| 119 | #define NUM_DMM_MODE_CTX 1 ///< number of context models for DMM mode |
---|
[296] | 120 | #if LGE_DMM3_SIMP_C0044 |
---|
| 121 | #define NUM_DMM_DATA_CTX 4 ///< number of context models for DMM data |
---|
| 122 | #else |
---|
[56] | 123 | #define NUM_DMM_DATA_CTX 3 ///< number of context models for DMM data |
---|
[2] | 124 | #endif |
---|
[296] | 125 | #endif |
---|
[2] | 126 | |
---|
[189] | 127 | #if LGE_EDGE_INTRA_A0070 |
---|
[100] | 128 | #define NUM_EDGE_INTRA_CTX 1 |
---|
| 129 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
| 130 | #define NUM_EDGE_INTRA_DELTA_DC_CTX 2 // one for Delta_DC flag, another for Delta_DC value |
---|
| 131 | #endif |
---|
| 132 | #endif |
---|
| 133 | |
---|
[189] | 134 | #if RWTH_SDC_DLT_B0036 |
---|
[443] | 135 | #if PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
| 136 | #define DEPTH_MODE_NUM_FLAG_CTX 8 |
---|
| 137 | #define DMM_DELTA_NUM_FLAG_CTX 1 |
---|
| 138 | #else |
---|
[189] | 139 | #define SDC_NUM_FLAG_CTX 3 |
---|
[443] | 140 | #endif |
---|
[189] | 141 | #define SDC_NUM_RESIDUAL_FLAG_CTX 1 |
---|
[443] | 142 | #if !RWTH_SDC_CTX_SIMPL_D0032 |
---|
[189] | 143 | #define SDC_NUM_SIGN_FLAG_CTX 1 |
---|
[443] | 144 | #endif |
---|
| 145 | #if LGE_CONCATENATE_D0141 |
---|
| 146 | #define SDC_NUM_RESIDUAL_CTX 1 |
---|
| 147 | #else |
---|
| 148 | #if RWTH_SDC_CTX_SIMPL_D0032 |
---|
| 149 | #define SDC_NUM_RESIDUAL_CTX 8 |
---|
| 150 | #else |
---|
[189] | 151 | #define SDC_NUM_RESIDUAL_CTX 10 |
---|
[443] | 152 | #endif |
---|
| 153 | #endif |
---|
[189] | 154 | |
---|
| 155 | #define SDC_NUM_PRED_MODE_CTX 5 |
---|
| 156 | #endif |
---|
| 157 | |
---|
[2] | 158 | // ==================================================================================================================== |
---|
| 159 | // Tables |
---|
| 160 | // ==================================================================================================================== |
---|
| 161 | |
---|
[56] | 162 | // initial probability for split flag |
---|
| 163 | static const UChar |
---|
| 164 | INIT_SPLIT_FLAG[3][NUM_SPLIT_FLAG_CTX] = |
---|
[2] | 165 | { |
---|
[56] | 166 | { 139, 141, 157, }, |
---|
| 167 | { 107, 139, 126, }, |
---|
| 168 | { 107, 139, 126, }, |
---|
[2] | 169 | }; |
---|
| 170 | |
---|
[56] | 171 | static const UChar |
---|
| 172 | INIT_SKIP_FLAG[3][NUM_SKIP_FLAG_CTX] = |
---|
[2] | 173 | { |
---|
[56] | 174 | { CNU, CNU, CNU, }, |
---|
| 175 | { 197, 185, 201, }, |
---|
| 176 | { 197, 185, 201, }, |
---|
[2] | 177 | }; |
---|
| 178 | |
---|
[189] | 179 | #if LGE_ILLUCOMP_B0045 |
---|
[56] | 180 | static const UChar |
---|
[189] | 181 | INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = |
---|
| 182 | { |
---|
| 183 | { CNU, CNU, CNU, }, |
---|
| 184 | { 197, 185, 201, }, |
---|
| 185 | { 197, 185, 201, }, |
---|
| 186 | }; |
---|
| 187 | #endif |
---|
| 188 | |
---|
| 189 | static const UChar |
---|
[56] | 190 | INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = |
---|
[2] | 191 | { |
---|
[56] | 192 | { 200, }, |
---|
| 193 | { 139, }, |
---|
| 194 | { 169, }, |
---|
[2] | 195 | }; |
---|
| 196 | |
---|
[56] | 197 | static const UChar |
---|
| 198 | INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = |
---|
| 199 | { |
---|
| 200 | { CNU, }, |
---|
| 201 | { 110, }, |
---|
| 202 | { 154, }, |
---|
| 203 | }; |
---|
[2] | 204 | |
---|
[56] | 205 | static const UChar |
---|
| 206 | INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = |
---|
[2] | 207 | { |
---|
[56] | 208 | { CNU, }, |
---|
| 209 | { 122, }, |
---|
| 210 | { 137, }, |
---|
| 211 | }; |
---|
| 212 | |
---|
[296] | 213 | #if H3D_IVRP |
---|
[56] | 214 | static const UChar |
---|
| 215 | INIT_RES_PRED_FLAG[3][NUM_RES_PRED_FLAG_CTX] = |
---|
| 216 | { |
---|
| 217 | { CNU, CNU, CNU, CNU }, |
---|
| 218 | { 154, 154, 154, 154 }, |
---|
| 219 | { 154, 154, 154, 154 }, |
---|
| 220 | }; |
---|
| 221 | #endif |
---|
| 222 | |
---|
| 223 | static const UChar |
---|
| 224 | INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = |
---|
| 225 | { |
---|
| 226 | { 184, CNU, CNU, CNU, }, |
---|
| 227 | { 154, 139, CNU, CNU, }, |
---|
| 228 | { 154, 139, CNU, CNU, }, |
---|
| 229 | }; |
---|
| 230 | |
---|
| 231 | static const UChar |
---|
| 232 | INIT_CU_AMP_POS[3][NUM_CU_AMP_CTX] = |
---|
| 233 | { |
---|
| 234 | { CNU, }, |
---|
| 235 | { 154, }, |
---|
| 236 | { 154, }, |
---|
| 237 | }; |
---|
| 238 | |
---|
| 239 | static const UChar |
---|
| 240 | INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = |
---|
| 241 | { |
---|
| 242 | { CNU, }, |
---|
| 243 | { 149, }, |
---|
| 244 | { 134, }, |
---|
| 245 | }; |
---|
| 246 | |
---|
| 247 | static const UChar |
---|
| 248 | INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = |
---|
| 249 | { |
---|
| 250 | { 184, }, |
---|
| 251 | { 154, }, |
---|
| 252 | { 183, }, |
---|
| 253 | }; |
---|
| 254 | |
---|
| 255 | static const UChar |
---|
| 256 | INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = |
---|
| 257 | { |
---|
| 258 | { 63, 139, }, |
---|
| 259 | { 152, 139, }, |
---|
| 260 | { 152, 139, }, |
---|
| 261 | }; |
---|
| 262 | |
---|
| 263 | static const UChar |
---|
| 264 | INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = |
---|
| 265 | { |
---|
| 266 | { CNU, CNU, CNU, CNU, }, |
---|
| 267 | #if CABAC_INIT_FLAG |
---|
| 268 | { 95, 79, 63, 31, }, |
---|
| 269 | #else |
---|
| 270 | { CNU, CNU, CNU, CNU, }, |
---|
| 271 | #endif |
---|
| 272 | { 95, 79, 63, 31, }, |
---|
| 273 | }; |
---|
| 274 | |
---|
| 275 | static const UChar |
---|
| 276 | INIT_MVD[3][NUM_MV_RES_CTX] = |
---|
| 277 | { |
---|
| 278 | { CNU, CNU, }, |
---|
| 279 | { 140, 198, }, |
---|
| 280 | { 169, 198, }, |
---|
| 281 | }; |
---|
| 282 | |
---|
| 283 | static const UChar |
---|
| 284 | INIT_REF_PIC[3][NUM_REF_NO_CTX] = |
---|
| 285 | { |
---|
| 286 | { CNU, CNU, CNU, CNU, }, |
---|
| 287 | { 153, 153, 139, CNU, }, |
---|
| 288 | { 153, 153, 168, CNU, }, |
---|
| 289 | }; |
---|
| 290 | |
---|
| 291 | static const UChar |
---|
| 292 | INIT_DQP[3][NUM_DELTA_QP_CTX] = |
---|
| 293 | { |
---|
| 294 | { 154, 154, 154, }, |
---|
| 295 | { 154, 154, 154, }, |
---|
| 296 | { 154, 154, 154, }, |
---|
| 297 | }; |
---|
| 298 | |
---|
| 299 | static const UChar |
---|
| 300 | INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = |
---|
| 301 | { |
---|
| 302 | { 111, 141, CNU, CNU, CNU, 94, 138, 182, CNU, CNU, }, |
---|
| 303 | { 153, 111, CNU, CNU, CNU, 149, 107, 167, CNU, CNU, }, |
---|
| 304 | { 153, 111, CNU, CNU, CNU, 149, 92, 167, CNU, CNU, }, |
---|
| 305 | }; |
---|
| 306 | |
---|
| 307 | static const UChar |
---|
| 308 | INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = |
---|
| 309 | { |
---|
| 310 | { CNU, }, |
---|
| 311 | { 79, }, |
---|
| 312 | { 79, }, |
---|
| 313 | }; |
---|
| 314 | |
---|
| 315 | static const UChar |
---|
| 316 | INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = |
---|
| 317 | { |
---|
| 318 | { 110, 110, 124, 110, 140, 111, 125, 111, 127, 111, 111, 156, 127, 127, 111, |
---|
| 319 | 108, 123, 63, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 320 | }, |
---|
| 321 | { 125, 110, 94, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
| 322 | 108, 123, 108, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 323 | }, |
---|
| 324 | { 125, 110, 124, 110, 125, 110, 125, 111, 111, 110, 139, 111, 111, 111, 125, |
---|
| 325 | 108, 123, 93, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, |
---|
| 326 | }, |
---|
| 327 | }; |
---|
| 328 | |
---|
| 329 | static const UChar |
---|
| 330 | INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = |
---|
| 331 | { |
---|
| 332 | { 91, 171, |
---|
| 333 | 134, 141, |
---|
| 334 | }, |
---|
| 335 | { 121, 140, |
---|
| 336 | 61, 154, |
---|
| 337 | }, |
---|
| 338 | { 121, 140, |
---|
| 339 | 61, 154, |
---|
| 340 | }, |
---|
| 341 | }; |
---|
| 342 | |
---|
| 343 | static const UChar |
---|
| 344 | INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = |
---|
| 345 | { |
---|
| 346 | { 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, }, |
---|
| 347 | { 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, }, |
---|
| 348 | { 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, }, |
---|
| 349 | }; |
---|
| 350 | |
---|
| 351 | static const UChar |
---|
| 352 | INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = |
---|
| 353 | { |
---|
| 354 | { 140, 92, 137, 138, 140, 152, 138, 139, 153, 74, 149, 92, 139, 107, 122, 152, 140, 179, 166, 182, 140, 227, 122, 197, }, |
---|
| 355 | { 154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 137, 169, 194, 166, 167, 154, 167, 137, 182, }, |
---|
| 356 | { 154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 122, 169, 208, 166, 167, 154, 152, 167, 182, }, |
---|
| 357 | }; |
---|
| 358 | |
---|
| 359 | static const UChar |
---|
| 360 | INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = |
---|
| 361 | { |
---|
| 362 | { 138, 153, 136, 167, 152, 152, }, |
---|
| 363 | { 107, 167, 91, 122, 107, 167, }, |
---|
| 364 | { 107, 167, 91, 107, 107, 167, }, |
---|
| 365 | }; |
---|
| 366 | |
---|
| 367 | static const UChar |
---|
| 368 | INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = |
---|
| 369 | { |
---|
| 370 | { CNU, CNU, }, |
---|
| 371 | { 168, CNU, }, |
---|
| 372 | { 168, CNU, }, |
---|
| 373 | }; |
---|
| 374 | |
---|
| 375 | static const UChar |
---|
| 376 | INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] = |
---|
| 377 | { |
---|
| 378 | { 153, }, |
---|
| 379 | { 153, }, |
---|
| 380 | { 153, }, |
---|
| 381 | }; |
---|
| 382 | |
---|
| 383 | static const UChar |
---|
| 384 | INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] = |
---|
| 385 | { |
---|
| 386 | { 140, 154, }, |
---|
| 387 | { 154, 154, }, |
---|
| 388 | { 154, 154, }, |
---|
| 389 | }; |
---|
| 390 | |
---|
| 391 | static const UChar |
---|
| 392 | INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] = |
---|
| 393 | { |
---|
| 394 | { 187, 154, 159, }, |
---|
| 395 | { 141, 154, 189, }, |
---|
| 396 | { 141, 154, 159, }, |
---|
| 397 | }; |
---|
[443] | 398 | #if LGE_SAO_MIGRATION_D0091 |
---|
| 399 | static const UChar |
---|
| 400 | INIT_SAO_MERGE_FLAG[3][NUM_SAO_MERGE_FLAG_CTX] = |
---|
| 401 | { |
---|
| 402 | { 153, }, |
---|
| 403 | { 153, }, |
---|
| 404 | { 153, }, |
---|
| 405 | }; |
---|
[56] | 406 | |
---|
| 407 | static const UChar |
---|
[443] | 408 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
| 409 | { |
---|
| 410 | { 200, }, |
---|
| 411 | { 185, }, |
---|
| 412 | { 160, }, |
---|
| 413 | }; |
---|
| 414 | #else |
---|
| 415 | static const UChar |
---|
[56] | 416 | INIT_SAO_FLAG[3][NUM_SAO_FLAG_CTX] = |
---|
| 417 | { |
---|
| 418 | { 154, }, |
---|
| 419 | { 153, }, |
---|
| 420 | { 153, }, |
---|
| 421 | }; |
---|
| 422 | |
---|
| 423 | static const UChar |
---|
| 424 | INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] = |
---|
| 425 | { |
---|
| 426 | { 143, 140, }, |
---|
| 427 | { 185, 140, }, |
---|
| 428 | { 200, 140, }, |
---|
| 429 | }; |
---|
| 430 | |
---|
| 431 | static const UChar |
---|
| 432 | INIT_SAO_SVLC[3][NUM_SAO_SVLC_CTX] = |
---|
| 433 | { |
---|
| 434 | { 247, 154, 244, }, |
---|
| 435 | { 215, 154, 169, }, |
---|
| 436 | { 215, 154, 169, }, |
---|
| 437 | }; |
---|
| 438 | |
---|
| 439 | static const UChar |
---|
| 440 | INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = |
---|
| 441 | { |
---|
| 442 | { 153, 153, 153, }, |
---|
| 443 | { 153, 153, 153, }, |
---|
| 444 | { 153, 153, 153, }, |
---|
| 445 | }; |
---|
| 446 | |
---|
| 447 | static const UChar |
---|
| 448 | INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = |
---|
| 449 | { |
---|
| 450 | { 175, }, |
---|
| 451 | { 153, }, |
---|
| 452 | { 153, }, |
---|
| 453 | }; |
---|
| 454 | |
---|
| 455 | static const UChar |
---|
| 456 | INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = |
---|
| 457 | { |
---|
| 458 | { 160, 140, }, |
---|
| 459 | { 185, 140, }, |
---|
| 460 | { 200, 140, }, |
---|
| 461 | }; |
---|
[443] | 462 | #endif |
---|
[56] | 463 | |
---|
| 464 | static const UChar |
---|
| 465 | INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = |
---|
| 466 | { |
---|
| 467 | { CNU, 224, 167, 122, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
| 468 | { CNU, 124, 138, 94, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
| 469 | { CNU, 153, 138, 138, CNU, CNU, CNU, CNU, CNU, CNU, }, |
---|
| 470 | }; |
---|
[2] | 471 | |
---|
[296] | 472 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[56] | 473 | static const UChar |
---|
[296] | 474 | INIT_DMM_FLAG[3][NUM_DMM_FLAG_CTX] = |
---|
[2] | 475 | { |
---|
| 476 | { |
---|
[296] | 477 | CNU |
---|
[2] | 478 | }, |
---|
| 479 | { |
---|
[296] | 480 | CNU |
---|
[2] | 481 | }, |
---|
| 482 | { |
---|
[296] | 483 | CNU |
---|
| 484 | } |
---|
[2] | 485 | }; |
---|
| 486 | |
---|
[56] | 487 | static const UChar |
---|
[296] | 488 | INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] = |
---|
[56] | 489 | { |
---|
| 490 | { |
---|
| 491 | CNU |
---|
[2] | 492 | }, |
---|
| 493 | { |
---|
[56] | 494 | CNU |
---|
[2] | 495 | }, |
---|
| 496 | { |
---|
[56] | 497 | CNU |
---|
[2] | 498 | } |
---|
| 499 | }; |
---|
| 500 | |
---|
[296] | 501 | static const UChar |
---|
| 502 | INIT_DMM_DATA[3][NUM_DMM_DATA_CTX] = |
---|
[2] | 503 | { |
---|
[296] | 504 | #if LGE_DMM3_SIMP_C0044 |
---|
[56] | 505 | { |
---|
[296] | 506 | CNU, CNU, CNU, CNU |
---|
[56] | 507 | }, |
---|
| 508 | { |
---|
[296] | 509 | CNU, CNU, CNU, CNU |
---|
[56] | 510 | }, |
---|
| 511 | { |
---|
[296] | 512 | CNU, CNU, CNU, CNU |
---|
[56] | 513 | } |
---|
[296] | 514 | #else |
---|
[2] | 515 | { |
---|
[56] | 516 | CNU, CNU, CNU |
---|
[2] | 517 | }, |
---|
| 518 | { |
---|
[56] | 519 | CNU, CNU, CNU |
---|
[2] | 520 | }, |
---|
| 521 | { |
---|
[56] | 522 | CNU, CNU, CNU |
---|
[2] | 523 | } |
---|
[296] | 524 | #endif |
---|
[2] | 525 | }; |
---|
[443] | 526 | #if QC_ARP_D0177 |
---|
| 527 | #define NUM_ARPW_CTX 4 ///< number of context models for generalized residual prediction weighting factor |
---|
| 528 | static const UChar |
---|
| 529 | INIT_ARPW[3][NUM_ARPW_CTX] = |
---|
| 530 | { |
---|
| 531 | { 154 , 154 , 154 , 154 }, |
---|
| 532 | { 154 , 154 , 154 , 154 }, |
---|
| 533 | { 154 , 154 , 154 , 154 }, |
---|
| 534 | }; |
---|
| 535 | #endif |
---|
[100] | 536 | |
---|
[189] | 537 | #if LGE_EDGE_INTRA_A0070 |
---|
[100] | 538 | static const Short |
---|
| 539 | INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] = |
---|
| 540 | { |
---|
| 541 | { |
---|
| 542 | CNU |
---|
| 543 | }, |
---|
| 544 | { |
---|
| 545 | CNU |
---|
| 546 | }, |
---|
| 547 | { |
---|
| 548 | CNU |
---|
| 549 | } |
---|
| 550 | }; |
---|
| 551 | |
---|
| 552 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
| 553 | static const Short |
---|
| 554 | INIT_EDGE_INTRA_DELTA_DC[3][NUM_EDGE_INTRA_DELTA_DC_CTX] = |
---|
| 555 | { |
---|
| 556 | { |
---|
| 557 | CNU, CNU |
---|
| 558 | }, |
---|
| 559 | { |
---|
| 560 | CNU, CNU |
---|
| 561 | }, |
---|
| 562 | { |
---|
| 563 | CNU, CNU |
---|
| 564 | } |
---|
| 565 | }; |
---|
[2] | 566 | #endif |
---|
[100] | 567 | #endif |
---|
[56] | 568 | |
---|
[100] | 569 | #endif |
---|
| 570 | |
---|
[189] | 571 | #if RWTH_SDC_DLT_B0036 |
---|
[443] | 572 | #if PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
| 573 | static const UChar INIT_DEPTHMODE_FLAG[3][DEPTH_MODE_NUM_FLAG_CTX]= |
---|
| 574 | { |
---|
| 575 | {0, 0, 64, 0, CNU, 0, CNU, 0}, |
---|
| 576 | {0, 64, 0, CNU, 0, CNU, 0, 0}, |
---|
| 577 | {64, 0, CNU, 0, CNU, 0, 0, 0} |
---|
| 578 | }; |
---|
| 579 | static const UChar INIT_DMMDELTA_FLAG[3][DMM_DELTA_NUM_FLAG_CTX]= |
---|
| 580 | { |
---|
| 581 | {0}, |
---|
| 582 | {0}, |
---|
| 583 | {64} |
---|
| 584 | }; |
---|
| 585 | #else |
---|
[189] | 586 | static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] = |
---|
| 587 | { |
---|
| 588 | { |
---|
| 589 | { 0, 64 }, { 0, 64 }, { 0, 64 } |
---|
| 590 | }, |
---|
| 591 | { |
---|
| 592 | { 0, 64 }, { 0, 64 }, { 0, 64 } |
---|
| 593 | }, |
---|
| 594 | { |
---|
| 595 | { 0, 64 }, { 0, 64 }, { 0, 64 } |
---|
| 596 | } |
---|
| 597 | }; |
---|
[443] | 598 | #endif |
---|
[189] | 599 | |
---|
[443] | 600 | #if RWTH_SDC_CTX_SIMPL_D0032 |
---|
| 601 | static const UChar INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] = |
---|
| 602 | { |
---|
| 603 | { |
---|
| 604 | CNU |
---|
| 605 | |
---|
| 606 | }, |
---|
| 607 | { |
---|
| 608 | CNU |
---|
| 609 | }, |
---|
| 610 | { |
---|
| 611 | CNU |
---|
| 612 | } |
---|
| 613 | }; |
---|
| 614 | |
---|
| 615 | #if LGE_CONCATENATE_D0141 |
---|
| 616 | static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = |
---|
| 617 | { |
---|
| 618 | { |
---|
| 619 | 155 |
---|
| 620 | }, |
---|
| 621 | { |
---|
| 622 | 155 |
---|
| 623 | }, |
---|
| 624 | { |
---|
| 625 | 155 |
---|
| 626 | } |
---|
| 627 | }; |
---|
| 628 | #else |
---|
| 629 | static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = |
---|
| 630 | { |
---|
| 631 | { |
---|
| 632 | CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU |
---|
| 633 | }, |
---|
| 634 | { |
---|
| 635 | CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU |
---|
| 636 | }, |
---|
| 637 | { |
---|
| 638 | CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU |
---|
| 639 | } |
---|
| 640 | }; |
---|
| 641 | #endif |
---|
| 642 | |
---|
| 643 | static const UChar INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX] = |
---|
| 644 | { |
---|
| 645 | { |
---|
| 646 | CNU, CNU |
---|
| 647 | ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU |
---|
| 648 | }, |
---|
| 649 | { |
---|
| 650 | CNU, CNU |
---|
| 651 | ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU |
---|
| 652 | }, |
---|
| 653 | { |
---|
| 654 | CNU, CNU |
---|
| 655 | ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU |
---|
| 656 | } |
---|
| 657 | }; |
---|
| 658 | #else |
---|
[189] | 659 | static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] = |
---|
| 660 | { |
---|
| 661 | { |
---|
| 662 | { -5, 35 }, |
---|
| 663 | { -0, 56 }, |
---|
| 664 | { -0, 56 } |
---|
| 665 | |
---|
| 666 | }, |
---|
| 667 | { |
---|
| 668 | { -5, 35 }, |
---|
| 669 | { -0, 56 }, |
---|
| 670 | { -0, 56 } |
---|
| 671 | }, |
---|
| 672 | { |
---|
| 673 | { -5, 35 }, |
---|
| 674 | { -0, 56 }, |
---|
| 675 | { -0, 56 } |
---|
| 676 | } |
---|
| 677 | }; |
---|
| 678 | |
---|
| 679 | static const Short INIT_SDC_SIGN_FLAG[3][3*SDC_NUM_SIGN_FLAG_CTX][2] = |
---|
| 680 | { |
---|
| 681 | { |
---|
| 682 | { -1, 56 }, |
---|
| 683 | { -4, 55 }, |
---|
| 684 | { -4, 55 } |
---|
| 685 | }, |
---|
| 686 | { |
---|
| 687 | { -1, 56 }, |
---|
| 688 | { -4, 55 }, |
---|
| 689 | { -4, 55 } |
---|
| 690 | }, |
---|
| 691 | { |
---|
| 692 | { -1, 56 }, |
---|
| 693 | { -4, 55 }, |
---|
| 694 | { -4, 55 } |
---|
| 695 | } |
---|
| 696 | }; |
---|
| 697 | |
---|
| 698 | static const Short INIT_SDC_RESIDUAL[3][3*SDC_NUM_RESIDUAL_CTX][2] = |
---|
| 699 | { |
---|
| 700 | { |
---|
| 701 | { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, |
---|
| 702 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, |
---|
| 703 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } |
---|
| 704 | }, |
---|
| 705 | { |
---|
| 706 | { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, |
---|
| 707 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, |
---|
| 708 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } |
---|
| 709 | }, |
---|
| 710 | { |
---|
| 711 | { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, |
---|
| 712 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, |
---|
| 713 | { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } |
---|
| 714 | } |
---|
| 715 | }; |
---|
| 716 | |
---|
| 717 | static const Short INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX][2] = |
---|
| 718 | { |
---|
| 719 | { |
---|
| 720 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
| 721 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
| 722 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } |
---|
| 723 | }, |
---|
| 724 | { |
---|
| 725 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
| 726 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
| 727 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } |
---|
| 728 | }, |
---|
| 729 | { |
---|
| 730 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
| 731 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, |
---|
| 732 | { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } |
---|
| 733 | } |
---|
| 734 | }; |
---|
| 735 | #endif |
---|
[443] | 736 | #endif |
---|
[189] | 737 | |
---|
[56] | 738 | //! \} |
---|
| 739 | |
---|
[2] | 740 | #endif |
---|
| 741 | |
---|