Changeset 619 in SHVCSoftware
- Timestamp:
- 21 Feb 2014, 04:13:08 (11 years ago)
- Location:
- branches/SHM-5.1-dev/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-5.1-dev/source/App/TAppDecoder/TAppDecTop.cpp
r612 r619 1150 1150 // Find DPB-information from the VPS 1151 1151 DpbStatus maxDpbLimit; 1152 Int targetLsIdx, subDpbIdx; 1152 1153 TComVPS *vps = findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit); 1153 Int targetLsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 1154 Int subDpbIdx = vps->getSubDpbAssigned( targetLsIdx, layerIdx ); 1154 if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 ) 1155 { 1156 targetLsIdx = 0; 1157 subDpbIdx = 0; 1158 } 1159 else 1160 { 1161 targetLsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 1162 subDpbIdx = vps->getSubDpbAssigned( targetLsIdx, layerIdx ); 1163 } 1155 1164 // Assume that listOfPocs is sorted in increasing order - if not have to sort it. 1156 1165 while( ifInvokeBumpingBeforeDecoding(dpbStatus, maxDpbLimit, layerIdx, subDpbIdx) ) … … 1230 1239 TComVPS *TAppDecTop::findDpbParametersFromVps(std::vector<Int> const &listOfPocs, std::vector<Int> const *listOfPocsInEachLayer, std::vector<Int> const *listOfPocsPositionInEachLayer, DpbStatus &maxDpbLimit) 1231 1240 { 1232 // ------------------------------------- 1233 // Find the VPS used for the pictures 1234 // ------------------------------------- 1241 Int targetOutputLsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx(); 1235 1242 TComVPS *vps; 1236 for(Int i = 0; i < MAX_LAYERS; i++) 1237 { 1238 if( m_acTDecTop[i].getListPic()->empty() ) 1239 { 1240 assert( listOfPocsInEachLayer[i].size() == 0 ); 1241 continue; 1242 } 1243 std::vector<Int>::const_iterator it; 1244 it = find( listOfPocsInEachLayer[i].begin(), listOfPocsInEachLayer[i].end(), listOfPocs[0] ); 1243 1244 if( targetOutputLsIdx == 0 ) // Only base layer is output 1245 { 1246 TComSPS *sps = NULL; 1247 assert( listOfPocsInEachLayer[0].size() != 0 ); 1245 1248 TComList<TComPic*>::iterator iterPic; 1246 if( it != listOfPocsInEachLayer[i].end() ) 1247 { 1248 Int picPosition = std::distance( listOfPocsInEachLayer[i].begin(), it ); 1249 Int j; 1250 for(j = 0, iterPic = m_acTDecTop[i].getListPic()->begin(); j < listOfPocsPositionInEachLayer[i][picPosition]; j++) // Picture to be output 1251 { 1252 iterPic++; 1253 } 1254 TComPic *pic = *iterPic; 1255 vps = pic->getSlice(0)->getVPS(); 1256 break; 1257 } 1258 } 1259 Int targetOutputLsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx(); 1260 Int targetLsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 1261 Int highestTId = getCommonDecoderParams()->getHighestTId(); 1262 1263 maxDpbLimit.m_numAUsNotDisplayed = vps->getMaxVpsNumReorderPics( targetOutputLsIdx, highestTId ); // m_numAUsNotDisplayed is only variable name - stores reorderpics 1264 maxDpbLimit.m_maxLatencyIncrease = vps->getMaxVpsLatencyIncreasePlus1(targetOutputLsIdx, highestTId ) > 0; 1265 if( maxDpbLimit.m_maxLatencyIncrease ) 1266 { 1267 maxDpbLimit.m_maxLatencyPictures = vps->getMaxVpsNumReorderPics( targetOutputLsIdx, highestTId ) + vps->getMaxVpsLatencyIncreasePlus1(targetOutputLsIdx, highestTId ) - 1; 1268 } 1269 for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++) 1270 { 1271 maxDpbLimit.m_numPicsInLayer[i] = vps->getMaxVpsLayerDecPicBuffMinus1( targetOutputLsIdx, i, highestTId ) + 1; 1272 maxDpbLimit.m_numPicsInSubDpb[vps->getSubDpbAssigned( targetLsIdx, i )] = vps->getMaxVpsDecPicBufferingMinus1( targetOutputLsIdx, vps->getSubDpbAssigned( targetLsIdx, i ), highestTId) + 1; 1249 Int j; 1250 for(j = 0, iterPic = m_acTDecTop[0].getListPic()->begin(); j < listOfPocsPositionInEachLayer[0][0]; j++) // Picture to be output 1251 { 1252 iterPic++; 1253 } 1254 TComPic *pic = *iterPic; 1255 sps = pic->getSlice(0)->getSPS(); assert( sps->getLayerId() == 0 ); 1256 vps = pic->getSlice(0)->getVPS(); 1257 Int highestTId = sps->getMaxTLayers() - 1; 1258 1259 maxDpbLimit.m_numAUsNotDisplayed = sps->getNumReorderPics( highestTId ); // m_numAUsNotDisplayed is only variable name - stores reorderpics 1260 maxDpbLimit.m_maxLatencyIncrease = sps->getMaxLatencyIncrease( highestTId ) > 0; 1261 if( maxDpbLimit.m_maxLatencyIncrease ) 1262 { 1263 maxDpbLimit.m_maxLatencyPictures = sps->getMaxLatencyIncrease( highestTId ) + sps->getNumReorderPics( highestTId ) - 1; 1264 } 1265 maxDpbLimit.m_numPicsInLayer[0] = sps->getMaxDecPicBuffering( highestTId ); 1266 maxDpbLimit.m_numPicsInSubDpb[0] = sps->getMaxDecPicBuffering( highestTId ); 1267 } 1268 else 1269 { 1270 // ------------------------------------- 1271 // Find the VPS used for the pictures 1272 // ------------------------------------- 1273 for(Int i = 0; i < MAX_LAYERS; i++) 1274 { 1275 if( m_acTDecTop[i].getListPic()->empty() ) 1276 { 1277 assert( listOfPocsInEachLayer[i].size() == 0 ); 1278 continue; 1279 } 1280 std::vector<Int>::const_iterator it; 1281 it = find( listOfPocsInEachLayer[i].begin(), listOfPocsInEachLayer[i].end(), listOfPocs[0] ); 1282 TComList<TComPic*>::iterator iterPic; 1283 if( it != listOfPocsInEachLayer[i].end() ) 1284 { 1285 Int picPosition = std::distance( listOfPocsInEachLayer[i].begin(), it ); 1286 Int j; 1287 for(j = 0, iterPic = m_acTDecTop[i].getListPic()->begin(); j < listOfPocsPositionInEachLayer[i][picPosition]; j++) // Picture to be output 1288 { 1289 iterPic++; 1290 } 1291 TComPic *pic = *iterPic; 1292 vps = pic->getSlice(0)->getVPS(); 1293 break; 1294 } 1295 } 1296 1297 Int targetLsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 1298 Int highestTId = vps->getMaxTLayers() - 1; 1299 1300 maxDpbLimit.m_numAUsNotDisplayed = vps->getMaxVpsNumReorderPics( targetOutputLsIdx, highestTId ); // m_numAUsNotDisplayed is only variable name - stores reorderpics 1301 maxDpbLimit.m_maxLatencyIncrease = vps->getMaxVpsLatencyIncreasePlus1(targetOutputLsIdx, highestTId ) > 0; 1302 if( maxDpbLimit.m_maxLatencyIncrease ) 1303 { 1304 maxDpbLimit.m_maxLatencyPictures = vps->getMaxVpsNumReorderPics( targetOutputLsIdx, highestTId ) + vps->getMaxVpsLatencyIncreasePlus1(targetOutputLsIdx, highestTId ) - 1; 1305 } 1306 for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++) 1307 { 1308 maxDpbLimit.m_numPicsInLayer[i] = vps->getMaxVpsLayerDecPicBuffMinus1( targetOutputLsIdx, i, highestTId ) + 1; 1309 maxDpbLimit.m_numPicsInSubDpb[vps->getSubDpbAssigned( targetLsIdx, i )] = vps->getMaxVpsDecPicBufferingMinus1( targetOutputLsIdx, vps->getSubDpbAssigned( targetLsIdx, i ), highestTId) + 1; 1310 } 1311 // ------------------------------------- 1273 1312 } 1274 1313 return vps; 1275 // -------------------------------------1276 1314 } 1277 1315 Void TAppDecTop::emptyUnusedPicturesNotNeededForOutput() … … 1374 1412 // Update status 1375 1413 dpbStatus.m_numAUsNotDisplayed = listOfPocs.size(); // Number of AUs not displayed 1376 dpbStatus.m_numLayers = vps->get MaxLayers();1414 dpbStatus.m_numLayers = vps->getNumLayersInIdList( targetLsIdx ); 1377 1415 dpbStatus.m_numSubDpbs = vps->getNumSubDpbs( vps->getOutputLayerSetIdx( 1378 1416 this->getCommonDecoderParams()->getTargetOutputLayerSetIdx() ) ); -
branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r618 r619 645 645 646 646 #if SPS_DPB_PARAMS 647 if( pcSPS->getLayerId() == 0 ) { 647 if( pcSPS->getLayerId() == 0 ) 648 { 648 649 #endif 649 650 UInt subLayerOrderingInfoPresentFlag; 650 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");651 652 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)653 {654 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1");655 pcSPS->setMaxDecPicBuffering( uiCode + 1, i);656 READ_UVLC ( uiCode, "sps_num_reorder_pics" );657 pcSPS->setNumReorderPics(uiCode, i);658 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1");659 pcSPS->setMaxLatencyIncrease( uiCode, i );660 661 if (!subLayerOrderingInfoPresentFlag)662 {663 for (i++; i <= pcSPS->getMaxTLayers()-1; i++)664 {665 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);666 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);667 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);668 }669 break;670 }671 }651 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 652 653 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 654 { 655 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1"); 656 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 657 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 658 pcSPS->setNumReorderPics(uiCode, i); 659 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 660 pcSPS->setMaxLatencyIncrease( uiCode, i ); 661 662 if (!subLayerOrderingInfoPresentFlag) 663 { 664 for (i++; i <= pcSPS->getMaxTLayers()-1; i++) 665 { 666 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i); 667 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i); 668 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i); 669 } 670 break; 671 } 672 } 672 673 #if SPS_DPB_PARAMS 673 674 } 674 675 #endif 675 676 READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" );
Note: See TracChangeset for help on using the changeset viewer.