Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibCommon/ContextTables.h
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/ContextTables.h
r1196 r1313 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 51 51 #define NUM_SPLIT_FLAG_CTX 3 ///< number of context models for split flag 52 52 #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag 53 #if H_3D53 #if NH_3D_DIS 54 54 #define NUM_DIS_FLAG_CTX 1 55 55 #define NUM_DIS_TYPE_CTX 1 … … 61 61 #define NUM_PRED_MODE_CTX 1 ///< number of context models for prediction mode 62 62 63 #define NUM_ ADI_CTX1 ///< number of context models for intra prediction63 #define NUM_INTRA_PREDICT_CTX 1 ///< number of context models for intra prediction 64 64 65 65 #define NUM_CHROMA_PRED_CTX 2 ///< number of context models for intra prediction (chroma) 66 66 #define NUM_INTER_DIR_CTX 5 ///< number of context models for inter prediction direction 67 67 #define NUM_MV_RES_CTX 2 ///< number of context models for motion vector difference 68 #define NUM_CHROMA_QP_ADJ_FLAG_CTX 1 ///< number of context models for chroma_qp_adjustment_flag 69 #define NUM_CHROMA_QP_ADJ_IDC_CTX 1 ///< number of context models for chroma_qp_adjustment_idc 68 70 69 71 #define NUM_REF_NO_CTX 2 ///< number of context models for reference index 70 72 #define NUM_TRANS_SUBDIV_FLAG_CTX 3 ///< number of context models for transform subdivision flags 71 #define NUM_QT_CBF_CTX 4 ///< number of context models for QT CBF72 73 #define NUM_QT_ROOT_CBF_CTX 1 ///< number of context models for QT ROOT CBF 73 74 #define NUM_DELTA_QP_CTX 3 ///< number of context models for dQP 74 75 75 76 #define NUM_SIG_CG_FLAG_CTX 2 ///< number of context models for MULTI_LEVEL_SIGNIFICANCE 76 77 #define NUM_SIG_FLAG_CTX 42 ///< number of context models for sig flag 78 #define NUM_SIG_FLAG_CTX_LUMA 27 ///< number of context models for luma sig flag 79 #define NUM_SIG_FLAG_CTX_CHROMA 15 ///< number of context models for chroma sig flag 77 #define NUM_EXPLICIT_RDPCM_FLAG_CTX 1 ///< number of context models for the flag which specifies whether to use RDPCM on inter coded residues 78 #define NUM_EXPLICIT_RDPCM_DIR_CTX 1 ///< number of context models for the flag which specifies which RDPCM direction is used on inter coded residues 79 80 //-------------------------------------------------------------------------------------------------- 81 82 // context size definitions for significance map 83 84 #define NUM_SIG_FLAG_CTX_LUMA 28 ///< number of context models for luma sig flag 85 #define NUM_SIG_FLAG_CTX_CHROMA 16 ///< number of context models for chroma sig flag 86 87 // |----Luma-----| |---Chroma----| 88 static const UInt significanceMapContextSetStart [MAX_NUM_CHANNEL_TYPE][CONTEXT_NUMBER_OF_TYPES] = { {0, 9, 21, 27}, {0, 9, 12, 15} }; 89 static const UInt significanceMapContextSetSize [MAX_NUM_CHANNEL_TYPE][CONTEXT_NUMBER_OF_TYPES] = { {9, 12, 6, 1}, {9, 3, 3, 1} }; 90 static const UInt nonDiagonalScan8x8ContextOffset [MAX_NUM_CHANNEL_TYPE] = { 6, 0 }; 91 static const UInt notFirstGroupNeighbourhoodContextOffset[MAX_NUM_CHANNEL_TYPE] = { 3, 0 }; 92 93 //------------------ 94 95 #define NEIGHBOURHOOD_00_CONTEXT_1_THRESHOLD_4x4 3 96 #define NEIGHBOURHOOD_00_CONTEXT_2_THRESHOLD_4x4 1 97 98 //------------------ 99 100 #define FIRST_SIG_FLAG_CTX_LUMA 0 101 #define FIRST_SIG_FLAG_CTX_CHROMA (FIRST_SIG_FLAG_CTX_LUMA + NUM_SIG_FLAG_CTX_LUMA) 102 103 #define NUM_SIG_FLAG_CTX (NUM_SIG_FLAG_CTX_LUMA + NUM_SIG_FLAG_CTX_CHROMA) ///< number of context models for sig flag 104 105 //-------------------------------------------------------------------------------------------------- 106 107 // context size definitions for last significant coefficient position 108 109 #define NUM_CTX_LAST_FLAG_SETS 2 80 110 81 111 #define NUM_CTX_LAST_FLAG_XY 15 ///< number of context models for last coefficient position 82 112 83 #define NUM_ONE_FLAG_CTX 24 ///< number of context models for greater than 1 flag 84 #define NUM_ONE_FLAG_CTX_LUMA 16 ///< number of context models for greater than 1 flag of luma 85 #define NUM_ONE_FLAG_CTX_CHROMA 8 ///< number of context models for greater than 1 flag of chroma 86 #define NUM_ABS_FLAG_CTX 6 ///< number of context models for greater than 2 flag 87 #define NUM_ABS_FLAG_CTX_LUMA 4 ///< number of context models for greater than 2 flag of luma 88 #define NUM_ABS_FLAG_CTX_CHROMA 2 ///< number of context models for greater than 2 flag of chroma 113 //-------------------------------------------------------------------------------------------------- 114 115 // context size definitions for greater-than-one and greater-than-two maps 116 117 #define NUM_ONE_FLAG_CTX_PER_SET 4 ///< number of context models for greater than 1 flag in a set 118 #define NUM_ABS_FLAG_CTX_PER_SET 1 ///< number of context models for greater than 2 flag in a set 119 120 //------------------ 121 122 #define NUM_CTX_SETS_LUMA 4 ///< number of context model sets for luminance 123 #define NUM_CTX_SETS_CHROMA 2 ///< number of context model sets for combined chrominance 124 125 #define FIRST_CTX_SET_LUMA 0 ///< index of first luminance context set 126 127 //------------------ 128 129 #define NUM_ONE_FLAG_CTX_LUMA (NUM_ONE_FLAG_CTX_PER_SET * NUM_CTX_SETS_LUMA) ///< number of context models for greater than 1 flag of luma 130 #define NUM_ONE_FLAG_CTX_CHROMA (NUM_ONE_FLAG_CTX_PER_SET * NUM_CTX_SETS_CHROMA) ///< number of context models for greater than 1 flag of chroma 131 132 #define NUM_ABS_FLAG_CTX_LUMA (NUM_ABS_FLAG_CTX_PER_SET * NUM_CTX_SETS_LUMA) ///< number of context models for greater than 2 flag of luma 133 #define NUM_ABS_FLAG_CTX_CHROMA (NUM_ABS_FLAG_CTX_PER_SET * NUM_CTX_SETS_CHROMA) ///< number of context models for greater than 2 flag of chroma 134 135 #define NUM_ONE_FLAG_CTX (NUM_ONE_FLAG_CTX_LUMA + NUM_ONE_FLAG_CTX_CHROMA) ///< number of context models for greater than 1 flag 136 #define NUM_ABS_FLAG_CTX (NUM_ABS_FLAG_CTX_LUMA + NUM_ABS_FLAG_CTX_CHROMA) ///< number of context models for greater than 2 flag 137 138 #define FIRST_CTX_SET_CHROMA (FIRST_CTX_SET_LUMA + NUM_CTX_SETS_LUMA) ///< index of first chrominance context set 139 140 //-------------------------------------------------------------------------------------------------- 141 142 // context size definitions for CBF 143 144 #define NUM_QT_CBF_CTX_SETS 2 145 146 #define NUM_QT_CBF_CTX_PER_SET 5 ///< number of context models for QT CBF 147 148 #define FIRST_CBF_CTX_LUMA 0 ///< index of first luminance CBF context 149 150 #define FIRST_CBF_CTX_CHROMA (FIRST_CBF_CTX_LUMA + NUM_QT_CBF_CTX_PER_SET) ///< index of first chrominance CBF context 151 152 153 //-------------------------------------------------------------------------------------------------- 89 154 90 155 #define NUM_MVP_IDX_CTX 1 ///< number of context models for MVP index … … 93 158 #define NUM_SAO_TYPE_IDX_CTX 1 ///< number of context models for SAO type index 94 159 95 #define NUM_TRANSFORMSKIP_FLAG_CTX 1 ///< number of context models for transform skipping 96 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX 1 97 98 #if H_3D_ARP 160 #define NUM_TRANSFORMSKIP_FLAG_CTX 1 ///< number of context models for transform skipping 161 162 #define NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX 1 163 164 #if NH_3D_ARP 99 165 #define NUM_ARPW_CTX 3 ///< number of context models for weighting factor index used by advanced residual prediction 100 166 #endif 101 167 102 #if H_3D_IC168 #if NH_3D_IC 103 169 #define NUM_IC_FLAG_CTX 1 ///< number of context models for illumination compensation flag 104 170 #endif 171 #define NUM_CROSS_COMPONENT_PREDICTION_CTX 10 105 172 106 173 #define CNU 154 ///< dummy initialization value for unused context models 'Context model Not Used' 107 174 108 #if H_3D_DIM 109 #define NUM_DEPTH_INTRA_MODE_CTX 1 ///< number of context models for depth intra modes 110 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (DMM or RBC) 111 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or RBC) 112 #if H_3D_DIM_DMM 113 #define NUM_DMM1_DATA_CTX 1 ///< number of context models for DMM1 data 114 #endif 115 #define NUM_ANGLE_FLAG_CTX 1 116 #endif 117 118 #if H_3D_DIM_SDC 175 #if NH_3D_DMM 176 #define NUM_NOTDMM_FLAG_CTX 1 ///< number of context models for not-DMM flag 177 #define NUM_DMM_MODE_CTX 1 ///< number of context models for DMM modes 178 #endif 179 #if NH_3D_DMM || NH_3D_SDC_INTRA 180 #define NUM_DDC_DATA_CTX 1 ///< number of context models for deltaDC data (DMM or SDC) 181 #endif 182 #if NH_3D_SDC_INTRA 119 183 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 120 184 #define SDC_NUM_RESIDUAL_CTX 1 121 185 #define NUM_SDC_FLAG_CTX 1 ///< number of context 122 #endif 123 #if H_3D_DBBP 186 #define NUM_DDC_FLAG_CTX 2 ///< number of context models for deltaDC flag (SDC only) 187 #endif 188 #if NH_3D_DBBP 124 189 #define DBBP_NUM_FLAG_CTX 1 125 190 #endif … … 130 195 // initial probability for cu_transquant_bypass flag 131 196 static const UChar 132 INIT_CU_TRANSQUANT_BYPASS_FLAG[ 3][NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX] =133 { 134 { 154 }, 135 { 154 }, 136 { 154 }, 197 INIT_CU_TRANSQUANT_BYPASS_FLAG[NUMBER_OF_SLICE_TYPES][NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX] = 198 { 199 { 154 }, 200 { 154 }, 201 { 154 }, 137 202 }; 138 203 139 204 // initial probability for split flag 140 static const UChar 141 INIT_SPLIT_FLAG[ 3][NUM_SPLIT_FLAG_CTX] =205 static const UChar 206 INIT_SPLIT_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SPLIT_FLAG_CTX] = 142 207 { 143 208 { 107, 139, 126, }, 144 { 107, 139, 126, }, 145 { 139, 141, 157, }, 146 }; 147 148 static const UChar 149 INIT_SKIP_FLAG[ 3][NUM_SKIP_FLAG_CTX] =150 { 151 { 197, 185, 201, }, 152 { 197, 185, 201, }, 153 { CNU, CNU, CNU, }, 154 }; 155 #if H_3D209 { 107, 139, 126, }, 210 { 139, 141, 157, }, 211 }; 212 213 static const UChar 214 INIT_SKIP_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SKIP_FLAG_CTX] = 215 { 216 { 197, 185, 201, }, 217 { 197, 185, 201, }, 218 { CNU, CNU, CNU, }, 219 }; 220 #if NH_3D_DIS 156 221 static const UChar 157 222 INIT_DIS_FLAG[3][NUM_DIS_FLAG_CTX] = … … 170 235 #endif 171 236 static const UChar 172 INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = 173 { 174 { 154, }, 175 { 110, }, 176 { CNU, }, 177 }; 178 179 static const UChar 180 INIT_MERGE_IDX_EXT[3][NUM_MERGE_IDX_EXT_CTX] = 181 { 182 { 137, }, 183 { 122, }, 184 { CNU, }, 185 }; 186 187 static const UChar 188 INIT_PART_SIZE[3][NUM_PART_SIZE_CTX] = 189 { 190 { 154, 139, 154, 154 }, 191 { 154, 139, 154, 154 }, 192 { 184, CNU, CNU, CNU }, 193 }; 194 195 static const UChar 196 INIT_PRED_MODE[3][NUM_PRED_MODE_CTX] = 197 { 198 { 134, }, 199 { 149, }, 200 { CNU, }, 201 }; 202 203 static const UChar 204 INIT_INTRA_PRED_MODE[3][NUM_ADI_CTX] = 205 { 206 { 183, }, 207 { 154, }, 208 { 184, }, 209 }; 210 211 static const UChar 212 INIT_CHROMA_PRED_MODE[3][NUM_CHROMA_PRED_CTX] = 213 { 214 { 152, 139, }, 215 { 152, 139, }, 216 { 63, 139, }, 217 }; 218 219 static const UChar 220 INIT_INTER_DIR[3][NUM_INTER_DIR_CTX] = 221 { 222 { 95, 79, 63, 31, 31, }, 223 { 95, 79, 63, 31, 31, }, 224 { CNU, CNU, CNU, CNU, CNU, }, 225 }; 226 227 static const UChar 228 INIT_MVD[3][NUM_MV_RES_CTX] = 229 { 230 { 169, 198, }, 231 { 140, 198, }, 232 { CNU, CNU, }, 233 }; 234 235 static const UChar 236 INIT_REF_PIC[3][NUM_REF_NO_CTX] = 237 { 238 { 153, 153 }, 239 { 153, 153 }, 240 { CNU, CNU }, 241 }; 242 243 static const UChar 244 INIT_DQP[3][NUM_DELTA_QP_CTX] = 245 { 246 { 154, 154, 154, }, 247 { 154, 154, 154, }, 248 { 154, 154, 154, }, 249 }; 250 251 static const UChar 252 INIT_QT_CBF[3][2*NUM_QT_CBF_CTX] = 253 { 254 { 153, 111, CNU, CNU, 149, 92, 167, 154 }, 255 { 153, 111, CNU, CNU, 149, 107, 167, 154 }, 256 { 111, 141, CNU, CNU, 94, 138, 182, 154 }, 257 }; 258 259 static const UChar 260 INIT_QT_ROOT_CBF[3][NUM_QT_ROOT_CBF_CTX] = 261 { 262 { 79, }, 263 { 79, }, 264 { CNU, }, 265 }; 266 267 static const UChar 268 INIT_LAST[3][2*NUM_CTX_LAST_FLAG_XY] = 269 { 270 { 125, 110, 124, 110, 95, 94, 125, 111, 111, 79, 125, 126, 111, 111, 79, 271 108, 123, 93, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, 272 }, 273 { 125, 110, 94, 110, 95, 79, 125, 111, 110, 78, 110, 111, 111, 95, 94, 274 108, 123, 108, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, 275 }, 276 { 110, 110, 124, 125, 140, 153, 125, 127, 140, 109, 111, 143, 127, 111, 79, 277 108, 123, 63, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, 278 }, 279 }; 280 281 static const UChar 282 INIT_SIG_CG_FLAG[3][2 * NUM_SIG_CG_FLAG_CTX] = 283 { 284 { 121, 140, 285 61, 154, 286 }, 287 { 121, 140, 288 61, 154, 289 }, 290 { 91, 171, 291 134, 141, 292 }, 293 }; 294 295 static const UChar 296 INIT_SIG_FLAG[3][NUM_SIG_FLAG_CTX] = 297 { 298 { 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, }, 299 { 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, }, 300 { 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, }, 301 }; 302 303 static const UChar 304 INIT_ONE_FLAG[3][NUM_ONE_FLAG_CTX] = 305 { 306 { 154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 122, 169, 208, 166, 167, 154, 152, 167, 182, }, 307 { 154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 137, 169, 194, 166, 167, 154, 167, 137, 182, }, 308 { 140, 92, 137, 138, 140, 152, 138, 139, 153, 74, 149, 92, 139, 107, 122, 152, 140, 179, 166, 182, 140, 227, 122, 197, }, 309 }; 310 311 static const UChar 312 INIT_ABS_FLAG[3][NUM_ABS_FLAG_CTX] = 313 { 314 { 107, 167, 91, 107, 107, 167, }, 315 { 107, 167, 91, 122, 107, 167, }, 316 { 138, 153, 136, 167, 152, 152, }, 317 }; 318 319 static const UChar 320 INIT_MVP_IDX[3][NUM_MVP_IDX_CTX] = 321 { 322 { 168 }, 323 { 168 }, 324 { CNU }, 325 }; 326 327 static const UChar 328 INIT_SAO_MERGE_FLAG[3][NUM_SAO_MERGE_FLAG_CTX] = 329 { 330 { 153, }, 331 { 153, }, 332 { 153, }, 333 }; 334 335 static const UChar 336 INIT_SAO_TYPE_IDX[3][NUM_SAO_TYPE_IDX_CTX] = 237 INIT_MERGE_FLAG_EXT[NUMBER_OF_SLICE_TYPES][NUM_MERGE_FLAG_EXT_CTX] = 238 { 239 { 154, }, 240 { 110, }, 241 { CNU, }, 242 }; 243 244 static const UChar 245 INIT_MERGE_IDX_EXT[NUMBER_OF_SLICE_TYPES][NUM_MERGE_IDX_EXT_CTX] = 246 { 247 { 137, }, 248 { 122, }, 249 { CNU, }, 250 }; 251 252 static const UChar 253 INIT_PART_SIZE[NUMBER_OF_SLICE_TYPES][NUM_PART_SIZE_CTX] = 254 { 255 { 154, 139, 154, 154 }, 256 { 154, 139, 154, 154 }, 257 { 184, CNU, CNU, CNU }, 258 }; 259 260 static const UChar 261 INIT_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_PRED_MODE_CTX] = 262 { 263 { 134, }, 264 { 149, }, 265 { CNU, }, 266 }; 267 268 static const UChar 269 INIT_INTRA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_INTRA_PREDICT_CTX] = 270 { 271 { 183, }, 272 { 154, }, 273 { 184, }, 274 }; 275 276 static const UChar 277 INIT_CHROMA_PRED_MODE[NUMBER_OF_SLICE_TYPES][NUM_CHROMA_PRED_CTX] = 278 { 279 { 152, 139, }, 280 { 152, 139, }, 281 { 63, 139, }, 282 }; 283 284 static const UChar 285 INIT_INTER_DIR[NUMBER_OF_SLICE_TYPES][NUM_INTER_DIR_CTX] = 286 { 287 { 95, 79, 63, 31, 31, }, 288 { 95, 79, 63, 31, 31, }, 289 { CNU, CNU, CNU, CNU, CNU, }, 290 }; 291 292 static const UChar 293 INIT_MVD[NUMBER_OF_SLICE_TYPES][NUM_MV_RES_CTX] = 294 { 295 { 169, 198, }, 296 { 140, 198, }, 297 { CNU, CNU, }, 298 }; 299 300 static const UChar 301 INIT_REF_PIC[NUMBER_OF_SLICE_TYPES][NUM_REF_NO_CTX] = 302 { 303 { 153, 153 }, 304 { 153, 153 }, 305 { CNU, CNU }, 306 }; 307 308 static const UChar 309 INIT_DQP[NUMBER_OF_SLICE_TYPES][NUM_DELTA_QP_CTX] = 310 { 311 { 154, 154, 154, }, 312 { 154, 154, 154, }, 313 { 154, 154, 154, }, 314 }; 315 316 static const UChar 317 INIT_CHROMA_QP_ADJ_FLAG[NUMBER_OF_SLICE_TYPES][NUM_CHROMA_QP_ADJ_FLAG_CTX] = 318 { 319 { 154, }, 320 { 154, }, 321 { 154, }, 322 }; 323 324 static const UChar 325 INIT_CHROMA_QP_ADJ_IDC[NUMBER_OF_SLICE_TYPES][NUM_CHROMA_QP_ADJ_IDC_CTX] = 326 { 327 { 154, }, 328 { 154, }, 329 { 154, }, 330 }; 331 332 //-------------------------------------------------------------------------------------------------- 333 334 //Initialisation for CBF 335 336 // |---------Luminance---------| 337 #define BSLICE_LUMA_CBF_CONTEXT 153, 111, CNU, CNU, CNU 338 #define PSLICE_LUMA_CBF_CONTEXT 153, 111, CNU, CNU, CNU 339 #define ISLICE_LUMA_CBF_CONTEXT 111, 141, CNU, CNU, CNU 340 // |--------Chrominance--------| 341 #define BSLICE_CHROMA_CBF_CONTEXT 149, 92, 167, 154, 154 342 #define PSLICE_CHROMA_CBF_CONTEXT 149, 107, 167, 154, 154 343 #define ISLICE_CHROMA_CBF_CONTEXT 94, 138, 182, 154, 154 344 345 346 static const UChar 347 INIT_QT_CBF[NUMBER_OF_SLICE_TYPES][NUM_QT_CBF_CTX_SETS * NUM_QT_CBF_CTX_PER_SET] = 348 { 349 { BSLICE_LUMA_CBF_CONTEXT, BSLICE_CHROMA_CBF_CONTEXT }, 350 { PSLICE_LUMA_CBF_CONTEXT, PSLICE_CHROMA_CBF_CONTEXT }, 351 { ISLICE_LUMA_CBF_CONTEXT, ISLICE_CHROMA_CBF_CONTEXT }, 352 }; 353 354 355 //-------------------------------------------------------------------------------------------------- 356 357 static const UChar 358 INIT_QT_ROOT_CBF[NUMBER_OF_SLICE_TYPES][NUM_QT_ROOT_CBF_CTX] = 359 { 360 { 79, }, 361 { 79, }, 362 { CNU, }, 363 }; 364 365 366 //-------------------------------------------------------------------------------------------------- 367 368 //Initialisation for last-significant-position 369 370 // |------------------------------Luminance----------------------------------| 371 #define BSLICE_LUMA_LAST_POSITION_CONTEXT 125, 110, 124, 110, 95, 94, 125, 111, 111, 79, 125, 126, 111, 111, 79 372 #define PSLICE_LUMA_LAST_POSITION_CONTEXT 125, 110, 94, 110, 95, 79, 125, 111, 110, 78, 110, 111, 111, 95, 94 373 #define ISLICE_LUMA_LAST_POSITION_CONTEXT 110, 110, 124, 125, 140, 153, 125, 127, 140, 109, 111, 143, 127, 111, 79 374 // |------------------------------Chrominance--------------------------------| 375 #define BSLICE_CHROMA_LAST_POSITION_CONTEXT 108, 123, 93, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 376 #define PSLICE_CHROMA_LAST_POSITION_CONTEXT 108, 123, 108, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 377 #define ISLICE_CHROMA_LAST_POSITION_CONTEXT 108, 123, 63, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 378 379 380 static const UChar 381 INIT_LAST[NUMBER_OF_SLICE_TYPES][NUM_CTX_LAST_FLAG_SETS * NUM_CTX_LAST_FLAG_XY] = 382 { 383 { BSLICE_LUMA_LAST_POSITION_CONTEXT, BSLICE_CHROMA_LAST_POSITION_CONTEXT }, 384 { PSLICE_LUMA_LAST_POSITION_CONTEXT, PSLICE_CHROMA_LAST_POSITION_CONTEXT }, 385 { ISLICE_LUMA_LAST_POSITION_CONTEXT, ISLICE_CHROMA_LAST_POSITION_CONTEXT }, 386 }; 387 388 389 //-------------------------------------------------------------------------------------------------- 390 391 static const UChar 392 INIT_SIG_CG_FLAG[NUMBER_OF_SLICE_TYPES][2 * NUM_SIG_CG_FLAG_CTX] = 393 { 394 { 121, 140, 395 61, 154, 396 }, 397 { 121, 140, 398 61, 154, 399 }, 400 { 91, 171, 401 134, 141, 402 }, 403 }; 404 405 406 //-------------------------------------------------------------------------------------------------- 407 408 //Initialisation for significance map 409 410 // |-DC-| |-----------------4x4------------------| |------8x8 Diagonal Scan------| |----8x8 Non-Diagonal Scan----| |-NxN First group-| |-NxN Other group-| |-Single context-| 411 // | | | | |-First Group-| |-Other Group-| |-First Group-| |-Other Group-| | | | | | | 412 #define BSLICE_LUMA_SIGNIFICANCE_CONTEXT 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, 140 413 #define PSLICE_LUMA_SIGNIFICANCE_CONTEXT 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, 140 414 #define ISLICE_LUMA_SIGNIFICANCE_CONTEXT 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, 141 415 416 // |-DC-| |-----------------4x4------------------| |-8x8 Any group-| |-NxN Any group-| |-Single context-| 417 #define BSLICE_CHROMA_SIGNIFICANCE_CONTEXT 170, 153, 138, 138, 122, 121, 122, 121, 167, 151, 183, 140, 151, 183, 140, 140 418 #define PSLICE_CHROMA_SIGNIFICANCE_CONTEXT 170, 153, 123, 123, 107, 121, 107, 121, 167, 151, 183, 140, 151, 183, 140, 140 419 #define ISLICE_CHROMA_SIGNIFICANCE_CONTEXT 140, 139, 182, 182, 152, 136, 152, 136, 153, 136, 139, 111, 136, 139, 111, 111 420 421 //------------------------------------------------ 422 423 static const UChar 424 INIT_SIG_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SIG_FLAG_CTX] = 425 { 426 { BSLICE_LUMA_SIGNIFICANCE_CONTEXT, BSLICE_CHROMA_SIGNIFICANCE_CONTEXT }, 427 { PSLICE_LUMA_SIGNIFICANCE_CONTEXT, PSLICE_CHROMA_SIGNIFICANCE_CONTEXT }, 428 { ISLICE_LUMA_SIGNIFICANCE_CONTEXT, ISLICE_CHROMA_SIGNIFICANCE_CONTEXT }, 429 }; 430 431 432 //-------------------------------------------------------------------------------------------------- 433 434 //Initialisation for greater-than-one flags and greater-than-two flags 435 436 // |------Set 0-------| |------Set 1-------| |------Set 2-------| |------Set 3-------| 437 #define BSLICE_LUMA_ONE_CONTEXT 154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 122 438 #define PSLICE_LUMA_ONE_CONTEXT 154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 137 439 #define ISLICE_LUMA_ONE_CONTEXT 140, 92, 137, 138, 140, 152, 138, 139, 153, 74, 149, 92, 139, 107, 122, 152 440 441 #define BSLICE_LUMA_ABS_CONTEXT 107, 167, 91, 107 442 #define PSLICE_LUMA_ABS_CONTEXT 107, 167, 91, 122 443 #define ISLICE_LUMA_ABS_CONTEXT 138, 153, 136, 167 444 445 // |------Set 4-------| |------Set 5-------| 446 #define BSLICE_CHROMA_ONE_CONTEXT 169, 208, 166, 167, 154, 152, 167, 182 447 #define PSLICE_CHROMA_ONE_CONTEXT 169, 194, 166, 167, 154, 167, 137, 182 448 #define ISLICE_CHROMA_ONE_CONTEXT 140, 179, 166, 182, 140, 227, 122, 197 449 450 #define BSLICE_CHROMA_ABS_CONTEXT 107, 167 451 #define PSLICE_CHROMA_ABS_CONTEXT 107, 167 452 #define ISLICE_CHROMA_ABS_CONTEXT 152, 152 453 454 455 //------------------------------------------------ 456 457 static const UChar 458 INIT_ONE_FLAG[NUMBER_OF_SLICE_TYPES][NUM_ONE_FLAG_CTX] = 459 { 460 { BSLICE_LUMA_ONE_CONTEXT, BSLICE_CHROMA_ONE_CONTEXT }, 461 { PSLICE_LUMA_ONE_CONTEXT, PSLICE_CHROMA_ONE_CONTEXT }, 462 { ISLICE_LUMA_ONE_CONTEXT, ISLICE_CHROMA_ONE_CONTEXT }, 463 }; 464 465 static const UChar 466 INIT_ABS_FLAG[NUMBER_OF_SLICE_TYPES][NUM_ABS_FLAG_CTX] = 467 { 468 { BSLICE_LUMA_ABS_CONTEXT, BSLICE_CHROMA_ABS_CONTEXT }, 469 { PSLICE_LUMA_ABS_CONTEXT, PSLICE_CHROMA_ABS_CONTEXT }, 470 { ISLICE_LUMA_ABS_CONTEXT, ISLICE_CHROMA_ABS_CONTEXT }, 471 }; 472 473 474 //-------------------------------------------------------------------------------------------------- 475 476 static const UChar 477 INIT_MVP_IDX[NUMBER_OF_SLICE_TYPES][NUM_MVP_IDX_CTX] = 478 { 479 { 168, }, 480 { 168, }, 481 { CNU, }, 482 }; 483 484 static const UChar 485 INIT_SAO_MERGE_FLAG[NUMBER_OF_SLICE_TYPES][NUM_SAO_MERGE_FLAG_CTX] = 486 { 487 { 153, }, 488 { 153, }, 489 { 153, }, 490 }; 491 492 static const UChar 493 INIT_SAO_TYPE_IDX[NUMBER_OF_SLICE_TYPES][NUM_SAO_TYPE_IDX_CTX] = 337 494 { 338 495 { 160, }, … … 342 499 343 500 static const UChar 344 INIT_TRANS_SUBDIV_FLAG[ 3][NUM_TRANS_SUBDIV_FLAG_CTX] =501 INIT_TRANS_SUBDIV_FLAG[NUMBER_OF_SLICE_TYPES][NUM_TRANS_SUBDIV_FLAG_CTX] = 345 502 { 346 503 { 224, 167, 122, }, … … 350 507 351 508 static const UChar 352 INIT_TRANSFORMSKIP_FLAG[3][2*NUM_TRANSFORMSKIP_FLAG_CTX] = 353 { 354 { 139, 139}, 355 { 139, 139}, 356 { 139, 139}, 357 }; 358 359 #if H_3D_ARP 509 INIT_TRANSFORMSKIP_FLAG[NUMBER_OF_SLICE_TYPES][2*NUM_TRANSFORMSKIP_FLAG_CTX] = 510 { 511 { 139, 139}, 512 { 139, 139}, 513 { 139, 139}, 514 }; 515 516 static const UChar 517 INIT_EXPLICIT_RDPCM_FLAG[NUMBER_OF_SLICE_TYPES][2*NUM_EXPLICIT_RDPCM_FLAG_CTX] = 518 { 519 {139, 139}, 520 {139, 139}, 521 {CNU, CNU} 522 }; 523 524 static const UChar 525 INIT_EXPLICIT_RDPCM_DIR[NUMBER_OF_SLICE_TYPES][2*NUM_EXPLICIT_RDPCM_DIR_CTX] = 526 { 527 {139, 139}, 528 {139, 139}, 529 {CNU, CNU} 530 }; 531 532 static const UChar 533 INIT_CROSS_COMPONENT_PREDICTION[NUMBER_OF_SLICE_TYPES][NUM_CROSS_COMPONENT_PREDICTION_CTX] = 534 { 535 { 154, 154, 154, 154, 154, 154, 154, 154, 154, 154 }, 536 { 154, 154, 154, 154, 154, 154, 154, 154, 154, 154 }, 537 { 154, 154, 154, 154, 154, 154, 154, 154, 154, 154 }, 538 }; 539 540 //! \} 541 542 #if NH_3D_ARP 360 543 static const UChar 361 544 INIT_ARPW[3][NUM_ARPW_CTX] = … … 367 550 368 551 #endif 369 #if H_3D_IC552 #if NH_3D_IC 370 553 static const UChar 371 554 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = … … 377 560 378 561 #endif 379 #if H_3D_DIM 380 static const UChar 381 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] = 382 { 383 { 154, }, 384 { 154, }, 385 { 154, } 386 }; 387 562 563 #if NH_3D_DMM 388 564 static const UChar 389 INIT_ ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =565 INIT_NOTDMM_FLAG[3][NUM_NOTDMM_FLAG_CTX] = 390 566 { 391 567 { 154 }, … … 393 569 { 155 }, 394 570 }; 395 571 static const UChar 572 INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] = 573 { 574 { CNU }, 575 { CNU }, 576 { CNU } 577 }; 578 #endif 579 #if NH_3D_DMM || NH_3D_SDC_INTRA 580 static const UChar 581 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 582 { 583 { CNU }, 584 { CNU }, 585 { CNU }, 586 }; 587 #endif 588 #if NH_3D_SDC_INTRA 589 static const UChar 590 INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] = 591 { 592 { CNU }, 593 { CNU }, 594 { CNU }, 595 }; 596 static const UChar 597 INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 598 { 599 { 155 }, 600 { 155 }, 601 { 155 }, 602 }; 603 static const UChar 604 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = 605 { 606 { 154 }, 607 { 154 }, 608 { 154 }, 609 }; 396 610 static const UChar 397 611 INIT_DDC_FLAG[3][NUM_DDC_FLAG_CTX] = … … 401 615 {64, CNU} 402 616 }; 403 static const UChar 404 INIT_DDC_DATA[3][NUM_DDC_DATA_CTX] = 405 { 406 { 154 }, 407 { 154 }, 408 { 154 }, 409 }; 410 #if H_3D_DIM_DMM 411 static const UChar 412 INIT_DMM1_DATA[3][NUM_DMM1_DATA_CTX] = 413 { 414 { CNU }, 415 { CNU }, 416 { CNU }, 417 }; 418 #endif 419 #if H_3D_DIM_SDC 420 static const UChar 421 INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] = 422 { 423 { CNU }, 424 { CNU }, 425 { CNU }, 426 }; 427 static const UChar 428 INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 429 { 430 { 155 }, 431 { 155 }, 432 { 155 }, 433 }; 434 #endif 435 #endif 436 437 438 //! \} 439 #if H_3D_DIM_SDC 440 static const UChar 441 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] = 442 { 443 { 154 }, 444 { 154 }, 445 { 154 }, 446 }; 447 #endif 448 449 #if H_3D_DBBP 617 #endif 618 #if NH_3D_DBBP 450 619 static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] = 451 620 {
Note: See TracChangeset for help on using the changeset viewer.