Changeset 1006 in SHVCSoftware
- Timestamp:
- 27 Jan 2015, 19:44:15 (10 years ago)
- Location:
- branches/SHM-upgrade/source
- Files:
-
- 3 added
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-upgrade/source/App/TAppDecoder/TAppDecCfg.cpp
r962 r1006 265 265 } 266 266 fclose (targetDecLayerIdSetFile); 267 #if !R0235_SMALLEST_LAYER_ID // LayerId=0 is not required anymore in some cases 267 268 if ( m_targetDecLayerIdSet.size() > 0 && !isLayerIdZeroIncluded ) 268 269 { … … 270 271 return false; 271 272 } 273 #endif 272 274 } 273 275 else -
branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.cpp
r962 r1006 1212 1212 return true; 1213 1213 } 1214 #if R0235_SMALLEST_LAYER_ID 1215 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)) 1216 { 1217 return true; 1218 } 1219 #endif 1214 1220 for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++) 1215 1221 { -
branches/SHM-upgrade/source/App/TAppEncoder/TAppEncCfg.cpp
r998 r1006 2681 2681 #if MULTIPLE_PTL_SUPPORT 2682 2682 Int olsToLsIndex = (olsCtr >= (m_numLayerSets + m_numAddLayerSets)) ? m_outputLayerSetIdx[olsCtr - (m_numLayerSets + m_numAddLayerSets)] : olsCtr; 2683 #if R0235_SMALLEST_LAYER_ID 2684 // This is a fix to allow setting of PTL for additional layer sets 2685 if (olsCtr >= m_numLayerSets && olsCtr < (m_numLayerSets + m_numAddLayerSets)) 2686 { 2687 scanStringToArrayNumEntries(cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr]); 2688 } 2689 else 2690 { 2691 scanStringToArray(cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr]); 2692 } 2693 #else 2683 2694 scanStringToArray( cfg_listOfLayerPTLOfOlss[olsCtr], m_numLayerInIdList[olsToLsIndex], "List of PTL for each layers in OLS", m_listOfLayerPTLofOlss[olsCtr] ); 2695 #endif 2684 2696 //For conformance checking 2685 2697 //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: … … 2688 2700 //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 2689 2701 //The following assert may be updated / upgraded to take care of general_profile_compatibility_flag. 2702 #if R0235_SMALLEST_LAYER_ID 2703 if (m_numAddLayerSets == 0) 2704 { 2705 #endif 2690 2706 for ( Int ii = 1; ii < m_numLayerInIdList[olsToLsIndex]; ii++) 2691 2707 { … … 2696 2712 (m_profileCompatibility[m_listOfLayerPTLofOlss[olsCtr][ii]] == m_profileList[m_listOfLayerPTLofOlss[olsCtr][ii - 1]]) ); 2697 2713 } 2698 } 2714 } 2715 #if R0235_SMALLEST_LAYER_ID 2716 } 2717 #endif 2699 2718 #endif 2700 2719 } … … 5084 5103 } 5085 5104 #endif 5105 5106 #if R0235_SMALLEST_LAYER_ID 5107 #if OUTPUT_LAYER_SETS_CONFIG 5108 Void TAppEncCfg::cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString) 5109 { 5110 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); 5111 if (numEntries > 0) 5112 { 5113 Char *arrayEntry; 5114 Int i = 0; 5115 *arr = new Int[numEntries]; 5116 5117 if (tempChar == NULL) 5118 { 5119 arrayEntry = NULL; 5120 } 5121 else 5122 { 5123 arrayEntry = strtok(tempChar, " ,"); 5124 } 5125 while (arrayEntry != NULL) 5126 { 5127 if (i >= numEntries) 5128 { 5129 printf("%s: The number of entries specified is larger than the allowed number.\n", logString); 5130 exit(EXIT_FAILURE); 5131 } 5132 *(*arr + i) = atoi(arrayEntry); 5133 arrayEntry = strtok(NULL, " ,"); 5134 i++; 5135 } 5136 numEntries = i; 5137 /* 5138 if (i < numEntries) 5139 { 5140 printf("%s: Some entries are not specified.\n", logString); 5141 exit(EXIT_FAILURE); 5142 } 5143 */ 5144 } 5145 else 5146 { 5147 *arr = NULL; 5148 } 5149 5150 if (tempChar) 5151 { 5152 free(tempChar); 5153 tempChar = NULL; 5154 } 5155 } 5156 5157 Bool TAppEncCfg::scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> & returnVector) 5158 { 5159 Int *tempArray = NULL; 5160 numEntries = MAX_LAYERS; 5161 // For all layer sets 5162 cfgStringToArrayNumEntries(&tempArray, cfgString, numEntries, logString); 5163 if (tempArray) 5164 { 5165 returnVector.empty(); 5166 for (Int i = 0; i < numEntries; i++) 5167 { 5168 returnVector.push_back(tempArray[i]); 5169 } 5170 delete[] tempArray; tempArray = NULL; 5171 return true; 5172 } 5173 return false; 5174 } 5175 #endif 5176 #endif // R0235 5086 5177 #endif //SVC_EXTENSION 5087 5178 //! \} -
branches/SHM-upgrade/source/App/TAppEncoder/TAppEncCfg.h
r959 r1006 587 587 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector); 588 588 Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString); 589 #if R0235_SMALLEST_LAYER_ID 590 Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, Int * const returnArray); 591 Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> & returnVector); 592 Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString); 593 #endif 589 594 #else 590 595 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); -
branches/SHM-upgrade/source/Lib/TLibCommon/TComSlice.cpp
r1000 r1006 901 901 */ 902 902 #if NO_CLRAS_OUTPUT_FLAG 903 #if R0235_SMALLEST_LAYER_ID 904 Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId ) 905 #else 903 906 Void TComSlice::decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ) 907 #endif 904 908 { 905 909 if( !isIRAP() ) … … 913 917 // When the current picture is an IRAP picture with nuh_layer_id equal to 0 and NoClrasOutputFlag is equal to 1, 914 918 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked as "unused for reference". 919 #if R0235_SMALLEST_LAYER_ID 920 if (m_layerId == smallestLayerId && noClrasOutputFlag) 921 #else 915 922 if( m_layerId == 0 && noClrasOutputFlag ) 923 #endif 916 924 { 917 925 // mark all pictures for all layers as not used for reference -
branches/SHM-upgrade/source/Lib/TLibCommon/TComSlice.h
r959 r1006 2536 2536 Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); 2537 2537 #if NO_CLRAS_OUTPUT_FLAG 2538 #if R0235_SMALLEST_LAYER_ID 2539 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 ); 2540 #else 2538 2541 Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ); 2542 #endif 2539 2543 Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag); 2540 2544 #else -
branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h
r979 r1006 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-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1002 r1006 1525 1525 for(Int kk = 0; kk < pcSlice->getVPS()->getNumLayersInIdList(layerSetIdxForOutputLayerSet); kk++) 1526 1526 { 1527 #if R0235_SMALLEST_LAYER_ID 1528 if( pcSlice->getVPS()->getNecessaryLayerFlag(ii, kk) && pcSlice->getLayerId() == pcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk) ) 1529 #else 1527 1530 if(pcSlice->getLayerId() == pcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk)) 1531 #endif 1528 1532 { 1529 1533 chkAssert=1; … … 3218 3222 #endif 3219 3223 { 3220 READ_CODE( numBitsForPtlIdx, uiCode, "profile_ level_tier_idx[i]" );3224 READ_CODE( numBitsForPtlIdx, uiCode, "profile_tier_level_idx[i]" ); 3221 3225 vps->setProfileLevelTierIdx(i, j, uiCode ); 3222 3226 … … 3228 3232 //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 3229 3233 //The following assert may be updated / upgraded to take care of general_profile_compatibility_flag. 3234 #if R0235_SMALLEST_LAYER_ID 3235 // The assertion below is not valid for independent non-base layers 3236 if (vps->getNumAddLayerSets() == 0) 3237 { 3238 #endif 3230 3239 if (j > 0 && vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j) != 0 && vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j - 1) != 0) 3231 3240 { … … 3234 3243 vps->getPTL(vps->getProfileLevelTierIdx(i, j))->getGeneralPTL()->getProfileCompatibilityFlag(vps->getPTL(vps->getProfileLevelTierIdx(i, j - 1))->getGeneralPTL()->getProfileIdc()) ); 3235 3244 } 3245 #if R0235_SMALLEST_LAYER_ID 3246 } 3247 #endif 3236 3248 #endif 3237 3249 } … … 3243 3255 numBits++; 3244 3256 } 3245 READ_CODE( numBits, uiCode, "profile_ level_tier_idx[i]" ); vps->setProfileLevelTierIdx(i, uiCode);3257 READ_CODE( numBits, uiCode, "profile_tier_level_idx[i]" ); vps->setProfileLevelTierIdx(i, uiCode); 3246 3258 #endif 3247 3259 #if P0300_ALT_OUTPUT_LAYER_FLAG -
branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.cpp
r1000 r1006 91 91 #if SVC_EXTENSION 92 92 m_layerId = 0; 93 #if R0235_SMALLEST_LAYER_ID 94 m_smallestLayerId = 0; 95 #endif 93 96 #if AVC_BASE 94 97 m_pBLReconFile = NULL; … … 838 841 #if OUTPUT_LAYER_SET_INDEX 839 842 // Following check should go wherever the VPS is activated 843 #if R0235_SMALLEST_LAYER_ID 844 if (!m_apcSlicePilot->getVPS()->getBaseLayerAvailableFlag()) 845 { 846 assert(nalu.m_layerId != 0); 847 assert(m_apcSlicePilot->getVPS()->getNumAddLayerSets() > 0); 848 if (getCommonDecoderParams()->getTargetOutputLayerSetIdx() >= 0) 849 { 850 UInt layerIdx = m_apcSlicePilot->getVPS()->getOutputLayerSetIdx(getCommonDecoderParams()->getTargetOutputLayerSetIdx()); 851 assert(layerIdx > m_apcSlicePilot->getVPS()->getVpsNumLayerSetsMinus1()); 852 } 853 } 854 if (m_apcSlicePilot->getVPS()->getNumAddLayerSets() == 0) 855 { 856 checkValueOfTargetOutputLayerSetIdx(m_apcSlicePilot->getVPS()); 857 } 858 #else 840 859 checkValueOfTargetOutputLayerSetIdx( m_apcSlicePilot->getVPS()); 860 #endif 841 861 #endif 842 862 #if RESOLUTION_BASED_DPB … … 969 989 #if NO_OUTPUT_OF_PRIOR_PICS 970 990 #if NO_CLRAS_OUTPUT_FLAG 991 #if R0235_SMALLEST_LAYER_ID 992 if (m_layerId == m_smallestLayerId && m_apcSlicePilot->getRapPicFlag()) 993 #else 971 994 if (m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() ) 995 #endif 972 996 { 973 997 if (m_bFirstSliceInSequence) … … 1001 1025 } 1002 1026 1027 #if R0235_SMALLEST_LAYER_ID 1028 m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag, m_smallestLayerId ); 1029 #else 1003 1030 m_apcSlicePilot->decodingRefreshMarking( m_cListPic, m_noClrasOutputFlag ); 1031 #endif 1004 1032 #endif 1005 1033 … … 2470 2498 cListPic->clear(); 2471 2499 } 2500 #endif 2501 #if R0235_SMALLEST_LAYER_ID 2502 xDeriveSmallestLayerId(m_parameterSetManagerDecoder.getPrefetchedVPS(0)); 2472 2503 #endif 2473 2504 return false; … … 3116 3147 Void TDecTop::xCheckLayerReset() 3117 3148 { 3149 #if R0235_SMALLEST_LAYER_ID 3150 if (m_apcSlicePilot->isIRAP() && m_layerId > m_smallestLayerId) 3151 #else 3118 3152 if (m_apcSlicePilot->isIRAP() && m_layerId > 0) 3153 #endif 3119 3154 { 3120 3155 Bool layerResetFlag; … … 3200 3235 #endif 3201 3236 3237 #if R0235_SMALLEST_LAYER_ID 3238 Void TDecTop::xDeriveSmallestLayerId(TComVPS* vps) 3239 { 3240 UInt smallestLayerId; 3241 UInt targetOlsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx(); 3242 UInt targetDecLayerSetIdx = vps->getOutputLayerSetIdx(targetOlsIdx); 3243 UInt lsIdx = targetDecLayerSetIdx; 3244 UInt targetDecLayerIdList[MAX_LAYERS] = {0}; 3245 3246 for (UInt i = 0, j = 0; i < vps->getNumLayersInIdList(lsIdx); i++) 3247 { 3248 if (vps->getNecessaryLayerFlag(targetOlsIdx, i)) 3249 { 3250 targetDecLayerIdList[j++] = vps->getLayerSetLayerIdList(lsIdx, i); 3251 } 3252 } 3253 3254 if (targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1()) 3255 { 3256 smallestLayerId = 0; 3257 } 3258 else if (vps->getNumLayersInIdList(targetDecLayerSetIdx) == 1) 3259 { 3260 smallestLayerId = 0; 3261 } 3262 else 3263 { 3264 smallestLayerId = targetDecLayerIdList[0]; 3265 } 3266 3267 for (UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1 - 1; layer++) 3268 { 3269 m_ppcTDecTop[layer]->m_smallestLayerId = smallestLayerId; 3270 } 3271 } 3272 #endif 3273 3202 3274 #endif //SVC_EXTENSION 3203 3275 -
branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.h
r979 r1006 133 133 UInt m_numLayer; 134 134 TDecTop** m_ppcTDecTop; 135 #if R0235_SMALLEST_LAYER_ID 136 UInt m_smallestLayerId; 137 #endif 135 138 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 136 139 Bool m_pocResettingFlag; … … 256 259 Void setLayerDec(TDecTop **p) { m_ppcTDecTop = p; } 257 260 TDecTop* getLayerDec(UInt layer) { return m_ppcTDecTop[layer]; } 261 #if R0235_SMALLEST_LAYER_ID 262 Void xDeriveSmallestLayerId(TComVPS* vps); 263 #endif 258 264 #if VPS_EXTN_DIRECT_REF_LAYERS 259 265 TDecTop* getRefLayerDec(UInt refLayerIdc);
Note: See TracChangeset for help on using the changeset viewer.