Changeset 1356 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncGOP.cpp
- Timestamp:
- 27 Oct 2015, 11:33:16 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r1321 r1356 100 100 m_layerId = 0; 101 101 m_viewId = 0; 102 m_pocLastCoded = -1; 102 m_pocLastCoded = -1; 103 103 #if NH_3D 104 m_viewIndex = 0; 104 m_viewIndex = 0; 105 105 m_isDepth = false; 106 106 #endif … … 147 147 148 148 #if NH_MV 149 m_ivPicLists = pcTEncTop->getIvPicLists(); 149 m_ivPicLists = pcTEncTop->getIvPicLists(); 150 150 m_layerId = pcTEncTop->getLayerId(); 151 151 m_viewId = pcTEncTop->getViewId(); … … 156 156 #endif 157 157 #if NH_3D_IC 158 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate(); 159 m_aICEnableNum = pcTEncTop->getICEnableNum(); 158 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate(); 159 m_aICEnableNum = pcTEncTop->getICEnableNum(); 160 160 #endif 161 161 #if KWU_FIX_URQ … … 207 207 #if NH_MV 208 208 if ( getLayerId() == 0 ) 209 { 209 { 210 210 actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS()); 211 211 } … … 277 277 278 278 while ( (itNalu!=accessUnit.end())&& 279 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 279 ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 280 280 || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS 281 281 || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS … … 288 288 SEIMessages localMessages = seiMessages; 289 289 SEIMessages currentMessages; 290 290 291 291 #if ENC_DEC_TRACE 292 292 g_HLSTraceEnable = !testWrite; … … 299 299 xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 300 300 xClearSEIs(currentMessages, !testWrite); 301 301 302 302 // Buffering period SEI must always be following active parameter sets 303 303 currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD); … … 328 328 xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 329 329 xClearSEIs(currentMessages, !testWrite); 330 331 #if NH_MV_LAYERS_NOT_PRESENT_SEI 332 // Layers not present SEI message 333 currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT); 334 xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps); 335 xClearSEIs(currentMessages, !testWrite); 336 #endif 330 337 331 338 // And finally everything else one by one … … 412 419 Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps) 413 420 { 414 #if NH_MV415 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());416 #else417 421 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 418 #endif 422 419 423 if(m_pcCfg->getActiveParameterSetsSEIEnabled()) 420 424 { … … 472 476 seiMessages.push_back(sei); 473 477 } 474 478 475 479 if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled) 476 480 { … … 482 486 483 487 #if NH_MV 488 #if !NH_MV_SEI 484 489 if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) ) 485 490 { 486 491 SEISubBitstreamProperty *sei = new SEISubBitstreamProperty; 487 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 492 m_seiEncoder.initSEISubBitstreamProperty( sei, sps ); 488 493 seiMessages.push_back(sei); 489 494 } 495 #endif 490 496 #endif 491 497 } … … 679 685 } 680 686 } 681 687 682 688 if( m_pcCfg->getPictureTimingSEIEnabled() ) 683 689 { … … 715 721 return; 716 722 } 717 // fix first 723 // fix first 718 724 UInt numNalUnits = (UInt)testAU.size(); 719 725 UInt numRBSPBytes = 0; … … 927 933 IRAPGOPid = iGOPid; 928 934 IRAPtoReorder = true; 929 swapIRAPForward = true; 935 swapIRAPForward = true; 930 936 break; 931 937 } … … 935 941 IRAPGOPid = iGOPid; 936 942 IRAPtoReorder = true; 937 swapIRAPForward = false; 943 swapIRAPForward = false; 938 944 break; 939 945 } … … 1066 1072 #endif 1067 1073 #if NH_MV 1068 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1069 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1074 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 1075 TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, 1070 1076 Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid ) 1071 1077 #else … … 1170 1176 pcPic->setCurrSliceIdx(0); 1171 1177 #if NH_MV 1172 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1178 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField ); 1173 1179 #else 1174 1180 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField ); … … 1181 1187 pcSlice->setSliceIdx(0); 1182 1188 #if NH_MV 1183 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1189 pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 1184 1190 pcPic ->setLayerId ( getLayerId() ); 1185 pcPic ->setViewId ( getViewId() ); 1191 pcPic ->setViewId ( getViewId() ); 1186 1192 #if !NH_3D 1187 1193 pcSlice->setLayerId ( getLayerId() ); 1188 pcSlice->setViewId ( getViewId() ); 1194 pcSlice->setViewId ( getViewId() ); 1189 1195 pcSlice->setVPS ( m_pcEncTop->getVPS() ); 1190 1196 #else 1191 pcPic ->setViewIndex ( getViewIndex() ); 1197 pcPic ->setViewIndex ( getViewIndex() ); 1192 1198 pcPic ->setIsDepth( getIsDepth() ); 1193 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1194 #endif 1195 #endif 1199 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 1200 #endif 1201 #endif 1196 1202 //set default slice level flag to the same as SPS level flag 1197 1203 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); … … 1201 1207 if( pcSlice->getSliceType() == B_SLICE ) 1202 1208 { 1203 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1204 { 1209 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1210 { 1205 1211 pcSlice->setSliceType( P_SLICE ); 1206 1212 } … … 1210 1216 if( pcSlice->getSliceType() == B_SLICE ) 1211 1217 { 1212 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1213 { 1218 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 1219 { 1214 1220 pcSlice->setSliceType( I_SLICE ); 1215 1221 } … … 1225 1231 pcSlice->setSliceType(I_SLICE); 1226 1232 } 1227 1233 1228 1234 // Set the nal unit type 1229 1235 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField)); … … 1279 1285 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1280 1286 } 1281 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1287 if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 1282 1288 || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1) 1283 1289 ) … … 1288 1294 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); 1289 1295 1290 if(pcSlice->getTLayer() > 0 1296 if(pcSlice->getTLayer() > 0 1291 1297 && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N // Check if not a leading picture 1292 1298 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R … … 1358 1364 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 1359 1365 { 1360 // Some more sophisticated algorithm to determine discardable_flag might be added here. 1361 pcSlice->setDiscardableFlag ( false ); 1362 } 1363 1364 const TComVPS* vps = pcSlice->getVPS(); 1366 // Some more sophisticated algorithm to determine discardable_flag might be added here. 1367 pcSlice->setDiscardableFlag ( false ); 1368 } 1369 1370 const TComVPS* vps = pcSlice->getVPS(); 1365 1371 #if NH_3D 1366 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1372 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() ); 1367 1373 #else 1368 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1374 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1369 1375 #endif 1370 1376 #if NH_3D 1371 pcSlice->setIvPicLists( m_ivPicLists ); 1377 pcSlice->setIvPicLists( m_ivPicLists ); 1372 1378 1373 1379 Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid; 1374 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1380 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum ); 1375 1381 #else 1376 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1377 #endif 1378 1379 1380 1381 Bool interLayerPredLayerIdcPresentFlag = false; 1382 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1383 #endif 1384 1385 1386 1387 Bool interLayerPredLayerIdcPresentFlag = false; 1382 1388 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 ) 1383 { 1384 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1389 { 1390 pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 ); 1385 1391 if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 ) 1386 1392 { 1387 1393 if ( !vps->getMaxOneActiveRefLayerFlag() ) 1388 { 1389 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1394 { 1395 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1390 1396 } 1391 1397 #if NH_3D … … 1394 1400 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 1395 1401 #endif 1396 { 1397 interLayerPredLayerIdcPresentFlag = true; 1402 { 1403 interLayerPredLayerIdcPresentFlag = true; 1398 1404 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 1399 1405 { 1400 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1406 pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 1401 1407 } 1402 1408 } … … 1405 1411 if ( !interLayerPredLayerIdcPresentFlag ) 1406 1412 { 1407 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1413 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1408 1414 { 1409 1415 pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) ); … … 1412 1418 1413 1419 1414 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1415 1420 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1421 1416 1422 #if NH_3D 1417 1423 if ( m_pcEncTop->decProcAnnexI() ) 1418 { 1419 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1424 { 1425 pcSlice->deriveInCmpPredAndCpAvailFlag( ); 1420 1426 if ( pcSlice->getInCmpPredAvailFlag() ) 1421 { 1422 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1427 { 1428 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 1423 1429 } 1424 1430 else … … 1434 1440 printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) ); 1435 1441 } 1436 1442 1437 1443 exit(EXIT_FAILURE); 1438 1444 } 1439 1445 } 1440 pcSlice->init3dToolParameters(); 1441 pcSlice->checkInCompPredRefLayers(); 1442 } 1446 pcSlice->init3dToolParameters(); 1447 pcSlice->checkInCompPredRefLayers(); 1448 } 1443 1449 #if NH_3D_IV_MERGE 1444 1450 // This needs to be done after initialization of 3D tool parameters. … … 1447 1453 #endif 1448 1454 1449 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1455 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 1450 1456 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); 1451 1457 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) ); … … 1456 1462 1457 1463 pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 1458 1459 1460 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1464 1465 1466 xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid ); 1461 1467 #else 1462 1468 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); … … 1464 1470 #endif 1465 1471 // Set reference list 1466 #if NH_MV 1467 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1472 #if NH_MV 1473 pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 1468 1474 #else 1469 1475 pcSlice->setRefPicList ( rcListPic ); … … 1477 1483 #endif 1478 1484 #if NH_3D_IC 1479 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1480 pcSlice->setICEnableNum( m_aICEnableNum ); 1485 pcSlice->setICEnableCandidate( m_aICEnableCandidate ); 1486 pcSlice->setICEnableNum( m_aICEnableNum ); 1481 1487 #endif 1482 1488 … … 1485 1491 if ( pcSlice->getSliceType() == B_SLICE ) 1486 1492 { 1487 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1488 { 1489 pcSlice->setSliceType( P_SLICE ); 1493 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 1494 { 1495 pcSlice->setSliceType( P_SLICE ); 1490 1496 } 1491 1497 } … … 1566 1572 1567 1573 #if NH_3D_VSO 1568 // Should be moved to TEncTop !!! 1574 // Should be moved to TEncTop !!! 1569 1575 Bool bUseVSO = m_pcEncTop->getUseVSO(); 1570 1571 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1576 1577 TComRdCost* pcRdCost = m_pcEncTop->getRdCost(); 1572 1578 1573 1579 pcRdCost->setUseVSO( bUseVSO ); … … 1725 1731 #endif 1726 1732 #if NH_3D 1727 pcSlice->setDepthToDisparityLUTs(); 1733 pcSlice->setDepthToDisparityLUTs(); 1728 1734 1729 1735 #endif … … 1835 1841 xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice); 1836 1842 1843 #if NH_MV_SEI 1844 m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice ); 1845 #endif 1846 1837 1847 /* use the main bitstream buffer for storing the marshalled picture */ 1838 1848 m_pcEntropyCoder->setBitstream(NULL); … … 1980 1990 cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled()); 1981 1991 #if NH_3D 1982 pcPic->compressMotion(2); 1992 pcPic->compressMotion(2); 1983 1993 #else 1984 1994 pcPic->compressMotion(); … … 2055 2065 pcPic->setReconMark ( true ); 2056 2066 #if NH_MV 2057 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2058 std::vector<Int> temp; 2059 TComSlice::markCurrPic( pcPic ); 2067 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 2068 std::vector<Int> temp; 2069 TComSlice::markCurrPic( pcPic ); 2060 2070 #endif 2061 2071 m_bFirst = false; … … 2094 2104 //-- all 2095 2105 #if NH_MV 2096 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2106 printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() ); 2097 2107 #else 2098 2108 printf( "\n\nSUMMARY --------------------------------------------------------\n" ); … … 2402 2412 #if H_3D_VSO_SYNTH_DIST_OUT 2403 2413 } 2404 #endif 2405 #endif 2414 #endif 2415 #endif 2406 2416 /* calculate the size of the access unit, excluding: 2407 2417 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,) … … 2526 2536 2527 2537 #if NH_MV 2528 assert( 0 ); // Field coding and MV need to be aligned. 2538 assert( 0 ); // Field coding and MV need to be aligned. 2529 2539 #else 2530 2540 … … 2969 2979 #if NH_MV 2970 2980 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid ) 2971 { 2972 2981 { 2982 2973 2983 if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 ) 2974 2984 { 2975 2985 return; 2976 2986 } 2977 2987 2978 2988 GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid ); 2979 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2980 2981 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2982 2983 // GT: check if SliceType should be checked here. 2989 assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 2990 2991 Int numPicsInTempList = pcSlice->getNumRpsCurrTempList(); 2992 2993 // GT: check if SliceType should be checked here. 2984 2994 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1 2985 2995 { 2986 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2987 2996 Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 2997 2988 2998 Int finalIdxToTempIdxMap[16]; 2989 2999 for( Int k = 0; k < 16; k++ ) … … 2999 3009 // get position in temp. list 3000 3010 Int refPicLayerId = pcSlice->getRefPicLayerId(k); 3001 Int idxInTempList = 0; 3011 Int idxInTempList = 0; 3002 3012 for (; idxInTempList < numPicsInTempList; idxInTempList++) 3003 3013 { 3004 3014 if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId ) 3005 3015 { 3006 break; 3016 break; 3007 3017 } 3008 3018 } 3009 3019 3010 3020 Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ]; 3011 3012 // Add negative from behind 3013 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3014 3021 3022 // Add negative from behind 3023 idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 3024 3015 3025 Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ; 3016 3026 if ( curIsModified ) 3017 3027 { 3018 isModified = true; 3028 isModified = true; 3019 3029 assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position 3020 3030 } 3021 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3031 finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList; 3022 3032 } 3023 3033 } 3024 3034 3025 3035 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 3026 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3036 refPicListModification->setRefPicListModificationFlagL( li, isModified ); 3027 3037 3028 3038 if( isModified ) 3029 3039 { 3030 3040 Int refIdx = 0; 3031 3041 3032 3042 for( Int i = 0; i < numPicsInFinalRefList; i++ ) 3033 3043 { 3034 if( finalIdxToTempIdxMap[i] >= 0 ) 3044 if( finalIdxToTempIdxMap[i] >= 0 ) 3035 3045 { 3036 3046 refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] ); … … 3042 3052 while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId()) ) 3043 3053 { 3044 refIdx++; 3054 refIdx++; 3045 3055 } 3046 3056 refPicListModification->setRefPicSetIdxL( li, i, refIdx );
Note: See TracChangeset for help on using the changeset viewer.