Changeset 1325 in 3DVCSoftware for branches/HTM-15.1-MV-draft-4/source/Lib/TLibEncoder/TEncTop.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/TEncTop.cpp
r1321 r1325 79 79 m_ivPicLists = NULL; 80 80 #endif 81 #if NH_3D_IC82 m_aICEnableCandidate = NULL;83 m_aICEnableNum = NULL;84 #endif85 81 #if NH_MV 86 82 m_cCavlcCoder.setEncTop(this); … … 126 122 if ( m_RCEnableRateControl ) 127 123 { 128 #if KWU_RC_MADPRED_E0227129 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,130 g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList, getLayerId() );131 #else132 124 m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight, 133 125 m_maxCUWidth, m_maxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList ); 134 #endif135 126 } 136 127 … … 202 193 } 203 194 204 #if KWU_RC_MADPRED_E0227205 Void TEncTop::init(TAppEncTop* pcTAppEncTop, Bool isFieldCoding)206 #else207 195 Void TEncTop::init(Bool isFieldCoding) 208 #endif209 196 { 210 197 // initialize SPS 211 #if H_3D212 // Assuming that all PPS indirectly refer to the same VPS via different SPS213 m_cSPS.setVPS(m_cVPS);214 #endif215 198 xInitSPS(); 216 199 xInitVPS(); … … 228 211 229 212 xInitPPSforTiles(); 230 #if NH_3D_IC231 m_aICEnableCandidate = new Int[ 10 ];232 m_aICEnableNum = new Int[ 10 ];233 234 for(int i=0;i<10;i++)235 {236 m_aICEnableCandidate[i]=0;237 m_aICEnableNum[i]=0;238 }239 #endif240 213 241 214 // initialize processing unit classes … … 244 217 m_cCuEncoder. init( this ); 245 218 246 #if KWU_RC_MADPRED_E0227247 m_pcTAppEncTop = pcTAppEncTop;248 #endif249 219 // initialize transform & quantization class 250 220 m_pcCavlcCoder = getCavlcCoder(); … … 351 321 } 352 322 pcPicCurr->setLayerId( getLayerId()); 353 #if NH_3D354 pcPicCurr->setScaleOffset( m_cameraParameters->getCodedScale(), m_cameraParameters->getCodedOffset() );355 #endif356 323 } 357 324 #endif … … 393 360 Void TEncTop::encode( Bool flush, TComPicYuv* pcPicYuvOrg, TComPicYuv* pcPicYuvTrueOrg, const InputColourSpaceConversion snrCSC, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ) 394 361 { 395 #endif396 #if NH_3D397 TComPic* picLastCoded = getPic( getGOPEncoder()->getPocLastCoded() );398 if( picLastCoded )399 {400 picLastCoded->compressMotion(1);401 }402 362 #endif 403 363 #if NH_MV … … 711 671 m_cSPS.setSpsExtensionPresentFlag ( true ); 712 672 m_cSPS.setSpsMultilayerExtensionFlag ( true ); 713 #if NH_3D714 m_cSPS.setSps3dExtensionFlag ( true );715 #endif716 673 #endif 717 674 … … 722 679 m_cSPS.setMaxCUHeight ( m_maxCUHeight ); 723 680 m_cSPS.setMaxTotalCUDepth ( m_maxTotalCUDepth ); 724 #if NH_3D725 assert( !getIsDepth() || m_chromaFormatIDC == CHROMA_400 );726 #endif727 681 m_cSPS.setChromaFormatIdc( m_chromaFormatIDC); 728 682 m_cSPS.setLog2DiffMaxMinCodingBlockSize(m_log2DiffMaxMinCodingBlockSize); … … 987 941 #if NH_MV 988 942 m_cPPS.setLayerId( getLayerId() ); 989 #if NH_3D990 // Check if this condition is still correct991 if( getVPS()->getNumRefListLayers( getLayerId() ) > 0 )992 #else993 943 if( getVPS()->getNumDirectRefLayers( getLayerId() ) > 0 ) 994 #endif995 944 { 996 945 m_cPPS.setListsModificationPresentFlag( true ); … … 999 948 m_cPPS.setSPSId( getLayerIdInVps() ); 1000 949 m_cPPS.setPpsMultilayerExtensionFlag ( true ); 1001 #if NH_3D 1002 // Might be used for DLT 1003 m_cPPS.setPps3dExtensionFlag ( getIsDepth() ); 1004 #endif 1005 #endif 1006 1007 #if NH_3D_DLT 1008 // create mapping from depth layer indexes to layer ids 1009 Int j=0; 1010 for( Int i=0; i<=getVPS()->getMaxLayersMinus1(); i++ ) 1011 { 1012 Int layerId = getVPS()->getLayerIdInNuh(i); 1013 if( getVPS()->getDepthId(layerId) ) 1014 m_cDLT.setDepthIdxToLayerId(j++, layerId); 1015 } 1016 m_cPPS.setDLT( m_cDLT ); 1017 #endif 950 #endif 951 1018 952 1019 953 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); … … 1486 1420 #endif 1487 1421 1488 #if NH_3D_VSO1489 Void TEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset, Int maxCuHeight )1490 {1491 TRenModel* rendererModel = m_cRdCost.getRenModel();1492 rendererModel->setupPart( iHorOffset, std::min( maxCuHeight, (Int) ( m_iSourceHeight - iHorOffset ) )) ;1493 1494 Int iEncViewSIdx = m_cameraParameters->getBaseId2SortedId()[ iEncViewIdx ];1495 1496 // setup base views1497 Int iNumOfBV = m_renderModelParameters->getNumOfBaseViewsForView( iEncViewSIdx, iEncContent );1498 1499 for (Int iCurView = 0; iCurView < iNumOfBV; iCurView++ )1500 {1501 Int iBaseViewSIdx;1502 Int iVideoDistMode;1503 Int iDepthDistMode;1504 1505 m_renderModelParameters->getBaseViewData( iEncViewSIdx, iEncContent, iCurView, iBaseViewSIdx, iVideoDistMode, iDepthDistMode );1506 1507 AOT( iVideoDistMode < 0 || iVideoDistMode > 2 );1508 1509 Int iBaseViewIdx = m_cameraParameters->getBaseSortedId2Id()[ iBaseViewSIdx ];1510 1511 TComPicYuv* pcPicYuvVideoRec = m_ivPicLists->getPicYuv( iBaseViewIdx, false, iPoc, true );1512 TComPicYuv* pcPicYuvDepthRec = m_ivPicLists->getPicYuv( iBaseViewIdx, true , iPoc, true );1513 TComPicYuv* pcPicYuvVideoOrg = m_ivPicLists->getPicYuv( iBaseViewIdx, false, iPoc, false );1514 TComPicYuv* pcPicYuvDepthOrg = m_ivPicLists->getPicYuv( iBaseViewIdx, true , iPoc, false );1515 1516 TComPicYuv* pcPicYuvVideoRef = ( iVideoDistMode == 2 ) ? pcPicYuvVideoOrg : NULL;1517 TComPicYuv* pcPicYuvDepthRef = ( iDepthDistMode == 2 ) ? pcPicYuvDepthOrg : NULL;1518 1519 TComPicYuv* pcPicYuvVideoTest = ( iVideoDistMode == 0 ) ? pcPicYuvVideoOrg : pcPicYuvVideoRec;1520 TComPicYuv* pcPicYuvDepthTest = ( iDepthDistMode == 0 ) ? pcPicYuvDepthOrg : pcPicYuvDepthRec;1521 1522 AOT( (iVideoDistMode == 2) != (pcPicYuvVideoRef != NULL) );1523 AOT( (iDepthDistMode == 2) != (pcPicYuvDepthRef != NULL) );1524 AOT( pcPicYuvDepthTest == NULL );1525 AOT( pcPicYuvVideoTest == NULL );1526 1527 rendererModel->setBaseView( iBaseViewSIdx, pcPicYuvVideoTest, pcPicYuvDepthTest, pcPicYuvVideoRef, pcPicYuvDepthRef );1528 }1529 1530 rendererModel->setErrorMode( iEncViewSIdx, iEncContent, 0 );1531 // setup virtual views1532 Int iNumOfSV = m_renderModelParameters->getNumOfModelsForView( iEncViewSIdx, iEncContent );1533 for (Int iCurView = 0; iCurView < iNumOfSV; iCurView++ )1534 {1535 Int iOrgRefBaseViewSIdx;1536 Int iLeftBaseViewSIdx;1537 Int iRightBaseViewSIdx;1538 Int iSynthViewRelNum;1539 Int iModelNum;1540 Int iBlendMode;1541 m_renderModelParameters->getSingleModelData(iEncViewSIdx, iEncContent, iCurView, iModelNum, iBlendMode,iLeftBaseViewSIdx, iRightBaseViewSIdx, iOrgRefBaseViewSIdx, iSynthViewRelNum );1542 1543 Int iLeftBaseViewIdx = -1;1544 Int iRightBaseViewIdx = -1;1545 1546 TComPicYuv* pcPicYuvOrgRef = NULL;1547 Int** ppiShiftLUTLeft = NULL;1548 Int** ppiShiftLUTRight = NULL;1549 Int** ppiBaseShiftLUTLeft = NULL;1550 Int** ppiBaseShiftLUTRight = NULL;1551 1552 1553 Int iDistToLeft = -1;1554 1555 Int iSynthViewIdx = m_cameraParameters->synthRelNum2Idx( iSynthViewRelNum );1556 1557 if ( iLeftBaseViewSIdx != -1 )1558 {1559 iLeftBaseViewIdx = m_cameraParameters->getBaseSortedId2Id() [ iLeftBaseViewSIdx ];1560 ppiShiftLUTLeft = m_cameraParameters->getSynthViewShiftLUTI()[ iLeftBaseViewIdx ][ iSynthViewIdx ];1561 }1562 1563 if ( iRightBaseViewSIdx != -1 )1564 {1565 iRightBaseViewIdx = m_cameraParameters->getBaseSortedId2Id() [iRightBaseViewSIdx ];1566 ppiShiftLUTRight = m_cameraParameters->getSynthViewShiftLUTI()[ iRightBaseViewIdx ][ iSynthViewIdx ];1567 }1568 1569 if ( iRightBaseViewSIdx != -1 && iLeftBaseViewSIdx != -1 )1570 {1571 iDistToLeft = m_cameraParameters->getRelDistLeft( iSynthViewIdx , iLeftBaseViewIdx, iRightBaseViewIdx);1572 ppiBaseShiftLUTLeft = m_cameraParameters->getBaseViewShiftLUTI() [ iLeftBaseViewIdx ][ iRightBaseViewIdx ];1573 ppiBaseShiftLUTRight = m_cameraParameters->getBaseViewShiftLUTI() [ iRightBaseViewIdx ][ iLeftBaseViewIdx ];1574 1575 }1576 1577 if ( iOrgRefBaseViewSIdx != -1 )1578 {1579 pcPicYuvOrgRef = m_ivPicLists->getPicYuv( m_cameraParameters->getBaseSortedId2Id()[ iOrgRefBaseViewSIdx ] , false, iPoc, false );1580 AOF ( pcPicYuvOrgRef );1581 }1582 1583 rendererModel->setSingleModel( iModelNum, ppiShiftLUTLeft, ppiBaseShiftLUTLeft, ppiShiftLUTRight, ppiBaseShiftLUTRight, iDistToLeft, pcPicYuvOrgRef );1584 }1585 }1586 #endif1587 1422 1588 1423 //! \}
Note: See TracChangeset for help on using the changeset viewer.