Changeset 12 in 3DVCSoftware for branches/0.2-poznan-univ/source/App


Ignore:
Timestamp:
6 Feb 2012, 00:52:17 (13 years ago)
Author:
poznan-univ
Message:

Poznan Tools

  • Depth base motion vector prediction
Location:
branches/0.2-poznan-univ/source/App
Files:
9 edited

Legend:

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

    r11 r12  
    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      TComPowerConverter power(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 = power(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   iDepthValue = (Int64)uiDepthValue;
     903        Int64   iTempScale      = iDepthValue * iScale;
     904#if POZNAN_LUT_INCREASED_PRECISION
     905        iTempScale >>= g_uiBitIncrement;
     906#endif
    889907        Int64   iTestScale      = ( iTempScale + iOffset       );   // for checking accuracy of camera parameters
    890908        Int64   iShiftLuma      = ( iTempScale + iOffsetLuma   ) >> iLog2DivLuma;
     
    899917      }
    900918
    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 ];
     919      radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ];
     920      radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ];
     921      raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ];
     922      raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ];
    905923    }
    906924  }
     
    12321250                      Char*  pchSynthViewNumbers,
    12331251                      std::vector<Int>* paiSynthViewNumbers,
    1234                       Int    iLog2Precision )
     1252                      Int    iLog2Precision
     1253#if POZNAN_NONLINEAR_DEPTH
     1254                      ,Float fDepthPower
     1255#endif
     1256                      )
    12351257{
    12361258  //===== set miscellaneous variables =====
     
    12401262  m_uiCamParsCodedPrecision = uiCodedCamParsPrecision;
    12411263  m_iLog2Precision          = iLog2Precision;
     1264
     1265#if POZNAN_NONLINEAR_DEPTH
     1266  m_fDepthPower             = fDepthPower;
     1267#endif
    12421268
    12431269  xReadCameraParameterFile( pchCfgFileName );
     
    13391365}
    13401366
     1367  xReadCameraParameterFile( pchCfgFileName );
     1368
     1369  m_bSetupFromCoded         = ( m_aadCameraParameters[ 0 ].size() == 2 );
     1370
     1371  if ( m_bSetupFromCoded )
     1372  {
     1373    std::cout << "Detected decoded camera parameter file. Overwriting base view settings from cfg file. " << std::endl;
     1374    xSetupBaseViewsFromCoded();
     1375  }
     1376  else
     1377  {
     1378    xSetupBaseViews( pchBaseViewNumbers, uiNumBaseViews );
     1379  }
     1380
     1381  //===== set derived parameters =====
     1382  xGetViewOrderIndices( m_aiBaseId2SortedId, m_aiViewOrderIndex );
     1383  m_bCamParsVaryOverTime = xGetCamParsChangeFlag();
     1384
     1385
     1386  //===== create arrays =====
     1387  xCreateLUTs   ( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_adBaseViewShiftLUT,  m_aiBaseViewShiftLUT,  m_adBaseViewShiftParameter,  m_aiBaseViewShiftParameter  );
     1388  xCreateLUTs   ( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfSynthViews, m_adSynthViewShiftLUT, m_aiSynthViewShiftLUT, m_adSynthViewShiftParameter, m_aiSynthViewShiftParameter );
     1389  xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiCodedScale           );
     1390  xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiCodedOffset          );
     1391  xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiScaleAndOffsetSet    );
     1392  xInit2dArray  ( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiScaleAndOffsetSet, 0 );
     1393
     1394  xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiPdmScaleNomDelta     );
     1395  xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiPdmOffset            );
     1396
     1397  //===== init disparity to virtual depth conversion parameters =====
     1398  xSetPdmConversionParams();
     1399
     1400  //===== init arrays for first frame =====
     1401  xSetShiftParametersAndLUT( m_uiFirstFrameId );
     1402}
     1403#endif//*/
     1404
    13411405Void
    13421406TAppComCamPara::check( Bool bCheckViewRange, Bool bCheckFrameRange )
     
    14561520}
    14571521
    1458 #if POZNAN_SYNTH
     1522#if POZNAN_CU_SYNTH||POZNAN_CU_SKIP
    14591523Bool
    14601524TAppComCamPara::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft)
  • branches/0.2-poznan-univ/source/App/TAppCommon/TAppComCamPara.h

    r11 r12  
    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 );
    184 #if POZNAN_SYNTH
     194#if POZNAN_CU_SYNTH||POZNAN_CU_SKIP
    185195  Bool getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft);
    186196#endif
     
    189199  UInt                getCurFrameId             ()  { return m_iCurrentFrameId;   }
    190200  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
    191205
    192206  // function for getting parameters and parameter arrays
  • branches/0.2-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp

    r11 r12  
    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    {
    165 #if POZNAN_SYNTH
     177#if POZNAN_CU_SKIP||POZNAN_CU_SYNTH
    166178      if(cComSPS.getViewId()==0 && !cComSPS.isDepth()) // it should be called at first view at the begining of the stream
    167179        initRenderer(cComSPS);
     
    416428        if ( m_pchReconFile )
    417429        {
     430
     431#if POZNAN_NONLINEAR_DEPTH
     432          TComSPS* pcSPS = pcPic->getSlice(0)->getSPS();
     433          TComPicYuv cPicPower;
     434
     435          //pcPic->getPicYuvRec()
     436          cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() );
     437
     438          pcPic->getPicYuvRec()->power(&cPicPower, 1.0f/pcSPS->getDepthPower());
     439
     440          m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write(&cPicPower, pcSPS->getPad());
     441          cPicPower.destroy();           
     442#else
    418443          m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPic->getPicYuvRec(), pcPic->getSlice(0)->getSPS()->getPad() );
     444#endif
    419445        }
    420446
     
    544570}
    545571
    546 #if POZNAN_SYNTH
     572#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP
    547573Void TAppDecTop::initRenderer(TComSPS &cComSPS)
    548574{
     
    566592  iNearestViewIdx = 0;
    567593  bRenderFromLeft = iCoddedViewOrderIdx>0?true:false;
    568   //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft);
    569594
    570595  m_cAvailabilityRenderer.setShiftLUTs(
     
    592617    pcPicYuvAvailView = pcPic->getPicYuvAvail();
    593618  }
     619#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     620  TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth();
     621  if(!pcPicYuvSynthDepthView)
     622  {
     623    pcPic->addSynthesisDepthBuffer();
     624    pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth();
     625  }
     626  m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPicYuvAvailView, bRenderFromLeft );
     627 
     628#if POZNAN_OUTPUT_SYNTH
     629      Char acFilenameBaseD[1024];
     630      ::sprintf( acFilenameBaseD,  "SynthDepth_%s_V%d.yuv", ( true ? "Dec" : "Enc" ),iCoddedViewIdx );
     631      pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0);
     632#endif
     633#endif
    594634
    595635  //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft );
    596636  m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft );
    597 
     637     
    598638  pcPicYuvAvailView->setBorderExtension( false );//Needed??
    599639  pcPicYuvAvailView->extendPicBorder();//Needed??
     
    613653  }
    614654#endif
    615  
    616 }
    617 #endif
     655
     656}//*/
     657#endif
  • branches/0.2-poznan-univ/source/App/TAppDecoder/TAppDecTop.h

    r11 r12  
    5252#include "../../Lib/TLibCommon/TComDepthMapGenerator.h"
    5353#include "../../Lib/TLibDecoder/TDecTop.h"
    54 #if POZNAN_SYNTH
     54#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH
    5555#include "../../Lib/TLibRenderer/TRenTop.h"
    5656#endif
    5757#include "TAppDecCfg.h"
     58
     59#if POZNAN_MP
     60#include "../../Lib/TLibCommon/TComMP.h"
     61#endif
    5862
    5963// ====================================================================================================================
     
    9094#endif
    9195
    92 #if POZNAN_SYNTH
     96#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH
    9397  TRenTop                         m_cAvailabilityRenderer;
    9498#endif
    9599
     100#if POZNAN_MP
     101  TComMP*                                                 m_pcMP;
     102#endif
    96103
    97104public:
     
    105112  Void  startUsingDepth() ;
    106113
    107 #if POZNAN_SYNTH
     114#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH
    108115  Void  initRenderer(TComSPS &cComSPS);
    109116  Void  storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx,Int iCurPoc,Bool bDepth);
     
    120127#endif
    121128
     129#if POZNAN_MP
     130  TComMP* getMP() { return m_pcMP; }
     131#endif
     132
    122133protected:
    123134  Void  xCreateDecLib     (); ///< create internal classes
  • branches/0.2-poznan-univ/source/App/TAppEncoder/TAppEncCfg.cpp

    r5 r12  
    127127#endif
    128128
     129#if POZNAN_STAT_JK
     130  for(Int i = 0; i< m_pchStatFileList.size(); i++ )
     131  {
     132    if ( m_pchStatFileList[i] != NULL )
     133      free (m_pchStatFileList[i]);
     134  }
     135
     136  for(Int i = 0; i< m_pchDepthStatFileList.size(); i++ )
     137  {
     138    if ( m_pchDepthStatFileList[i] != NULL )
     139      free (m_pchDepthStatFileList[i]);
     140  }
     141#endif
     142
    129143}
    130144
     
    346360#endif
    347361#endif
     362#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     363  ("textureCuDeltaQpOffset",              m_dTextureCuDeltaQpOffset,       (Double)(-2.6), "texture block QP changing tool based on coresponding depth block values - offset parameter" )
     364  ("textureCuDeltaQpMul",                 m_dTextureCuDeltaQpMul,          (Double)(1),    "texture block QP changing tool based on coresponding depth block values - multiplicative parameter" )
     365  ("textureCuDeltaQpOffsetTopBottomRow",  m_iTextureCuDeltaQpTopBottomRow, (Int)2,         "texture block QP changing tool - top and bottom CU rows delta QP parameter" )
     366#endif
     367#if POZNAN_NONLINEAR_DEPTH
     368  ("DepthPower,-dpow",    m_fDepthPower,      1.0, "Depth power value (for non-linear processing)")
     369#endif
     370
    348371
    349372  /* Compatability with old style -1 FOO or -0 FOO options. */
    350373  ("1", doOldStyleCmdlineOn, "turn option <name> on")
    351374  ("0", doOldStyleCmdlineOff, "turn option <name> off")
     375
     376#if POZNAN_STAT_JK
     377  ("StatFile_%d,sf_%d",       m_pchStatFileList,       (char *) 0 , MAX_INPUT_VIEW_NUM , "Mode selection staticstics file name for view %d")
     378  ("DepthStatFile_%d,sf_%d",  m_pchDepthStatFileList,  (char *) 0 , MAX_INPUT_VIEW_NUM , "Mode selection staticstics file name for depth view %d")
     379#endif
    352380  ;
    353381
     
    396424// GT FIX END
    397425
     426#if POZNAN_STAT_JK
     427  if ( m_bUsingDepthMaps )
     428  {
     429    for(Int i = 0; i < m_pchDepthStatFileList.size() ; i++)
     430    {
     431      if ((m_pchDepthInputFileList[i] != NULL) && (m_pchStatFileList[i] != NULL) && (i < m_iNumberOfViews) )
     432      {
     433        if (m_pchDepthStatFileList[i] == NULL )
     434        {
     435          xAppendToFileNameEnd( m_pchStatFileList[i], "_depth", m_pchDepthStatFileList[i] );
     436        }
     437      }
     438      else
     439      {
     440        m_pchDepthStatFileList[i] = NULL;
     441      }
     442    };
     443  }
     444#endif 
     445
    398446  if (m_iRateGOPSize == -1)
    399447  {
     
    431479#if HHI_VSO
    432480  m_bUseVSO = m_bUseVSO && m_bUsingDepthMaps && (m_uiVSOMode != 0);
     481#endif
     482
     483#if POZNAN_NONLINEAR_DEPTH
     484if (m_fDepthPower<=0)
     485  {
     486    Float fDepthQP = m_adQP[ m_adQP.size()  < 2 ? 0 : 1];
     487    m_fDepthPower = (fDepthQP-30) *0.25/20.0 + 1.25;
     488    if (m_fDepthPower<=1.0) m_fDepthPower = 1.0;
     489    // QP = 30 = 1.25
     490    // QP = 50 = 1.5
     491    if (m_fDepthPower>=1.66) m_fDepthPower = 1.66;
     492  };
     493
     494#if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE
     495  m_fDepthPower = dequantizeDepthPower(quantizeDepthPower((Float)m_fDepthPower));
     496#endif
     497
    433498#endif
    434499
     
    498563                                      NULL,
    499564                                      m_cRenModStrParser.getSynthViews(),
    500                                       LOG2_DISP_PREC_LUT );
     565                                      LOG2_DISP_PREC_LUT
     566#if POZNAN_NONLINEAR_DEPTH                                     
     567                                      ,m_fDepthPower
     568#endif
     569                                      );
    501570}
    502571else if ( m_bUseVSO && m_uiVSOMode != 4 )
     
    511580                                      m_pchVSOConfig,
    512581                                      NULL,
    513                                       LOG2_DISP_PREC_LUT );
     582                                      LOG2_DISP_PREC_LUT
     583#if POZNAN_NONLINEAR_DEPTH                                     
     584                                      ,m_fDepthPower
     585#endif                                     
     586                                      );
    514587}
    515588else
     
    524597    NULL,
    525598    NULL,
    526     LOG2_DISP_PREC_LUT );
     599    LOG2_DISP_PREC_LUT
     600#if POZNAN_NONLINEAR_DEPTH                                     
     601    ,m_fDepthPower
     602#endif   
     603    );
    527604}
    528605#else
     
    536613    NULL,
    537614    NULL,
    538     LOG2_DISP_PREC_LUT );
     615    LOG2_DISP_PREC_LUT
     616#if POZNAN_NONLINEAR_DEPTH                                     
     617    ,m_fDepthPower
     618#endif   
     619    );
    539620#endif
    540621
     
    668749    }
    669750#endif
     751#if POZNAN_NONLINEAR_DEPTH
     752    printf("Depth map power              : %f\n", m_fDepthPower );
     753#endif
    670754  }
    671755
     
    820904    printf("Reconstruction Depth File %i  : %s\n", iCounter, m_pchDepthReconFileList[iCounter]);
    821905  }
     906#if POZNAN_STAT_JK
     907  for( Int iCounter = 0; iCounter<m_iNumberOfViews; iCounter++)
     908  {
     909    printf("Statistics File %i        : %s\n", iCounter, m_pchStatFileList[iCounter]);
     910  }
     911  for( Int iCounter = 0; iCounter<m_iNumberOfViews; iCounter++)
     912  {
     913    printf("Statistics Depth File %i  : %s\n", iCounter, m_pchDepthStatFileList[iCounter]);
     914  }
     915#endif
    822916  printf("Real     Format              : %dx%d %dHz\n", m_iSourceWidth - m_aiPad[0], m_iSourceHeight-m_aiPad[1], m_iFrameRate );
    823917  printf("Internal Format              : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate );
     
    9121006#if MTK_SAO
    9131007#endif
     1008
     1009#if POZNAN_MP
     1010  printf("POZNAN_MP(1){ ");
     1011
     1012#if POZNAN_MP_USE_DEPTH_MAP_GENERATION
     1013  printf("dmg=1 ");
     1014#else
     1015  printf("dmg=0 ");
     1016#endif
     1017
     1018#if POZNAN_MP_FILL
     1019  printf("fill=%d ",POZNAN_MP_FILL_TYPE);
     1020#else
     1021  printf("fill=- ");
     1022#endif
     1023
     1024#if POZNAN_EIVD
     1025  printf("EIVD(1): ");
     1026  printf("cand=%d ",POZNAN_EIVD_MERGE_POS);
     1027#if POZNAN_EIVD_CALC_PRED_DATA
     1028  printf("pr=1 ");
     1029#else
     1030  printf("pr=0 ");
     1031#endif
     1032#if POZNAN_EIVD_COMPRESS_ME_DATA
     1033  printf("comp=1 ");
     1034#else
     1035  printf("comp=0 ");
     1036#endif
     1037#if POZNAN_EIVD_USE_IN_NONANCHOR_PIC_ONLY
     1038  printf("na=1 ");
     1039#else
     1040  printf("na=0 ");
     1041#endif
     1042#else
     1043  printf("EIVD(0) ");
     1044#endif
     1045  printf("}");
     1046#else
     1047  printf("POZNAN_MP(0) ");
     1048#endif
     1049
    9141050  printf("\n");
    9151051  printf("TOOL CFG VIDEO  : ");
     
    9331069#endif
    9341070  printf("\n");
     1071
     1072 
     1073printf("POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH(");
     1074#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1075printf("1), ");
     1076#else
     1077printf("0), ");
     1078#endif
    9351079
    9361080  fflush(stdout);
  • branches/0.2-poznan-univ/source/App/TAppEncoder/TAppEncCfg.h

    r5 r12  
    271271  TRenModSetupStrParser       m_cRenModStrParser;
    272272#endif
     273
     274#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     275  Double                      m_dTextureCuDeltaQpOffset;
     276  Double                      m_dTextureCuDeltaQpMul;
     277  Int                         m_iTextureCuDeltaQpTopBottomRow;
     278#endif
     279
     280#if POZNAN_NONLINEAR_DEPTH
     281  Double    m_fDepthPower;                                                                        ///< Depth power value
     282#endif
     283
     284#if POZNAN_STAT_JK
     285  std::vector<char*>       m_pchStatFileList;                                   ///< texure statistics file names
     286  std::vector<char*>       m_pchDepthStatFileList;                              ///< depth statistics file names
     287#endif
     288
    273289public:
    274290
  • branches/0.2-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp

    r11 r12  
    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
     
    222226    m_acTEncTopList[iViewIdx]->setQpChangeOffsetVideo( m_iQpChangeOffsetVideo );
    223227    m_acTEncTopList[iViewIdx]->setQpChangeOffsetDepth( m_iQpChangeOffsetDepth );
     228
     229   
     230 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     231    m_acTEncTopList[iViewIdx]->setTextureCuDeltaQpOffset( m_dTextureCuDeltaQpOffset );
     232    m_acTEncTopList[iViewIdx]->setTextureCuDeltaQpMul( m_dTextureCuDeltaQpMul );
     233    m_acTEncTopList[iViewIdx]->setTextureCuDeltaQpTopBottomRow( m_iTextureCuDeltaQpTopBottomRow ); 
     234#endif
    224235  }
    225236  if( m_bUsingDepthMaps )
     
    382393      m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI );
    383394#endif
     395#if POZNAN_NONLINEAR_DEPTH
     396      m_acTEncDepthTopList[iViewIdx]->setDepthPower                   ( (Float)m_fDepthPower );
     397#endif
    384398
    385399      m_acTEncDepthTopList[iViewIdx]->setPictureDigestEnabled(m_pictureDigestEnabled);
     
    435449#endif
    436450
    437 #if POZNAN_SYNTH
     451#if POZNAN_CU_SYNTH||POZNAN_CU_SKIP
    438452  //m_cAvailabilityRenderer.init(m_iSourceWidth, m_iSourceHeight,true,0,0,true, 0,0,0,0,0,0,0,1,0,0 );  //GT: simplest configuration
    439453  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
     
    443457  m_cUsedPelsRenderer.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 );
    444458#endif
     459
     460#if POZNAN_MP
     461#if POZNAN_MP_USE_DEPTH_MAP_GENERATION
     462  m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth);
     463#else
     464  //m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth, &m_cCameraData);
     465  m_pcMP = new TComMP(m_iSourceHeight, m_iSourceWidth, m_cCameraData.getBaseViewShiftLUTI());
     466#endif
     467#endif
     468
    445469}
    446470
     
    484508  }
    485509#endif
     510
     511#if POZNAN_STAT_JK
     512  for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++)
     513  {
     514        if(m_pchStatFileList[iViewIdx] != NULL) m_cStatFileList.push_back(fopen(m_pchStatFileList[iViewIdx],"w"));
     515        else m_cStatFileList.push_back(NULL);
     516
     517        if ( m_bUsingDepthMaps && m_pchDepthStatFileList[iViewIdx] != NULL) m_cDepthStatFileList.push_back(fopen(m_pchDepthStatFileList[iViewIdx],"w"));
     518        else m_cDepthStatFileList.push_back(NULL);
     519  }
     520#endif 
     521
    486522}
    487523
     
    490526
    491527  m_cTVideoIOBitsFile.closeBits();
     528
     529#if POZNAN_MP
     530  if (m_pcMP) { delete m_pcMP; m_pcMP=NULL; };
     531#endif
     532
     533#if POZNAN_STAT_JK
     534  for ( Int iViewIdx = 0; iViewIdx < m_iNumberOfExternalRefs; iViewIdx++ )
     535  {
     536          if(m_cStatFileList[iViewIdx]) {fclose(m_cStatFileList[iViewIdx]); m_cStatFileList[iViewIdx]=NULL;}
     537          if(m_cDepthStatFileList[iViewIdx]) {fclose(m_cDepthStatFileList[iViewIdx]); m_cDepthStatFileList[iViewIdx]=NULL;}
     538  }
     539#endif
    492540
    493541#if HHI_VSO
     
    545593    m_acTEncTopList[iViewIdx]->setTEncTopList( &m_acTEncTopList  );
    546594  }
     595#if POZNAN_STAT_JK
     596  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     597  {
     598    m_acTEncTopList[iViewIdx]->setStatFile(m_cStatFileList[iViewIdx]);//JK
     599  }
     600#endif
    547601  if ( m_bUsingDepthMaps )
    548602  {
     
    555609      m_acTEncDepthTopList[iViewIdx]->setTEncTopList( &m_acTEncDepthTopList  );
    556610    }
     611#if POZNAN_STAT_JK
     612  for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++)
     613  {
     614    m_acTEncDepthTopList[iViewIdx]->setStatFile(m_cDepthStatFileList[iViewIdx]);//JK
     615  }
     616#endif
    557617  }
    558618}
     
    645705        {
    646706          m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcPdmDepthOrg, m_aiPad, m_bUsingDepthMaps );
     707#if POZNAN_NONLINEAR_DEPTH
     708          pcPdmDepthOrg->power(pcPdmDepthOrg, m_fDepthPower);             
     709#endif
    647710        }
    648711#endif
     
    666729          // read input YUV file
    667730          m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcDepthPicYuvOrg, m_aiPad  ) ;
     731#if POZNAN_NONLINEAR_DEPTH
     732          pcDepthPicYuvOrg->power(pcDepthPicYuvOrg, m_fDepthPower);               
     733#endif
    668734          bDepthEos[iViewIdx] = ( m_acTVideoIOYuvDepthInputFileList[iViewIdx]->isEof() == 1 ?   true : false  );
    669735          bDepthEos[iViewIdx] = ( m_iDepthFrameRcvdVector[iViewIdx] == (m_iFrameToBeEncoded - 1) ?    true : bDepthEos[iViewIdx]   );
     
    697763    for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )     // Start encoding
    698764    {
    699 #if POZNAN_SYNTH
     765#if POZNAN_CU_SYNTH||POZNAN_CU_SKIP
    700766      xStoreSynthPicsInBuffer(iViewIdx,false);
    701767#endif
     
    716782      if( m_bUsingDepthMaps )
    717783      {
    718 #if POZNAN_SYNTH
     784#if POZNAN_CU_SYNTH||POZNAN_CU_SKIP
    719785        xStoreSynthPicsInBuffer(iViewIdx,true);
    720786#endif
     
    9391005  {
    9401006    riNextPocToDump++;
     1007#if POZNAN_NONLINEAR_DEPTH
     1008    if(isDepth)
     1009    {
     1010      TComPicYuv *pcPicOrg = i->second;
     1011      TComPicYuv *pcPicPow = new TComPicYuv;
     1012      //pcPicYuvRec->createCompatibleAs(*iterPicYuvRec);
     1013      pcPicPow->create( pcPicOrg->getWidth(), pcPicOrg->getHeight(), pcPicOrg->getMaxCuWidth(), pcPicOrg->getMaxCuHeight(), pcPicOrg->getMaxCuDepth() );
     1014      //cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() );
     1015      pcPicOrg->power(pcPicPow, (Float)(1.0/m_fDepthPower));           
     1016      rpcTVideoIOYuvReconFile->write( pcPicPow, m_aiPad );
     1017    } else
     1018#endif
    9411019    rpcTVideoIOYuvReconFile->write( i->second, m_aiPad );
    9421020    rcMap.erase( i );
     
    11881266#endif
    11891267
    1190 #if POZNAN_SYNTH
    1191 Void TAppEncTop::xStoreSynthPicsInBuffer(Int iCoddedViewIdx,Bool bDepth)
     1268#if POZNAN_CU_SYNTH||POZNAN_CU_SKIP
     1269Void TAppEncTop::xStoreSynthPicsInBuffer(Int iCoddedViewIdx, Bool bDepth)
    11921270{
    11931271  Int iCurPoc;
     
    12001278  {
    12011279    iCurPoc = m_acTEncTopList[ iCoddedViewIdx ]->getNextFrameId();
    1202     if (!(m_acTEncTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return;
    1203   }
    1204  
     1280  if (!(m_acTEncTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return;
     1281
    12051282  Int iNumberOfReferenceViews = 0;
    12061283  UInt iSynthViewIdx;
     
    12211298
    12221299  m_cAvailabilityRenderer.setShiftLUTs(
    1223     m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],
    1224     m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
    1225     m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
    1226     m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right
    1227     m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
    1228     m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
    1229     iRelDistToLeft
    1230   );
    1231    
     1300        m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],
     1301        m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1302        m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1303        m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right
     1304        m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1305        m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx],
     1306        iRelDistToLeft
     1307      );
    12321308
    12331309  TComPicYuv* pcPicYuvERView = new TComPicYuv;
    12341310  pcPicYuvERView->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
    1235 
    12361311  TComPic* pcPic = xGetPicFromView( iCoddedViewIdx, iCurPoc, bDepth );
    12371312  pcPic->addSynthesisBuffer();
    12381313  pcPic->addAvailabilityBuffer();
     1314#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1315      pcPic->addSynthesisDepthBuffer();
     1316      TComPicYuv* pcPicYuvSynthDepthView = pcPic->getPicYuvSynthDepth();
     1317      m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthDepthView, pcPic->getPicYuvAvail(), bRenderFromLeft );
     1318#if POZNAN_OUTPUT_SYNTH
     1319      Char acFilenameBaseD[1024];
     1320      ::sprintf( acFilenameBaseD,  "SynthDepth_%s_V%d.yuv", ( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1321      pcPicYuvSynthDepthView->dump(acFilenameBaseD, iCurPoc!=0);
     1322#endif
     1323#endif
    12391324  TComPicYuv* pcPicYuvSynthView = pcPic->getPicYuvSynth();
    12401325  TComPicYuv* pcPicYuvAvailView = pcPic->getPicYuvAvail();
    1241  
    12421326  //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft );
    12431327  m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, bDepth )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft );
     
    12561340#if POZNAN_OUTPUT_AVAILABLE_MAP
    12571341  {
    1258   Char acFilenameBase[1024];
    1259   ::sprintf( acFilenameBase,  "Available_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx );
    1260   pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0);
     1342    Char acFilenameBase[1024];
     1343    ::sprintf( acFilenameBase,  "Available_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx );
     1344    pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0);
    12611345  }
    12621346#endif
     
    12681352  }
    12691353#endif
    1270 
    1271       //Usun pcPicYuvERView i inne bufforki
    12721354}
    12731355#endif
  • branches/0.2-poznan-univ/source/App/TAppEncoder/TAppEncTop.h

    r11 r12  
    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
    94 #if POZNAN_SYNTH
     98#if POZNAN_CU_SKIP||POZNAN_CU_SYNTH
    9599  TRenTop                     m_cAvailabilityRenderer;
     100#endif
     101
     102#if POZNAN_MP
     103  TComMP*                                 m_pcMP;
     104#endif
     105
     106#if POZNAN_STAT_JK
     107  std::vector<FILE*>       m_cStatFileList;                                         ///< texure statistics file handles
     108  std::vector<FILE*>       m_cDepthStatFileList;                                ///< depth statistics file handles
    96109#endif
    97110
     
    149162#endif
    150163
     164#if POZNAN_MP
     165  TComMP* getMP() {return m_pcMP;}
     166#endif
     167
    151168#if HHI_VSO
    152169private:
     
    160177
    161178
    162 #if POZNAN_SYNTH
     179#if POZNAN_CU_SYNTH
    163180private:
    164181  Void  xStoreSynthPicsInBuffer(Int iCoddedViewIdx, Bool bDepth);
  • branches/0.2-poznan-univ/source/App/TAppRenderer/TAppRendererCfg.cpp

    r5 r12  
    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.