Changeset 125 in SHVCSoftware for trunk/source/Lib/TLibCommon/ContextTables.h
- Timestamp:
- 16 Apr 2013, 06:39:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/ContextTables.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * 9 9 * Redistribution and use in source and binary forms, with or without 10 10 * modification, are permitted provided that the following conditions are met: 11 * 11 * 12 12 * * Redistributions of source code must retain the above copyright notice, 13 13 * this list of conditions and the following disclaimer. … … 42 42 //! \ingroup TLibCommon 43 43 //! \{ 44 #define FIX827 1 ///< Fix for issue #827: CABAC init tables 45 #define FIX712 1 ///< Fix for issue #712: CABAC init tables 44 46 45 47 // ==================================================================================================================== … … 55 57 #define NUM_MERGE_IDX_EXT_CTX 1 ///< number of context models for merge index of merge extended 56 58 57 #define NUM_ALF_CTRL_FLAG_CTX 1 ///< number of context models for ALF control flag58 59 #define NUM_PART_SIZE_CTX 4 ///< number of context models for partition size 59 60 #define NUM_CU_AMP_CTX 1 ///< number of context models for partition size (AMP) … … 66 67 #define NUM_MV_RES_CTX 2 ///< number of context models for motion vector difference 67 68 68 #if REF_IDX_BYPASS69 69 #define NUM_REF_NO_CTX 2 ///< number of context models for reference index 70 #else71 #define NUM_REF_NO_CTX 4 ///< number of context models for reference index72 #endif73 #if TRANS_SPLIT_FLAG_CTX_REDUCTION74 70 #define NUM_TRANS_SUBDIV_FLAG_CTX 3 ///< number of context models for transform subdivision flags 75 #else76 #define NUM_TRANS_SUBDIV_FLAG_CTX 10 ///< number of context models for transform subdivision flags77 #endif78 71 #define NUM_QT_CBF_CTX 5 ///< number of context models for QT CBF 79 72 #define NUM_QT_ROOT_CBF_CTX 1 ///< number of context models for QT ROOT CBF … … 82 75 #define NUM_SIG_CG_FLAG_CTX 2 ///< number of context models for MULTI_LEVEL_SIGNIFICANCE 83 76 84 #if REMOVAL_8x2_2x8_CG85 77 #define NUM_SIG_FLAG_CTX 42 ///< number of context models for sig flag 86 78 #define NUM_SIG_FLAG_CTX_LUMA 27 ///< number of context models for luma sig flag 87 79 #define NUM_SIG_FLAG_CTX_CHROMA 15 ///< number of context models for chroma sig flag 88 #else89 #define NUM_SIG_FLAG_CTX 45 ///< number of context models for sig flag90 #define NUM_SIG_FLAG_CTX_LUMA 24 ///< number of context models for luma sig flag91 #define NUM_SIG_FLAG_CTX_CHROMA 21 ///< number of context models for chroma sig flag92 #endif93 80 94 81 #define NUM_CTX_LAST_FLAG_XY 15 ///< number of context models for last coefficient position … … 103 90 #define NUM_MVP_IDX_CTX 2 ///< number of context models for MVP index 104 91 105 #define NUM_ALF_FLAG_CTX 1 ///< number of context models for ALF flag106 #define NUM_ALF_UVLC_CTX 2 ///< number of context models for ALF UVLC (filter length)107 #define NUM_ALF_SVLC_CTX 3 ///< number of context models for ALF SVLC (filter coeff.)108 #if !SAO_ABS_BY_PASS109 #define NUM_SAO_UVLC_CTX 2 ///< number of context models for SAO UVLC110 #endif111 #if SAO_MERGE_ONE_CTX112 92 #define NUM_SAO_MERGE_FLAG_CTX 1 ///< number of context models for SAO merge flags 113 #else114 #if SAO_SINGLE_MERGE115 #define NUM_SAO_MERGE_LEFT_FLAG_CTX 1 ///< number of context models for SAO Merge-Left flag116 #else117 #define NUM_SAO_MERGE_LEFT_FLAG_CTX 3 ///< number of context models for AO SVLC (filter coeff.)118 #endif119 #define NUM_SAO_MERGE_UP_FLAG_CTX 1 ///< number of context models for AO SVLC (filter coeff.)120 #endif121 #if SAO_TYPE_CODING122 93 #define NUM_SAO_TYPE_IDX_CTX 1 ///< number of context models for SAO type index 123 #else124 #define NUM_SAO_TYPE_IDX_CTX 2 ///< number of context models for AO SVLC (filter coeff.)125 #endif126 127 94 #if INTRA_BL 128 95 #define NUM_INTRA_BL_PRED_CTX 3 … … 163 130 }; 164 131 165 static const UChar 166 INIT_ALF_CTRL_FLAG[3][NUM_ALF_CTRL_FLAG_CTX] = 167 { 168 { 102, }, 169 { 102, }, 170 { 118, }, 171 }; 172 173 static const UChar 132 static const UChar 174 133 INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = 175 134 { … … 243 202 }; 244 203 245 #if REF_IDX_BYPASS246 204 static const UChar 247 205 INIT_REF_PIC[3][NUM_REF_NO_CTX] = … … 251 209 { CNU, CNU }, 252 210 }; 253 #else254 static const UChar255 INIT_REF_PIC[3][NUM_REF_NO_CTX] =256 {257 { 153, 153, 168, CNU, },258 { 153, 153, 139, CNU, },259 { CNU, CNU, CNU, CNU, },260 };261 #endif262 211 263 212 static const UChar … … 316 265 INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = 317 266 { 318 #if REMOVAL_8x2_2x8_CG319 267 { 170, 154, 139, 153, 139, 123, 123, 63, 124, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 170, 153, 138, 138, 122, 121, 122, 121, 167, 151, 183, 140, 151, 183, 140, }, 320 268 { 155, 154, 139, 153, 139, 123, 123, 63, 153, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 170, 153, 123, 123, 107, 121, 107, 121, 167, 151, 183, 140, 151, 183, 140, }, 321 269 { 111, 111, 125, 110, 110, 94, 124, 108, 124, 107, 125, 141, 179, 153, 125, 107, 125, 141, 179, 153, 125, 107, 125, 141, 179, 153, 125, 140, 139, 182, 182, 152, 136, 152, 136, 153, 136, 139, 111, 136, 139, 111, }, 322 #else323 { 170, 154, 139, 153, 139, 123, 123, 63, 124, 153, 153, 152, 152, 152, 137, 152, 137, 137, 166, 183, 140, 136, 153, 154, 170, 153, 138, 138, 122, 121, 122, 121, 167, 153, 167, 136, 121, 122, 136, 121, 122, 91, 151, 183, 140, },324 { 155, 154, 139, 153, 139, 123, 123, 63, 153, 153, 153, 152, 152, 152, 137, 152, 137, 122, 166, 183, 140, 136, 153, 154, 170, 153, 123, 123, 107, 121, 107, 121, 167, 153, 167, 136, 149, 107, 136, 121, 122, 91, 151, 183, 140, },325 { 111, 111, 125, 110, 110, 94, 124, 108, 124, 139, 139, 139, 168, 124, 138, 124, 138, 107, 107, 125, 141, 179, 153, 125, 140, 139, 182, 182, 152, 136, 152, 136, 153, 182, 137, 149, 192, 152, 224, 136, 31, 136, 136, 139, 111, },326 #endif327 270 }; 328 271 … … 352 295 353 296 static const UChar 354 INIT_ALF_FLAG[3][NUM_ALF_FLAG_CTX] =355 {356 { 153, },357 { 153, },358 { 153, },359 };360 361 static const UChar362 INIT_ALF_UVLC[3][NUM_ALF_UVLC_CTX] =363 {364 { 154, 154, },365 { 154, 154, },366 { 140, 154, },367 };368 369 static const UChar370 INIT_ALF_SVLC[3][NUM_ALF_SVLC_CTX] =371 {372 { 141, 154, 159, },373 { 141, 154, 189, },374 { 187, 154, 159, },375 };376 #if !SAO_ABS_BY_PASS377 static const UChar378 INIT_SAO_UVLC[3][NUM_SAO_UVLC_CTX] =379 {380 { 200, 140, },381 { 185, 140, },382 { 143, 140, },383 };384 #endif385 #if SAO_MERGE_ONE_CTX386 static const UChar387 297 INIT_SAO_MERGE_FLAG[3][NUM_SAO_MERGE_FLAG_CTX] = 388 298 { … … 391 301 { 153, }, 392 302 }; 303 304 static const UChar 305 INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = 306 { 307 #if FIX827 308 { 160, }, 309 { 185, }, 310 { 200, }, 393 311 #else 394 static const UChar 395 INIT_SAO_MERGE_LEFT_FLAG[3][NUM_SAO_MERGE_LEFT_FLAG_CTX] = 396 { 397 #if SAO_SINGLE_MERGE 398 { 153, }, 399 { 153, }, 400 { 153, }, 401 #else 402 { 153, 153, 153, }, 403 { 153, 153, 153, }, 404 { 153, 153, 153, }, 405 #endif 406 }; 407 408 static const UChar 409 INIT_SAO_MERGE_UP_FLAG[3][NUM_SAO_MERGE_UP_FLAG_CTX] = 410 { 411 { 153, }, 412 { 153, }, 413 { 175, }, 414 }; 415 #endif 416 417 static const UChar 418 INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = 419 { 420 #if SAO_TYPE_CODING 421 { 200, }, 312 { 200, }, 422 313 { 185, }, 423 { 160, }, 424 #else 425 { 200, 140, }, 426 { 185, 140, }, 427 { 160, 140, }, 428 #endif 429 }; 430 431 #if TRANS_SPLIT_FLAG_CTX_REDUCTION 314 { 160, }, 315 #endif 316 }; 317 432 318 static const UChar 433 319 INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = 434 320 { 321 #if FIX712 322 { 224, 167, 122, }, 323 { 124, 138, 94, }, 324 { 153, 138, 138, }, 325 #else 435 326 { 153, 138, 138, }, 436 327 { 124, 138, 94, }, 437 328 { 224, 167, 122, }, 438 }; 439 #else 440 static const UChar 441 INIT_TRANS_SUBDIV_FLAG[3][NUM_TRANS_SUBDIV_FLAG_CTX] = 442 { 443 { CNU, 153, 138, 138, CNU, CNU, CNU, CNU, CNU, CNU, }, 444 { CNU, 124, 138, 94, CNU, CNU, CNU, CNU, CNU, CNU, }, 445 { CNU, 224, 167, 122, CNU, CNU, CNU, CNU, CNU, CNU, }, 446 }; 447 #endif 448 329 #endif 330 }; 449 331 450 332 #if INTRA_BL
Note: See TracChangeset for help on using the changeset viewer.