Changeset 1325 in 3DVCSoftware for branches/HTM-15.1-MV-draft-4/source/Lib/TLibEncoder/TEncGOP.cpp
- Timestamp:
- 7 Sep 2015, 18:40:35 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-15.1-MV-draft-4/source/Lib/TLibEncoder/TEncGOP.cpp
r1321 r1325 101 101 m_viewId = 0; 102 102 m_pocLastCoded = -1; 103 #if NH_3D104 m_viewIndex = 0;105 m_isDepth = false;106 #endif107 103 #endif 108 104 m_associatedIRAPType = NAL_UNIT_CODED_SLICE_IDR_N_LP; … … 150 146 m_layerId = pcTEncTop->getLayerId(); 151 147 m_viewId = pcTEncTop->getViewId(); 152 #if NH_3D153 m_viewIndex = pcTEncTop->getViewIndex();154 m_isDepth = pcTEncTop->getIsDepth();155 #endif156 #endif157 #if NH_3D_IC158 m_aICEnableCandidate = pcTEncTop->getICEnableCandidate();159 m_aICEnableNum = pcTEncTop->getICEnableNum();160 #endif161 #if KWU_FIX_URQ162 m_pcRateCtrl = pcTEncTop->getRateCtrl();163 148 #endif 164 149 } … … 1184 1169 pcPic ->setLayerId ( getLayerId() ); 1185 1170 pcPic ->setViewId ( getViewId() ); 1186 #if !NH_3D1187 1171 pcSlice->setLayerId ( getLayerId() ); 1188 1172 pcSlice->setViewId ( getViewId() ); 1189 1173 pcSlice->setVPS ( m_pcEncTop->getVPS() ); 1190 #else1191 pcPic ->setViewIndex ( getViewIndex() );1192 pcPic ->setIsDepth( getIsDepth() );1193 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );1194 #endif1195 1174 #endif 1196 1175 //set default slice level flag to the same as SPS level flag … … 1363 1342 1364 1343 const TComVPS* vps = pcSlice->getVPS(); 1365 #if NH_3D1366 Int numDirectRefLayers = vps ->getNumRefListLayers( getLayerId() );1367 #else1368 1344 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 1369 #endif1370 #if NH_3D1371 pcSlice->setIvPicLists( m_ivPicLists );1372 1373 Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;1374 GOPEntry gopEntry = m_pcCfg->getGOPEntry( gopNum );1375 #else1376 1345 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 1377 #endif1378 1346 1379 1347 … … 1389 1357 pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 1390 1358 } 1391 #if NH_3D1392 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumRefListLayers( getLayerId() ) )1393 #else1394 1359 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 1395 #endif1396 1360 { 1397 1361 interLayerPredLayerIdcPresentFlag = true; … … 1414 1378 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 1415 1379 1416 #if NH_3D1417 if ( m_pcEncTop->decProcAnnexI() )1418 {1419 pcSlice->deriveInCmpPredAndCpAvailFlag( );1420 if ( pcSlice->getInCmpPredAvailFlag() )1421 {1422 pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );1423 }1424 else1425 {1426 if (gopEntry.m_interCompPredFlag )1427 {1428 if ( gopNum == MAX_GOP)1429 {1430 printf( "\nError: FrameI_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", pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );1431 }1432 else1433 {1434 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 }1436 1437 exit(EXIT_FAILURE);1438 }1439 }1440 pcSlice->init3dToolParameters();1441 pcSlice->checkInCompPredRefLayers();1442 }1443 #if NH_3D_IV_MERGE1444 // This needs to be done after initialization of 3D tool parameters.1445 pcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ( ( pcSlice->getMpiFlag( ) || pcSlice->getIvMvPredFlag( ) || pcSlice->getViewSynthesisPredFlag( ) ) ? 1 : 0 ));1446 #endif1447 #endif1448 1380 1449 1381 pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); … … 1469 1401 pcSlice->setRefPicList ( rcListPic ); 1470 1402 #endif 1471 #if NH_3D_NBDV1472 pcSlice->setDefaultRefView();1473 #endif1474 #if NH_3D_ARP1475 //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh1476 pcSlice->setARPStepNum(m_ivPicLists);1477 #endif1478 #if NH_3D_IC1479 pcSlice->setICEnableCandidate( m_aICEnableCandidate );1480 pcSlice->setICEnableNum( m_aICEnableNum );1481 #endif1482 1403 1483 1404 // Slice info. refinement … … 1533 1454 1534 1455 pcSlice->setList1IdxToList0Idx(); 1535 #if NH_3D_TMVP1536 if(pcSlice->getLayerId())1537 pcSlice->generateAlterRefforTMVP();1538 #endif1539 1456 1540 1457 if (m_pcEncTop->getTMVPModeId() == 2) … … 1565 1482 #endif 1566 1483 1567 #if NH_3D_VSO1568 // Should be moved to TEncTop !!!1569 Bool bUseVSO = m_pcEncTop->getUseVSO();1570 1571 TComRdCost* pcRdCost = m_pcEncTop->getRdCost();1572 1573 pcRdCost->setUseVSO( bUseVSO );1574 1575 // SAIT_VSO_EST_A00331576 pcRdCost->setUseEstimatedVSD( m_pcEncTop->getUseEstimatedVSD() );1577 1578 if ( bUseVSO )1579 {1580 Int iVSOMode = m_pcEncTop->getVSOMode();1581 pcRdCost->setVSOMode( iVSOMode );1582 pcRdCost->setAllowNegDist( m_pcEncTop->getAllowNegDist() );1583 1584 // SAIT_VSO_EST_A00331585 #if H_3D_FCO1586 Bool flagRec;1587 flagRec = ((m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), true) == NULL) ? false: true);1588 pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), flagRec ) );1589 pcRdCost->setDepthPicYuv ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true, pcSlice->getPOC(), false ) );1590 #else1591 pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false , pcSlice->getPOC(), true ) );1592 pcRdCost->setDepthPicYuv ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true , pcSlice->getPOC(), false ) );1593 #endif1594 1595 // LGE_WVSO_A01191596 Bool bUseWVSO = m_pcEncTop->getUseWVSO();1597 pcRdCost->setUseWVSO( bUseWVSO );1598 1599 }1600 #endif1601 1484 1602 1485 /////////////////////////////////////////////////////////////////////////////////////////////////// Compress a slice … … 1649 1532 m_pcRateCtrl->initRCPic( frameLevel ); 1650 1533 1651 #if KWU_RC_MADPRED_E02271652 if(m_pcCfg->getLayerId() != 0)1653 {1654 m_pcRateCtrl->getRCPic()->setIVPic( m_pcEncTop->getEncTop()->getTEncTop(0)->getRateCtrl()->getRCPic() );1655 }1656 #endif1657 1534 1658 1535 estimatedBits = m_pcRateCtrl->getRCPic()->getTargetBits(); … … 1691 1568 else // normal case 1692 1569 { 1693 #if KWU_RC_MADPRED_E02271694 if(m_pcRateCtrl->getLayerID() != 0)1695 {1696 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList();1697 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambdaIV( listPreviousPicture, pcSlice->getPOC() );1698 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture );1699 }1700 else1701 {1702 #endif1703 1570 list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList(); 1704 1571 lambda = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, pcSlice->getSliceType()); 1705 1572 sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture ); 1706 #if KWU_RC_MADPRED_E02271707 }1708 #endif1709 1573 } 1710 1574 … … 1717 1581 UInt uiNumSliceSegments = 1; 1718 1582 1719 #if NH_3D_NBDV 1720 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 1721 { 1722 Int iColPoc = pcSlice->getRefPOC(RefPicList(1 - pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx()); 1723 pcPic->setNumDdvCandPics(pcPic->getDisCandRefPictures(iColPoc)); 1724 } 1725 #endif 1726 #if NH_3D 1727 pcSlice->setDepthToDisparityLUTs(); 1728 1729 #endif 1730 1731 #if NH_3D_NBDV 1732 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth() && !pcSlice->isIntra()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 1733 { 1734 pcPic->checkTemporalIVRef(); 1735 } 1736 1737 if(pcSlice->getIsDepth()) 1738 { 1739 pcPic->checkTextureRef(); 1740 } 1741 #endif 1583 1742 1584 // Allocate some coders, now the number of tiles are known. 1743 1585 const Int numSubstreamsColumns = (pcSlice->getPPS()->getNumTileColumnsMinus1() + 1); … … 1814 1656 // write various parameter sets 1815 1657 actualTotalBits += xWriteParameterSets(accessUnit, pcSlice); 1816 #if PPS_FIX_DEPTH1817 if(!pcSlice->getIsDepth() || !pcSlice->getViewIndex() )1818 {1819 #endif1820 #if PPS_FIX_DEPTH1821 }1822 #endif1823 1658 1824 1659 … … 1979 1814 // cabac_zero_words processing 1980 1815 cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled()); 1981 #if NH_3D1982 pcPic->compressMotion(2);1983 #else1984 1816 pcPic->compressMotion(); 1985 #endif1986 1817 #if NH_MV 1987 1818 m_pocLastCoded = pcPic->getPOC(); … … 2140 1971 } 2141 1972 2142 #if NH_3D_VSO2143 Void TEncGOP::preLoopFilterPicAll( TComPic* pcPic, Dist64& ruiDist )2144 #else2145 1973 Void TEncGOP::preLoopFilterPicAll( TComPic* pcPic, UInt64& ruiDist ) 2146 #endif2147 1974 { 2148 1975 Bool bCalcDist = false; … … 2225 2052 } 2226 2053 2227 #if NH_3D_VSO2228 Dist64 TEncGOP::xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1, const BitDepths &bitDepths)2229 #else2230 2054 UInt64 TEncGOP::xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1, const BitDepths &bitDepths) 2231 #endif 2232 { 2233 #if NH_3D_VSO 2234 Dist64 uiTotalDiff = 0; 2235 #else 2055 { 2236 2056 UInt64 uiTotalDiff = 0; 2237 #endif2238 2057 2239 2058 for(Int chan=0; chan<pcPic0 ->getNumberValidComponents(); chan++) … … 2375 2194 pRec += iRecStride; 2376 2195 } 2377 #if NH_3D_VSO2378 #if H_3D_VSO_SYNTH_DIST_OUT2379 if ( m_pcRdCost->getUseRenModel() )2380 {2381 unsigned int maxval = 255 * (1<<(g_uiBitDepth + g_uiBitIncrement -8));2382 Double fRefValueY = (double) maxval * maxval * iSize;2383 Double fRefValueC = fRefValueY / 4.0;2384 TRenModel* pcRenModel = m_pcEncTop->getEncTop()->getRenModel();2385 Int64 iDistVSOY, iDistVSOU, iDistVSOV;2386 pcRenModel->getTotalSSE( iDistVSOY, iDistVSOU, iDistVSOV );2387 dYPSNR = ( iDistVSOY ? 10.0 * log10( fRefValueY / (Double) iDistVSOY ) : 99.99 );2388 dUPSNR = ( iDistVSOU ? 10.0 * log10( fRefValueC / (Double) iDistVSOU ) : 99.99 );2389 dVPSNR = ( iDistVSOV ? 10.0 * log10( fRefValueC / (Double) iDistVSOV ) : 99.99 );2390 }2391 else2392 {2393 #endif2394 #endif2395 2196 const Int maxval = 255 << (pcPic->getPicSym()->getSPS().getBitDepth(toChannelType(ch)) - 8); 2396 2197 const Double fRefValue = (Double) maxval * maxval * iSize; … … 2399 2200 } 2400 2201 2401 #if NH_3D_VSO2402 #if H_3D_VSO_SYNTH_DIST_OUT2403 }2404 #endif2405 #endif2406 2202 /* calculate the size of the access unit, excluding: 2407 2203 * - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
Note: See TracChangeset for help on using the changeset viewer.