Changeset 28 in 3DVCSoftware for branches/0.3-poznan-univ/source/App/TAppDecoder
- Timestamp:
- 24 Feb 2012, 20:22:58 (13 years ago)
- Location:
- branches/0.3-poznan-univ/source/App/TAppDecoder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp
r21 r28 64 64 // m_iPOCLastDisplay = -1; 65 65 m_pScaleOffsetFile = 0; 66 67 #if POZNAN_MP 68 m_pcMP = NULL; 69 #endif 66 70 } 67 71 … … 71 75 72 76 m_apcBitstream->create( BITS_BUF_SIZE ); 77 78 #if POZNAN_MP 79 m_pcMP = new TComMP(); 80 #endif 73 81 } 74 82 … … 89 97 free(m_pchReconFile); 90 98 } 99 100 #if POZNAN_MP 101 if(m_pcMP) { delete m_pcMP; m_pcMP = NULL; }; 102 #endif 91 103 } 92 104 … … 163 175 if( eNalUnitType == NAL_UNIT_SPS ) 164 176 { 177 #if POZNAN_SYNTH 178 if(cComSPS.getViewId()==0 && !cComSPS.isDepth()) // it should be called at first view at the begining of the stream 179 initRenderer(cComSPS); 180 #endif 165 181 if( cComSPS.isDepth() && (m_bUsingDepth==false) ) // expected not using depth, but bitstream are using depth 166 182 { // know from sps … … 415 431 if ( m_pchReconFile ) 416 432 { 433 434 #if POZNAN_NONLINEAR_DEPTH 435 TComSPS* pcSPS = pcPic->getSlice(0)->getSPS(); 436 TComPicYuv cPicPower; 437 438 //pcPic->getPicYuvRec() 439 cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() ); 440 441 pcPic->getPicYuvRec()->nonlinearDepthBackward(&cPicPower, pcSPS->getDepthPower()); 442 443 m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write(&cPicPower, pcSPS->getPad()); 444 cPicPower.destroy(); 445 #else 417 446 m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPic->getPicYuvRec(), pcPic->getSlice(0)->getSPS()->getPad() ); 447 #endif 418 448 } 419 449 … … 542 572 return pcRefPic; 543 573 } 574 575 #if POZNAN_SYNTH 576 Void TAppDecTop::initRenderer(TComSPS &cComSPS) 577 { 578 m_cAvailabilityRenderer.init(cComSPS.getWidth(), cComSPS.getHeight(),true,0,LOG2_DISP_PREC_LUT,true, 0,0,0,0,0,6,4,1,0,6 ); //GT: simplest configuration 579 } 580 //* 581 Void TAppDecTop::storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth) 582 { 583 Int iLeftViewIdx = -1; 584 Int iRightViewIdx = -1; 585 Int iNearestViewIdx = -1; 586 Bool bRenderFromLeft; 587 588 Int iRelDistToLeft = 128; 589 if(iCoddedViewIdx==0) //First on View Coded List 590 { 591 //TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 592 return; 593 } 594 iNearestViewIdx = 0; 595 //bRenderFromLeft = iCoddedViewOrderIdx>0?true:false; 596 //bRenderFromLeft = iCoddedViewOrderIdx<0?true:false; 597 //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 598 bRenderFromLeft = iCoddedViewIdx>1?true:false; 599 600 m_cAvailabilityRenderer.setShiftLUTs( 601 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 602 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 603 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 604 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 605 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 606 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 607 iRelDistToLeft 608 ); 609 610 TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, bDepth ); 611 612 TComPicYuv* pcPicYuvSynthView = pcPic->getPicYuvSynth(); 613 TComPicYuv* pcPicYuvAvailView = pcPic->getPicYuvAvail(); 614 if(!pcPicYuvSynthView) 615 { 616 pcPic->addSynthesisBuffer(); 617 pcPicYuvSynthView = pcPic->getPicYuvSynth(); 618 } 619 if(!pcPicYuvAvailView) 620 { 621 pcPic->addAvailabilityBuffer(); 622 pcPicYuvAvailView = pcPic->getPicYuvAvail(); 623 } 624 // usun i uzyj syntezy Krzysztofa tylko przesun ja przed dekodowanie tekstury to do 625 /* 626 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 627 if(!bDepth) 628 { 629 TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 630 if(!pcPicYuvSynthDepthView) 631 { 632 pcPic->addSynthesisDepthBuffer(); 633 pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 634 } 635 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPicYuvAvailView, bRenderFromLeft ); 636 637 #if POZNAN_OUTPUT_SYNTH 638 Char acFilenameBaseD[1024]; 639 //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false"); 640 ::sprintf( acFilenameBaseD, "SynthInputDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 641 getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0); 642 ::sprintf( acFilenameBaseD, "SynthDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 643 pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0); 644 #endif 645 } 646 #endif//*/ 647 648 //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft ); 649 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, bDepth )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft ); 650 651 pcPicYuvAvailView->setBorderExtension( false );//Needed?? 652 pcPicYuvAvailView->extendPicBorder();//Needed?? 653 654 #if POZNAN_OUTPUT_AVAILABLE_MAP 655 { 656 Char acFilenameBase[1024]; 657 ::sprintf( acFilenameBase, "Available_%s_%s_V%d.yuv", (bDepth ? "Depth":"Tex"),( true ? "Dec" : "Enc" ), iCoddedViewIdx); 658 pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0); 659 } 660 #endif 661 #if POZNAN_OUTPUT_SYNTH 662 { 663 Char acFilenameBase[1024]; 664 ::sprintf( acFilenameBase, "Synth_%s_%s_V%d.yuv", (bDepth ? "Depth":"Tex"),( true ? "Dec" : "Enc" ), iCoddedViewIdx ); 665 pcPicYuvSynthView->dump(acFilenameBase, iCurPoc!=0); 666 } 667 #endif 668 } 669 #endif 670 671 //* 672 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 673 Void TAppDecTop::storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc) 674 { 675 Int iLeftViewIdx = -1; 676 Int iRightViewIdx = -1; 677 Int iNearestViewIdx = -1; 678 Bool bRenderFromLeft; 679 680 Int iRelDistToLeft = 128; 681 if(iCoddedViewIdx==0) //First on View Coded List 682 { 683 //TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 684 return; 685 } 686 iNearestViewIdx = 0; 687 //bRenderFromLeft = iCoddedViewOrderIdx>0?true:false; 688 //bRenderFromLeft = iCoddedViewOrderIdx<0?true:false; 689 //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 690 bRenderFromLeft = iCoddedViewIdx>1?true:false; 691 692 m_cAvailabilityRenderer.setShiftLUTs( 693 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 694 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 695 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 696 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 697 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 698 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 699 iRelDistToLeft 700 ); 701 702 TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 703 704 TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 705 if(!pcPicYuvSynthDepthView) 706 { 707 pcPic->addSynthesisDepthBuffer(); 708 pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth(); 709 } 710 711 Int iWidth = pcPicYuvSynthDepthView->getWidth (); 712 Int iHeight = pcPicYuvSynthDepthView->getHeight (); 713 UInt uiMaxCuWidth = pcPicYuvSynthDepthView->getMaxCuWidth (); 714 UInt uiMaxCuHeight = pcPicYuvSynthDepthView->getMaxCuHeight(); 715 UInt uiMaxCuDepth = pcPicYuvSynthDepthView->getMaxCuDepth (); 716 717 TComPicYuv* pcPicYuvAvailView = new TComPicYuv; 718 pcPicYuvAvailView->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 719 720 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPicYuvAvailView, bRenderFromLeft ); 721 722 pcPicYuvAvailView->destroy(); 723 delete pcPicYuvAvailView; 724 725 #if POZNAN_OUTPUT_SYNTH 726 Char acFilenameBaseD[1024]; 727 //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false"); 728 ::sprintf( acFilenameBaseD, "SynthInputDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 729 getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0); 730 ::sprintf( acFilenameBaseD, "SynthDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx ); 731 pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0); 732 #endif 733 734 } 735 #endif//*/ -
branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.h
r21 r28 52 52 #include "../../Lib/TLibCommon/TComDepthMapGenerator.h" 53 53 #include "../../Lib/TLibDecoder/TDecTop.h" 54 #if POZNAN_SYNTH 55 #include "../../Lib/TLibRenderer/TRenTop.h" 56 #endif 54 57 #include "TAppDecCfg.h" 58 59 #if POZNAN_MP 60 #include "../../Lib/TLibCommon/TComMP.h" 61 #endif 55 62 56 63 // ==================================================================================================================== … … 87 94 #endif 88 95 96 #if POZNAN_SYNTH 97 TRenTop m_cAvailabilityRenderer; 98 #endif 99 100 #if POZNAN_MP 101 TComMP* m_pcMP; 102 #endif 103 89 104 public: 90 105 TAppDecTop(); … … 97 112 Void startUsingDepth() ; 98 113 99 // GT FIX 114 #if POZNAN_SYNTH 115 Void initRenderer(TComSPS &cComSPS); 116 Void storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx,Int iCurPoc,Bool bDepth); 117 #endif 118 119 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 120 Void storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc); 121 #endif 122 123 // GT FIX 100 124 std::vector<TComPic*> getSpatialRefPics( Int iViewIdx, Int iPoc, Bool bIsDepth ); 101 125 TComPic* getPicFromView( Int iViewIdx, Int iPoc, bool bDepth ); … … 106 130 TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; } 107 131 TDecTop* getDecTop0 () { return m_acTDecTopList[0]; } 132 #endif 133 134 #if POZNAN_MP 135 TComMP* getMP() { return m_pcMP; } 108 136 #endif 109 137
Note: See TracChangeset for help on using the changeset viewer.