Changeset 166 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder
- Timestamp:
- 1 Nov 2012, 19:22:41 (12 years ago)
- Location:
- branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r100 r166 2348 2348 #endif 2349 2349 2350 #if VSP_SLICE_HEADER 2351 if( rpcSlice->getSPS()->getViewId()!=0 2352 #if VSP_TEXT_ONLY 2353 && !(rpcSlice->getSPS()->isDepth()) 2354 #endif 2355 ) 2356 { 2357 READ_FLAG( uiCode, "vsp_flag" ); 2358 rpcSlice->setVspFlag( uiCode ? true : false ); 2359 } 2360 #endif 2361 2350 2362 if (!bEntropySlice) 2351 2363 { … … 2601 2613 } 2602 2614 2615 #if FORCE_REF_VSP==1 2616 Void TDecCavlc::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2617 { 2618 assert(0); 2619 } 2620 #endif 2621 2603 2622 #if HHI_INTER_VIEW_MOTION_PRED 2604 2623 Void TDecCavlc::parseMVPIdx( Int& riMVPIdx, Int iAMVPCands ) -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r77 r166 142 142 143 143 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 144 #if FORCE_REF_VSP==1 145 Void parseVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 146 #endif 144 147 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 145 148 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r100 r166 52 52 m_ppcYuvResPred = NULL; 53 53 #endif 54 #if FORCE_REF_VSP 55 m_ppcYuvAvail = NULL; 56 m_ppcYuvSynth = NULL; 57 #endif 54 58 m_ppcCU = NULL; 55 59 } … … 79 83 #if HHI_INTER_VIEW_RESIDUAL_PRED 80 84 m_ppcYuvResPred = new TComYuv* [m_uiMaxDepth-1]; 85 #endif 86 #if FORCE_REF_VSP 87 m_ppcYuvAvail = new TComYuv* [m_uiMaxDepth-1]; 88 m_ppcYuvSynth = new TComYuv* [m_uiMaxDepth-1]; 81 89 #endif 82 90 m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; … … 94 102 m_ppcYuvResPred[ui] = new TComYuv; m_ppcYuvResPred[ui]->create( uiWidth, uiHeight ); 95 103 #endif 104 #if FORCE_REF_VSP 105 m_ppcYuvAvail [ui] = new TComYuv; m_ppcYuvAvail [ui]->create( uiWidth, uiHeight ); 106 m_ppcYuvSynth [ui] = new TComYuv; m_ppcYuvSynth [ui]->create( uiWidth, uiHeight ); 107 #endif 96 108 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 97 109 } … … 118 130 m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL; 119 131 #endif 132 #if FORCE_REF_VSP 133 m_ppcYuvAvail [ui]->destroy(); delete m_ppcYuvAvail [ui]; m_ppcYuvAvail [ui] = NULL; 134 m_ppcYuvSynth [ui]->destroy(); delete m_ppcYuvSynth [ui]; m_ppcYuvSynth [ui] = NULL; 135 #endif 120 136 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 121 137 } … … 125 141 #if HHI_INTER_VIEW_RESIDUAL_PRED 126 142 delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL; 143 #endif 144 #if FORCE_REF_VSP 145 delete [] m_ppcYuvAvail; m_ppcYuvAvail = NULL; 146 delete [] m_ppcYuvSynth; m_ppcYuvSynth = NULL; 127 147 #endif 128 148 delete [] m_ppcCU ; m_ppcCU = NULL; … … 328 348 { 329 349 m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 350 351 #if FORCE_REF_VSP==1 352 if( pcCU->isSkipped(uiAbsPartIdx) && pcCU->getSlice()->getViewId() != 0 ) 353 #if VSP_TEXT_ONLY 354 if( !pcCU->getSlice()->getSPS()->isDepth() ) 355 #endif 356 { 357 m_pcEntropyDecoder->decodeVspFlag( pcCU, uiAbsPartIdx, uiDepth ); 358 } 359 #endif 330 360 } 331 361 332 362 if( pcCU->isSkipped(uiAbsPartIdx) ) 363 #if FORCE_REF_VSP==1 364 if( !pcCU->isVspMode(uiAbsPartIdx) ) 365 #endif 333 366 { 334 367 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); … … 352 385 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth ) 353 386 { 387 #if DEBUGLOGOUT 388 PredMode eOrgPred = pcCU->getPredictionMode( uiAbsPartIdx ); 389 #endif 354 390 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 355 391 pcCU->copyTextureMotionDataFrom( pcTextureCU, uiDepth, pcCU->getZorderIdxInCU() + uiAbsPartIdx, uiAbsPartIdx ); 392 #if DEBUGLOGOUT 393 if( eOrgPred == MODE_SKIP ) 394 pcCU->setPredModeSubParts( MODE_SKIP, uiAbsPartIdx, uiDepth ); 395 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 396 #endif 356 397 357 398 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); … … 396 437 #endif 397 438 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 439 #if DEBUGLOGOUT 440 #if HHI_MPI 441 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) != uiDepth ) 442 #endif 443 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 444 #endif 398 445 return; 399 446 } 447 448 #if FORCE_REF_VSP==1 449 if( pcCU->isVspMode( uiAbsPartIdx ) ) 450 { 451 TComMv cMvZero; 452 453 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 454 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 455 456 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 457 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 458 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( cMvZero, SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 459 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( cMvZero, SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 460 461 //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), SIZE_2Nx2N, 0, pcCU->getDepth(0), 0 ); 462 //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), SIZE_2Nx2N, 0, pcCU->getDepth(0), 0 ); 463 464 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth ); 465 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth ); 466 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth ); 467 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth ); 468 469 pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); 470 pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); 471 pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth ); 472 473 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 474 #if DEBUGLOGOUT 475 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 476 #endif 477 return; 478 } 479 #endif 400 480 401 481 #if HHI_MPI … … 428 508 { 429 509 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 510 #if DEBUGLOGOUT 511 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 512 #endif 430 513 return; 431 514 } … … 527 610 setdQPFlag( bCodeDQP ); 528 611 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 612 #if DEBUGLOGOUT 613 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 614 #endif 529 615 } 530 616 … … 553 639 { 554 640 TComPic* pcPic = pcCU->getPic(); 641 #if FORCE_REF_VSP 642 if(pcPic->getPicYuvSynth()) m_ppcYuvSynth[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx ); 643 if(pcPic->getPicYuvAvail()) m_ppcYuvAvail[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx ); 644 #endif 555 645 556 646 Bool bBoundary = false; … … 603 693 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 604 694 break; 695 #if FORCE_REF_VSP==1 696 case MODE_SYNTH: 697 m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx); 698 break; 699 #endif 605 700 default: 606 701 assert(0); … … 615 710 616 711 xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth ); 712 #if DEBUGIMGOUT 713 xColsetToPicMerge( m_ppcCU[uiDepth], pcPic->getPicYuvRecDbg(), uiAbsPartIdx, uiDepth ); 714 #endif 617 715 } 618 716 … … 626 724 // inter prediction 627 725 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 628 629 726 #if HHI_MPI 630 727 if( pcCU->getTextureModeDepth( 0 ) != -1 ) -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.h
r56 r166 46 46 #include "TLibCommon/TComPrediction.h" 47 47 #include "TDecEntropy.h" 48 #if DEBUGIMGOUT || DEBUGLOGOUT 49 #include "TLibCommon/DebugLog.h" 50 #endif 48 51 49 52 //! \ingroup TLibDecoder … … 64 67 TComYuv** m_ppcYuvResPred; ///< residual prediction buffer 65 68 #endif 69 #if VSP_N 70 TComYuv** m_ppcYuvAvail; ///< array of available map buffer 71 TComYuv** m_ppcYuvSynth; ///< array of synth buffer 72 #endif 66 73 TComDataCU** m_ppcCU; ///< CU data array 67 74 … … 77 84 virtual ~TDecCu(); 78 85 86 #if DEBUGLOGOUT 87 DebugLog m_cDebug; 88 #endif 89 79 90 /// initialize access channels 80 91 Void init ( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction ); … … 121 132 Void xFillPCMBuffer (TComDataCU* pCU, UInt absPartIdx, UInt depth); 122 133 #endif 134 #if DEBUGIMGOUT 135 Void xColsetToPic ( TComDataCU* pcCU, TComPicYuv* pcPicYuv, UInt uiZorderIdx, UInt uiDepth ); 136 Void xColsetToPicMerge ( TComDataCU* pcCU, TComPicYuv* pcPicYuv, UInt uiZorderIdx, UInt uiDepth ); 137 #endif 123 138 }; 124 139 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r100 r166 54 54 } 55 55 56 #if FORCE_REF_VSP==1 57 Void TDecEntropy::decodeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 58 { 59 m_pcEntropyDecoderIf->parseVspFlag( pcCU, uiAbsPartIdx, uiDepth ); 60 } 61 #endif 62 56 63 /** decode merge flag 57 64 * \param pcSubCU … … 301 308 { 302 309 decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 310 #if VSP_MV_ZERO 311 Int iRefIdx = pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx(uiSubPartIdx); 312 if( pcCU->getSlice()->getViewId() && iRefIdx >= 0 && (pcCU->getSlice()->getRefViewId( RefPicList( uiRefListIdx ), iRefIdx ) == NUM_VIEW_VSP) ) 313 { 314 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( TComMv(0, 0), pcCU->getPartitionSize( uiSubPartIdx ), uiSubPartIdx, uiDepth, uiPartIdx ); 315 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMv ( TComMv(0, 0), pcCU->getPartitionSize( uiSubPartIdx ), uiSubPartIdx, uiDepth, uiPartIdx ); 316 pcCU->setMVPIdxSubParts( -1, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, pcCU->getDepth(uiSubPartIdx)); 317 pcCU->setMVPNumSubParts( -1, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, pcCU->getDepth(uiSubPartIdx)); 318 } 319 else 320 { 321 #endif 303 322 decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 304 323 decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 324 #if VSP_MV_ZERO 325 } 326 #endif 305 327 } 306 328 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.h
r77 r166 103 103 public: 104 104 virtual Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 105 #if FORCE_REF_VSP==1 106 virtual Void parseVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 107 #endif 105 108 virtual Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 106 109 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; … … 196 199 Void decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 197 200 Void decodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 201 #if FORCE_REF_VSP==1 202 Void decodeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 203 #endif 198 204 Void decodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 199 205 Void decodeMergeIndex ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r100 r166 578 578 } 579 579 580 #if FORCE_REF_VSP==1 581 Void TDecSbac::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 582 { 583 if( pcCU->getSlice()->isIntra() || pcCU->getSlice()->getViewId()==0 ) 584 { 585 return; 586 } 587 588 UInt uiSymbol = 0; 589 UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ); 590 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) ); 591 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 592 DTRACE_CABAC_T( "\tVspFlag" ); 593 DTRACE_CABAC_T( "\tuiCtxSkip: "); 594 DTRACE_CABAC_V( uiCtxSkip ); 595 DTRACE_CABAC_T( "\tuiSymbol: "); 596 DTRACE_CABAC_V( uiSymbol ); 597 DTRACE_CABAC_T( "\n"); 598 599 if( uiSymbol ) 600 { 601 pcCU->setPredModeSubParts( MODE_SYNTH, uiAbsPartIdx, uiDepth ); 602 } 603 } 604 #endif 605 580 606 /** parse merge flag 581 607 * \param pcCU … … 610 636 uiNumCand = pcCU->getSlice()->getMaxNumMergeCand(); 611 637 #if HHI_MPI 638 #if VSP_TEXT_ONLY 639 TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL; 640 Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1, 641 pcTextCU ? pcTextCU->getCUMvField( RefPicList(1) )->getRefIdx( uiAbsPartIdx ) : -1 }; 642 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE 643 && !( aiRefIdxVsp[0] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(0), aiRefIdxVsp[0] ) == NUM_VIEW_VSP ) 644 && !( aiRefIdxVsp[1] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(1), aiRefIdxVsp[1] ) == NUM_VIEW_VSP ); 645 #else 612 646 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE; 647 #endif 613 648 const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : uiNumCand; 614 649 #endif -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.h
r100 r166 166 166 167 167 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 168 #if FORCE_REF_VSP==1 169 Void parseVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 170 #endif 168 171 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 169 172 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSlice.cpp
r77 r166 102 102 rpcPic->setPicYuvResi( 0 ); 103 103 104 #if DEBUGLOGOUT 105 char fname[128]; 106 sprintf(fname, "%sV%02d_%05d%s.csv", "DecLog", rpcPic->getSlice(0)->getViewId(), rpcPic->getPOC(), rpcPic->getSlice(0)->getIsDepth() ? "depth":"text"); 107 m_pcCuDecoder->m_cDebug.DebugLogFileOpen( fname ); 108 #endif 104 109 #if ENC_DEC_TRACE 105 110 g_bJustDoIt = g_bEncDecTraceEnable; … … 439 444 #endif 440 445 } 446 #if DEBUGLOGOUT 447 m_pcCuDecoder->m_cDebug.DebugLogFileClose(); 448 #endif 441 449 442 450 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r77 r166 56 56 m_aaiCodedScale [ uiId ] = new Int [ MAX_VIEW_NUM ]; 57 57 } 58 59 #if VSP_N 60 xCreateLUTs( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 61 m_iLog2Precision = LOG2_DISP_PREC_LUT; 62 m_uiBitDepthForLUT = 8; //fixed 63 #if NTT_SUBPEL 64 xCreateLUTs_Subpel( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos); 65 #endif 66 #endif 58 67 } 59 68 … … 69 78 delete [] m_aiViewOrderIndex; 70 79 delete [] m_aiViewReceived; 80 81 #if VSP_N 82 xDeleteArray( m_adBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 83 xDeleteArray( m_aiBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 84 #if NTT_SUBPEL 85 xDeleteArray( m_aiBaseViewShiftLUT_ipel, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 86 xDeleteArray( m_aiBaseViewShiftLUT_fpos, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 87 #endif 88 #endif 71 89 } 72 90 … … 82 100 m_uiMaxViewId = 0; 83 101 } 102 103 #if VSP_N 104 Void 105 CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT) 106 { 107 //AOF( m_uiBitDepthForLUT == 8 ); 108 //AOF(radLUT == NULL && raiLUT == NULL ); 109 110 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 111 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 112 113 radLUT = new Double***[ uiNumberSourceViews ]; 114 raiLUT = new Int ***[ uiNumberSourceViews ]; 115 116 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 117 { 118 radLUT [ uiSourceView ] = new Double**[ uiNumberTargetViews ]; 119 raiLUT [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 120 121 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 122 { 123 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 124 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ]; 125 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ]; 126 127 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 128 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 129 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 130 } 131 } 132 } 133 134 Void 135 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 136 { 137 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 138 Int iLog2DivChroma = iLog2DivLuma + 1; 139 140 iOffset <<= m_uiBitDepthForLUT; 141 142 Double dScale = (Double) iScale / (( Double ) ( 1 << iLog2DivLuma )); 143 Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma )); 144 145 // offsets including rounding offsets 146 Int64 iOffsetLuma = iOffset + ( ( 1 << iLog2DivLuma ) >> 1 ); 147 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 148 149 150 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 151 { 152 153 // real-valued look-up tables 154 #if POZNAN_NONLINEAR_DEPTH 155 Double dShiftLuma; 156 if( m_bUseNonlinearDepth ) 157 dShiftLuma = ( m_cNonlinearDepthModel.BackwardD( (Double)uiDepthValue, dScale) + dOffset ) * Double( 1 << m_iLog2Precision ); 158 else 159 dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 160 #else 161 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 162 #endif 163 Double dShiftChroma = dShiftLuma / 2; 164 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; 165 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma; 166 167 // integer-valued look-up tables 168 #if POZNAN_NONLINEAR_DEPTH 169 Int64 iTempScale; 170 if( m_bUseNonlinearDepth ) 171 iTempScale = (Int64)m_cNonlinearDepthModel.BackwardI(uiDepthValue, iScale); 172 else 173 iTempScale = (Int64)uiDepthValue * iScale; 174 #else 175 Int64 iTempScale = (Int64)uiDepthValue * iScale; 176 #endif 177 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; 178 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma; 179 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma; 180 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma; 181 182 // maximum deviation 183 //dMaxDispDev = Max( dMaxDispDev, fabs( Double( (Int) iTestScale ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) ); 184 //dMaxRndDispDvL = Max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) ); 185 //dMaxRndDispDvC = Max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) ); 186 } 187 188 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 189 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 190 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 191 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 192 } 193 194 Bool 195 CamParsCollector::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft) 196 { 197 /* 198 riNearestViewIdx = 0; 199 200 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 201 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 202 203 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor <= 0 ) 204 { 205 rbRenderFromLeft = true; 206 } 207 else 208 { 209 rbRenderFromLeft = false; 210 } 211 212 riRelDistToLeft = 128; //Not used for now; 213 //*/ 214 return true; 215 } 216 217 #if NTT_SUBPEL 218 Void 219 CamParsCollector::xCreateLUTs_Subpel( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ) 220 { 221 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 222 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 223 224 raiLUT0 = new Int ***[ uiNumberSourceViews ]; 225 raiLUT1 = new Int ***[ uiNumberSourceViews ]; 226 227 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 228 { 229 raiLUT0 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 230 raiLUT1 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 231 232 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 233 { 234 raiLUT0 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 235 raiLUT0 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 236 raiLUT0 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 237 raiLUT1 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 238 raiLUT1 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 239 raiLUT1 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 240 } 241 } 242 } 243 Void 244 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Int****& raiLUT_ipel, Int****& raiLUT_fpos) 245 { 246 Int iLog2Div = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2Div > 0 ); 247 Int64 iOffset64 = ( Int64(iOffset) << m_uiBitDepthForLUT ) + ( ( 1 << iLog2Div ) >> 1 ); 248 249 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 250 { 251 Int64 iTempScale = (Int64)uiDepthValue * iScale; 252 Int iShiftSubpel = (Int) (( iTempScale + iOffset64 ) >> iLog2Div); 253 Int iShiftPelLuma = iShiftSubpel >> m_iLog2Precision; // better to have rounding ? 254 Int iShiftPelChroma = iShiftPelLuma >> 1; 255 256 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftPelLuma; 257 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftPelChroma; 258 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelLuma << m_iLog2Precision ); 259 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelChroma << (m_iLog2Precision+1) ); 260 261 #if 0 // NTT bugfix 262 if ( raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] < 0 ) 263 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = -4 - raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]; 264 if ( raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] < 0 ) 265 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = -8 - raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]; 266 #endif 267 268 #if _DEBUG 269 AOF( (raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]>> m_iLog2Precision ) == 0 ); 270 AOF( (raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]>>(m_iLog2Precision+1)) == 0 ); 271 #endif 272 } 273 274 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 275 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 276 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 277 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 278 } 279 #endif 280 281 #endif 84 282 85 283 Void … … 164 362 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 165 363 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 364 #if VSP_N 365 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 366 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 367 #if NTT_SUBPEL 368 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 369 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 370 #endif 371 #endif 166 372 } 167 373 else … … 171 377 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ]; 172 378 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ]; 379 #if VSP_N 380 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 381 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 382 #if NTT_SUBPEL 383 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 384 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 385 #endif 386 #endif 173 387 } 174 388 } … … 185 399 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 186 400 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 401 #if VSP_N 402 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 403 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 404 #if NTT_SUBPEL 405 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 406 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 407 #endif 408 #endif 187 409 } 188 410 } … … 255 477 #endif 256 478 #if ENC_DEC_TRACE 257 g_hTrace = fopen( "TraceDec.txt", "wb" );479 if(!g_hTrace) g_hTrace = fopen( "TraceDec.txt", "wb" ); 258 480 g_bJustDoIt = g_bEncDecTraceDisable; 259 481 g_nSymbolCounter = 0; … … 266 488 m_bFirstSliceInSequence = true; 267 489 m_pcCamParsCollector = 0; 490 491 #if VSP_N 492 m_pcPicVSP = NULL; 493 m_pcPicAvail = NULL; 494 #endif 268 495 } 269 496 … … 271 498 { 272 499 #if ENC_DEC_TRACE 273 fclose( g_hTrace ); 500 if(g_hTrace) fclose( g_hTrace ); 501 g_hTrace=NULL; 274 502 #endif 275 503 } … … 298 526 m_cResidualGenerator.destroy(); 299 527 #endif 528 529 #if VSP_N 530 if( m_pcPicVSP ) 531 { 532 m_pcPicVSP->destroy(); 533 delete m_pcPicVSP; 534 m_pcPicVSP = NULL; 535 } 536 if( m_pcPicAvail ) 537 { 538 m_pcPicAvail->destroy(); 539 delete m_pcPicAvail; 540 m_pcPicAvail = NULL; 541 } 542 #endif 543 300 544 } 301 545 … … 732 976 // Get a new picture buffer 733 977 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 978 #if VSP_N 979 #if VSP_SLICE_HEADER 980 if( m_apcSlicePilot->getVspFlag() ) 981 #endif 982 { 983 if( m_pcPicVSP == NULL ) 984 { 985 m_pcPicVSP = new TComPic; 986 m_pcPicVSP->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 987 m_pcPicVSP->setCurrSliceIdx(0); 988 m_pcPicVSP->getCurrSlice()->setViewId( NUM_VIEW_VSP ); 989 m_pcPicVSP->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() ); 990 m_pcPicVSP->getCurrSlice()->setSPS( m_apcSlicePilot->getSPS() ); 991 m_pcPicVSP->getCurrSlice()->setPPS( m_apcSlicePilot->getPPS() ); 992 m_pcPicVSP->getCurrSlice()->setPPSId( m_apcSlicePilot->getPPS()->getPPSId() ); 993 m_pcPicVSP->getPicSym()->setNumColumnsMinus1( m_apcSlicePilot->getSPS()->getNumColumnsMinus1() ); 994 m_pcPicVSP->getPicSym()->setNumRowsMinus1( m_apcSlicePilot->getSPS()->getNumRowsMinus1() ); 995 m_pcPicVSP->getPicSym()->xCreateTComTileArray(); 996 for (int i=0;i<m_pcPicVSP->getPicSym()->getNumberOfCUsInFrame();i++) 997 { 998 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 999 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 1000 } 1001 #if DEPTH_MAP_GENERATION 1002 UInt uiPdm = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() ); 1003 Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 ); 1004 if( bNeedPrdDepthMapBuffer ) 1005 { 1006 m_pcPicVSP->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 1007 } 1008 #endif 1009 } 1010 if( m_pcPicAvail == NULL ) 1011 { 1012 m_pcPicAvail = new TComPic; 1013 m_pcPicAvail->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 1014 m_pcPicAvail->setCurrSliceIdx(0); 1015 m_pcPicAvail->getCurrSlice()->setViewId( 99 ); 1016 m_pcPicAvail->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() ); 1017 m_pcPicAvail->getCurrSlice()->setSPS( m_apcSlicePilot->getSPS() ); 1018 m_pcPicAvail->getCurrSlice()->setPPS( m_apcSlicePilot->getPPS() ); 1019 m_pcPicAvail->getCurrSlice()->setPPSId( m_apcSlicePilot->getPPS()->getPPSId() ); 1020 m_pcPicAvail->getPicSym()->setNumColumnsMinus1( m_apcSlicePilot->getSPS()->getNumColumnsMinus1() ); 1021 m_pcPicAvail->getPicSym()->setNumRowsMinus1( m_apcSlicePilot->getSPS()->getNumRowsMinus1() ); 1022 m_pcPicAvail->getPicSym()->xCreateTComTileArray(); 1023 for (int i=0;i<m_pcPicAvail->getPicSym()->getNumberOfCUsInFrame();i++) 1024 { 1025 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 1026 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 1027 } 1028 #if DEPTH_MAP_GENERATION 1029 UInt uiPdm = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() ); 1030 Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 ); 1031 if( bNeedPrdDepthMapBuffer ) 1032 { 1033 m_pcPicAvail->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 1034 } 1035 #endif 1036 } 1037 } 1038 #endif 734 1039 735 1040 #if SONY_COLPIC_AVAILABILITY … … 759 1064 m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement ); 760 1065 #endif 1066 #if !QC_MULTI_DIS_CAN 1067 #if VSP_N 1068 #if VSP_SLICE_HEADER 1069 if( m_apcSlicePilot->getVspFlag() ) 1070 #endif 1071 { 1072 UInt uiPdm = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() ); 1073 Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 ); 1074 if( bNeedPrdDepthMapBuffer ) 1075 { 1076 if( m_pcPicVSP && m_pcPicVSP->getPredDepthMap() ) 1077 { 1078 m_cDepthMapGenerator.clearDepthMap( m_pcPicVSP ); 1079 } 1080 if( m_pcPicAvail && m_pcPicAvail->getPredDepthMap() ) 1081 { 1082 m_cDepthMapGenerator.clearDepthMap( m_pcPicAvail ); 1083 } 1084 } 1085 } 1086 #endif 1087 #endif 761 1088 } 762 1089 … … 973 1300 974 1301 std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() ); 1302 #if VSP_N 1303 Bool bUseVsp = (m_viewId!=0); 1304 #if VSP_TEXT_ONLY 1305 if( m_isDepth ) bUseVsp = false; 1306 #endif 1307 #if VSP_SLICE_HEADER 1308 if( !pcSlice->getVspFlag() ) bUseVsp = false; 1309 #endif 1310 1311 #if VSP_SLICE_HEADER 1312 if( bUseVsp ) 1313 #endif 1314 m_pcPicVSP->getCurrSlice()->setPOC( pcPic->getPOC() ); 1315 1316 pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics, bUseVsp ? m_pcPicVSP : NULL ); 1317 1318 #else 975 1319 pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics ); 1320 #endif 976 1321 977 1322 // For generalized B … … 1068 1413 #endif 1069 1414 1415 #if VSP_N 1416 if( m_pcCamParsCollector ) 1417 { 1418 m_pcCamParsCollector->setSlice( pcSlice ); 1419 } 1420 #if VSP_SLICE_HEADER 1421 if( pcSlice->getVspFlag() ) 1422 #endif 1423 if( getTAppDecTop()->getUseDepth() ) 1424 { 1425 getTAppDecTop()->storeVSPInBuffer( m_pcPicVSP, m_pcPicAvail, pcSlice->getViewId(), pcSlice->getSPS()->getViewOrderIdx(), pcSlice->getPOC(), m_isDepth ); 1426 } 1427 #endif 1428 1070 1429 // Decode a picture 1071 1430 m_cGopDecoder.decompressGop(nalu.m_Bitstream, pcPic, false); … … 1108 1467 #if LCU_SYNTAX_ALF 1109 1468 m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 1469 #endif 1470 1471 #if VSP_N 1472 if( !sps->isDepth() && sps->getViewId() == 0 && getTAppDecTop()->getVSPRendererTop() ) 1473 { 1474 #if NTT_SUBPEL 1475 getTAppDecTop()->getVSPRendererTop()->init( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 5, 1, 0, 6 ); 1476 #else 1477 getTAppDecTop()->getVSPRendererTop()->init( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 ); 1478 #endif 1479 } 1110 1480 #endif 1111 1481 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.h
r100 r166 77 77 Bool isInitialized() const { return m_bInitialized; } 78 78 79 #if VSP_N 80 Double**** getBaseViewShiftLUTD () { return m_adBaseViewShiftLUT; } 81 Int**** getBaseViewShiftLUTI () { return m_aiBaseViewShiftLUT; } 82 Int** getBaseViewOffsetI () { return m_aaiCodedOffset; } 83 Int** getBaseViewScaleI () { return m_aaiCodedScale; } 84 Bool getNearestBaseView ( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft); 85 #if NTT_SUBPEL 86 Int**** getBaseViewIPelLUT () { return m_aiBaseViewShiftLUT_ipel; } 87 Int**** getBaseViewFPosLUT () { return m_aiBaseViewShiftLUT_fpos; } 88 #endif 89 #endif 90 79 91 private: 80 92 Bool xIsComplete (); … … 94 106 Int m_iLastPOC; 95 107 UInt m_uiMaxViewId; 108 109 #if VSP_N 110 UInt m_uiBitDepthForLUT; 111 UInt m_iLog2Precision; 112 UInt m_uiInputBitDepth; 113 // look-up tables 114 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT 115 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT 116 Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT); 117 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT); 118 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ); 119 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2 ); 120 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 121 122 #if NTT_SUBPEL 123 Int**** m_aiBaseViewShiftLUT_ipel; ///< Disparity LUT 124 Int**** m_aiBaseViewShiftLUT_fpos; ///< Disparity LUT 125 Void xCreateLUTs_Subpel ( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ); 126 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Int****& raiLUT_ipel, Int****& raiLUT_fpos); 127 #endif 128 #endif 96 129 }; 130 131 #if VSP_N 132 template <class T> 133 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ) 134 { 135 if( rpt ) 136 { 137 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 138 { 139 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 140 { 141 for( UInt uiM = 0; uiM < uiSize3; uiM++ ) 142 { 143 delete[] rpt[ uiK ][ uiL ][ uiM ]; 144 } 145 delete[] rpt[ uiK ][ uiL ]; 146 } 147 delete[] rpt[ uiK ]; 148 } 149 delete[] rpt; 150 } 151 rpt = NULL; 152 }; 153 154 155 template <class T> 156 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 ) 157 { 158 if( rpt ) 159 { 160 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 161 { 162 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 163 { 164 delete[] rpt[ uiK ][ uiL ]; 165 } 166 delete[] rpt[ uiK ]; 167 } 168 delete[] rpt; 169 } 170 rpt = NULL; 171 }; 172 173 174 template <class T> 175 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize ) 176 { 177 if( rpt ) 178 { 179 for( UInt uiK = 0; uiK < uiSize; uiK++ ) 180 { 181 delete[] rpt[ uiK ]; 182 } 183 delete[] rpt; 184 } 185 rpt = NULL; 186 }; 187 #endif 97 188 98 189 /// decoder class … … 155 246 NalUnitType m_nalUnitTypeBaseView; 156 247 248 #if VSP_N 249 TComPic* m_pcPicVSP; //view synthesis prediction buffer for current POC to be coded 250 TComPic* m_pcPicAvail; 251 #endif 252 157 253 public: 158 254 TDecTop(); … … 195 291 TAppDecTop* getTAppDecTop() { return m_tAppDecTop; } 196 292 NalUnitType getNalUnitTypeBaseView() { return m_nalUnitTypeBaseView; } 293 294 #if VSP_N 295 TComPic* getVSPBuf() { return m_pcPicVSP; } 296 #endif 197 297 198 298 protected:
Note: See TracChangeset for help on using the changeset viewer.