Changeset 28 in 3DVCSoftware for branches/0.3-poznan-univ/source/App


Ignore:
Timestamp:
24 Feb 2012, 20:22:58 (13 years ago)
Author:
poznan-univ
Message:

Poznan Tools

  • Encoding only disoccluded CUs in depended views
  • Depth based motion prediction
  • Texture QP adjustment based on depth data
  • Nonlinear depth representation
Location:
branches/0.3-poznan-univ/source/App
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.cpp

    r21 r28  
    7676
    7777      radLUT        [ uiSourceView ][ uiTargetView ]      = new Double*[ 2 ];
    78       radLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ];
    79       radLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ];
     78      radLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ SizeOfLUT+1 ];
     79      radLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ SizeOfLUT+1 ];
    8080
    8181      raiLUT        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
    82       raiLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
    83       raiLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     82      raiLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ SizeOfLUT+1 ];
     83      raiLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ SizeOfLUT+1 ];
    8484    }
    8585  }
     
    877877      radShiftParams[ uiSourceView][ uiTargetView ][ 1 ] = dOffset;
    878878
    879       for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ )
    880       {
     879#if POZNAN_NONLINEAR_DEPTH
     880      TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0);
     881#endif
     882
     883      for( UInt uiDepthValue = 0; uiDepthValue < SizeOfLUT; uiDepthValue++ )
     884      {
     885        Double  dDepthValue = (Double)uiDepthValue;
     886        Int64   iDepthValue = (Int64)uiDepthValue;
     887#if POZNAN_NONLINEAR_DEPTH
     888        dDepthValue = cNonlinearDepthBwd(dDepthValue);
     889        iDepthValue = (Int64)(dDepthValue+0.5);
     890#endif
     891#if POZNAN_LUT_INCREASED_PRECISION
     892        dDepthValue /= (1<<g_uiBitIncrement);
     893#endif
    881894        // real-valued look-up tables
    882         Double  dShiftLuma      = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );
     895
     896        Double  dShiftLuma      = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );
    883897        Double  dShiftChroma    = dShiftLuma / 2;
    884898        radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma;
     
    886900
    887901        // integer-valued look-up tables
    888         Int64   iTempScale      = (Int64)uiDepthValue * iScale;
     902        Int64   iTempScale      = iDepthValue * iScale;
     903#if POZNAN_LUT_INCREASED_PRECISION
     904        iTempScale >>= g_uiBitIncrement;
     905#endif
    889906        Int64   iTestScale      = ( iTempScale + iOffset       );   // for checking accuracy of camera parameters
    890907        Int64   iShiftLuma      = ( iTempScale + iOffsetLuma   ) >> iLog2DivLuma;
     
    899916      }
    900917
    901       radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
    902       radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
    903       raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
    904       raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     918      radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ];
     919      radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ];
     920      raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ];
     921      raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ];
    905922    }
    906923  }
     
    12351252                      Char*  pchSynthViewNumbers,
    12361253                      std::vector<Int>* paiSynthViewNumbers,
    1237                       Int    iLog2Precision )
     1254                      Int    iLog2Precision
     1255#if POZNAN_NONLINEAR_DEPTH
     1256                      ,Float fDepthPower
     1257#endif
     1258                      )
    12381259{
    12391260  //===== set miscellaneous variables =====
     
    12431264  m_uiCamParsCodedPrecision = uiCodedCamParsPrecision;
    12441265  m_iLog2Precision          = iLog2Precision;
     1266
     1267#if POZNAN_NONLINEAR_DEPTH
     1268  m_fDepthPower             = fDepthPower;
     1269#endif
    12451270
    12461271  xReadCameraParameterFile( pchCfgFileName );
     
    14601485}
    14611486
     1487#if POZNAN_SYNTH
     1488Bool
     1489TAppComCamPara::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft)
     1490{
     1491  riNearestViewIdx = 0;
     1492
     1493  Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] );
     1494  Int  iFactor       = ( bDecencdingVN ? -1 : 1 );
     1495
     1496  if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor  <= 0 )
     1497  {
     1498    rbRenderFromLeft = true;
     1499  }
     1500  else
     1501  {
     1502    rbRenderFromLeft = false;
     1503  }
     1504
     1505  riRelDistToLeft = 128; //Not used for now;
     1506
     1507  return true;
     1508}
     1509#endif
     1510
     1511
     1512
    14621513Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx )
    14631514{
     
    14741525  return xGetViewId(m_aiRelSynthViewsNum, iRelNum );
    14751526}
     1527
     1528
     1529#if POZNAN_MP
     1530Bool
     1531TAppComCamPara::isLeftView( Int iSynthViewIdx, Int iNearestViewIdx)
     1532{
     1533  Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] );
     1534  Int  iFactor       = ( bDecencdingVN ? -1 : 1 );
     1535
     1536  if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[iNearestViewIdx] ) * iFactor  <= 0 ) return true;
     1537  else return false;
     1538}
     1539#endif
  • branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.h

    r5 r28  
    104104  Int****             m_aiSynthViewShiftLUT;                                                                    ///< Disparity LUT
    105105
     106#if POZNAN_NONLINEAR_DEPTH
     107  Float               m_fDepthPower;
     108#endif
    106109
    107110protected:
     
    161164                Char*   pchSynthViewNumbers,
    162165                std::vector<Int>* paiSynthViewNumbers,
    163                 Int     iLog2Precision );
     166                Int     iLog2Precision
     167#if POZNAN_NONLINEAR_DEPTH
     168                ,Float  fDepthPower
     169#endif
     170                );
    164171
    165172  Void init   ( UInt    uiInputBitDepth,
     
    170177                std::vector<Int>* paiSynthViewNumbers,
    171178                Int     iLog2Precision
     179#if POZNAN_NONLINEAR_DEPTH
     180                ,Float  fDepthPower
     181#endif
    172182              );
    173183
     
    182192  Int                 synthRelNum2Idx           ( Int iRelNum );
    183193  Bool getLeftRightBaseView( Int iSynthViewIdx, Int &riLeftViewIdx, Int &riRightViewIdx, Int &riRelDistToLeft, Bool& rbIsBaseView );
     194#if POZNAN_SYNTH
     195  Bool getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft);
     196#endif
     197
    184198  Int                 getRelDistLeft            ( Int iSynthViewIdx, Int   iLeftViewIdx, Int iRightViewIdx );
    185199  UInt                getCurFrameId             ()  { return m_iCurrentFrameId;   }
    186200  static Void         convertNumberString       ( Char* pchViewNumberString, std::vector<Int>& raiViewNumbers, Double dViewNumPrec );
     201
     202#if POZNAN_MP
     203  Bool isLeftView( Int iSynthViewIdx, Int iNearestViewIdx);
     204#endif
    187205
    188206  // function for getting parameters and parameter arrays
  • branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp

    r21 r28  
    6464//  m_iPOCLastDisplay  = -1;
    6565  m_pScaleOffsetFile  = 0;
     66
     67#if POZNAN_MP
     68  m_pcMP = NULL;
     69#endif
    6670}
    6771
     
    7175 
    7276  m_apcBitstream->create( BITS_BUF_SIZE );
     77
     78#if POZNAN_MP
     79  m_pcMP = new TComMP();
     80#endif
    7381}
    7482
     
    8997    free(m_pchReconFile);
    9098  }
     99
     100#if POZNAN_MP
     101  if(m_pcMP) { delete m_pcMP; m_pcMP = NULL; };
     102#endif
    91103}
    92104
     
    163175    if( eNalUnitType == NAL_UNIT_SPS )
    164176    {
     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
    165181      if( cComSPS.isDepth() && (m_bUsingDepth==false) )  // expected not using depth, but bitstream are using depth
    166182      {                                                     // know from sps
     
    415431        if ( m_pchReconFile )
    416432        {
     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
    417446          m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPic->getPicYuvRec(), pcPic->getSlice(0)->getSPS()->getPad() );
     447#endif
    418448        }
    419449
     
    542572  return pcRefPic;
    543573}
     574
     575#if POZNAN_SYNTH
     576Void 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//*
     581Void 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
     673Void 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  
    5252#include "../../Lib/TLibCommon/TComDepthMapGenerator.h"
    5353#include "../../Lib/TLibDecoder/TDecTop.h"
     54#if POZNAN_SYNTH
     55#include "../../Lib/TLibRenderer/TRenTop.h"
     56#endif
    5457#include "TAppDecCfg.h"
     58
     59#if POZNAN_MP
     60#include "../../Lib/TLibCommon/TComMP.h"
     61#endif
    5562
    5663// ====================================================================================================================
     
    8794#endif
    8895
     96#if POZNAN_SYNTH
     97  TRenTop                         m_cAvailabilityRenderer;
     98#endif
     99
     100#if POZNAN_MP
     101  TComMP*                                                 m_pcMP;
     102#endif
     103
    89104public:
    90105  TAppDecTop();
     
    97112  Void  startUsingDepth() ;
    98113
    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
    100124  std::vector<TComPic*> getSpatialRefPics( Int iViewIdx, Int iPoc, Bool bIsDepth );
    101125  TComPic* getPicFromView( Int iViewIdx, Int iPoc, bool bDepth );
     
    106130  TComAUPicAccess*  getAUPicAccess() { return &m_cAUPicAccess; }
    107131  TDecTop*          getDecTop0    () { return m_acTDecTopList[0]; }
     132#endif
     133
     134#if POZNAN_MP
     135  TComMP* getMP() { return m_pcMP; }
    108136#endif
    109137
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.cpp

    r21 r28  
    341341#endif
    342342
     343#if POZNAN_DBMP
     344  ("DBMP",  m_uiDBMP,    (UInt)0, "usage of Depth-Based Motion Prediction" )
     345#endif
     346
     347#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     348  ("CUSkip",  m_uiUseCUSkip,    (UInt)1, "encode only disoccluded CUs in dependend view" )
     349#endif
     350
    343351  ("QpChangeFrame", m_iQpChangeFrame, PicOrderCnt(0), "start frame for QP change")
    344352  ("QpChangeOffsetVideo", m_iQpChangeOffsetVideo, 0, "QP change offset for video")
     
    350358#endif
    351359#endif
     360#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     361  ("TDdQP", m_bUseTexDqpAccordingToDepth, false, "texture TU blocks QP param modification according to depth map's values")
     362#endif
     363#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     364  ("TDdQPOffset",              m_dTexDqpAccordingToDepthOffset,       (Double)(-2.6), "texture block QP changing tool based on coresponding depth block values - offset parameter" )
     365  ("TDdQPMul",                 m_dTexDqpAccordingToDepthMul,          (Double)(1),    "texture block QP changing tool based on coresponding depth block values - multiplicative parameter" )
     366  ("TDdQPTopBottomRow",        m_iTexDqpAccordingToDepthTopBottomRow, (Int)2,         "texture block QP changing tool - top and bottom CU rows delta QP parameter" )
     367#endif
     368#if POZNAN_NONLINEAR_DEPTH
     369  ("DepthPower,-dpow",    m_fDepthPower,      (Double)1.0, "Depth power value (for non-linear processing)")
     370#endif
     371
    352372
    353373  /* Compatability with old style -1 FOO or -0 FOO options. */
     
    437457#endif
    438458
     459#if POZNAN_NONLINEAR_DEPTH
     460if (m_fDepthPower<=0)
     461  {
     462    Float fDepthQP = m_adQP[ m_adQP.size()  < 2 ? 0 : 1];
     463    m_fDepthPower = (fDepthQP-30) *0.25/20.0 + 1.25;
     464    if (m_fDepthPower<=1.0) m_fDepthPower = 1.0;
     465    // QP = 30 = 1.25
     466    // QP = 50 = 1.5
     467    if (m_fDepthPower>=1.66) m_fDepthPower = 1.66;
     468  };
     469
     470#if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE
     471  m_fDepthPower = dequantizeDepthPower(quantizeDepthPower((Float)m_fDepthPower));
     472#endif
     473
     474#endif
     475
    439476  xCleanUpVectors();
    440477
     
    516553                                      NULL,
    517554                                      m_cRenModStrParser.getSynthViews(),
    518                                       LOG2_DISP_PREC_LUT );
     555                                      LOG2_DISP_PREC_LUT
     556#if POZNAN_NONLINEAR_DEPTH                                     
     557                                      ,m_fDepthPower
     558#endif
     559                                      );
    519560}
    520561else if ( m_bUseVSO && m_uiVSOMode != 4 )
     
    529570                                      m_pchVSOConfig,
    530571                                      NULL,
    531                                       LOG2_DISP_PREC_LUT );
     572                                      LOG2_DISP_PREC_LUT
     573#if POZNAN_NONLINEAR_DEPTH                                     
     574                                      ,m_fDepthPower
     575#endif                                     
     576                                      );
    532577}
    533578else
     
    542587    NULL,
    543588    NULL,
    544     LOG2_DISP_PREC_LUT );
     589    LOG2_DISP_PREC_LUT
     590#if POZNAN_NONLINEAR_DEPTH                                     
     591    ,m_fDepthPower
     592#endif   
     593    );
    545594}
    546595#else
     
    554603    NULL,
    555604    NULL,
    556     LOG2_DISP_PREC_LUT );
     605    LOG2_DISP_PREC_LUT
     606#if POZNAN_NONLINEAR_DEPTH                                     
     607    ,m_fDepthPower
     608#endif   
     609    );
    557610#endif
    558611
     
    665718#endif
    666719
     720#if POZNAN_DBMP
     721  xConfirmPara    ( m_uiDBMP > 1,                                                                                                       "DBMP must be less than or equal to 1" );
     722#endif
     723
     724#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     725  xConfirmPara    ( m_uiUseCUSkip > 1,                                                                                          "CU-Skip must be less than or equal to 1" );
     726#endif
     727
    667728#if HHI_INTERVIEW_SKIP
    668729  xConfirmPara    ( m_uiInterViewSkip > 1,                                        "RenderingSkipMode > 1 not supported" );
     
    933994#if MTK_SAO
    934995#endif
     996
     997#if POZNAN_MP
     998  printf("POZNAN_MP(1){ ");
     999
     1000#if POZNAN_MP_USE_DEPTH_MAP_GENERATION
     1001  printf("dmg=1 ");
     1002#else
     1003  printf("dmg=0 ");
     1004#endif
     1005
     1006#if POZNAN_MP_FILL
     1007  printf("fill=%d ",POZNAN_MP_FILL_TYPE);
     1008#else
     1009  printf("fill=- ");
     1010#endif
     1011
     1012#if POZNAN_DBMP
     1013  printf("DBMP:%d ", m_uiDBMP);
     1014  if(m_uiDBMP)
     1015  {   
     1016        printf("cand=%d ",POZNAN_DBMP_MERGE_POS);
     1017#if POZNAN_DBMP_CALC_PRED_DATA
     1018        printf("pr=1 ");
     1019#else
     1020        printf("pr=0 ");
     1021#endif
     1022#if POZNAN_DBMP_COMPRESS_ME_DATA
     1023        printf("comp=1 ");
     1024#else
     1025        printf("comp=0 ");
     1026#endif
     1027#if POZNAN_DBMP_USE_IN_NONANCHOR_PIC_ONLY
     1028        printf("na=1 ");
     1029#else
     1030        printf("na=0 ");
     1031#endif
     1032  }
     1033#endif
     1034  printf("} ");
     1035#endif
     1036
     1037#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     1038  printf("CU-Skip:%d ", m_uiUseCUSkip);
     1039#endif
     1040
    9351041  printf("\n");
    9361042  printf("TOOL CFG VIDEO  : ");
     
    9381044  printf("SAO:%d ", (m_abUseSAO [0] ? 1 : 0));
    9391045  printf("RDQ:%d ", (m_abUseRDOQ[0] ? 1 : 0) );
     1046#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1047  printf("TDdQP:%d ", m_bUseTexDqpAccordingToDepth);
     1048#endif
     1049
    9401050  printf("\n");
    9411051
     
    9521062#if HHI_MPI
    9531063  printf("MVI:%d ", m_bUseMVI ? 1 : 0 );
     1064#endif
     1065#if POZNAN_NONLINEAR_DEPTH
     1066  printf("DepthPower:%f ", m_fDepthPower);
    9541067#endif
    9551068  printf("\n");
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.h

    r5 r28  
    178178#endif
    179179
     180#if POZNAN_DBMP
     181  UInt      m_uiDBMP;                                                                               ///< using Depth-Based Motion Prediction
     182#endif
     183
     184#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     185  UInt      m_uiUseCUSkip;                                       ///< using CU-Skip - Encode only disoccluded CUs in dependend view
     186#endif
     187
    180188#if HHI_INTERVIEW_SKIP
    181189  UInt      m_uiInterViewSkip;                            ///< usage of interview skip mode ( do not transmit residual)
     
    246254#endif
    247255
     256#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     257  Bool      m_bUseTexDqpAccordingToDepth;                       ///< flag for using texture QP param modyfication according to depth map's values
     258#endif
    248259  // internal member functions
    249260  Void  xSetGlobal      ();                                   ///< set global variables
     
    271282  TRenModSetupStrParser       m_cRenModStrParser;
    272283#endif
     284
     285#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     286  Double                      m_dTexDqpAccordingToDepthOffset;
     287  Double                      m_dTexDqpAccordingToDepthMul;
     288  Int                         m_iTexDqpAccordingToDepthTopBottomRow;
     289#endif
     290
     291#if POZNAN_NONLINEAR_DEPTH
     292  Double    m_fDepthPower;                                                                        ///< Depth power value
     293#endif
     294
    273295public:
    274296
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp

    r21 r28  
    141141    m_acTEncTopList[iViewIdx]->setUseFastEnc                   ( m_bUseFastEnc  );
    142142
     143#if POZNAN_NONLINEAR_DEPTH
     144    m_acTEncTopList[iViewIdx]->setDepthPower                   ( (Float)m_fDepthPower );
     145#endif
     146
    143147#if HHI_VSO
    144148    m_acTEncTopList[iViewIdx]->setUseVSO                       ( false ); //GT: might be enabled later for VSO Mode 4
     
    167171#endif
    168172
     173#if POZNAN_DBMP
     174        m_acTEncTopList[iViewIdx]->setDBMP                           ( m_uiDBMP );
     175#endif
     176
     177#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     178        m_acTEncTopList[iViewIdx]->setUseCUSkip                         ( m_uiUseCUSkip );
     179#endif
    169180
    170181#if HHI_INTERVIEW_SKIP
     
    222233    m_acTEncTopList[iViewIdx]->setQpChangeOffsetVideo( m_iQpChangeOffsetVideo );
    223234    m_acTEncTopList[iViewIdx]->setQpChangeOffsetDepth( m_iQpChangeOffsetDepth );
     235
     236   
     237#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     238    m_acTEncTopList[iViewIdx]->setUseTexDqpAccordingToDepth      ( m_bUseTexDqpAccordingToDepth );
     239#endif
     240 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     241    m_acTEncTopList[iViewIdx]->setTexDqpAccordingToDepthOffset( m_dTexDqpAccordingToDepthOffset );
     242    m_acTEncTopList[iViewIdx]->setTexDqpAccordingToDepthMul( m_dTexDqpAccordingToDepthMul );
     243    m_acTEncTopList[iViewIdx]->setTexDqpAccordingToDepthTopBottomRow( m_iTexDqpAccordingToDepthTopBottomRow ); 
     244#endif
    224245  }
    225246  if( m_bUsingDepthMaps )
     
    382403      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
    383404#endif
     405#if POZNAN_DBMP
     406      m_acTEncDepthTopList[iViewIdx]->setDBMP                        ( m_uiDBMP );
     407#endif
     408#if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     409            m_acTEncDepthTopList[iViewIdx]->setUseCUSkip                      ( m_uiUseCUSkip );
     410#endif
     411#if POZNAN_NONLINEAR_DEPTH
     412      m_acTEncDepthTopList[iViewIdx]->setDepthPower                   ( (Float)m_fDepthPower );
     413#endif
    384414
    385415      m_acTEncDepthTopList[iViewIdx]->setPictureDigestEnabled(m_pictureDigestEnabled);
     
    435465#endif
    436466
     467#if POZNAN_SYNTH
     468  //m_cAvailabilityRenderer.init(m_iSourceWidth, m_iSourceHeight,true,0,0,true, 0,0,0,0,0,0,0,1,0,0 );  //GT: simplest configuration
     469  m_cAvailabilityRenderer.init(m_iSourceWidth, m_iSourceHeight,true,0,LOG2_DISP_PREC_LUT,true, 0,0,0,0,0,6,4,1,0,6 );  //GT: simplest configuration
     470#endif
     471
    437472#if HHI_INTERVIEW_SKIP
    438473  m_cUsedPelsRenderer.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 );
    439474#endif
     475
     476#if POZNAN_MP
     477#if POZNAN_MP_USE_DEPTH_MAP_GENERATION
     478  m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth);
     479#else
     480  //m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth, &m_cCameraData);
     481  m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth, m_cCameraData.getBaseViewShiftLUTI());
     482#endif
     483#endif
     484
    440485}
    441486
     
    485530
    486531  m_cTVideoIOBitsFile.closeBits();
     532
     533#if POZNAN_MP
     534  if (m_pcMP) { delete m_pcMP; m_pcMP=NULL; };
     535#endif
    487536
    488537#if HHI_VSO
     
    640689        {
    641690          m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcPdmDepthOrg, m_aiPad, m_bUsingDepthMaps );
     691#if POZNAN_NONLINEAR_DEPTH
     692                      pcPdmDepthOrg->nonlinearDepthForward(pcPdmDepthOrg, m_fDepthPower);                 
     693#endif
    642694        }
    643695#endif
     
    661713          // read input YUV file
    662714          m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcDepthPicYuvOrg, m_aiPad  ) ;
     715#if POZNAN_NONLINEAR_DEPTH
     716                      pcDepthPicYuvOrg->nonlinearDepthForward(pcDepthPicYuvOrg, m_fDepthPower);           
     717#endif
    663718          bDepthEos[iViewIdx] = ( m_acTVideoIOYuvDepthInputFileList[iViewIdx]->isEof() == 1 ?   true : false  );
    664719          bDepthEos[iViewIdx] = ( m_iDepthFrameRcvdVector[iViewIdx] == (m_iFrameToBeEncoded - 1) ?    true : bDepthEos[iViewIdx]   );
     
    692747    for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )     // Start encoding
    693748    {
     749#if POZNAN_SYNTH
     750      if( m_uiUseCUSkip )
     751      {
     752        xStoreSynthPicsInBuffer(iViewIdx,false);
     753      }
     754#endif
     755            //*
     756#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     757      if(m_bUseTexDqpAccordingToDepth)
     758      {
     759        xStoreDepthSynthPicsInBuffer(iViewIdx);
     760      }
     761#endif
     762      //*/
    694763      bool bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx];
    695764      m_acTEncTopList[iViewIdx]->encode( bEos[iViewIdx], m_cListPicYuvRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingPics );
     
    708777      if( m_bUsingDepthMaps )
    709778      {
     779#if POZNAN_SYNTH
     780        if( m_uiUseCUSkip )
     781        {
     782          xStoreSynthPicsInBuffer(iViewIdx,true);
     783        }
     784#endif
    710785        bool bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx];
    711786        m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics );
     
    9281003  {
    9291004    riNextPocToDump++;
     1005#if POZNAN_NONLINEAR_DEPTH
     1006    if(isDepth)
     1007    {
     1008      TComPicYuv *pcPicOrg = i->second;
     1009      TComPicYuv *pcPicPow = new TComPicYuv;
     1010      //pcPicYuvRec->createCompatibleAs(*iterPicYuvRec);
     1011      pcPicPow->create( pcPicOrg->getWidth(), pcPicOrg->getHeight(), pcPicOrg->getMaxCuWidth(), pcPicOrg->getMaxCuHeight(), pcPicOrg->getMaxCuDepth() );
     1012      //cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() );
     1013      pcPicOrg->nonlinearDepthBackward(pcPicPow, m_fDepthPower);               
     1014      rpcTVideoIOYuvReconFile->write( pcPicPow, m_aiPad );
     1015// to do destroy pcPicow
     1016    } else
     1017#endif
    9301018    rpcTVideoIOYuvReconFile->write( i->second, m_aiPad );
    9311019    rcMap.erase( i );
     
    11771265#endif
    11781266
     1267#if POZNAN_SYNTH
     1268Void TAppEncTop::xStoreSynthPicsInBuffer(Int iCoddedViewIdx,Bool bDepth)
     1269{
     1270  Int iCurPoc;
     1271  if(bDepth)
     1272  {
     1273    iCurPoc = m_acTEncDepthTopList[ iCoddedViewIdx ]->getNextFrameId();
     1274    if (!(m_acTEncDepthTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return;
     1275  }
     1276  else
     1277  {
     1278    iCurPoc = m_acTEncTopList[ iCoddedViewIdx ]->getNextFrameId();
     1279    if (!(m_acTEncTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return;
     1280  }
     1281 
     1282  Int iNumberOfReferenceViews = 0;
     1283  Int  iNearestViewIdx = -1;
     1284  Bool bRenderFromLeft;
     1285
     1286  Int iRelDistToLeft;
     1287  if(iCoddedViewIdx==0) //First on View Coded List
     1288  {
     1289    //TComPic* pcPic = xGetPicFromView( iCoddedViewIdx, iCurPoc, false );
     1290    return;
     1291  }
     1292  m_cCameraData.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft);
     1293
     1294  m_cAvailabilityRenderer.setShiftLUTs(
     1295    m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],
     1296    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1297    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1298    m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right
     1299    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1300    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1301    iRelDistToLeft
     1302  );
     1303   
     1304
     1305  TComPicYuv* pcPicYuvERView = new TComPicYuv;
     1306  pcPicYuvERView->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
     1307
     1308  TComPic* pcPic = xGetPicFromView( iCoddedViewIdx, iCurPoc, bDepth );
     1309  pcPic->addSynthesisBuffer();
     1310  pcPic->addAvailabilityBuffer();
     1311// usun to i wykorzystaj synteze która robi krzysztof dla glebi - tylko najpierw ja przeson przed kodowanie tekstury //to do
     1312  /*
     1313#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1314      if(!bDepth)
     1315      {
     1316      pcPic->addSynthesisDepthBuffer();
     1317      TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth();
     1318      m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPic->getPicYuvAvail(), bRenderFromLeft );
     1319#if POZNAN_OUTPUT_SYNTH
     1320      Char acFilenameBaseD[1024];
     1321      //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false");
     1322      ::sprintf( acFilenameBaseD,  "SynthInputDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1323      xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0);
     1324      ::sprintf( acFilenameBaseD,  "SynthDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1325      pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0);
     1326#endif
     1327      }
     1328#endif//*/
     1329  TComPicYuv* pcPicYuvSynthView = pcPic->getPicYuvSynth();
     1330  TComPicYuv* pcPicYuvAvailView = pcPic->getPicYuvAvail();
     1331 
     1332  //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft );
     1333  m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, bDepth )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft );
     1334     
     1335  pcPicYuvAvailView->setBorderExtension( false );//Needed??
     1336  pcPicYuvAvailView->extendPicBorder();//Needed??
     1337
     1338  pcPicYuvSynthView->setBorderExtension( false );//Needed??
     1339  pcPicYuvSynthView->extendPicBorder();//Needed??
     1340
     1341  //TComPic* pcPicDepth = xGetPicFromView( iCoddedViewIdx, iCurPoc, true );
     1342  //pcPicDepth->addAvailabilityBuffer();
     1343  //pcPicDepth->addSynthesisBuffer();
     1344  //pcPicYuvAvailView->copyToPic(pcPicDepth->getPicYuvAvail());
     1345     
     1346#if POZNAN_OUTPUT_AVAILABLE_MAP
     1347  {
     1348  Char acFilenameBase[1024];
     1349  ::sprintf( acFilenameBase,  "Available_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1350  pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0);
     1351  }
     1352#endif
     1353#if POZNAN_OUTPUT_SYNTH
     1354  {
     1355  Char acFilenameBase[1024];
     1356  ::sprintf( acFilenameBase,  "Synth_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1357  pcPicYuvERView->dump(acFilenameBase, iCurPoc!=0);
     1358  }
     1359#endif
     1360
     1361      //Usun pcPicYuvERView i inne bufforki
     1362}
     1363#endif
     1364
     1365//*
     1366#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1367Void TAppEncTop::xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx)
     1368{
     1369  Int  iLeftViewIdx  = -1;
     1370  Int  iRightViewIdx = -1;
     1371  Int  iNearestViewIdx = -1;
     1372  Bool bRenderFromLeft;
     1373
     1374  Int iCurPoc = m_acTEncTopList[ iCoddedViewIdx ]->getNextFrameId();
     1375  if (!(m_acTEncTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return;
     1376
     1377  Int iRelDistToLeft = 128;
     1378  if(iCoddedViewIdx==0) //First on View Coded List
     1379  {
     1380    //TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false );
     1381    return;
     1382  }
     1383  iNearestViewIdx = 0;
     1384  //bRenderFromLeft = iCoddedViewOrderIdx>0?true:false;
     1385  //bRenderFromLeft = iCoddedViewOrderIdx<0?true:false;
     1386  //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft);
     1387  bRenderFromLeft = iCoddedViewIdx>1?true:false;
     1388
     1389  m_cAvailabilityRenderer.setShiftLUTs(
     1390    m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],
     1391    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1392    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1393    m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right
     1394    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1395    m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1396    iRelDistToLeft
     1397  );
     1398
     1399  TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false );
     1400
     1401  TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth();
     1402  if(!pcPicYuvSynthDepthView)
     1403  {
     1404    pcPic->addSynthesisDepthBuffer();
     1405    pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth();
     1406  }
     1407 
     1408  Int   iWidth        = pcPicYuvSynthDepthView->getWidth      ();
     1409  Int   iHeight       = pcPicYuvSynthDepthView->getHeight     ();
     1410  UInt  uiMaxCuWidth  = pcPicYuvSynthDepthView->getMaxCuWidth ();
     1411  UInt  uiMaxCuHeight = pcPicYuvSynthDepthView->getMaxCuHeight();
     1412  UInt  uiMaxCuDepth  = pcPicYuvSynthDepthView->getMaxCuDepth ();
     1413
     1414  TComPicYuv* pcPicYuvAvailView = new TComPicYuv;
     1415  pcPicYuvAvailView->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
     1416
     1417  m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPicYuvAvailView, bRenderFromLeft );
     1418 
     1419  pcPicYuvAvailView->destroy();
     1420  delete pcPicYuvAvailView;
     1421
     1422#if POZNAN_OUTPUT_SYNTH
     1423      Char acFilenameBaseD[1024];
     1424      //printf("\niNearestViewIdx: %d, iCurPoc: %d, bRenderFromLeft: %s\n", iNearestViewIdx, iCurPoc, (bRenderFromLeft)?"true":"false");
     1425      ::sprintf( acFilenameBaseD,  "SynthInputDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1426      getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec()->dump(acFilenameBaseD, iCurPoc!=0);
     1427      ::sprintf( acFilenameBaseD,  "SynthDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1428      pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0);
     1429#endif
     1430 
     1431}
     1432#endif//*/
     1433
     1434
    11791435#if HHI_INTERVIEW_SKIP
    11801436Void TAppEncTop::getUsedPelsMap( Int iViewIdx, Int iPoc, TComPicYuv* pcPicYuvUsedSplsMap )
  • branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.h

    r5 r28  
    5151//GT VSO end
    5252
     53#if POZNAN_MP
     54#include "../../Lib/TLibCommon/TComMP.h"
     55#endif 
     56
    5357// ====================================================================================================================
    5458// Class definition
     
    9296#endif
    9397
     98#if POZNAN_SYNTH
     99  TRenTop                     m_cAvailabilityRenderer;
     100#endif
     101
     102#if POZNAN_MP
     103  TComMP*                                 m_pcMP;
     104#endif
    94105protected:
    95106  // initialization
     
    145156#endif
    146157
     158#if POZNAN_MP
     159  TComMP* getMP() {return m_pcMP;}
     160#endif
     161
    147162#if HHI_VSO
    148163private:
     
    155170#endif
    156171 
     172
     173#if POZNAN_SYNTH
     174private:
     175  Void  xStoreSynthPicsInBuffer(Int iCoddedViewIdx, Bool bDepth);
     176#endif
     177
     178#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     179private:
     180  Void xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx);
     181#endif
     182
    157183};// END CLASS DEFINITION TAppEncTop
    158184
  • branches/0.3-poznan-univ/source/App/TAppRenderer/TAppRendererCfg.cpp

    r5 r28  
    186186  {
    187187    m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered,
    188       m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, NULL, m_iLog2SamplingFactor+m_iShiftPrecision );
     188      m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, NULL, m_iLog2SamplingFactor+m_iShiftPrecision
     189#if POZNAN_NONLINEAR_DEPTH     
     190      ,1.0f
     191#endif
     192      );
    189193    m_iNumberOfInputViews  = (Int) m_cCameraData.getBaseViewNumbers() .size();
    190194    m_iNumberOfOutputViews = m_iNumberOfInputViews - 1;
     
    205209
    206210  m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered,
    207       m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, piaTempViews, m_iLog2SamplingFactor+m_iShiftPrecision );
     211      m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, piaTempViews, m_iLog2SamplingFactor+m_iShiftPrecision
     212#if POZNAN_NONLINEAR_DEPTH
     213      , 1.0f
     214#endif
     215      );
    208216  }
    209217  else
    210218  {
    211219  m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered,
    212       m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, m_pchSynthViewCameraNumbers, NULL, m_iLog2SamplingFactor+m_iShiftPrecision );
     220      m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, m_pchSynthViewCameraNumbers, NULL, m_iLog2SamplingFactor+m_iShiftPrecision
     221#if POZNAN_NONLINEAR_DEPTH
     222      ,1.0f
     223#endif
     224      );
    213225  m_iNumberOfOutputViews = (Int) m_cCameraData.getSynthViewNumbers().size();
    214226  m_iNumberOfInputViews  = (Int) m_cCameraData.getBaseViewNumbers() .size();
Note: See TracChangeset for help on using the changeset viewer.