- Timestamp:
- 26 Jan 2015, 17:11:15 (10 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 1 deleted
- 11 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp
r953 r1005 249 249 } 250 250 fclose (targetDecLayerIdSetFile); 251 if ( m_targetDecLayerIdSet.size() > 0 && !isLayerIdZeroIncluded ) 251 #if !R0235_SMALLEST_LAYER_ID // LayerId=0 is not required anymore in some cases 252 if (m_targetDecLayerIdSet.size() > 0 && !isLayerIdZeroIncluded) 252 253 { 253 254 fprintf(stderr, "TargetDecLayerIdSet must contain LayerId=0, aborting" ); 254 255 return false; 255 256 } 257 #endif 256 258 } 257 259 else -
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
r953 r1005 1113 1113 return true; 1114 1114 } 1115 #if R0235_SMALLEST_LAYER_ID 1116 if (nalu->m_layerId == 0 && (nalu->m_nalUnitType == NAL_UNIT_VPS || nalu->m_nalUnitType == NAL_UNIT_SPS || nalu->m_nalUnitType == NAL_UNIT_PPS || nalu->m_nalUnitType == NAL_UNIT_EOS)) 1117 { 1118 return true; 1119 } 1120 #endif 1115 1121 for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++) 1116 1122 { -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r997 r1005 1985 1985 #if MULTIPLE_PTL_SUPPORT 1986 1986 Int olsToLsIndex = (olsCtr >= (m_numLayerSets + m_numAddLayerSets)) ? m_outputLayerSetIdx[olsCtr - (m_numLayerSets + m_numAddLayerSets)] : olsCtr; 1987 #if R0235_SMALLEST_LAYER_ID 1988 // This is a fix to allow setting of PTL for additional layer sets 1989 if (olsCtr >= m_numLayerSets && olsCtr < (m_numLayerSets + m_numAddLayerSets)) 1990 { 1991 scanStringToArrayNumEntries(cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr]); 1992 } 1993 else 1994 { 1995 scanStringToArray(cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr]); 1996 } 1997 #else 1998 Int olsToLsIndex = (olsCtr >= (m_numLayerSets + m_numAddLayerSets)) ? m_outputLayerSetIdx[olsCtr - (m_numLayerSets + m_numAddLayerSets)] : olsCtr; 1987 1999 scanStringToArray( cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr] ); 2000 #endif 1988 2001 //For conformance checking 1989 2002 //Conformance of a layer in an output operation point associated with an OLS in a bitstream to the Scalable Main profile is indicated as follows: … … 1992 2005 //If OpTid of the output operation point is equal to vps_max_sub_layer_minus1, the conformance is indicated by general_profile_idc being equal to 7 or general_profile_compatibility_flag[ 7 ] being equal to 1 1993 2006 //The following assert may be updated / upgraded to take care of general_profile_compatibility_flag. 2007 #if R0235_SMALLEST_LAYER_ID 2008 if (m_numAddLayerSets == 0) 2009 { 2010 #endif 1994 2011 for ( Int ii = 1; ii < m_numLayerInIdList[olsToLsIndex]; ii++) 1995 2012 { … … 2001 2018 } 2002 2019 } 2020 #if R0235_SMALLEST_LAYER_ID 2021 } 2022 #endif 2003 2023 #endif 2004 2024 } … … 4175 4195 #endif 4176 4196 #endif //SVC_EXTENSION 4197 4198 #if SVC_EXTENSION 4199 #if R0235_SMALLEST_LAYER_ID 4200 #if OUTPUT_LAYER_SETS_CONFIG 4201 Void TAppEncCfg::cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString) 4202 { 4203 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); 4204 if (numEntries > 0) 4205 { 4206 Char *arrayEntry; 4207 Int i = 0; 4208 *arr = new Int[numEntries]; 4209 4210 if (tempChar == NULL) 4211 { 4212 arrayEntry = NULL; 4213 } 4214 else 4215 { 4216 arrayEntry = strtok(tempChar, " ,"); 4217 } 4218 while (arrayEntry != NULL) 4219 { 4220 if (i >= numEntries) 4221 { 4222 printf("%s: The number of entries specified is larger than the allowed number.\n", logString); 4223 exit(EXIT_FAILURE); 4224 } 4225 *(*arr + i) = atoi(arrayEntry); 4226 arrayEntry = strtok(NULL, " ,"); 4227 i++; 4228 } 4229 numEntries = i; 4230 /* 4231 if (i < numEntries) 4232 { 4233 printf("%s: Some entries are not specified.\n", logString); 4234 exit(EXIT_FAILURE); 4235 } 4236 */ 4237 } 4238 else 4239 { 4240 *arr = NULL; 4241 } 4242 4243 if (tempChar) 4244 { 4245 free(tempChar); 4246 tempChar = NULL; 4247 } 4248 } 4249 4250 Bool TAppEncCfg::scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> & returnVector) 4251 { 4252 Int *tempArray = NULL; 4253 numEntries = MAX_LAYERS; 4254 // For all layer sets 4255 cfgStringToArrayNumEntries(&tempArray, cfgString, numEntries, logString); 4256 if (tempArray) 4257 { 4258 returnVector.empty(); 4259 for (Int i = 0; i < numEntries; i++) 4260 { 4261 returnVector.push_back(tempArray[i]); 4262 } 4263 delete[] tempArray; tempArray = NULL; 4264 return true; 4265 } 4266 return false; 4267 } 4268 #endif 4269 #endif // R0235 4270 #endif //SVC_EXTENSION 4271 4272 4177 4273 //! \} -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r951 r1005 544 544 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector); 545 545 Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString); 546 #if R0235_SMALLEST_LAYER_ID 547 Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, Int * const returnArray); 548 Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> & returnVector); 549 Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString); 550 #endif 546 551 #else 547 552 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); -
branches/SHM-dev/source/App/utils/ExtractAddLS/ExtractAddLS.c
r1004 r1005 34 34 #include <stdlib.h> 35 35 #include <stdio.h> 36 #include <string.h> 36 37 37 38 38 39 enum NalUnitType 39 40 { 40 NAL_UNIT_CODED_SLICE_TRAIL_N = 0, // 041 NAL_UNIT_CODED_SLICE_TRAIL_R, // 142 43 NAL_UNIT_CODED_SLICE_TSA_N, // 244 NAL_UNIT_CODED_SLICE_TSA_R, // 345 46 NAL_UNIT_CODED_SLICE_STSA_N, // 447 NAL_UNIT_CODED_SLICE_STSA_R, // 548 49 NAL_UNIT_CODED_SLICE_RADL_N, // 650 NAL_UNIT_CODED_SLICE_RADL_R, // 751 52 NAL_UNIT_CODED_SLICE_RASL_N, // 853 NAL_UNIT_CODED_SLICE_RASL_R, // 941 NAL_UNIT_CODED_SLICE_TRAIL_N = 0, 42 NAL_UNIT_CODED_SLICE_TRAIL_R, 43 44 NAL_UNIT_CODED_SLICE_TSA_N, 45 NAL_UNIT_CODED_SLICE_TSA_R, 46 47 NAL_UNIT_CODED_SLICE_STSA_N, 48 NAL_UNIT_CODED_SLICE_STSA_R, 49 50 NAL_UNIT_CODED_SLICE_RADL_N, 51 NAL_UNIT_CODED_SLICE_RADL_R, 52 53 NAL_UNIT_CODED_SLICE_RASL_N, 54 NAL_UNIT_CODED_SLICE_RASL_R, 54 55 55 56 NAL_UNIT_RESERVED_VCL_N10, … … 60 61 NAL_UNIT_RESERVED_VCL_R15, 61 62 62 NAL_UNIT_CODED_SLICE_BLA_W_LP, // 1663 NAL_UNIT_CODED_SLICE_BLA_W_RADL, // 1764 NAL_UNIT_CODED_SLICE_BLA_N_LP, // 1865 NAL_UNIT_CODED_SLICE_IDR_W_RADL, // 1966 NAL_UNIT_CODED_SLICE_IDR_N_LP, // 2067 NAL_UNIT_CODED_SLICE_CRA, // 2163 NAL_UNIT_CODED_SLICE_BLA_W_LP, 64 NAL_UNIT_CODED_SLICE_BLA_W_RADL, 65 NAL_UNIT_CODED_SLICE_BLA_N_LP, 66 NAL_UNIT_CODED_SLICE_IDR_W_RADL, 67 NAL_UNIT_CODED_SLICE_IDR_N_LP, 68 NAL_UNIT_CODED_SLICE_CRA, 68 69 NAL_UNIT_RESERVED_IRAP_VCL22, 69 70 NAL_UNIT_RESERVED_IRAP_VCL23, … … 78 79 NAL_UNIT_RESERVED_VCL31, 79 80 80 NAL_UNIT_VPS, // 3281 NAL_UNIT_SPS, // 3382 NAL_UNIT_PPS, // 3483 NAL_UNIT_ACCESS_UNIT_DELIMITER, // 3584 NAL_UNIT_EOS, // 3685 NAL_UNIT_EOB, // 3786 NAL_UNIT_FILLER_DATA, // 3887 NAL_UNIT_PREFIX_SEI, // 3988 NAL_UNIT_SUFFIX_SEI, // 4081 NAL_UNIT_VPS, 82 NAL_UNIT_SPS, 83 NAL_UNIT_PPS, 84 NAL_UNIT_ACCESS_UNIT_DELIMITER, 85 NAL_UNIT_EOS, 86 NAL_UNIT_EOB, 87 NAL_UNIT_FILLER_DATA, 88 NAL_UNIT_PREFIX_SEI, 89 NAL_UNIT_SUFFIX_SEI, 89 90 NAL_UNIT_RESERVED_NVCL41, 90 91 NAL_UNIT_RESERVED_NVCL42, … … 113 114 }; 114 115 116 char *nalUnitNames[] = 117 { 118 "NAL_UNIT_CODED_SLICE_TRAIL_N", 119 "NAL_UNIT_CODED_SLICE_TRAIL_R", 120 121 "NAL_UNIT_CODED_SLICE_TSA_N", 122 "NAL_UNIT_CODED_SLICE_TSA_R", 123 124 "NAL_UNIT_CODED_SLICE_STSA_N", 125 "NAL_UNIT_CODED_SLICE_STSA_R", 126 127 "NAL_UNIT_CODED_SLICE_RADL_N", 128 "NAL_UNIT_CODED_SLICE_RADL_R", 129 130 "NAL_UNIT_CODED_SLICE_RASL_N", 131 "NAL_UNIT_CODED_SLICE_RASL_R", 132 133 "NAL_UNIT_RESERVED_VCL_N10", 134 "NAL_UNIT_RESERVED_VCL_R11", 135 "NAL_UNIT_RESERVED_VCL_N12", 136 "NAL_UNIT_RESERVED_VCL_R13", 137 "NAL_UNIT_RESERVED_VCL_N14", 138 "NAL_UNIT_RESERVED_VCL_R15", 139 140 "NAL_UNIT_CODED_SLICE_BLA_W_LP", 141 "NAL_UNIT_CODED_SLICE_BLA_W_RADL", 142 "NAL_UNIT_CODED_SLICE_BLA_N_LP", 143 "NAL_UNIT_CODED_SLICE_IDR_W_RADL", 144 "NAL_UNIT_CODED_SLICE_IDR_N_LP", 145 "NAL_UNIT_CODED_SLICE_CRA", 146 "NAL_UNIT_RESERVED_IRAP_VCL22", 147 "NAL_UNIT_RESERVED_IRAP_VCL23", 148 149 "NAL_UNIT_RESERVED_VCL24", 150 "NAL_UNIT_RESERVED_VCL25", 151 "NAL_UNIT_RESERVED_VCL26", 152 "NAL_UNIT_RESERVED_VCL27", 153 "NAL_UNIT_RESERVED_VCL28", 154 "NAL_UNIT_RESERVED_VCL29", 155 "NAL_UNIT_RESERVED_VCL30", 156 "NAL_UNIT_RESERVED_VCL31", 157 158 "NAL_UNIT_VPS", 159 "NAL_UNIT_SPS", 160 "NAL_UNIT_PPS", 161 "NAL_UNIT_ACCESS_UNIT_DELIMITER", 162 "NAL_UNIT_EOS", 163 "NAL_UNIT_EOB", 164 "NAL_UNIT_FILLER_DATA", 165 "NAL_UNIT_PREFIX_SEI", 166 "NAL_UNIT_SUFFIX_SEI", 167 "NAL_UNIT_RESERVED_NVCL41", 168 "NAL_UNIT_RESERVED_NVCL42", 169 "NAL_UNIT_RESERVED_NVCL43", 170 "NAL_UNIT_RESERVED_NVCL44", 171 "NAL_UNIT_RESERVED_NVCL45", 172 "NAL_UNIT_RESERVED_NVCL46", 173 "NAL_UNIT_RESERVED_NVCL47", 174 "NAL_UNIT_UNSPECIFIED_48", 175 "NAL_UNIT_UNSPECIFIED_49", 176 "NAL_UNIT_UNSPECIFIED_50", 177 "NAL_UNIT_UNSPECIFIED_51", 178 "NAL_UNIT_UNSPECIFIED_52", 179 "NAL_UNIT_UNSPECIFIED_53", 180 "NAL_UNIT_UNSPECIFIED_54", 181 "NAL_UNIT_UNSPECIFIED_55", 182 "NAL_UNIT_UNSPECIFIED_56", 183 "NAL_UNIT_UNSPECIFIED_57", 184 "NAL_UNIT_UNSPECIFIED_58", 185 "NAL_UNIT_UNSPECIFIED_59", 186 "NAL_UNIT_UNSPECIFIED_60", 187 "NAL_UNIT_UNSPECIFIED_61", 188 "NAL_UNIT_UNSPECIFIED_62", 189 "NAL_UNIT_UNSPECIFIED_63" 190 }; 191 115 192 typedef struct NalUnitHeader_s 116 193 { … … 126 203 int currByte; 127 204 128 while (1)205 for (;;) 129 206 { 130 207 currByte = fgetc(inFile); … … 201 278 int numStartCodeZeros; 202 279 int nalIsSpsPpsEob; 280 int nalIsVpsSpsPpsEos; 203 281 int removeNal; 204 205 if (argc < 4 || argc > 5) 206 { 207 fprintf(stderr, "Usage: BLRewrite <infile> <outfile> <assigned base layer ID> [<max temporal ID>]\n"); 282 int layerIdListTarget[8]; 283 int i; 284 int layerIdx; 285 int numLayerIds; 286 char nalName[32]; 287 288 if (argc < 5 || argc > 10) 289 { 290 fprintf(stderr, "\n Usage: ExtractAddLS <infile> <outfile> <max temporal ID> <list of layer IDs> \n\n"); 291 fprintf(stderr, " If only one layer ID is given, independent non-base layer rewriting process\n"); 292 fprintf(stderr, " is performed\n"); 293 fprintf(stderr, " If more than one layer ID is given, sub-bitstream extraction process for\n"); 294 fprintf(stderr, " additional layer sets is performed (Layer ID list should exactly match\n"); 295 fprintf(stderr, " an additional layer set defined in VPS)\n"); 208 296 exit(1); 209 297 } … … 223 311 } 224 312 225 assignedBaseLayerId= atoi(argv[3]);226 if ( assignedBaseLayerId < 1 || assignedBaseLayerId > 7)227 { 228 fprintf(stderr, "Invalid assigned base layer ID (must be in range 1-7)\n");313 tIdTarget = atoi(argv[3]); 314 if (tIdTarget < 0 || tIdTarget > 6) 315 { 316 fprintf(stderr, "Invalid maximum temporal ID (must be in range 0-6)\n"); 229 317 exit(1); 230 318 } 231 319 232 if (argc == 5)233 { 234 tIdTarget = atoi(argv[4]);235 if ( tIdTarget < 0 || tIdTarget > 6)236 { 237 fprintf(stderr, "Invalid maximum temporal ID (must be in range 0-6)\n");320 for (i = 4, layerIdx = 0; i < argc; i++, layerIdx++) 321 { 322 layerIdListTarget[layerIdx] = atoi(argv[i]); 323 if (layerIdListTarget[layerIdx] < 1 || layerIdListTarget[layerIdx] > 7) 324 { 325 fprintf(stderr, "Invalid layer ID (must be in range 1-7)\n"); 238 326 exit(1); 239 327 } 240 328 } 241 329 242 while (1) 330 numLayerIds = layerIdx; 331 assignedBaseLayerId = layerIdListTarget[0]; 332 333 /* Iterate through all NAL units */ 334 for (;;) 243 335 { 244 336 if (!findStartCodePrefix(inFile, &numStartCodeZeros)) … … 251 343 } 252 344 253 printf("NAL unit type: %i, NUH layer ID: %i, NUH Temporal ID: %i\n", nalu.nalUnitType, nalu.nuhLayerId, nalu.nuhTemporalIdPlus1 - 1); 254 255 nalIsSpsPpsEob = (nalu.nalUnitType == NAL_UNIT_SPS || nalu.nalUnitType == NAL_UNIT_PPS || nalu.nalUnitType == NAL_UNIT_EOB); 256 257 removeNal = (!nalIsSpsPpsEob && (nalu.nuhLayerId != assignedBaseLayerId)) 258 || (nalIsSpsPpsEob && (nalu.nuhLayerId != 0) && (nalu.nuhLayerId != assignedBaseLayerId)) 259 || (nalu.nalUnitType == NAL_UNIT_VPS) 260 || ((nalu.nuhTemporalIdPlus1 - 1) > tIdTarget); 345 if (numLayerIds == 1) 346 { 347 /* independent non-base layer rewriting process */ 348 349 nalIsSpsPpsEob = (nalu.nalUnitType == NAL_UNIT_SPS || nalu.nalUnitType == NAL_UNIT_PPS || nalu.nalUnitType == NAL_UNIT_EOB); 350 351 removeNal = (!nalIsSpsPpsEob && (nalu.nuhLayerId != assignedBaseLayerId)) 352 || (nalIsSpsPpsEob && (nalu.nuhLayerId != 0) && (nalu.nuhLayerId != assignedBaseLayerId)) 353 || (nalu.nalUnitType == NAL_UNIT_VPS) 354 || ((nalu.nuhTemporalIdPlus1 - 1) > tIdTarget); 355 356 nalu.nuhLayerId = 0; 357 } 358 else /* numLayerIds > 1 */ 359 { 360 /* sub-bitstream extraction process for additional layer sets */ 361 362 int isTargetLayer = 0; 363 364 for (i = 0; i < numLayerIds; i++) 365 { 366 if (layerIdListTarget[i] == nalu.nuhLayerId) 367 { 368 isTargetLayer = 1; 369 } 370 } 371 372 nalIsVpsSpsPpsEos = (nalu.nalUnitType == NAL_UNIT_VPS || nalu.nalUnitType == NAL_UNIT_SPS || nalu.nalUnitType == NAL_UNIT_PPS || nalu.nalUnitType == NAL_UNIT_EOS); 373 374 removeNal = (!(nalIsVpsSpsPpsEos || nalu.nalUnitType == NAL_UNIT_EOB) && !isTargetLayer) 375 || (nalIsVpsSpsPpsEos && (nalu.nuhLayerId != 0) && !isTargetLayer) 376 || ((nalu.nuhTemporalIdPlus1 - 1) > tIdTarget); 377 } 261 378 262 379 if (!removeNal) … … 268 385 long i; 269 386 270 nalu.nuhLayerId = 0; 387 printf("Keep "); 388 271 389 writeStartCodePrefixAndNUH(outFile, numStartCodeZeros, &nalu); 272 390 … … 283 401 fseek(inFile, naluBytesStartPos, SEEK_SET); 284 402 285 for (i = 0; i < numNaluBytes; i++) 403 i = 0; 404 405 if (numLayerIds > 1 && nalu.nalUnitType == NAL_UNIT_VPS) 406 { 407 /* sub-bitstream extraction process for additional layer sets */ 408 int nalByte = fgetc(inFile); 409 nalByte = nalByte & ~(0x04); /* vps_base_layer_available_flag in each VPS is set equal to 0 */ 410 fputc(nalByte, outFile); 411 i++; 412 } 413 414 for (; i < numNaluBytes; i++) 286 415 { 287 416 fputc(fgetc(inFile), outFile); 288 417 } 289 418 } 419 else 420 { 421 printf("- "); 422 } 423 424 strcpy(nalName, nalUnitNames[nalu.nalUnitType]); 425 for (i = strlen(nalName); i < 31; i++) 426 { 427 nalName[i] = ' '; 428 } 429 nalName[31] = '\0'; 430 431 printf("%s layer ID: %i temporal ID: %i\n", nalName, nalu.nuhLayerId, nalu.nuhTemporalIdPlus1 - 1); 290 432 } 291 433 -
branches/SHM-dev/source/App/utils/ExtractAddLS/ReadMe.txt
r778 r1005 1 1 2 This is a simple tool that extracts an independent non-base layer from a multi-layer bitstream, converts it to a base-layer bistream and writes it to a file. The tool is invoked as follows.2 This a tool that either: 3 3 4 BLRewrite <infile> <outfile> <layer ID of the extracted layer>4 1. Extracts an independent non-base layer from a multi-layer bitstream, converts it to a base-layer bistream and writes it to a file. The extraction processs is defined in chapter F.10.2 of the HEVC version 2 specification. 5 5 6 The tool is based on the contribution JCTVC-Q0078 / JCTVC-R0042. Sub-bitstream extraction process done by the tool can be summarized as follows. 6 or 7 7 8 - NAL units with nal_unit_type not equal to SPS_NUT, PPS_NUT, EOS_NUT and EOB_NUT and with nuh_layer_id not equal to the assignedBaseLayerId are removed from outBitstream. 9 - NAL units with nal_unit_type equal to SPS_NUT, PPS_NUT, EOS_NUT or EOB_NUT with nuh_layer_id not equal to 0 are removed from outBitstream. 10 - For each NAL unit, the following applies: 11 When nuh_layer_id is equal to assignedBaseLayerId, nuh_layer_id is set equal to 0. 8 2. Extracts an additional layer set sub-bitstream from multi-layer bitstream and writes it to a file. The extraction processs is defined in chapter F.10.3 of the HEVC version 2 specification. 12 9 13 The resulting bitstream can be decoded with an HEVC/H.265 v1 compliant decoder as long as the extracted independent layer conform with v1 specification text. The tool removes VPS from the output bitstream so an HEVC/H.265 decoder should not expect it to be present. 10 11 The tool is invoked as follows: 12 13 ExtractAddLS <infile> <outfile> <Max temporal ID> <layer IDs of the extracted layers> 14 15 The process that is invoked is decided based on the number of IDs that are given in the layer ID list. If only one layer ID is given, independent non-base layer rewriting process is invoked. If more than one layer ID is given, sub-bitstream extraction for additional layer sets is invoked. 16 17 The result of independent non-base layer rewriting process can be decoded with an HEVC/H.265 v1 compliant decoder as long as the extracted independent layer conform with v1 specification text. The tool removes VPS from the output bitstream during rewriting so an HEVC/H.265 decoder should not expect it to be present. 14 18 15 19 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r999 r1005 1076 1076 */ 1077 1077 #if NO_CLRAS_OUTPUT_FLAG 1078 #if R0235_SMALLEST_LAYER_ID 1079 Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId ) 1080 #else 1078 1081 Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ) 1082 #endif 1079 1083 { 1080 1084 if( !isIRAP() ) … … 1086 1090 TComPic* rpcPic = NULL; 1087 1091 1088 // When the current picture is an IRAP picture with nuh_layer_id equal to 0and NoClrasOutputFlag is equal to 1,1092 // When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId and NoClrasOutputFlag is equal to 1, 1089 1093 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked as "unused for reference". 1094 #if R0235_SMALLEST_LAYER_ID 1095 if (m_layerId == smallestLayerId && noClrasOutputFlag) 1096 #else 1090 1097 if( m_layerId == 0 && noClrasOutputFlag ) 1098 #endif 1091 1099 { 1092 1100 // mark all pictures for all layers as not used for reference -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r951 r1005 2463 2463 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2464 2464 #if NO_CLRAS_OUTPUT_FLAG 2465 #if R0235_SMALLEST_LAYER_ID 2466 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 ); 2467 #else 2465 2468 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ); 2469 #endif 2466 2470 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag); 2467 2471 #else -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r978 r1005 81 81 #define R0227_BR_PR_ADD_LAYER_SET 1 ///< JCTVC-R0227, Signalling of bit-rate and picture rate for additional layer set 82 82 #define R0042_PROFILE_INDICATION 1 ///< JCTVC-R0042, Profile indication for additional layer sets 83 #define R0235_SMALLEST_LAYER_ID 1 ///< JCTVC-R0235, SmallestLayerId semantics 83 84 84 85 #define Q0108_TSA_STSA 1 ///< JCTVC-Q0108, Remove cross-layer alignment constraints of TSA and STSA pictures, enable to have different prediction structures in different layers -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1001 r1005 1813 1813 //If OpTid of the output operation point is equal to vps_max_sub_layer_minus1, the conformance is indicated by general_profile_idc being equal to 7 or general_profile_compatibility_flag[ 7 ] being equal to 1 1814 1814 //The following assert may be updated / upgraded to take care of general_profile_compatibility_flag. 1815 #if R0235_SMALLEST_LAYER_ID 1816 // The assertion below is not valid for independent non-base layers 1817 if (vps->getNumAddLayerSets() == 0) 1818 { 1819 #endif 1815 1820 if (j > 0 && vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j) != 0 && vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j - 1) != 0) 1816 1821 { … … 1819 1824 vps->getPTL(vps->getProfileLevelTierIdx(i, j))->getGeneralPTL()->getProfileCompatibilityFlag(vps->getPTL(vps->getProfileLevelTierIdx(i, j - 1))->getGeneralPTL()->getProfileIdc()) ); 1820 1825 } 1826 #if R0235_SMALLEST_LAYER_ID 1827 } 1828 #endif 1821 1829 #endif 1822 1830 } … … 3420 3428 for(Int kk = 0; kk < rpcSlice->getVPS()->getNumLayersInIdList(layerSetIdxForOutputLayerSet); kk++) 3421 3429 { 3430 #if R0235_SMALLEST_LAYER_ID 3431 if(vps->getNecessaryLayerFlag(ii, kk) && rpcSlice->getLayerId()==rpcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk)) 3432 #else 3422 3433 if(rpcSlice->getLayerId()==rpcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk)) 3434 #endif 3423 3435 { 3424 3436 chkAssert=1; -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r978 r1005 84 84 #if SVC_EXTENSION 85 85 m_layerId = 0; 86 #if R0235_SMALLEST_LAYER_ID 87 m_smallestLayerId = 0; 88 #endif 86 89 #if AVC_BASE 87 90 m_pBLReconFile = NULL; … … 1011 1014 #if OUTPUT_LAYER_SET_INDEX 1012 1015 // Following check should go wherever the VPS is activated 1013 checkValueOfTargetOutputLayerSetIdx( m_apcSlicePilot->getVPS()); 1016 #if R0235_SMALLEST_LAYER_ID 1017 if (!m_apcSlicePilot->getVPS()->getBaseLayerAvailableFlag()) 1018 { 1019 assert(nalu.m_layerId != 0); 1020 assert(m_apcSlicePilot->getVPS()->getNumAddLayerSets() > 0); 1021 if (getCommonDecoderParams()->getTargetOutputLayerSetIdx() >= 0) 1022 { 1023 UInt layerIdx = m_apcSlicePilot->getVPS()->getOutputLayerSetIdx(getCommonDecoderParams()->getTargetOutputLayerSetIdx()); 1024 assert(layerIdx > m_apcSlicePilot->getVPS()->getVpsNumLayerSetsMinus1()); 1025 } 1026 } 1027 if (m_apcSlicePilot->getVPS()->getNumAddLayerSets() == 0) 1028 { 1029 checkValueOfTargetOutputLayerSetIdx(m_apcSlicePilot->getVPS()); 1030 } 1031 #else 1032 checkValueOfTargetOutputLayerSetIdx(m_apcSlicePilot->getVPS()); 1033 #endif 1014 1034 #endif 1015 1035 #if RESOLUTION_BASED_DPB … … 1143 1163 #if NO_OUTPUT_OF_PRIOR_PICS 1144 1164 #if NO_CLRAS_OUTPUT_FLAG 1165 #if R0235_SMALLEST_LAYER_ID 1166 if (m_layerId == m_smallestLayerId && m_apcSlicePilot->getRapPicFlag()) 1167 #else 1145 1168 if (m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() ) 1169 #endif 1146 1170 { 1147 1171 if (m_bFirstSliceInSequence) … … 1175 1199 } 1176 1200 1201 #if R0235_SMALLEST_LAYER_ID 1202 m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag, m_smallestLayerId ); 1203 #else 1177 1204 m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag ); 1205 #endif 1178 1206 #endif 1179 1207 … … 2640 2668 cListPic->clear(); 2641 2669 } 2670 #endif 2671 #if R0235_SMALLEST_LAYER_ID 2672 xDeriveSmallestLayerId(m_parameterSetManagerDecoder.getPrefetchedVPS(0)); 2642 2673 #endif 2643 2674 return false; … … 3126 3157 Void TDecTop::xCheckLayerReset() 3127 3158 { 3159 #if R0235_SMALLEST_LAYER_ID 3160 if (m_apcSlicePilot->isIRAP() && m_layerId > m_smallestLayerId) 3161 #else 3128 3162 if (m_apcSlicePilot->isIRAP() && m_layerId > 0) 3163 #endif 3129 3164 { 3130 3165 Bool layerResetFlag; … … 3210 3245 #endif 3211 3246 3247 #if R0235_SMALLEST_LAYER_ID 3248 Void TDecTop::xDeriveSmallestLayerId(TComVPS* vps) 3249 { 3250 UInt smallestLayerId; 3251 UInt targetOlsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx(); 3252 UInt targetDecLayerSetIdx = vps->getOutputLayerSetIdx(targetOlsIdx); 3253 UInt lsIdx = targetDecLayerSetIdx; 3254 UInt targetDecLayerIdList[MAX_LAYERS] = {0}; 3255 3256 for (UInt i = 0, j = 0; i < vps->getNumLayersInIdList(lsIdx); i++) 3257 { 3258 if (vps->getNecessaryLayerFlag(targetOlsIdx, i)) 3259 { 3260 targetDecLayerIdList[j++] = vps->getLayerSetLayerIdList(lsIdx, i); 3261 } 3262 } 3263 3264 if (targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1()) 3265 { 3266 smallestLayerId = 0; 3267 } 3268 else if (vps->getNumLayersInIdList(targetDecLayerSetIdx) == 1) 3269 { 3270 smallestLayerId = 0; 3271 } 3272 else 3273 { 3274 smallestLayerId = targetDecLayerIdList[0]; 3275 } 3276 3277 for (UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1 - 1; layer++) 3278 { 3279 m_ppcTDecTop[layer]->m_smallestLayerId = smallestLayerId; 3280 } 3281 } 3282 #endif 3283 3212 3284 #endif //SVC_EXTENSION 3213 3285 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r978 r1005 130 130 UInt m_numLayer; 131 131 TDecTop** m_ppcTDecTop; 132 #if R0235_SMALLEST_LAYER_ID 133 UInt m_smallestLayerId; 134 #endif 132 135 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 133 136 Bool m_pocResettingFlag; … … 247 250 Void setLayerDec(TDecTop **p) { m_ppcTDecTop = p; } 248 251 TDecTop* getLayerDec(UInt layer) { return m_ppcTDecTop[layer]; } 252 #if R0235_SMALLEST_LAYER_ID 253 Void xDeriveSmallestLayerId(TComVPS* vps); 254 #endif 249 255 #if VPS_EXTN_DIRECT_REF_LAYERS 250 256 TDecTop* getRefLayerDec(UInt refLayerIdc);
Note: See TracChangeset for help on using the changeset viewer.