Changeset 479 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
- Timestamp:
- 18 Jun 2013, 23:24:53 (11 years ago)
- Location:
- branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCavlc.cpp
r478 r479 581 581 WRITE_FLAG( 0, "sps_extension_flag" ); 582 582 #endif 583 #if H_3D_IV_MERGE584 if( pcSPS->getViewIndex() || pcSPS->isDepth() )585 {586 WRITE_FLAG( 0, "base_view_flag" );587 if( pcSPS->isDepth() )588 {589 WRITE_FLAG( 1, "depth_flag" );590 WRITE_UVLC( pcSPS->getViewIndex(), "view_idx" );591 }592 else593 {594 WRITE_FLAG( 0, "depth_flag" );595 WRITE_UVLC( pcSPS->getViewIndex() - 1, "view_idx_minus1" );596 WRITE_UVLC( pcSPS->getPredDepthMapGeneration(), "Pdm_generation" );597 if( pcSPS->getPredDepthMapGeneration() )598 {599 WRITE_UVLC( pcSPS->getMultiviewMvPredMode(), "multi_view_mv_pred_mode" );600 }601 }602 }603 else604 {605 WRITE_FLAG( 1, "base_view_flag" );606 }607 #endif608 583 } 609 584 … … 766 741 } 767 742 } 743 #if H_3D_GEN 744 WRITE_FLAG( 1, "vps_extension2_flag" ); 745 for( Int layer = 0; layer <= pcVPS->getMaxLayers() - 1; layer++ ) 746 { 747 if (layer != 0) 748 { 749 if ( !( pcVPS->getDepthId( layer ) == 1 ) ) 750 { 751 #if H_3D_IV_MERGE 752 WRITE_FLAG( pcVPS->getIvMvPredFlag(layer) ? 1 : 0 , "ivMvPredFlag[i]"); 753 #endif 754 } 755 } 756 } 757 #else 768 758 WRITE_FLAG( 0, "vps_extension2_flag" ); 759 #endif 769 760 #else 770 761 WRITE_FLAG( 0, "vps_extension_flag" ); … … 1104 1095 { 1105 1096 #if H_3D_IV_MERGE 1106 WRITE_UVLC(((pcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE) == PDM_USE_FOR_MERGE? MRG_MAX_NUM_CANDS_MEM: MRG_MAX_NUM_CANDS) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand"); 1097 Bool ivMvPredFlag = pcSlice->getVPS()->getIvMvPredFlag( pcSlice->getLayerIdInVps() ) ; 1098 WRITE_UVLC( ( ivMvPredFlag ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS ) - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand"); 1107 1099 #else 1108 1100 WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "five_minus_max_num_merge_cand"); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncCfg.h
r476 r479 375 375 TAppComCamPara* m_cameraParameters; 376 376 377 #if H_3D_IV_MERGE378 UInt m_uiPredDepthMapGeneration;379 UInt m_uiMultiviewMvPredMode;380 #endif381 377 #if H_3D_VSO 382 378 //====== View Synthesis Optimization ====== … … 930 926 Void setDispCoeff ( Double d ) { m_dDispCoeff = d; } 931 927 #endif // H_3D_VSO 932 #if H_3D_IV_MERGE933 Void setMultiviewMvPredMode (UInt ui) { m_uiMultiviewMvPredMode = ui;}934 Void setPredDepthMapGeneration ( UInt u ) { m_uiPredDepthMapGeneration = u; }935 936 UInt getMultiviewMvPredMode () { return m_uiMultiviewMvPredMode;}937 #endif938 928 #endif // H_3D 939 929 }; -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.cpp
r478 r479 49 49 #include <time.h> 50 50 #include <math.h> 51 #if H_3D_IV_MERGE 52 #include "../../App/TAppEncoder/TAppEncTop.h" 53 #endif 51 54 52 using namespace std; 55 53 //! \ingroup TLibEncoder … … 109 107 m_viewIndex = 0; 110 108 m_isDepth = false; 111 #if H_3D_IV_MERGE112 m_pcDepthMapGenerator = NULL;113 #endif114 109 #endif 115 110 #endif … … 160 155 m_viewIndex = pcTEncTop->getViewIndex(); 161 156 m_isDepth = pcTEncTop->getIsDepth(); 162 #if H_3D_IV_MERGE163 m_pcDepthMapGenerator = pcTEncTop->getDepthMapGenerator();164 #endif165 157 #endif 166 158 #endif … … 502 494 pcPic->setCurrSliceIdx(0); 503 495 496 #if H_3D_GEN 497 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 498 #else 504 499 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 500 #endif 505 501 pcSlice->setLastIDR(m_iLastIDR); 506 502 pcSlice->setSliceIdx(0); … … 510 506 pcSlice->setLayerId ( getLayerId() ); 511 507 pcSlice->setViewId ( getViewId() ); 508 #if !H_3D_GEN 512 509 pcSlice->setVPS ( m_pcEncTop->getVPS() ); 510 #endif 513 511 #if H_3D 514 512 pcPic ->setViewIndex ( getViewIndex() ); … … 516 514 pcSlice->setViewIndex ( getViewIndex() ); 517 515 pcSlice->setIsDepth( getIsDepth() ); 518 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 519 #endif 520 #endif 516 pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); 517 #endif 518 #endif 521 519 //set default slice level flag to the same as SPS level flag 522 520 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); … … 682 680 #endif 683 681 684 #if H_3D _IV_MERGE685 TAppEncTop* tAppEncTop = m_pcEncTop->getEncTop();686 TComPic * const pcTexturePic = m_pcEncTop->getIsDepth() ? tAppEncTop->getPicFromView( getViewIndex(), pcSlice->getPOC(), false ) : NULL; 687 assert( !m_pcEncTop->getIsDepth() || pcTexturePic != NULL);688 pcSlice->setTexturePic( pcTexturePic ); 682 #if H_3D 683 pcSlice->setIvPicLists( m_ivPicLists ); 684 #if H_3D_IV_MERGE 685 assert( !m_pcEncTop->getIsDepth() || ( pcSlice->getTexturePic() != 0 ) ); 686 #endif 689 687 #endif 690 688 // Slice info. refinement … … 1042 1040 m_storedStartCUAddrForEncodingSliceSegment.push_back(nextCUAddr); 1043 1041 startCUAddrSliceSegmentIdx++; 1044 #if H_3D_IV_MERGE1045 m_pcDepthMapGenerator->initViewComponent( pcPic );1046 #endif1047 1042 #if H_3D_NBDV 1048 1043 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. -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncGOP.h
r478 r479 59 59 #include <vector> 60 60 61 #if H_3D_IV_MERGE62 #include "TLibCommon/TComDepthMapGenerator.h"63 #endif64 61 //! \ingroup TLibEncoder 65 62 //! \{ … … 110 107 Int m_viewIndex; 111 108 Bool m_isDepth; 112 #if H_3D_IV_MERGE113 TComDepthMapGenerator* m_pcDepthMapGenerator;114 #endif115 109 #endif 116 110 #endif … … 172 166 173 167 TComList<TComPic*>* getListPic() { return m_pcListPic; } 174 #if H_3D_IV_MERGE 175 TEncTop* getEncTop() { return m_pcEncTop; } 176 #endif 168 177 169 #if !H_MV 178 170 Void printOutSummary ( UInt uiNumAllPicCoded ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.cpp
r476 r479 176 176 \param pPPS PPS associated with the slice 177 177 */ 178 #if H_3D_GEN 179 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS ) 180 #else 178 181 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ) 182 #endif 179 183 { 180 184 Double dQP; … … 182 186 183 187 rpcSlice = pcPic->getSlice(0); 188 #if H_3D_GEN 189 rpcSlice->setVPS( pVPS ); 190 #endif 184 191 rpcSlice->setSPS( pSPS ); 185 192 rpcSlice->setPPS( pPPS ); … … 530 537 rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() ); 531 538 #if H_3D_IV_MERGE 532 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ((rpcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE) ? 1:0));539 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() + ( rpcSlice->getVPS()->getIvMvPredFlag( rpcSlice->getLayerIdInVps() ) ? 1 : 0 ) ); 533 540 #else 534 541 rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSlice.h
r446 r479 116 116 117 117 /// preparation of slice encoding (reference marking, QP and lambda) 118 #if H_3D_GEN 119 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 120 Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS ); 121 #else 118 122 Void initEncSlice ( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, 119 123 Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ); 124 #endif 120 125 #if RATE_CONTROL_LAMBDA_DOMAIN 121 126 Void resetQP ( TComPic* pic, Int sliceQP, Double lambda ); -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.cpp
r478 r479 120 120 m_cLoopFilter. create( g_uiMaxCUDepth ); 121 121 122 #if H_3D_IV_MERGE123 m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_bitDepthY, PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) );124 #endif125 122 #if RATE_CONTROL_LAMBDA_DOMAIN 126 123 if ( m_RCEnableRateControl ) … … 228 225 m_cLoopFilter. destroy(); 229 226 m_cRateCtrl. destroy(); 230 #if H_3D_IV_MERGE231 m_cDepthMapGenerator. destroy();232 #endif233 227 // SBAC RD 234 228 if( m_bUseSBACRD ) … … 290 284 } 291 285 292 #if H_3D_IV_MERGE293 Void TEncTop::init( TAppEncTop* pcTAppEncTop)294 #else295 286 Void TEncTop::init() 296 #endif297 287 { 298 288 // initialize SPS … … 316 306 m_cCuEncoder. init( this ); 317 307 318 #if H_3D_IV_MERGE319 m_pcTAppEncTop = pcTAppEncTop;320 m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getVPSAccess(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() );321 #endif322 308 // initialize transform & quantization class 323 309 m_pcCavlcCoder = getCavlcCoder(); … … 672 658 { 673 659 m_cSPS.initCamParaSPS ( m_viewIndex, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset ); 674 #if H_3D_IV_MERGE 675 if( m_viewIndex ) 676 { 677 m_cSPS.setPredDepthMapGeneration( m_viewIndex, false, m_uiPredDepthMapGeneration, m_uiMultiviewMvPredMode); 678 } 679 else 680 { 681 m_cSPS.setPredDepthMapGeneration( m_viewIndex, false ); 682 } 683 #endif 684 } 685 #if H_3D_IV_MERGE 686 else 687 { 688 m_cSPS.initCamParaSPSDepth ( m_viewIndex); 689 m_cSPS.setPredDepthMapGeneration( m_viewIndex, true ); 690 } 691 #endif 660 } 692 661 #endif 693 662 } -
branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncTop.h
r478 r479 57 57 #include "TEncPreanalyzer.h" 58 58 #include "TEncRateCtrl.h" 59 #if H_3D_IV_MERGE60 #include "TLibCommon/TComDepthMapGenerator.h"61 #endif62 59 //! \ingroup TLibEncoder 63 60 //! \{ … … 67 64 // ==================================================================================================================== 68 65 69 #if H_3D_IV_MERGE70 class TAppEncTop;71 #endif72 66 /// encoder class 73 67 class TEncTop : public TEncCfg … … 102 96 TEncSlice m_cSliceEncoder; ///< slice encoder 103 97 TEncCu m_cCuEncoder; ///< CU encoder 104 #if H_3D_IV_MERGE105 TComDepthMapGenerator m_cDepthMapGenerator; ///< depth map generator106 #endif107 98 // SPS 108 99 TComSPS m_cSPS; ///< SPS … … 128 119 TEncBinCABAC* m_pcRDGoOnBinCodersCABAC; ///< going on bin coder CABAC for RD stage per substream 129 120 130 #if H_3D_IV_MERGE131 TAppEncTop* m_pcTAppEncTop;132 #endif133 121 // quality control 134 122 TEncPreanalyzer m_cPreanalyzer; ///< image characteristics analyzer for TM5-step3-like adaptive QP … … 157 145 Void create (); 158 146 Void destroy (); 159 #if H_3D_IV_MERGE160 Void init ( TAppEncTop* pcTAppEncTop );161 #else162 147 Void init (); 163 #endif164 148 #if H_MV 165 149 TComPicLists* getIvPicLists() { return m_ivPicLists; } … … 201 185 TEncSbac* getRDGoOnSbacCoders () { return m_pcRDGoOnSbacCoders; } 202 186 TEncRateCtrl* getRateCtrl () { return &m_cRateCtrl; } 203 #if H_3D_IV_MERGE204 TAppEncTop* getEncTop () { return m_pcTAppEncTop; }205 #endif206 187 TComSPS* getSPS () { return &m_cSPS; } 207 188 TComPPS* getPPS () { return &m_cPPS; } … … 224 205 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; } 225 206 #endif 226 #if H_3D_IV_MERGE227 TComDepthMapGenerator* getDepthMapGenerator () { return &m_cDepthMapGenerator; }228 #endif229 207 // ------------------------------------------------------------------------------------------------------------------- 230 208 // encoder function
Note: See TracChangeset for help on using the changeset viewer.