Changeset 1199 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
- Timestamp:
- 8 Jul 2015, 20:02:01 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1191 r1199 124 124 resetPocRestrictionCheckParameters(); 125 125 #endif 126 #if P0297_VPS_POC_LSB_ALIGNED_FLAG127 126 m_pocResettingFlag = false; 128 127 m_pocDecrementedInDPBFlag = false; 129 #endif130 128 #if CONFORMANCE_BITSTREAM_MODE 131 129 m_confModeFlag = false; … … 909 907 #endif 910 908 markAllPicsAsNoCurrAu(m_apcSlicePilot->getVPS()); 911 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 912 for (UInt i = 0; i < MAX_LAYERS; i++)909 910 for( UInt i = 0; i < MAX_LAYERS; i++ ) 913 911 { 914 912 m_ppcTDecTop[m_apcSlicePilot->getVPS()->getLayerIdInNuh(i)]->m_pocDecrementedInDPBFlag = false; 915 913 } 916 #endif 917 } 918 919 920 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 914 } 915 921 916 m_pocResettingFlag = false; 922 917 923 if (m_apcSlicePilot->getPocResetIdc() != 0)924 { 925 if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())918 if( m_apcSlicePilot->getPocResetIdc() != 0 ) 919 { 920 if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() ) 926 921 { 927 922 m_pocResettingFlag = true; … … 936 931 } 937 932 } 938 #endif939 933 940 934 if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 ) … … 984 978 #if ALIGNED_BUMPING 985 979 #if POC_RESET_IDC_DECODER 986 987 #if P0297_VPS_POC_LSB_ALIGNED_FLAG988 980 UInt affectedLayerList[MAX_LAYERS]; 989 981 Int numAffectedLayers; … … 992 984 numAffectedLayers = 1; 993 985 994 if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())995 { 996 for (UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++)986 if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() ) 987 { 988 for( UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ ) 997 989 { 998 990 affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j); … … 1000 992 numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1; 1001 993 } 1002 #endif 1003 1004 //if( (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) ) 1005 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1006 if (m_parseIdc == 1 && m_pocResettingFlag) 1007 #else 1008 if (m_parseIdc == 1) 1009 #endif 994 995 if( m_parseIdc == 1 && m_pocResettingFlag ) 1010 996 { 1011 997 // Invoke output of pictures if the current picture is a POC reset picture … … 1013 999 /* Include reset of all POCs in the layer */ 1014 1000 1015 // This operation would do the following:1016 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture.1017 // 2. Update the value of m_pocCRA.1018 // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later1019 // 4. update value of POCLastDisplay1020 1021 //Do the reset stuff here1001 // This operation would do the following: 1002 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 1003 // 2. Update the value of m_pocCRA. 1004 // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later 1005 // 4. update value of POCLastDisplay 1006 1007 //Do the reset stuff here 1022 1008 Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1023 1009 Int pocLsbVal; … … 1032 1018 1033 1019 Int pocMsbDelta = 0; 1034 if 1020 if( m_apcSlicePilot->getPocMsbValPresentFlag() ) 1035 1021 { 1036 1022 pocMsbDelta = m_apcSlicePilot->getPocMsbVal() * maxPocLsb; … … 1058 1044 Int deltaPocVal = pocMsbDelta + pocLsbDelta; 1059 1045 1060 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1061 for (UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++) 1046 for( UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++ ) 1062 1047 { 1063 1048 if (!m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag) … … 1065 1050 m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag = true; 1066 1051 TComList<TComPic*>::iterator iterPic = m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->begin(); 1052 1067 1053 while (iterPic != m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->end()) 1068 #else 1069 //Reset all POC for DPB -> basically do it for each slice in the picutre 1070 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 1071 1072 // Iterate through all picture in DPB 1073 while( iterPic != m_cListPic.end() ) 1074 #endif 1075 { 1076 TComPic *dpbPic = *iterPic; 1077 // Check if the picture pointed to by iterPic is either used for reference or 1078 // needed for output, are in the same layer, and not the current picture. 1079 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1080 assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]); 1081 if ( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) ) 1082 #else 1083 if ( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 1084 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 1085 && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() )) 1086 #endif 1087 { 1088 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 1089 { 1090 1091 TComSlice *slice = dpbPic->getSlice(i); 1092 TComReferencePictureSet *rps = slice->getRPS(); 1093 slice->setPOC( slice->getPOC() - deltaPocVal ); 1094 1095 // Also adjust the POC value stored in the RPS of each such slice 1096 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 1054 { 1055 TComPic *dpbPic = *iterPic; 1056 // Check if the picture pointed to by iterPic is either used for reference or 1057 // needed for output, are in the same layer, and not the current picture. 1058 assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]); 1059 1060 if( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) ) 1097 1061 { 1098 rps->setPOC( j, rps->getPOC(j) - deltaPocVal ); 1099 } 1100 // Also adjust the value of refPOC 1101 for(Int k = 0; k < 2; k++) // For List 0 and List 1 1102 { 1103 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1104 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 1062 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 1105 1063 { 1106 slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j); 1064 1065 TComSlice *slice = dpbPic->getSlice(i); 1066 TComReferencePictureSet *rps = slice->getRPS(); 1067 slice->setPOC( slice->getPOC() - deltaPocVal ); 1068 1069 // Also adjust the POC value stored in the RPS of each such slice 1070 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 1071 { 1072 rps->setPOC( j, rps->getPOC(j) - deltaPocVal ); 1073 } 1074 // Also adjust the value of refPOC 1075 for(Int k = 0; k < 2; k++) // For List 0 and List 1 1076 { 1077 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1078 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 1079 { 1080 slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j); 1081 } 1082 } 1107 1083 } 1108 1084 } 1109 } 1110 } 1111 iterPic++; 1112 } 1113 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1085 iterPic++; 1086 } 1114 1087 // Update the value of pocCRA 1115 1088 m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocCRA -= deltaPocVal; 1116 1089 } 1117 1090 } 1118 #else1119 // Update the value of pocCRA1120 m_pocCRA -= deltaPocVal;1121 #endif1122 1091 1123 1092 // Update value of POCLastDisplay … … 1127 1096 Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb(); 1128 1097 1129 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1130 if (m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2)) 1131 #else 1132 if (m_parseIdc == 1 || m_parseIdc == 2) // TODO This should be replaced by pocResettingFlag. 1133 #endif 1098 if( m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2) ) 1134 1099 { 1135 1100 // Set poc for current slice … … 1172 1137 // Adjust prevPicOrderCnt 1173 1138 if( !m_apcSlicePilot->getRaslPicFlag() 1174 && !m_apcSlicePilot->getRadlPicFlag() 1175 && (m_apcSlicePilot->getNalUnitType() % 2 == 1) 1176 && ( nalu.m_temporalId == 0 ) 1177 && !m_apcSlicePilot->getDiscardableFlag() ) 1178 { 1179 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1180 for (UInt i = 0; i < numAffectedLayers; i++) 1139 && !m_apcSlicePilot->getRadlPicFlag() 1140 && (m_apcSlicePilot->getNalUnitType() % 2 == 1) 1141 && ( nalu.m_temporalId == 0 ) 1142 && !m_apcSlicePilot->getDiscardableFlag() ) 1143 { 1144 for( UInt i = 0; i < numAffectedLayers; i++ ) 1181 1145 { 1182 1146 m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt(m_apcSlicePilot->getPOC()); 1183 1147 } 1184 #else 1185 this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() ); 1186 #endif 1187 } 1188 else if ( m_apcSlicePilot->getPocResetIdc() == 3 ) 1189 { 1190 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1191 if (!m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag)) 1192 { 1193 for (UInt i = 0; i < numAffectedLayers; i++) 1194 { 1195 m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 1196 ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1197 } 1198 } 1199 #else 1200 this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 1201 ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1202 #endif 1148 } 1149 else if( m_apcSlicePilot->getPocResetIdc() == 3 ) 1150 { 1151 if( !m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag) ) 1152 { 1153 for( UInt i = 0; i < numAffectedLayers; i++ ) 1154 { 1155 m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1156 } 1157 } 1203 1158 } 1204 1159 #else … … 1947 1902 m_cGopDecoder.decompressSlice(nalu.m_Bitstream, m_pcPic); 1948 1903 1949 #if P0297_VPS_POC_LSB_ALIGNED_FLAG1904 #if SVC_EXTENSION 1950 1905 setFirstPicInLayerDecodedFlag(true); 1951 #endif1952 #if SVC_EXTENSION1953 1906 m_lastPicHasEos = false; 1954 1907 #endif
Note: See TracChangeset for help on using the changeset viewer.