Changeset 166 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder
- Timestamp:
- 1 Nov 2012, 19:22:41 (12 years ago)
- Location:
- branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r100 r166 1179 1179 WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "maxNumMergeCand"); 1180 1180 #endif 1181 1182 #if VSP_SLICE_HEADER 1183 if( pcSlice->getSPS()->getViewId()!=0 1184 #if VSP_TEXT_ONLY 1185 && !(pcSlice->getSPS()->isDepth()) 1186 #endif 1187 ) 1188 { 1189 WRITE_FLAG( pcSlice->getVspFlag()?1:0, "vsp_flag" ); 1190 // printf("[VSP: %d] ", pcSlice->getVspFlag()?1:0); 1191 } 1192 #endif 1193 1181 1194 } 1182 1195 … … 1426 1439 assert(0); 1427 1440 } 1441 1442 #if FORCE_REF_VSP==1 1443 Void TEncCavlc::codeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1444 { 1445 assert(0); 1446 } 1447 #endif 1428 1448 1429 1449 Void TEncCavlc::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r77 r166 164 164 165 165 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 166 #if FORCE_REF_VSP==1 167 Void codeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 168 #endif 166 169 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 167 170 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r100 r166 453 453 // get Original YUV data from picture 454 454 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 455 #if FORCE_REF_VSP 456 //Bool bWholeCUCanBeSynthesized = false; 457 //Bool bOneSubCUCanNotBeSynthesied = false; 458 Bool bSubCUCanBeSynthesized[4]; 459 if( rpcBestCU->getSlice()->getViewId() ) 460 { 461 Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 462 pcPic->checkSynthesisAvailability(/*rpcBestCU, */rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH 463 //Int iSubCUCanNotBeSynthesized = 0; // Dong: Compiling error, set but not used. DONG_CHECK 464 Int iSubCUCanBeSynthesizedCnt = 0; 465 for(Int i = 0; i < 4; i++) 466 { 467 if (!bSubCUCanBeSynthesized[i]) 468 { 469 //iSubCUCanNotBeSynthesized = i; 470 } 471 else 472 { 473 iSubCUCanBeSynthesizedCnt ++; 474 } 475 } 476 if(iSubCUCanBeSynthesizedCnt == 4) 477 { 478 //bWholeCUCanBeSynthesized = true; 479 } 480 //else if(iSubCUCanBeSynthesizedCnt == 3) 481 //{ 482 // bOneSubCUCanNotBeSynthesied = true; 483 //} 484 //bWholeCUCanBeSynthesized = true; 485 } 486 #endif 455 487 456 488 // variables for fast encoder decision … … 654 686 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 655 687 } 688 689 #if FORCE_REF_VSP==1 690 #if VSP_TEXT_ONLY 691 if( !rpcBestCU->getSlice()->getSPS()->isDepth() ) 692 #endif 693 #if HHI_INTER_VIEW_RESIDUAL_PRED 694 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 695 #endif 696 #if HHI_INTERVIEW_SKIP 697 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec, false, true ); // VSP 698 #else 699 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 700 #endif 701 rpcTempCU->initEstData( uiDepth, iQP ); 702 #endif 656 703 } 657 704 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1581 1628 { 1582 1629 m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx ); 1630 1631 #if FORCE_REF_VSP==1 1632 if( (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) && pcCU->getSlice()->getViewId() != 0 ) 1633 #if VSP_TEXT_ONLY 1634 if( !pcCU->getSlice()->getSPS()->isDepth() ) 1635 #endif 1636 { 1637 m_pcEntropyCoder->encodeVspFlag( pcCU, uiAbsPartIdx ); 1638 } 1639 #endif 1583 1640 } 1584 1641 1585 1642 if( pcCU->isSkipped( uiAbsPartIdx ) ) 1643 #if FORCE_REF_VSP==1 1644 if( !pcCU->isVspMode( uiAbsPartIdx ) ) 1645 #endif 1586 1646 { 1587 1647 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 ); 1588 1648 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1649 #if DEBUGLOGOUT 1650 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1651 #endif 1589 1652 xRestoreDepthWidthHeight( pcCU ); 1590 1653 return; … … 1635 1698 { 1636 1699 m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx ); 1700 1701 #if FORCE_REF_VSP==1 1702 if( (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) && pcCU->getSlice()->getViewId() != 0 ) 1703 #if VSP_TEXT_ONLY 1704 if( !pcCU->getSlice()->getSPS()->isDepth() ) 1705 #endif 1706 { 1707 m_pcEntropyCoder->encodeVspFlag( pcCU, uiAbsPartIdx ); 1708 } 1709 #endif 1637 1710 } 1638 1711 1639 1712 if( pcCU->isSkipped( uiAbsPartIdx ) ) 1713 #if FORCE_REF_VSP==1 1714 if( !pcCU->isVspMode( uiAbsPartIdx ) ) 1715 #endif 1640 1716 { 1641 1717 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 ); … … 1644 1720 #endif 1645 1721 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1722 #if DEBUGLOGOUT 1723 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1724 #endif 1646 1725 return; 1647 1726 } 1727 1728 #if FORCE_REF_VSP==1 1729 if( pcCU->isVspMode( uiAbsPartIdx ) ) 1730 { 1731 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1732 #if DEBUGLOGOUT 1733 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1734 #endif 1735 return; 1736 } 1737 #endif 1738 1648 1739 #if HHI_MPI 1649 1740 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 ) … … 1662 1753 // Encode slice finish 1663 1754 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1755 #if DEBUGLOGOUT 1756 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1757 #endif 1664 1758 return; 1665 1759 } … … 1685 1779 // --- write terminating bit --- 1686 1780 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1781 #if DEBUGLOGOUT 1782 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1783 #endif 1687 1784 } 1688 1785 … … 1873 1970 #if AMP_MRG 1874 1971 #if HHI_INTERVIEW_SKIP 1875 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bSkipRes, Bool bUseMRG) 1972 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bSkipRes, Bool bUseMRG 1973 #if FORCE_REF_VSP==1 1974 , Bool bForceRefVsp 1975 #endif 1976 ) 1876 1977 #else 1877 1978 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG) … … 1910 2011 rpcTempCU->setResPredFlagSubParts ( bResPrdFlag, 0, 0, uhDepth ); 1911 2012 #endif 2013 #if FORCE_REF_VSP==1 2014 if( bForceRefVsp ) 2015 rpcTempCU->setPredModeSubParts ( MODE_SYNTH, 0, uhDepth ); 2016 else 2017 #endif 1912 2018 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 1913 2019 … … 1925 2031 #if HHI_INTERVIEW_SKIP 1926 2032 #if LG_RESTRICTEDRESPRED_M24766 1927 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); 2033 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG 2034 #if FORCE_REF_VSP==1 2035 , bForceRefVsp 2036 #endif 2037 ); 1928 2038 #else 1929 2039 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); … … 2494 2604 for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ ) 2495 2605 { 2496 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) ) 2606 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) 2607 #if FORCE_REF_VSP==1 2608 || pcTextureCU->isVspMode( rpcTempCU->getZorderIdxInCU() + ui ) 2609 #endif 2610 ) 2497 2611 { 2498 2612 return; 2499 2613 } 2614 #if VSP_N 2615 #if !(!VSP_TEXT_ONLY && FORCE_REF_VSP==2) 2616 else // inter 2617 { 2618 Int aiRefIdx[2] = {NOT_VALID, NOT_VALID}; 2619 for( Int iList = 0; iList < 2; iList++ ) 2620 { 2621 aiRefIdx[iList] = pcTextureCU->getCUMvField( RefPicList(iList) )->getRefIdx( rpcTempCU->getZorderIdxInCU() + ui ); 2622 if( aiRefIdx[iList] >= 0 && pcTextureCU->getSlice()->getRefViewId( RefPicList(iList), aiRefIdx[iList] ) == NUM_VIEW_VSP ) 2623 { 2624 return; 2625 } 2626 } 2627 //if( aiRefIdx[0] == NOT_VALID && aiRefIdx[1] == NOT_VALID ) 2628 //{ 2629 // return; 2630 //} 2631 } 2632 #endif 2633 #endif 2500 2634 } 2501 2635 } … … 2694 2828 m_pcEntropyCoder->encodeSplitFlag( pcCU, 0, uhDepth, true ); 2695 2829 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 2830 #if FORCE_REF_VSP==1 2831 if( (pcCU->isSkipped( 0 ) || pcCU->isVspMode( 0 )) && pcCU->getSlice()->getViewId() != 0 ) 2832 #if VSP_TEXT_ONLY 2833 if( !pcCU->getSlice()->getSPS()->isDepth() ) 2834 #endif 2835 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 2836 #endif 2696 2837 2697 2838 if( pcCU->isSkipped( 0 ) ) 2839 #if FORCE_REF_VSP==1 2840 if( !pcCU->isVspMode( 0 ) ) 2841 #endif 2698 2842 { 2699 2843 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCu.h
r56 r166 46 46 #include "TLibCommon/TComBitCounter.h" 47 47 #include "TLibCommon/TComDataCU.h" 48 #if DEBUGLOGOUT 49 #include "TLibCommon/DebugLog.h" 50 #endif 48 51 49 52 #include "TEncEntropy.h" … … 113 116 114 117 public: 118 #if DEBUGLOGOUT 119 DebugLog m_cDebug; 120 #endif 121 115 122 /// copy parameters from encoder class 116 123 Void init ( TEncTop* pcEncTop ); … … 148 155 #if AMP_MRG 149 156 #if HHI_INTERVIEW_SKIP 150 Void xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFullyRendered, Bool bUseMRG = false ) ; 157 Void xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFullyRendered, Bool bUseMRG = false 158 #if FORCE_REF_VSP==1 159 , Bool bForceRefVsp = false 160 #endif 161 ) ; 151 162 #else 152 163 Void xCheckRDCostInter ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG = false ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r77 r166 169 169 } 170 170 171 172 #if FORCE_REF_VSP==1 173 Void TEncEntropy::encodeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 174 { 175 if ( pcCU->getSlice()->isIntra() || pcCU->getSlice()->getViewId() == 0 ) 176 { 177 return; 178 } 179 if( bRD ) 180 { 181 uiAbsPartIdx = 0; 182 } 183 m_pcEntropyCoderIf->codeVspFlag( pcCU, uiAbsPartIdx ); 184 } 185 #endif 186 171 187 Void TEncEntropy::codeFiltCountBit(ALFParam* pAlfParam, Int64* ruiRate) 172 188 { … … 1285 1301 uiAbsPartIdx = 0; 1286 1302 } 1303 1304 #if FORCE_REF_VSP==1 1305 if( pcCU->isVspMode( uiAbsPartIdx ) ) 1306 { 1307 return; 1308 } 1309 #endif 1287 1310 1288 1311 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); … … 1345 1368 { 1346 1369 encodeRefFrmIdxPU ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) ); 1370 #if VSP_MV_ZERO 1371 Int iRefIdx = pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx(uiSubPartIdx); 1372 if( !(pcCU->getSlice()->getViewId() && iRefIdx >= 0 && pcCU->getSlice()->getRefViewId( RefPicList( uiRefListIdx ), iRefIdx ) == NUM_VIEW_VSP) ) 1373 { 1374 #endif 1347 1375 encodeMvdPU ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) ); 1348 1376 encodeMVPIdxPU ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) ); 1377 #if VSP_MV_ZERO 1378 } 1379 #endif 1349 1380 } 1350 1381 } … … 1632 1663 { 1633 1664 { 1665 #if FORCE_REF_VSP==1 1666 if( !pcCU->isVspMode( uiAbsPartIdx ) ) 1667 #endif 1634 1668 #if HHI_MPI 1635 1669 if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.h
r100 r166 115 115 116 116 virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 117 #if FORCE_REF_VSP==1 118 virtual Void codeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 119 #endif 117 120 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 118 121 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 251 254 Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 252 255 Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 256 #if FORCE_REF_VSP==1 257 Void encodeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 258 #endif 253 259 Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 254 260 Void encodeInterDirPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
r102 r166 332 332 #endif 333 333 334 #if VSP_N 335 Int NumberOfVspRefs = ( ( pcPic->getViewId()==0 336 #if VSP_TEXT_ONLY 337 || m_pcEncTop->getIsDepth() 338 #endif 339 #if VSP_SLICE_HEADER 340 || !m_pcEncTop->getUseVSP() 341 #endif 342 ) ? 0 : 1 ); 343 pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) ); 344 pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) ); 345 #else 334 346 pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 335 347 pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 348 #endif 336 349 337 350 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); … … 358 371 359 372 std::vector<TComPic*> apcInterViewRefPics = tAppEncTop->getInterViewRefPics( m_pcEncTop->getViewId(), pcSlice->getPOC(), m_pcEncTop->getIsDepth(), pcSlice->getSPS() ); 373 #if VSP_N 374 Bool bUseVsp = (pcPic->getViewId()!=0); 375 #if VSP_TEXT_ONLY 376 if( m_pcEncTop->getIsDepth() ) bUseVsp = false; 377 #endif 378 #if VSP_SLICE_HEADER 379 if( !m_pcEncTop->getUseVSP() ) bUseVsp = false; 380 #endif 381 pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics, bUseVsp ? m_pcEncTop->getVSPBuf() : NULL ); 382 #else 360 383 pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics ); 384 #endif 385 #if VSP_SLICE_HEADER 386 pcSlice->setVspFlag( bUseVsp ); 387 #endif 361 388 362 389 // Slice info. refinement … … 1130 1157 m_pcSbacCoder->load( &pcSbacCoders[0] ); 1131 1158 1159 #if DEBUGLOGOUT 1160 char fname[128]; 1161 sprintf(fname, "%sV%02d_%05d%s.csv", "Log", pcSlice->getViewId(), uiPOCCurr, pcSlice->getIsDepth() ? "depth":"text"); 1162 getSliceEncoder()->getCUEncoder()->m_cDebug.DebugLogFileOpen( fname ); 1163 #endif 1164 1132 1165 pcSlice->setTileOffstForMultES( uiOneBitstreamPerSliceLength ); 1133 1166 if (!bEntropySlice) … … 1140 1173 m_pcSliceEncoder->encodeSlice(pcPic, &nalu.m_Bitstream, pcSubstreamsOut); // nalu.m_Bitstream is only used for CAVLC tile position info. 1141 1174 } 1175 1176 #if DEBUGLOGOUT 1177 getSliceEncoder()->getCUEncoder()->m_cDebug.DebugLogFileClose(); 1178 #endif 1142 1179 1143 1180 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.h
r101 r166 146 146 Void freeAPS (TComAPS* pAPS, TComSPS* pSPS); 147 147 Void allocAPS (TComAPS* pAPS, TComSPS* pSPS); 148 148 149 protected: 149 150 Void encodeAPS (TComAPS* pcAPS, TComOutputBitstream& APSbs, TComSlice* pcSlice); //!< encode APS syntax elements -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r101 r166 718 718 { 719 719 // get context function is here 720 #if FORCE_REF_VSP==1 721 UInt uiSymbol = (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) ? 1 : 0; 722 #else 720 723 UInt uiSymbol = pcCU->isSkipped( uiAbsPartIdx ) ? 1 : 0; 724 #endif 721 725 UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ) ; 722 726 m_pcBinIf->encodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) ); … … 730 734 } 731 735 736 #if FORCE_REF_VSP==1 737 Void TEncSbac::codeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 738 { 739 // get context function is here 740 UInt uiSymbol = (UInt)pcCU->isVspMode( uiAbsPartIdx ); 741 UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ) ; 742 m_pcBinIf->encodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) ); 743 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 744 DTRACE_CABAC_T( "\tVspFlag" ); 745 DTRACE_CABAC_T( "\tuiCtxSkip: "); 746 DTRACE_CABAC_V( uiCtxSkip ); 747 DTRACE_CABAC_T( "\tuiSymbol: "); 748 DTRACE_CABAC_V( uiSymbol ); 749 DTRACE_CABAC_T( "\n"); 750 } 751 #endif 752 732 753 /** code merge flag 733 754 * \param pcCU … … 764 785 uiNumCand = pcCU->getSlice()->getMaxNumMergeCand(); 765 786 #if HHI_MPI 787 #if VSP_TEXT_ONLY 788 TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL; 789 Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1, 790 pcTextCU ? pcTextCU->getCUMvField( RefPicList(1) )->getRefIdx( uiAbsPartIdx ) : -1 }; 791 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE 792 && !( aiRefIdxVsp[0] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(0), aiRefIdxVsp[0] ) == NUM_VIEW_VSP ) 793 && !( aiRefIdxVsp[1] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(1), aiRefIdxVsp[1] ) == NUM_VIEW_VSP ); 794 #else 766 795 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE; 796 #endif 767 797 if( bMVIAvailable ) 768 798 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.h
r100 r166 202 202 Void codeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 203 203 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 204 #if FORCE_REF_VSP==1 205 Void codeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 206 #endif 204 207 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 205 208 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r133 r166 683 683 UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey, 684 684 TComMv baseRefMv, 685 Int iFrac, TComMv& rcMvFrac ) 685 Int iFrac, TComMv& rcMvFrac 686 #if VSP_MV_ZERO 687 ,Bool bIsVsp 688 #endif 689 ) 686 690 { 687 691 UInt uiDist; … … 699 703 TComMv* pcMvRefine = (iFrac == 2 ? s_acMvRefineH : s_acMvRefineQ); 700 704 705 #if VSP_MV_ZERO 706 UInt iAround = ( bIsVsp )? 1:9; 707 for (UInt i = 0; i < iAround; i++) 708 #else 701 709 for (UInt i = 0; i < 9; i++) 710 #endif 702 711 { 703 712 TComMv cMvTest = pcMvRefine[i]; … … 871 880 { 872 881 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 882 #if FORCE_REF_VSP==1 883 if( pcCU->getSlice()->getViewId() != 0 ) 884 #if VSP_TEXT_ONLY 885 if( !pcCU->getSlice()->getSPS()->isDepth() ) 886 #endif 887 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 888 #endif 873 889 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 874 890 } … … 2751 2767 #if AMP_MRG 2752 2768 #if LG_RESTRICTEDRESPRED_M24766 2753 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2754 #else 2755 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2769 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG 2770 #if FORCE_REF_VSP==1 2771 , Bool bForceRefVsp 2772 #endif 2773 ) 2774 #else 2775 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG 2776 #if FORCE_REF_VSP==1 2777 , Bool bForceRefVsp 2778 #endif 2779 ) 2756 2780 #endif 2757 2781 #else … … 2813 2837 #endif 2814 2838 2839 #if FORCE_REF_VSP==1 2840 if( bForceRefVsp ) 2841 { 2842 assert( ePartSize == SIZE_2Nx2N ); 2843 2844 // Clear Motion Field 2845 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 ); 2846 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 ); 2847 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( cMvZero, ePartSize, 0, pcCU->getDepth(0), 0 ); 2848 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( cMvZero, ePartSize, 0, pcCU->getDepth(0), 0 ); 2849 2850 //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), ePartSize, 0, pcCU->getDepth(0), 0 ); 2851 //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), ePartSize, 0, pcCU->getDepth(0), 0 ); 2852 2853 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0)); 2854 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0)); 2855 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0)); 2856 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0)); 2857 2858 rpcPredYuv->copyFromPicYuv( pcCU->getPic()->getPicYuvSynth(), pcCU->getAddr(), pcCU->getZorderIdxInCU() ); 2859 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 2860 2861 return; 2862 } 2863 #endif 2864 2815 2865 #if ZERO_MVD_EST 2816 2866 Int aiZeroMvdMvpIdx[2] = {-1, -1}; … … 2833 2883 #if HHI_INTER_VIEW_MOTION_PRED 2834 2884 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 2885 #endif 2886 2887 #if VSP_MV_ZERO 2888 bool bIsVsp = false; 2889 //Bool bWholeCUCanBeSynthesized = false; 2890 //Bool bSubCUCanBeSynthesized[4]; 2891 //if( pcCU->getSlice()->getViewId() ) 2892 //{ 2893 // Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 2894 // pcCU->getPic()->checkSynthesisAvailability(/*rpcBestCU, */pcCU->getAddr(), pcCU->getZorderIdxInCU(), pcCU->getDepth(0), pbSubCUCanBeSynthesized); //KUBA SYNTH 2895 // Int iSubCUCanBeSynthesizedCnt = 0; 2896 // for(Int i = 0; i < 4; i++) 2897 // { 2898 // if (bSubCUCanBeSynthesized[i]) 2899 // { 2900 // iSubCUCanBeSynthesizedCnt ++; 2901 // } 2902 // } 2903 // if(iSubCUCanBeSynthesizedCnt == 4) 2904 // { 2905 // bWholeCUCanBeSynthesized = true; 2906 // } 2907 //} 2835 2908 #endif 2836 2909 … … 2857 2930 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 2858 2931 UInt uiBitsTempL0[MAX_NUM_REF]; 2932 2859 2933 #if LG_RESTRICTEDRESPRED_M24766 2860 2934 Int iPUResiPredShift[4] = {0, 0, 0, 0}; … … 2885 2959 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 2886 2960 { 2961 #if VSP_MV_ZERO 2962 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP); 2963 //if( bIsVsp && !bWholeCUCanBeSynthesized ) 2964 //{ 2965 // continue; 2966 //} 2967 #endif 2887 2968 #if LG_RESTRICTEDRESPRED_M24766 2888 2969 if( pcCU->getResPredFlag( 0 )) … … 2908 2989 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 2909 2990 } 2991 #if VSP_MV_ZERO 2992 if( bIsVsp ) 2993 { 2994 aaiMvpIdx[iRefList][iRefIdxTemp] = -1; 2995 aaiMvpNum[iRefList][iRefIdxTemp] = -1; 2996 cMvPred[iRefList][iRefIdxTemp].setZero(); 2997 } 2998 else 2999 { 3000 #endif 2910 3001 #if H0111_MVD_L1_ZERO 2911 3002 #if ZERO_MVD_EST … … 2937 3028 #else 2938 3029 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3030 #endif 3031 #if VSP_MV_ZERO 3032 } // if( bIsVsp ) 2939 3033 #endif 2940 3034 #if ZERO_MVD_EST … … 2973 3067 else 2974 3068 { 3069 #if VSP_MV_ZERO 3070 if( pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP ) 3071 { 3072 cMvTemp[1][iRefIdxTemp].setZero(); 3073 uiCostTemp = 0; 3074 } 3075 else 3076 { 3077 #endif 2975 3078 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)]; 2976 3079 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)]; 2977 3080 /*first subtract the bit-rate part of the cost of the other list*/ 2978 3081 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] ); 3082 #if VSP_MV_ZERO 3083 } 3084 #endif 2979 3085 } 2980 3086 /*correct the bit-rate part of the current ref*/ … … 2986 3092 else 2987 3093 { 3094 #if VSP_MV_ZERO 3095 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp ); 3096 #else 2988 3097 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3098 #endif 2989 3099 } 2990 3100 } … … 2998 3108 else 2999 3109 { 3110 #if VSP_MV_ZERO 3111 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp ); 3112 #else 3000 3113 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3114 #endif 3001 3115 } 3002 3116 } 3003 3117 #else 3004 3118 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3119 #endif 3120 #if VSP_MV_ZERO 3121 if( bIsVsp ) 3122 { 3123 cMvPred[iRefList][iRefIdxTemp].setZero(); 3124 } 3125 else 3126 { 3005 3127 #endif 3006 3128 xCopyAMVPInfo(pcCU->getCUMvField(eRefPicList)->getAMVPInfo(), &aacAMVPInfo[iRefList][iRefIdxTemp]); // must always be done ( also when AMVP_MODE = AM_NONE ) … … 3009 3131 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3010 3132 } 3133 #if VSP_MV_ZERO 3134 } 3135 #endif 3011 3136 3012 3137 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag()) … … 3088 3213 if(pcCU->getSlice()->getMvdL1ZeroFlag()) 3089 3214 { 3215 #if VSP_MV_ZERO 3216 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, bestBiPRefIdxL1) == NUM_VIEW_VSP); 3217 3218 if( bIsVsp ) 3219 { 3220 cMvPredBi[1][bestBiPRefIdxL1].setZero(); 3221 } 3222 else 3223 { 3224 #endif 3090 3225 xCopyAMVPInfo(&aacAMVPInfo[1][bestBiPRefIdxL1], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()); 3091 3226 pcCU->setMVPIdxSubParts( bestBiPMvpL1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3092 3227 aaiMvpIdxBi[1][bestBiPRefIdxL1] = bestBiPMvpL1; 3093 3228 cMvPredBi[1][bestBiPRefIdxL1] = pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()->m_acMvCand[bestBiPMvpL1]; 3229 #if VSP_MV_ZERO 3230 } 3231 #endif 3094 3232 3095 3233 cMvBi[1] = cMvPredBi[1][bestBiPRefIdxL1]; … … 3109 3247 } 3110 3248 3249 #if VSP_MV_ZERO 3250 if( !bIsVsp ) 3251 { 3252 #endif 3111 3253 #if HHI_INTER_VIEW_MOTION_PRED 3112 3254 uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][iNumAMVPCands]; 3113 3255 #else 3114 3256 uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][AMVP_MAX_NUM_CANDS]; 3257 #endif 3258 #if VSP_MV_ZERO 3259 } 3115 3260 #endif 3116 3261 … … 3168 3313 for ( Int iRefIdxTemp = iRefStart; iRefIdxTemp <= iRefEnd; iRefIdxTemp++ ) 3169 3314 { 3315 #if VSP_MV_ZERO 3316 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP); 3317 //if( bIsVsp && !bWholeCUCanBeSynthesized ) 3318 //{ 3319 // continue; 3320 //} 3321 #endif 3170 3322 uiBitsTemp = uiMbBits[2] + uiMotBits[1-iRefList]; 3171 3323 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) … … 3174 3326 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 3175 3327 } 3328 #if VSP_MV_ZERO 3329 if( !bIsVsp ) 3330 { 3331 #endif 3176 3332 #if HHI_INTER_VIEW_MOTION_PRED 3177 3333 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][iNumAMVPCands]; 3178 3334 #else 3179 3335 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3336 #endif 3337 #if VSP_MV_ZERO 3338 } 3180 3339 #endif 3181 3340 #if LG_RESTRICTEDRESPRED_M24766 … … 3211 3370 #endif 3212 3371 // call ME 3372 #if VSP_MV_ZERO 3373 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp, true ); 3374 #else 3213 3375 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp, true ); 3376 #endif 3377 #if VSP_MV_ZERO 3378 if( !bIsVsp ) 3379 { 3380 #endif 3214 3381 if ( pcCU->getAMVPMode(uiPartAddr) == AM_EXPL ) 3215 3382 { … … 3217 3384 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3218 3385 } 3219 3386 #if VSP_MV_ZERO 3387 } 3388 #endif 3389 3220 3390 if ( uiCostTemp < uiCostBi ) 3221 3391 { … … 3249 3419 if ( uiCostBi <= uiCost[0] && uiCostBi <= uiCost[1] && pcCU->getAMVPMode(uiPartAddr) == AM_EXPL ) 3250 3420 { 3421 #if VSP_MV_ZERO 3422 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP); 3423 3424 if( !bIsVsp ) 3425 { 3426 #endif 3251 3427 xCopyAMVPInfo(&aacAMVPInfo[0][iRefIdxBi[0]], pcCU->getCUMvField(REF_PIC_LIST_0)->getAMVPInfo()); 3252 3428 xCheckBestMVP(pcCU, REF_PIC_LIST_0, cMvBi[0], cMvPredBi[0][iRefIdxBi[0]], aaiMvpIdxBi[0][iRefIdxBi[0]], uiBits[2], uiCostBi); 3429 #if VSP_MV_ZERO 3430 } 3431 #endif 3253 3432 #if H0111_MVD_L1_ZERO 3254 3433 if(!pcCU->getSlice()->getMvdL1ZeroFlag()) 3255 3434 { 3256 3435 #endif 3436 #if VSP_MV_ZERO 3437 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP); 3438 3439 if( !bIsVsp ) 3440 { 3441 #endif 3257 3442 xCopyAMVPInfo(&aacAMVPInfo[1][iRefIdxBi[1]], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()); 3258 3443 xCheckBestMVP(pcCU, REF_PIC_LIST_1, cMvBi[1], cMvPredBi[1][iRefIdxBi[1]], aaiMvpIdxBi[1][iRefIdxBi[1]], uiBits[2], uiCostBi); 3444 #if VSP_MV_ZERO 3445 } 3446 #endif 3259 3447 #if H0111_MVD_L1_ZERO 3260 3448 } … … 3417 3605 pcCU->setInterDirSubParts( 3, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3418 3606 3607 #if VSP_MV_ZERO 3608 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP); 3609 if( !bIsVsp ) 3610 { 3611 #endif 3419 3612 pcCU->setMVPIdxSubParts( aaiMvpIdxBi[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3420 3613 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3614 #if VSP_MV_ZERO 3615 } 3616 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP); 3617 if( !bIsVsp ) 3618 { 3619 #endif 3421 3620 pcCU->setMVPIdxSubParts( aaiMvpIdxBi[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3422 3621 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3622 #if VSP_MV_ZERO 3623 } 3624 #endif 3423 3625 3424 3626 uiMEBits = uiBits[2]; … … 3435 3637 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3436 3638 3639 #if VSP_MV_ZERO 3640 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdx[0]) == NUM_VIEW_VSP); 3641 if( !bIsVsp ) 3642 { 3643 #endif 3437 3644 pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3438 3645 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3646 #if VSP_MV_ZERO 3647 } 3648 #endif 3439 3649 3440 3650 uiMEBits = uiBits[0]; … … 3451 3661 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3452 3662 3663 #if VSP_MV_ZERO 3664 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdx[1]) == NUM_VIEW_VSP); 3665 if( !bIsVsp ) 3666 { 3667 #endif 3453 3668 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3454 3669 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3670 #if VSP_MV_ZERO 3671 } 3672 #endif 3455 3673 3456 3674 uiMEBits = uiBits[1]; … … 3888 4106 } 3889 4107 4108 #if VSP_MV_ZERO 4109 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, Bool bIsVsp, UInt& ruiBits, UInt& ruiCost, Bool bBi ) 4110 #else 3890 4111 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, UInt& ruiCost, Bool bBi ) 4112 #endif 3891 4113 { 3892 4114 UInt uiPartAddr; … … 3901 4123 m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred]; 3902 4124 4125 #if VSP_MV_ZERO 4126 Int iSrchRng = ( bIsVsp ? 0 : ( bBi ? m_bipredSearchRange : m_iSearchRange ) ); 4127 #else 3903 4128 Int iSrchRng = ( bBi ? m_bipredSearchRange : m_iSearchRange ); 4129 #endif 3904 4130 TComPattern* pcPatternKey = pcCU->getPattern (); 3905 4131 … … 3947 4173 m_pcRdCost->setCostScale ( 2 ); 3948 4174 4175 #if VSP_MV_ZERO 4176 if( !bIsVsp ) 4177 #endif 3949 4178 #if HHI_INTER_VIEW_MOTION_PRED 3950 4179 { // init inter-view regularization … … 3965 4194 } 3966 4195 #endif 4196 #if VSP_MV_ZERO 4197 else { // bIsVsp 4198 m_pcRdCost->setMultiviewReg( 0 ); 4199 } 4200 #endif 3967 4201 3968 4202 setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList ); 3969 4203 // Do integer search 4204 #if VSP_MV_ZERO 4205 if ( !m_iFastSearch || bBi || bIsVsp ) 4206 #else 3970 4207 if ( !m_iFastSearch || bBi ) 4208 #endif 3971 4209 { 3972 4210 xPatternSearch ( pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost ); … … 3979 4217 3980 4218 m_pcRdCost->getMotionCost( 1, 0 ); 4219 3981 4220 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 3982 4221 if( ! pcCU->getSlice()->getIsDepth() ) … … 3988 4227 xPatternSearchFracDIF( pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost 3989 4228 ,bBi 4229 #if VSP_MV_ZERO 4230 ,bIsVsp 4231 #endif 3990 4232 ); 3991 4233 } … … 4006 4248 ruiCost += m_pcRdCost->getCost( uiMvBits ); 4007 4249 #endif 4008 4250 4251 #if VSP_MV_ZERO 4252 if( bIsVsp ) { 4253 uiMvBits = 0; // vector zero & not output 4254 assert( rcMv.getHor()==0 && rcMv.getVer()==0 ); 4255 } 4256 #endif 4257 4009 4258 ruiBits += uiMvBits; 4010 4259 ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); … … 4304 4553 UInt& ruiCost 4305 4554 ,Bool biPred 4555 #if VSP_MV_ZERO 4556 ,Bool bIsVsp 4557 #endif 4306 4558 ) 4307 4559 { … … 4322 4574 rcMvHalf = *pcMvInt; rcMvHalf <<= 1; // for mv-cost 4323 4575 TComMv baseRefMv(0, 0); 4324 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf ); 4576 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf 4577 #if VSP_MV_ZERO 4578 ,bIsVsp 4579 #endif 4580 ); 4325 4581 4326 4582 m_pcRdCost->setCostScale( 0 ); … … 4332 4588 rcMvQter = *pcMvInt; rcMvQter <<= 1; // for mv-cost 4333 4589 rcMvQter += rcMvHalf; rcMvQter <<= 1; 4334 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter ); 4590 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter 4591 #if VSP_MV_ZERO 4592 ,bIsVsp 4593 #endif 4594 ); 4335 4595 } 4336 4596 … … 4367 4627 #endif 4368 4628 // No residual coding : SKIP mode 4369 if ( ePredMode == MODE_SKIP && bSkipRes ) 4629 if ( (ePredMode == MODE_SKIP && bSkipRes) 4630 #if FORCE_REF_VSP==1 4631 || ePredMode == MODE_SYNTH 4632 #endif 4633 ) 4370 4634 { 4371 4635 rpcYuvResi->clear(); … … 5737 6001 m_pcEntropyCoder->resetBits(); 5738 6002 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 6003 #if FORCE_REF_VSP==1 6004 if( pcCU->getSlice()->getViewId() != 0 ) 6005 #if VSP_TEXT_ONLY 6006 if( !pcCU->getSlice()->getSPS()->isDepth() ) 6007 #endif 6008 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 6009 #endif 5739 6010 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true); 5740 6011 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 5743 6014 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 5744 6015 } 6016 #if FORCE_REF_VSP==1 6017 else if( pcCU->isVspMode( 0 ) ) 6018 { 6019 m_pcEntropyCoder->resetBits(); 6020 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 6021 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 6022 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 6023 } 6024 #endif 5745 6025 else 5746 6026 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.h
r100 r166 144 144 UInt xPatternRefinement( TComPattern* pcPatternKey, 145 145 TComMv baseRefMv, 146 Int iFrac, TComMv& rcMvFrac ); 146 Int iFrac, TComMv& rcMvFrac 147 #if VSP_MV_ZERO 148 ,Bool bIsVsp 149 #endif 150 ); 147 151 148 152 typedef struct … … 197 201 #if AMP_MRG 198 202 ,Bool bUseMRG = false 203 #endif 204 #if FORCE_REF_VSP==1 205 ,Bool bForceRefVsp = false 199 206 #endif 200 207 ); … … 486 493 Int iRefIdxPred, 487 494 TComMv& rcMv, 495 #if VSP_MV_ZERO 496 Bool bIsVsp, 497 #endif 488 498 UInt& ruiBits, 489 499 UInt& ruiCost, … … 531 541 UInt& ruiCost 532 542 ,Bool biPred 543 #if VSP_MV_ZERO 544 ,Bool bIsVsp 545 #endif 533 546 ); 534 547 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.cpp
r105 r166 79 79 m_pcBitCounters = NULL; 80 80 m_pcRdCosts = NULL; 81 82 #if VSP_N 83 m_pcPicVSP = NULL; 84 m_pcPicAvail = NULL; 85 #endif 86 87 #if VSP_SLICE_HEADER 88 m_bUseVSP = false; 89 #endif 90 81 91 } 82 92 … … 184 194 } 185 195 #endif 196 197 #if VSP_N 198 m_pcPicVSP = new TComPic; 199 m_pcPicVSP->create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 200 //m_pcPicVSP->getCurrSlice()->setViewId( this->getViewId() ); 201 m_pcPicVSP->getCurrSlice()->setViewId( NUM_VIEW_VSP ); 202 m_pcPicVSP->getCurrSlice()->setViewOrderIdx( m_iViewOrderIdx ); 203 204 m_pcPicAvail = new TComPic; 205 m_pcPicAvail->create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 206 m_pcPicAvail->getCurrSlice()->setViewId( 99 ); 207 m_pcPicAvail->getCurrSlice()->setViewOrderIdx( m_iViewOrderIdx ); 208 #endif 209 186 210 } 187 211 … … 325 349 } 326 350 351 #if VSP_N 352 if( m_pcPicVSP ) 353 { 354 m_pcPicVSP->destroy(); 355 delete m_pcPicVSP; 356 m_pcPicVSP = NULL; 357 } 358 if( m_pcPicAvail ) 359 { 360 m_pcPicAvail->destroy(); 361 delete m_pcPicAvail; 362 m_pcPicAvail = NULL; 363 } 364 #endif 365 327 366 return; 328 367 } … … 391 430 392 431 m_iMaxRefPicNum = 0; 432 433 #if VSP_N 434 m_pcPicVSP->setCurrSliceIdx( 0 ); 435 m_pcPicVSP->getCurrSlice()->setSPS( this->getSPS() ); 436 m_pcPicVSP->getCurrSlice()->setPPS( this->getPPS() ); 437 m_pcPicVSP->getCurrSlice()->setPPSId( this->getPPS()->getPPSId() ); 438 //initialize the motion vector field with zeros - How about the RefIdx ???? 439 //IS THIS REALLY NECESSARY ???? 440 for ( int i=0; i<m_pcPicVSP->getPicSym()->getNumberOfCUsInFrame(); i++ ) 441 { 442 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 443 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 444 } 445 #if DEPTH_MAP_GENERATION 446 #if !QC_MULTI_DIS_CAN 447 // add extra pic buffers 448 Bool bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 ); 449 if( bNeedPrdDepthMapBuf && !m_pcPicVSP->getPredDepthMap() ) 450 { 451 m_pcPicVSP->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); 452 m_cDepthMapGenerator.clearDepthMap( m_pcPicVSP ); 453 } 454 #endif 455 #endif 456 m_pcPicAvail->setCurrSliceIdx( 0 ); 457 m_pcPicAvail->getCurrSlice()->setSPS( this->getSPS() ); 458 m_pcPicAvail->getCurrSlice()->setPPS( this->getPPS() ); 459 m_pcPicAvail->getCurrSlice()->setPPSId( this->getPPS()->getPPSId() ); 460 //initialize the motion vector field with zeros - How about the RefIdx ???? 461 //IS THIS REALLY NECESSARY ???? 462 for ( int i=0; i<m_pcPicAvail->getPicSym()->getNumberOfCUsInFrame(); i++ ) 463 { 464 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 465 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 466 } 467 #if DEPTH_MAP_GENERATION 468 #if !QC_MULTI_DIS_CAN 469 // add extra pic buffers 470 bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 ); 471 if( bNeedPrdDepthMapBuf && !m_pcPicVSP->getPredDepthMap() ) 472 { 473 m_pcPicAvail->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); 474 m_cDepthMapGenerator.clearDepthMap( m_pcPicAvail ); 475 } 476 #endif 477 #endif 478 #endif 393 479 } 394 480 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.h
r56 r166 145 145 TEncAnalyze m_cAnalyzeB; 146 146 147 #if VSP_N 148 TComPic* m_pcPicVSP; ///< view synthesis prediction buffer for current POC to be coded 149 TComPic* m_pcPicAvail; 150 #endif 151 152 #if VSP_SLICE_HEADER 153 Bool m_bUseVSP; 154 #endif 155 147 156 protected: 148 157 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 237 246 TComResidualGenerator* getResidualGenerator () { return &m_cResidualGenerator; } 238 247 #endif 248 #if VSP_N 249 TComPic* getVSPBuf () { return m_pcPicVSP; } 250 TComPic* getVSPAvailBuf () { return m_pcPicAvail; } 251 #endif 252 253 #if VSP_SLICE_HEADER 254 Void setUseVSP ( Bool val ) { m_bUseVSP = val; } 255 Bool getUseVSP () { return m_bUseVSP; } 256 #endif 239 257 240 258 // -------------------------------------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.