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


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

Poznan Tools

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

Legend:

Unmodified
Added
Removed
  • branches/0.2-poznan-univ/build/HM_vc8.sln

    r11 r12  
    99                {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}
    1010                {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}
     11<<<<<<< .mine
     12                {5E87AD84-AC4F-4336-B4EE-549CA210EE4A} = {5E87AD84-AC4F-4336-B4EE-549CA210EE4A}
     13                {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}
     14                {F8B77A48-AF6C-4746-A89F-B706ABA6AD94} = {F8B77A48-AF6C-4746-A89F-B706ABA6AD94}
     15                {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}
     16=======
     17>>>>>>> .r11
    1118        EndProjectSection
    1219EndProject
  • branches/0.2-poznan-univ/build/HM_vc9.sln

    r11 r12  
    77                {78018D78-F890-47E3-A0B7-09D273F0B11D} = {78018D78-F890-47E3-A0B7-09D273F0B11D}
    88                {F8B77A48-AF6C-4746-A89F-B706ABA6AD94} = {F8B77A48-AF6C-4746-A89F-B706ABA6AD94}
     9                {ABF5855A-69D4-4579-AC8E-7109DEEFA7F0} = {ABF5855A-69D4-4579-AC8E-7109DEEFA7F0}
    910                {5280C25A-D316-4BE7-AE50-29D72108624F} = {5280C25A-D316-4BE7-AE50-29D72108624F}
    1011                {8783AD3A-A5CA-42B7-AAC4-A07EB845A684} = {8783AD3A-A5CA-42B7-AAC4-A07EB845A684}
     12                {457993C6-AE2C-4B9B-B5F9-71033279A0B9} = {457993C6-AE2C-4B9B-B5F9-71033279A0B9}
    1113        EndProjectSection
    1214EndProject
  • branches/0.2-poznan-univ/build/vc8/TAppDecoder_vc8.vcproj

    r2 r12  
    4444                                Name="VCCLCompilerTool"
    4545                                Optimization="0"
     46                                AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    4647                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
    47                                 AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    4848                                MinimalRebuild="true"
    4949                                BasicRuntimeChecks="3"
     
    119119                                Name="VCCLCompilerTool"
    120120                                Optimization="0"
     121                                AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    121122                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
    122                                 AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    123123                                MinimalRebuild="true"
    124124                                BasicRuntimeChecks="3"
     
    197197                                EnableIntrinsicFunctions="false"
    198198                                FavorSizeOrSpeed="1"
     199                                AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    199200                                PreprocessorDefinitions="WIN32;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
    200                                 AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    201201                                StringPooling="true"
    202202                                RuntimeLibrary="0"
     
    275275                                EnableIntrinsicFunctions="false"
    276276                                FavorSizeOrSpeed="1"
     277                                AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    277278                                PreprocessorDefinitions="WIN32;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
    278                                 AdditionalIncludeDirectories="&quot;..\..\compat\msvc&quot;"
    279279                                StringPooling="true"
    280280                                RuntimeLibrary="0"
  • 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();
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/CommonDef.h

    r11 r12  
    137137#define LOG2_DISP_PREC_LUT                              2                               ///< log2 of disparity precision used in integer disparity LUTs
    138138
    139 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED )
     139#if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED || POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    140140#define DEPTH_MAP_GENERATION        1
    141141#else
     
    178178#define POZNAN_OUTPUT_SYNTH               0           // output synthesised view (for debugging)
    179179
     180#if POZNAN_NONLINEAR_DEPTH
     181#define POZNAN_LUT_INCREASED_PRECISION 0 // 1
     182#else
     183#define POZNAN_LUT_INCREASED_PRECISION 0
     184#endif
     185
     186#if POZNAN_NONLINEAR_DEPTH
     187inline UChar quantizeDepthPower(Float fDepthPower)
     188{
     189  Int r = (Int) ( (fDepthPower-1.0f)*128.0f + 0.5f);
     190  if (r<=0) return 0;
     191  if (r>255) r=255; 
     192  return r;
     193};
     194
     195inline Float dequantizeDepthPower(Int iDepthQuant)
     196{
     197  return iDepthQuant/128.0f + 1.0f; 
     198};
     199#endif
     200
     201#if POZNAN_EIVD
     202#define POZNAN_EIVD_MERGE_POS                     0         // position of EIVD candidate in merge list for coding (0..6) - overwrites PDM_MERGE_POS settings, is overwritten by HHI_MPI_MERGE_POS settings!!!
     203#endif
     204
    180205// ====================================================================================================================
    181206// Macro functions
     
    187212#define Clip(x)                     ( Min(g_uiIBDI_MAX, Max( 0, (x)) ) )                              ///< clip with bit-depth range
    188213#define Clip3( MinVal, MaxVal, a)   ( ((a)<(MinVal)) ? (MinVal) : (((a)>(MaxVal)) ? (MaxVal) :(a)) )  ///< general min/max clip
    189 #define RemoveBitIncrement(x)       ( (x + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement )     ///< Remove Bit increment
     214#define RemoveBitIncrement(x)       ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement )     ///< Remove Bit increment
     215
     216#if POZNAN_LUT_INCREASED_PRECISION
     217#define RemoveBitIncrementLUT(x)       (x)     ///< Remove Bit increment
     218#define SizeOfLUT                      (256 << g_uiBitIncrement) 
     219#else
     220#define SizeOfLUT                      256
     221#define RemoveBitIncrementLUT(x)       ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement )     ///< Remove Bit increment
     222#endif
    190223
    191224#define DATA_ALIGN                  1                                                                 ///< use 32-bit aligned malloc/free
     
    217250#define AMVP_MAX_NUM_CANDS          6           ///< max number of final candidates
    218251// MERGE
     252#if POZNAN_EIVD
     253#define MRG_MAX_NUM_CANDS           7
     254#define POZNAN_EIVD_MRG_CAND    MRG_MAX_NUM_CANDS-1                     // position of EIVD candidate in merge list (0..6)
     255#else
    219256#define MRG_MAX_NUM_CANDS           6
     257#endif
    220258
    221259// Reference memory management
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/ContextTables.h

    r5 r12  
    5353#define NUM_MERGE_FLAG_EXT_CTX        3       ///< number of context models for merge flag of merge extended
    5454#define NUM_MERGE_IDX_EXT_CTX         4       ///< number of context models for merge index of merge extended
    55 #define NUM_MV_MERGE_IDX_EXT_CTX      5       ///< number of context models for merge index of merge extended
     55#define NUM_MV_MERGE_IDX_EXT_CTX      6       ///< number of context models for merge index of merge extended
    5656#define NUM_RES_PRED_FLAG_CTX         3       ///< number of context for residual prediction flag     
    5757
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp

    r11 r12  
    187187    m_acCUMvField[1].create( uiNumPartition );
    188188   
     189#if POZNAN_EIVD_CALC_PRED_DATA
     190    m_acCUMvField2nd[0].create( uiNumPartition );
     191    m_acCUMvField2nd[1].create( uiNumPartition );
     192#endif
     193   
    189194#if HHI_DMM_WEDGE_INTRA
    190195    m_puiWedgeFullTabIdx       = (UInt*)xMalloc(UInt, uiNumPartition);
     
    210215    m_acCUMvField[0].setNumPartition(uiNumPartition );
    211216    m_acCUMvField[1].setNumPartition(uiNumPartition );
     217
     218#if POZNAN_EIVD_CALC_PRED_DATA
     219    m_acCUMvField2nd[0].setNumPartition(uiNumPartition );
     220    m_acCUMvField2nd[1].setNumPartition(uiNumPartition );
     221#endif
    212222  }
    213223 
     
    296306    if ( m_piContourPredTexDeltaDC2  ) { xFree(m_piContourPredTexDeltaDC2);  m_piContourPredTexDeltaDC2  = NULL; }
    297307#endif   
     308   
     309#if POZNAN_EIVD_CALC_PRED_DATA
     310    m_acCUMvField2nd[0].destroy();
     311    m_acCUMvField2nd[1].destroy();
     312#endif
     313
    298314  }
    299315 
     
    388404  m_acCUMvField[0].clearMvField();
    389405  m_acCUMvField[1].clearMvField();
     406 
     407#if POZNAN_EIVD_CALC_PRED_DATA
     408  m_acCUMvField2nd[0].clearMvField();
     409  m_acCUMvField2nd[1].clearMvField();
     410#endif
    390411 
    391412  UInt uiTmp = m_puhWidth[0]*m_puhHeight[0];
     
    508529  m_acCUMvField[1].clearMvField();
    509530
     531#if POZNAN_EIVD_CALC_PRED_DATA
     532  m_acCUMvField2nd[0].clearMvField();
     533  m_acCUMvField2nd[1].clearMvField();
     534#endif
     535
    510536#if HHI_DMM_WEDGE_INTRA
    511537  memset( m_puiWedgeFullTabIdx,  0, iSizeInUInt   );
     
    617643  m_uiEntropySliceStartCU   = pcCU->getEntropySliceStartCU();
    618644
     645#if POZNAN_EIVD_CALC_PRED_DATA
     646  m_acCUMvField2nd[0].clearMvField();
     647  m_acCUMvField2nd[1].clearMvField();
     648#endif
     649
    619650#if HHI_DMM_WEDGE_INTRA
    620651  memset( m_puiWedgeFullTabIdx,  0, iSizeInUInt   );
     
    719750  m_acCUMvField[1].setMvdPtr(pcCU->getCUMvField(REF_PIC_LIST_1)->getMvd()    + uiPart);
    720751  m_acCUMvField[1].setRefIdxPtr(pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx() + uiPart);
     752
     753#if POZNAN_EIVD_CALC_PRED_DATA
     754  m_acCUMvField2nd[0].setMvPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getMv()     + uiPart);
     755  m_acCUMvField2nd[0].setMvdPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getMvd()    + uiPart);
     756  m_acCUMvField2nd[0].setRefIdxPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getRefIdx() + uiPart);
     757  m_acCUMvField2nd[1].setMvPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getMv()     + uiPart);
     758  m_acCUMvField2nd[1].setMvdPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getMvd()    + uiPart);
     759  m_acCUMvField2nd[1].setRefIdxPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getRefIdx() + uiPart);
     760#endif
     761
    721762  m_uiSliceStartCU        = pcCU->getSliceStartCU();
    722763  m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU();
     
    787828  m_acCUMvField[eRefPicList].setMvdPtr(pcCU->getCUMvField(eRefPicList)->getMvd()    + uiAbsPartIdx);
    788829  m_acCUMvField[eRefPicList].setRefIdxPtr(pcCU->getCUMvField(eRefPicList)->getRefIdx() + uiAbsPartIdx);
     830
     831#if POZNAN_EIVD_CALC_PRED_DATA
     832  m_acCUMvField2nd[eRefPicList].setMvPtr(pcCU->getCUMvField2nd(eRefPicList)->getMv()     + uiAbsPartIdx);
     833  m_acCUMvField2nd[eRefPicList].setMvdPtr(pcCU->getCUMvField2nd(eRefPicList)->getMvd()    + uiAbsPartIdx);
     834  m_acCUMvField2nd[eRefPicList].setRefIdxPtr(pcCU->getCUMvField2nd(eRefPicList)->getRefIdx() + uiAbsPartIdx);
     835#endif
     836
    789837#if HHI_MPI
    790838  m_piTextureModeDepth = pcCU->getTextureModeDepth() + uiAbsPartIdx;
     
    857905  m_acCUMvField[1].copyFrom( pcCU->getCUMvField( REF_PIC_LIST_1 ), pcCU->getTotalNumPart(), uiOffset );
    858906 
     907#if POZNAN_EIVD_CALC_PRED_DATA
     908  m_acCUMvField2nd[0].copyFrom( pcCU->getCUMvField2nd( REF_PIC_LIST_0 ), pcCU->getTotalNumPart(), uiOffset );
     909  m_acCUMvField2nd[1].copyFrom( pcCU->getCUMvField2nd( REF_PIC_LIST_1 ), pcCU->getTotalNumPart(), uiOffset );
     910#endif
     911
    859912  UInt uiTmp  = g_uiMaxCUWidth*g_uiMaxCUHeight >> (uiDepth<<1);
    860913  UInt uiTmp2 = uiPartUnitIdx*uiTmp;
     
    943996  m_acCUMvField[0].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU );
    944997  m_acCUMvField[1].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU );
     998 
     999#if POZNAN_EIVD_CALC_PRED_DATA
     1000  m_acCUMvField2nd[0].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU );
     1001  m_acCUMvField2nd[1].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU );
     1002#endif
    9451003 
    9461004  UInt uiTmp  = (g_uiMaxCUWidth*g_uiMaxCUHeight)>>(uhDepth<<1);
     
    10301088  m_acCUMvField[0].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart );
    10311089  m_acCUMvField[1].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart );
     1090 
     1091#if POZNAN_EIVD_CALC_PRED_DATA
     1092  m_acCUMvField2nd[0].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart );
     1093  m_acCUMvField2nd[1].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart );
     1094#endif
    10321095 
    10331096  UInt uiTmp  = (g_uiMaxCUWidth*g_uiMaxCUHeight)>>((uhDepth+uiPartDepth)<<1);
     
    26972760#endif
    26982761 
     2762#if POZNAN_EIVD
     2763  Bool bEIVDMerge = getSlice()->getMP()->isEIVDEnabled();
     2764  UInt uiEIVDAddr = POZNAN_EIVD_MRG_CAND;
     2765#endif
     2766 
    26992767  bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
    27002768  for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui )
     
    27122780  }
    27132781  if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx )
    2714 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     2782#if POZNAN_CU_SKIP
    27152783    && !pcCULeft->isCUSkiped( uiLeftPartIdx )
    27162784#endif
     
    27422810  }
    27432811  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx )
    2744 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     2812#if POZNAN_CU_SKIP
    27452813    && !pcCUAbove->isCUSkiped( uiAbovePartIdx )
    27462814#endif
     
    31913259#endif
    31923260
     3261#if POZNAN_EIVD
     3262  //===== add point-to-point merge with depth maps =====
     3263  if ( bEIVDMerge )
     3264  {
     3265    //prediction of motion data for points with disocclusion:
     3266        UInt uiRefArrayAddr = uiEIVDAddr;
     3267        for(UInt ui=0; ui<MRG_MAX_NUM_CANDS; ui++) if ( ui!=uiEIVDAddr && abCandIsInter[ui] ) {uiRefArrayAddr = ui; break;}     
     3268        if(uiRefArrayAddr != uiEIVDAddr)
     3269        {
     3270                puhInterDirNeighbours[uiEIVDAddr] = puhInterDirNeighbours[uiRefArrayAddr];
     3271                pcMvFieldNeighbours[uiEIVDAddr << 1].setMvField(pcMvFieldNeighbours[uiRefArrayAddr << 1].getMv(),pcMvFieldNeighbours[uiRefArrayAddr << 1].getRefIdx());
     3272                pcMvFieldNeighbours[(uiEIVDAddr << 1)+1].setMvField(pcMvFieldNeighbours[(uiRefArrayAddr << 1)+1].getMv(),pcMvFieldNeighbours[(uiRefArrayAddr << 1)+1].getRefIdx());
     3273        }
     3274        else
     3275        {
     3276                TComMv cMVzero; cMVzero.setZero();
     3277                if( getSlice()->isInterB() )
     3278                {
     3279                        puhInterDirNeighbours[uiEIVDAddr] = 3;
     3280                        pcMvFieldNeighbours[uiEIVDAddr << 1].setMvField(cMVzero,0);
     3281                        pcMvFieldNeighbours[(uiEIVDAddr << 1)+1].setMvField(cMVzero,0);
     3282                }
     3283                else
     3284                {
     3285                        if(getSlice()->getNumRefIdx(REF_PIC_LIST_0)>0)
     3286                        {
     3287                                puhInterDirNeighbours[uiEIVDAddr] = 1;
     3288                                pcMvFieldNeighbours[uiEIVDAddr << 1].setMvField(cMVzero,0);
     3289                        }
     3290                        else if(getSlice()->getNumRefIdx(REF_PIC_LIST_1)>0)
     3291                        {
     3292                                puhInterDirNeighbours[uiEIVDAddr] = 2;
     3293                                pcMvFieldNeighbours[(uiEIVDAddr << 1)+1].setMvField(cMVzero,0);
     3294                        }
     3295                        else puhInterDirNeighbours[uiEIVDAddr] = 0;
     3296                }
     3297        }       
     3298        if(puhInterDirNeighbours[uiEIVDAddr])
     3299        {               
     3300                abCandIsInter[uiEIVDAddr] = true;
     3301                puiNeighbourCandIdx[uiEIVDAddr] = uiEIVDAddr + 1;
     3302        }
     3303  }
     3304#endif
     3305
    31933306
    31943307  //===== remove duplicates =====
    31953308  for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS; uiOuter++ )
    31963309  {
     3310#if POZNAN_EIVD
     3311    if(uiOuter==POZNAN_EIVD_MRG_CAND) continue;
     3312#endif
    31973313    if( abCandIsInter[ uiOuter ] && ( puiNeighbourCandIdx[uiOuter] == uiOuter + 1 ) )
    31983314    {
    31993315      for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS; uiIter++ )
    32003316      {
     3317#if POZNAN_EIVD
     3318        if(uiIter==POZNAN_EIVD_MRG_CAND) continue;
     3319#endif
    32013320        if( abCandIsInter[ uiIter ] )
    32023321        {
     
    32803399  {
    32813400    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
    3282 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     3401#if POZNAN_CU_SKIP
    32833402       && !pcCorner->isCUSkiped( uiCornerPUIdx )
    32843403#endif
     
    33193438  {
    33203439    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
    3321 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     3440#if POZNAN_CU_SKIP
    33223441       && !pcCorner->isCUSkiped( uiCornerPUIdx )
    33233442#endif
     
    44414560  if (pColCU->isIntra(uiPartIdxCenter))
    44424561    return false;
    4443 
    4444 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     4562 
     4563#if POZNAN_CU_SKIP
    44454564  if (pColCU->isSkipped(uiPartIdxCenter))
    44464565    return false;
     
    48044923  }
    48054924#endif
     4925
     4926#if POZNAN_EIVD_CALC_PRED_DATA
     4927  pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->copyTo( &m_acCUMvField2nd[0], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition );
     4928  pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->copyTo( &m_acCUMvField2nd[1], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition );
     4929#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     4930  for( UInt ui = 0; ui < uiNumPartition; ui++ )
     4931  {
     4932    m_acCUMvField2nd[0].getMv( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 );
     4933    m_acCUMvField2nd[0].getMv( uiAbsPartIdxDst + ui ) >>= 2;
     4934
     4935    m_acCUMvField2nd[1].getMv( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 );
     4936    m_acCUMvField2nd[1].getMv( uiAbsPartIdxDst + ui ) >>= 2;
     4937
     4938    m_acCUMvField2nd[0].getMvd( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 );
     4939    m_acCUMvField2nd[0].getMvd( uiAbsPartIdxDst + ui ) >>= 2;
     4940
     4941    m_acCUMvField2nd[1].getMvd( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 );
     4942    m_acCUMvField2nd[1].getMvd( uiAbsPartIdxDst + ui ) >>= 2;
     4943  }
     4944#endif
     4945#endif
    48064946}
    48074947#endif
     
    48124952  riPosY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIndex]] + getCUPelY(); 
    48134953}
     4954#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     4955Int TComDataCU::CuQpIncrementFunction(Pel uiBlockMax)
     4956{
     4957  if((uiBlockMax >> g_uiBitIncrement) >= 256 || (uiBlockMax >> g_uiBitIncrement) <0)
     4958  {
     4959    fprintf(stderr, "Bitincrement = %d, uiBlockMax = %d\n", g_uiBitIncrement, uiBlockMax);
     4960    exit(333);
     4961  }
     4962  Float fVal = (Float)((255 - (uiBlockMax >> g_uiBitIncrement)) >> 4);
     4963  fVal = (fVal * fVal);
     4964#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     4965  fVal = (Float)( fVal + getPic()->getTextureCuDeltaQpOffset() * 32); // add offset, if offset is negative than objects in front will have smaller QP than originaly - quality in front will be increased and in bacground will be decreased
     4966  fVal = (Float)( fVal * getPic()->getTextureCuDeltaQpMul()); //
     4967#else
     4968  fVal = (Float)( fVal + POZNAN_TEXTURE_TU_DELTA_QP_OFFSET * 32); // add offset, if offset is negative objects in front will have smaller QP than in original approach - quality in front will be increased and in bacground will be decreased
     4969  fVal = (Float)( fVal * POZNAN_TEXTURE_TU_DELTA_QP_MUL); //
     4970#endif
     4971  return (Int)fVal >> 5;
     4972}
     4973 Int  TComDataCU::getQpOffsetForTextCU(UInt uiPartIdx, Bool bIsIntra)
     4974 {
     4975   //if(!isTexture(getSlice()->getViewId()))
     4976   if(this->getPic()->getSlice(0)->getSPS()->isDepth())
     4977   {
     4978     return 0;
     4979   }
     4980#if POZNAN_TEXTURE_TU_DELTA_QP_NOT_IN_BASE_VIEW
     4981   //if(!getPic()->getIsSideView())
     4982   if(this->getPic()->getViewIdx() == 0)//KUBA czy indeksy na pewno s¹ od zera?
     4983   {
     4984     return 0;
     4985   }
     4986#endif
     4987   UInt iCuAddr = getAddr();
     4988   //TComPic * pcDepthPic = getPic()->getDepthPic();
     4989   TComPicYuv * pcDepthPicYUV = getPic()->getPicYuvSynthDepth();
     4990   if(pcDepthPicYUV /*pcDepthPic*/ == NULL)
     4991   {
     4992    char errortext[200];
     4993    sprintf(errortext, "depth map expected");
     4994    fprintf(stderr, "%s\n", errortext);
     4995    exit(123);
     4996   }
     4997   //TComDataCU* rpcCUDepth = pcDepthPic->getCU(iCuAddr);
     4998   Pel uiDepthLumaTransformBlockMax;
     4999   if(bIsIntra)
     5000   {
     5001     // in intra block CU each TU block has QP chosen separatly so dQP is calculated for TU
     5002     uiDepthLumaTransformBlockMax = getDepthLumaTransformBlockMax( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx );
     5003   }
     5004   else
     5005   {
     5006     // in inter block CU all TU block has the same QP so dQP is calculated for CU
     5007     uiDepthLumaTransformBlockMax = getDepthLumaCodingBlockMax( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx );
     5008   }
     5009#if POZNAN_NONLINEAR_DEPTH
     5010   //Pel liczby_w[256];
     5011   //Pel liczby_t[256];
     5012   //Pel liczby_o[256];
     5013   //Float p = 1.9;
     5014   //TComPowerConverter powconv_t(p, g_uiBitIncrement, g_uiBitIncrement);
     5015   //TComPowerConverter powconv_o(1.0f/p, g_uiBitIncrement, g_uiBitIncrement);
     5016   //for(UInt i = 0; i <256; i++)
     5017   //{
     5018   //  liczby_w[i] = i<<2;
     5019   //  liczby_t[i] = (Pel)( powconv_t(liczby_w[i]) + 0.5);
     5020   //  liczby_o[i] = (Pel)( powconv_o(liczby_t[i]) + 0.5)>>2;
     5021   //}
     5022   //printf("\n");
     5023   //if(bIsIntra)printf("intra ");
     5024   //else        printf("inter ");
     5025   //printf("in:%d, ", uiDepthLumaTransformBlockMax);
     5026   Float p = 1.0f / getSlice()->getSPS()->getDepthPower();
     5027   //printf("p:%f, ", p);
     5028   TComPowerConverter powconv(p, g_uiBitIncrement, g_uiBitIncrement);
     5029   uiDepthLumaTransformBlockMax = (Pel)( powconv(uiDepthLumaTransformBlockMax) + 0.5);
     5030   //printf("out:%d, ", uiDepthLumaTransformBlockMax);
     5031#endif
     5032   Int iDeltaQP = CuQpIncrementFunction(uiDepthLumaTransformBlockMax);
     5033   //printf("dQP:%d ", iDeltaQP);
     5034#if POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW
     5035   Int iMaxCUHeight = this->getPic()->getPicSym()->getMaxCUHeight();
     5036   Int iPicHeight   = this->getPic()->getPicSym()->getPicHeight();
     5037   Int iLastPelYInFirstCURow = 0 + iMaxCUHeight;
     5038   Int iFirstPelYInLastCURow = iPicHeight - iMaxCUHeight;
     5039   Int iCUStartPelY = getCUPelY();
     5040   if((iCUStartPelY <= iLastPelYInFirstCURow) || (iCUStartPelY >= iFirstPelYInLastCURow))
     5041   {
     5042#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     5043     iDeltaQP += getPic()->getTextureCuDeltaQpTopBottomRow();// POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW;
     5044#else
     5045     iDeltaQP += POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_ROW_VAL;// POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW;
     5046#endif
     5047   }
     5048#endif
     5049   return iDeltaQP;
     5050 }
     5051
     5052Int cmpProc(const Void *arg1, const Void *arg2)
     5053{
     5054    return *((Pel*)arg2) - *((Pel*)arg1);
     5055}
     5056
     5057// Function gets median value of depth block that has the same size and position as texture block that calls this function
     5058Pel  TComDataCU::getDepthLumaCodingBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx )
     5059
     5060  static Pel pSortTable [64 * 64];
     5061  Int CUWidth, CUHeight;
     5062  sortDepthLumaCodingBlock( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, CUWidth, CUHeight );
     5063  return pSortTable[(CUHeight * CUWidth) / 2];
     5064}
     5065
     5066// Function gets maximal value of depth block that has the same size and position as texture block that calls this function
     5067Pel TComDataCU::getDepthLumaCodingBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx )
     5068
     5069  return maxDepthLumaCodingBlock( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx); 
     5070}
     5071Void TComDataCU::sortDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& CUWidth, Int& CUHeight )
     5072{
     5073  Int x, y;
     5074  UInt uiAbsZorderIdx  = getZorderIdxInCU() + uiPartIdx;
     5075  // CU size:
     5076  CUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size
     5077  CUWidth  = getWidth(uiPartIdx);
     5078  // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process
     5079  // What we need is z-order idx of first Base block (4x4 pix) in this block
     5080  Int iNumBase4x4InBlock = (CUWidth >> 2) * (CUHeight >> 2);
     5081
     5082  UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock;
     5083  // Address of block
     5084  Pel* pPel   = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart );
     5085
     5086  Int p =0;
     5087  Int iStride  = getPic()->getPicYuvRec()->getStride();
     5088  for ( y = CUHeight - 1; y >= 0; y-- )
     5089  {
     5090    for ( x = CUWidth - 1; x >= 0; x-- )
     5091    {
     5092      pSortTable[p] = pPel[x]; ++p;
     5093    }
     5094    pPel += iStride;
     5095  }
     5096  // sort elements
     5097  qsort(pSortTable, CUHeight * CUWidth, sizeof(Pel), cmpProc);
     5098}
     5099
     5100Pel TComDataCU::maxDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx)
     5101{
     5102  Int x, y;
     5103  UInt uiAbsZorderIdx  = getZorderIdxInCU() + uiPartIdx;
     5104  // CU size:
     5105  Int CUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size
     5106  Int CUWidth  = getWidth(uiPartIdx);
     5107  // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process
     5108  // What we need is z-order idx of first Base block (4x4 pix) in this block
     5109  Int iNumBase4x4InBlock = (CUWidth >> 2) * (CUHeight >> 2);
     5110
     5111  UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock;
     5112  // Address of block
     5113  Pel* pPel   = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart );
     5114
     5115  Pel  pValue = 0;
     5116  Int  iStride = getPic()->getPicYuvRec()->getStride();
     5117  for ( y = CUHeight - 1; y >= 0; y-- )
     5118  {
     5119    for ( x = CUWidth - 1; x >= 0; x-- )
     5120    {
     5121      if (pPel[x]>pValue) pValue = pPel[x];
     5122    }
     5123    pPel += iStride;
     5124  }
     5125  return pValue;
     5126}
     5127
     5128// Function gets median value of depth block that has the same size and position as texture block that calls this function
     5129Pel  TComDataCU::getDepthLumaTransformBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx )
     5130
     5131  static Pel pSortTable [64 * 64];
     5132  Int TUWidth, TUHeight;
     5133  sortDepthLumaTransformBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, TUWidth, TUHeight );
     5134  return pSortTable[(TUHeight * TUWidth) / 2];
     5135}
     5136
     5137// Function gets maximal value of depth block that has the same size and position as texture block that calls this function
     5138Pel TComDataCU::getDepthLumaTransformBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx )
     5139
     5140  return maxDepthLumaTransformBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx );
     5141}
     5142Void TComDataCU::sortDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& TUWidth, Int& TUHeight )
     5143{
     5144  Int x, y;
     5145  UInt uiAbsZorderIdx  = getZorderIdxInCU() + uiPartIdx;
     5146  // CU size:
     5147  TUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size
     5148  TUWidth  = getWidth(uiPartIdx);
     5149  // correct CU size to trnsform size:
     5150  if( getTransformIdx(uiPartIdx) )
     5151  {
     5152    TUWidth  = TUWidth >> 1;
     5153    TUHeight = TUHeight >> 1;
     5154  }
     5155  // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process
     5156  // What we need is z-order idx of first Base block (4x4 pix) in this block
     5157  Int iNumBase4x4InBlock = (TUWidth >> 2) * (TUHeight >> 2);
     5158
     5159  UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock;
     5160  // Address of block
     5161  Pel* pPel   = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart );
     5162
     5163  int p = 0;
     5164  Int  iStride  = getPic()->getPicYuvRec()->getStride();
     5165  for ( y = TUHeight - 1; y >= 0; y-- )
     5166  {
     5167    for ( x = TUWidth - 1; x >= 0; x-- )
     5168    {
     5169      pSortTable[p] = pPel[x];
     5170    }
     5171    pPel += iStride;
     5172  }
     5173  // sort elements
     5174  qsort(pSortTable, TUHeight * TUWidth, sizeof(Pel), cmpProc);
     5175}
     5176Pel TComDataCU::maxDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx)
     5177{
     5178  Int x, y;
     5179  UInt uiAbsZorderIdx  = getZorderIdxInCU() + uiPartIdx;
     5180  // CU size:
     5181  Int TUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size
     5182  Int TUWidth  = getWidth(uiPartIdx);
     5183  // correct CU size to trnsform size:
     5184  if( getTransformIdx(uiPartIdx) )
     5185  {
     5186    TUWidth  = TUWidth >> 1;
     5187    TUHeight = TUHeight >> 1;
     5188  }
     5189  // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process
     5190  // What we need is z-order idx of first Base block (4x4 pix) in this block
     5191  Int iNumBase4x4InBlock = (TUWidth >> 2) * (TUHeight >> 2);
     5192
     5193  UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock;
     5194  // Address of block
     5195  Pel* pPel   = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart );
     5196
     5197  Pel pValue = 0;
     5198  Int iStride  = getPic()->getPicYuvRec()->getStride();
     5199  for ( y = TUHeight - 1; y >= 0; y-- )
     5200  {
     5201    for ( x = TUWidth - 1; x >= 0; x-- )
     5202    {
     5203      if (pPel[x]>pValue) pValue = pPel[x];
     5204    }
     5205    pPel += iStride;
     5206  }
     5207  return pValue;
     5208}
     5209// Function gets median value of depth block that has the same size and position as texture block that calls this function
     5210Pel  TComDataCU::getDepthLumaPredictionBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx )
     5211
     5212  static Pel pSortTable [64 * 64];
     5213  Int PUWidth, PUHeight;
     5214  sortDepthLumaPredictionBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, PUWidth, PUHeight );
     5215  return pSortTable[(PUHeight * PUWidth) / 2];
     5216}
     5217
     5218// Function gets maximal value of depth block that has the same size and position as texture block that calls this function
     5219Pel  TComDataCU::getDepthLumaPredictionBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx )
     5220
     5221  static Pel pSortTable [64 * 64];
     5222  Int PUWidth, PUHeight;
     5223  sortDepthLumaPredictionBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, PUWidth, PUHeight );
     5224  return pSortTable[0];
     5225}
     5226Void TComDataCU::sortDepthLumaPredictionBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& PUWidth, Int& PUHeight )
     5227{
     5228  Int x, y;
     5229  UInt uiAbsZorderIdx  = getZorderIdxInCU() + uiPartIdx;
     5230  // CU size:
     5231  PUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size
     5232  PUWidth  = getWidth(uiPartIdx);
     5233  // correct CU size to partition size:
     5234  if( getPartitionSize(uiPartIdx) == SIZE_Nx2N || getPartitionSize(uiPartIdx) == SIZE_NxN )
     5235  {
     5236    PUWidth = PUWidth >> 1;
     5237  }
     5238  if( getPartitionSize(uiPartIdx) == SIZE_2NxN || getPartitionSize(uiPartIdx) == SIZE_NxN )
     5239  {
     5240    PUHeight = PUHeight >> 1;
     5241  }
     5242 
     5243  // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process
     5244  // What we need is z-order idx of first Base block (4x4 pix) in this block
     5245  Int iNumBase4x4InBlock = (PUWidth >> 2) * (PUHeight >> 2);
     5246  if(getPartitionSize(uiPartIdx) == SIZE_Nx2N)
     5247  {
     5248    iNumBase4x4InBlock = iNumBase4x4InBlock << 1; // KUBA if PU is Nx2N than to count start z-order idx we need to make such trick
     5249  }
     5250  UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock;
     5251  // Address of block
     5252  Pel* pPel   = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart );
     5253
     5254  UInt  uiStride  = getPic()->getPicYuvRec()->getStride();
     5255  for ( y = PUHeight - 1; y >= 0; y-- )
     5256  {
     5257    for ( x = PUWidth - 1; x >= 0; x-- )
     5258    {
     5259      pSortTable[y*PUWidth + x] = pPel[y*uiStride + x];
     5260    }
     5261  }
     5262  // sort elements
     5263  qsort(pSortTable, PUHeight * PUWidth, sizeof(Pel), cmpProc);
     5264}
     5265#endif
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.h

    r11 r12  
    105105#endif//SNY_DQP
    106106 
     107#if POZNAN_EIVD_CALC_PRED_DATA
     108  TComCUMvField m_acCUMvField2nd[2];              ///< array of motion vectors selected for points with no MP prediction available
     109#endif
     110 
    107111  // -------------------------------------------------------------------------------------------------------------------
    108112  // neighbour access variables
     
    310314#endif
    311315 
     316#if POZNAN_EIVD_CALC_PRED_DATA
     317  TComCUMvField* getCUMvField2nd         ( RefPicList e )          { return  &m_acCUMvField2nd[e];  }
     318#endif
     319 
    312320  // -------------------------------------------------------------------------------------------------------------------
    313321  // member functions for coding tool information
     
    529537  Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
    530538  Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
    531 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     539#if POZNAN_CU_SKIP
    532540  Bool          isCUSkiped( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; }
    533541#endif
     
    588596#endif //QC_MDCS
    589597
     598#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     599 Int            CuQpIncrementFunction  ( Pel uiBlockMax );
     600 Int            getQpOffsetForTextCU   ( UInt uiPartIdx, Bool bIsIntra );
     601 Pel            getDepthLumaCodingBlockMedian    ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     602 Pel            getDepthLumaCodingBlockMax       ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     603 Void           sortDepthLumaCodingBlock         ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& TUWidth, Int& TUHeight);
     604 Pel            maxDepthLumaCodingBlock          ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     605 Pel            getDepthLumaTransformBlockMedian ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     606 Pel            getDepthLumaTransformBlockMax    ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     607 Void           sortDepthLumaTransformBlock      ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx , Pel * pSortTable, Int& TUWidth, Int& TUHeight);
     608 Pel            maxDepthLumaTransformBlock       ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     609 Pel            getDepthLumaPredictionBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     610 Pel            getDepthLumaPredictionBlockMax   ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx );
     611 Void           sortDepthLumaPredictionBlock     ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx , Pel * pSortTable, Int& PUWidth, Int& PUHeight);
     612#endif
    590613};
    591614
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r11 r12  
    478478  Pel*        pSrcSamples = pcPicYuv->getLumaAddr ( 0 );
    479479  Pel*        pDstSamples = m_cTmpPic.getLumaAddr ( 0 );
     480  Int         iDstStrideC  = m_cTmpPic.getCStride ( );
     481  Pel*        pDstSamplesCb = m_cTmpPic.getCbAddr ( 0 );
     482  Pel*        pDstSamplesCr = m_cTmpPic.getCrAddr ( 0 );
    480483  Int         iMidOrgDpth = ( 1 << m_uiOrgDepthBitDepth ) >> 1;
    481484  AOF( m_cTmpPic.getWidth () == iWidth  );
     
    483486  for( Int iY = 0; iY < iHeight; iY++, pSrcSamples += iSrcStride, pDstSamples += iDstStride )
    484487  {
     488    if((iY%2) == 0 && iY != 0)
     489    {
     490      pDstSamplesCb += iDstStrideC;
     491      pDstSamplesCr += iDstStrideC;
     492    }
    485493    for( Int iX = 0; iX < iWidth; iX++ )
    486494    {
     495      if(pSrcSamples[ iX ] < 0)//== PDM_UNDEFINED_DEPTH)
     496      {
     497        pDstSamplesCb[ iX>>1 ] = 0;
     498        pDstSamplesCr[ iX>>1 ] = 0;
     499      }
    487500      Int iOrgDepth     = ( pSrcSamples[ iX ] != PDM_UNDEFINED_DEPTH ? xGetOrigDepthFromVirtDepth( uiViewId, pSrcSamples[ iX ] ) : iMidOrgDpth );
    488501      pDstSamples[ iX ] = Max( 0, Min( iMax, iOrgDepth ) );
     
    494507  ::sprintf     ( acFilename, "%s_V%d.yuv", pFilenameBase, uiViewId );
    495508  m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 )  );
     509
     510  pDstSamplesCb = m_cTmpPic.getCbAddr ( 0 );
     511  pDstSamplesCr = m_cTmpPic.getCrAddr ( 0 );
     512  for( Int iY = 0; iY < iHeight>>1; iY++, pDstSamplesCb += iDstStrideC, pDstSamplesCr += iDstStrideC)
     513  {
     514    for( Int iX = 0; iX < iWidth>>1; iX++ )
     515    {
     516      pDstSamplesCb[ iX ] = iMidOrgDpth;
     517      pDstSamplesCr[ iX ] = iMidOrgDpth;
     518    }
     519  }
    496520}
    497521
     
    971995    xInterPredictCUDepthMap( pcSubCU, pcSubDM );
    972996    break;
    973 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     997#if POZNAN_CU_SKIP
    974998  case MODE_SYNTH:
    975     //What to do? Need Fix!
     999    //What to do? Need Fix?
    9761000    xIntraPredictCUDepthMap( pcSubCU, pcSubDM );
    9771001    break;
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp

    r11 r12  
    445445  //-- Set BS for Intra MB : BS = 4 or 3
    446446  if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ)
    447 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     447#if POZNAN_CU_SKIP && POZNAN_CU_SYNTH
    448448     || pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ)
    449449#endif
     
    455455  //-- Set BS for not Intra MB : BS = 2 or 1 or 0
    456456  if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ)
    457 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     457#if POZNAN_CU_SKIP && POZNAN_CU_SYNTH
    458458     && !pcCUP->isCUSkiped(uiPartP) && !pcCUQ->isCUSkiped(uiPartQ)
    459459#endif
     
    536536  }   // enf of "if( not Intra )"
    537537
    538 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //if one of the block is CUSkipped dont use loop filter
     538#if POZNAN_CU_SKIP //if one of the block is CUSkipped dont use loop filter
    539539  if ( pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ))
    540540  {
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.cpp

    r11 r12  
    5050  m_apcPicYuv[0]      = NULL;
    5151  m_apcPicYuv[1]      = NULL;
    52 #if POZNAN_AVAIL_MAP
     52#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    5353  m_apcPicYuvAvail     = NULL;
    5454#endif
    55 #if POZNAN_SYNTH_VIEW
     55#if POZNAN_CU_SYNTH
    5656  m_apcPicYuvSynth     = NULL;
     57#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     58  m_apcPicYuvSynthDepth= NULL;
     59#endif
    5760#endif
    5861#if DEPTH_MAP_GENERATION
     
    122125    m_apcPicYuv[1]  = NULL;
    123126  }
    124 #if POZNAN_AVAIL_MAP
     127#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    125128  if (m_apcPicYuvAvail)
    126129  {
     
    131134#endif
    132135
    133 #if POZNAN_SYNTH_VIEW
     136#if POZNAN_CU_SYNTH
    134137  if (m_apcPicYuvSynth)
    135138  {
     
    138141    m_apcPicYuvSynth  = NULL;
    139142  }
     143#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     144  if (m_apcPicYuvSynthDepth)
     145  {
     146    m_apcPicYuvSynthDepth->destroy();
     147    delete m_apcPicYuvSynthDepth;
     148    m_apcPicYuvSynthDepth  = NULL;
     149  }
     150#endif
    140151#endif
    141152 
     
    216227}
    217228
    218 #if POZNAN_AVAIL_MAP
     229#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    219230Void
    220231TComPic::addAvailabilityBuffer()
     
    232243#endif
    233244
    234 #if POZNAN_SYNTH_VIEW
     245#if POZNAN_CU_SYNTH
    235246Void
    236247TComPic::addSynthesisBuffer()
     
    246257  m_apcPicYuvSynth      ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
    247258}
     259#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     260Void
     261TComPic::addSynthesisDepthBuffer()
     262{
     263  AOT( m_apcPicYuvSynthDepth );
     264  AOF( m_apcPicYuv[1] );
     265  Int   iWidth        = m_apcPicYuv[1]->getWidth      ();
     266  Int   iHeight       = m_apcPicYuv[1]->getHeight     ();
     267  UInt  uiMaxCuWidth  = m_apcPicYuv[1]->getMaxCuWidth ();
     268  UInt  uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight();
     269  UInt  uiMaxCuDepth  = m_apcPicYuv[1]->getMaxCuDepth ();
     270  m_apcPicYuvSynthDepth      = new TComPicYuv;
     271  m_apcPicYuvSynthDepth      ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth );
     272}
     273#endif
    248274#endif
    249275
     
    339365}
    340366
    341 #if POZNAN_AVAIL_MAP
     367#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    342368Void
    343369TComPic::removeAvailabilityBuffer()
     
    352378#endif
    353379
    354 #if POZNAN_SYNTH_VIEW
     380#if POZNAN_CU_SYNTH
    355381Void
    356382TComPic::removeSynthesisBuffer()
     
    363389  }
    364390}
     391#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     392Void
     393TComPic::removeSynthesisDepthBuffer()
     394{
     395  if( m_apcPicYuvSynthDepth )
     396  {
     397    m_apcPicYuvSynthDepth->destroy();
     398    delete m_apcPicYuvSynthDepth;
     399    m_apcPicYuvSynthDepth  = NULL;
     400  }
     401}
     402#endif
    365403#endif
    366404
     
    430468#endif
    431469
    432 #if POZNAN_AVAIL_MAP
     470#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP
    433471Void TComPic::checkSynthesisAvailability( TComDataCU*& rpcCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied )
    434472{
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.h

    r11 r12  
    6262  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
    6363
    64 #if POZNAN_AVAIL_MAP
     64#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    6565  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
    6666#endif
    6767
    68 #if POZNAN_SYNTH_VIEW
     68#if POZNAN_CU_SYNTH
    6969  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
     70#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     71  TComPicYuv*           m_apcPicYuvSynthDepth;         //  Sythesied depth image
     72#endif
    7073#endif
    7174
     
    107110#if HHI_INTERVIEW_SKIP
    108111  TComPicYuv*           m_pcUsedPelsMap;
     112#endif
     113#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     114  Double                m_dTextureCuDeltaQpOffset;
     115  Double                m_dTextureCuDeltaQpMul;
     116  Int                   m_iTextureCuDeltaQpTopBottomRow;
    109117#endif
    110118
     
    136144  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
    137145
    138 #if POZNAN_AVAIL_MAP
     146#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    139147  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image
    140148#endif
    141149
    142 #if POZNAN_SYNTH_VIEW
     150#if POZNAN_CU_SYNTH
    143151  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image
     152#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     153  TComPicYuv*   getPicYuvSynthDepth() { return  m_apcPicYuvSynthDepth; };    //  Sythesied depth image
     154#endif
    144155#endif
    145156
     
    213224
    214225  Void          addOriginalBuffer       ();
    215 #if POZNAN_AVAIL_MAP
     226#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    216227  Void          addAvailabilityBuffer   ();
    217228#endif
    218 #if POZNAN_SYNTH_VIEW
     229#if POZNAN_CU_SYNTH
    219230  Void          addSynthesisBuffer      ();
     231#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     232  Void          addSynthesisDepthBuffer ();
     233#endif
    220234#endif
    221235#if PARALLEL_MERGED_DEBLK
     
    237251
    238252  Void          removeOriginalBuffer    ();
    239 #if POZNAN_SYNTH_VIEW
     253#if POZNAN_CU_SYNTH
    240254  Void          removeSynthesisBuffer   ();
    241 #endif
    242 #if POZNAN_AVAIL_MAP
     255#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     256  Void          removeSynthesisDepthBuffer ();
     257#endif
     258#endif
     259#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP || POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
    243260  Void          removeAvailabilityBuffer();
    244261#endif
     
    259276#endif
    260277
    261 #if POZNAN_AVAIL_MAP
     278#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP
    262279  Void          checkSynthesisAvailability(  TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
    263280#endif
     
    280297  const SEImessages* getSEIs() const { return m_SEIs; }
    281298
     299#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     300  Double getTextureCuDeltaQpOffset( )      { return m_dTextureCuDeltaQpOffset;}
     301  Double getTextureCuDeltaQpMul( )         { return m_dTextureCuDeltaQpMul;}
     302  Int    getTextureCuDeltaQpTopBottomRow( ){ return m_iTextureCuDeltaQpTopBottomRow;}
     303  Void   setTextureCuDeltaQpOffset      ( Double dTextureCuDeltaQpOffset    ){ m_dTextureCuDeltaQpOffset       = dTextureCuDeltaQpOffset; }
     304  Void   setTextureCuDeltaQpMul         ( Double dTextureCuDeltaQpMul       ){ m_dTextureCuDeltaQpMul          = dTextureCuDeltaQpMul; }
     305  Void   setTextureCuDeltaQpTopBottomRow( Int iTextureCuDeltaQpTopBottomRow ){ m_iTextureCuDeltaQpTopBottomRow = iTextureCuDeltaQpTopBottomRow; } 
     306#endif
    282307};// END CLASS DEFINITION TComPic
    283308
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPicSym.cpp

    r2 r12  
    1818  m_uiNumPartitions   = 1<<(m_uhTotalDepth<<1);
    1919 
     20  m_iPicWidth         = iPicWidth;
     21  m_iPicHeight        = iPicHeight;
     22
    2023  m_uiMaxCUWidth      = uiMaxWidth;
    2124  m_uiMaxCUHeight     = uiMaxHeight;
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPicSym.h

    r5 r12  
    4343
    4444// Include files
     45#if POZNAN_MP
     46#include "../TLibCommon/TComMP.h"
     47#endif
     48
    4549#include "CommonDef.h"
    4650#include "TComSlice.h"
     
    5862  UInt          m_uiHeightInCU;
    5963 
     64  Int           m_iPicWidth;
     65  Int           m_iPicHeight;
    6066  UInt          m_uiMaxCUWidth;
    6167  UInt          m_uiMaxCUHeight;
     
    9399  UInt        getNumPartInWidth()       { return m_uiNumPartInWidth;            }
    94100  UInt        getNumPartInHeight()      { return m_uiNumPartInHeight;           }
     101  Int   getPicWidth    () {return m_iPicWidth;}
     102  Int   getPicHeight   () {return m_iPicHeight;}
     103  UInt  getMaxCUWidth  () {return m_uiMaxCUWidth;}
     104  UInt  getMaxCUHeight () {return m_uiMaxCUHeight;}
     105  UChar getTotalDepth  () {return m_uhTotalDepth;}
    95106};// END CLASS DEFINITION TComPicSym
    96107
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPicYuv.cpp

    r2 r12  
    88#include <assert.h>
    99#include <memory.h>
     10#include <math.h>
    1011
    1112#ifdef __APPLE__
     
    1617
    1718#include "TComPicYuv.h"
     19
    1820
    1921TComPicYuv::TComPicYuv()
     
    455457  }
    456458}
     459
     460#if POZNAN_NONLINEAR_DEPTH
     461Void TComPicYuv::power(TComPicYuv *pcPicDst, Float p)
     462{
     463  Int           x,y;
     464  TComPowerConverter powconv(p, g_uiBitIncrement, g_uiBitIncrement);
     465
     466  // Luma
     467  Pel* pPelSrc = getLumaAddr();
     468  Pel* pPelDst = pcPicDst->getLumaAddr();
     469  for(y=0; y<m_iPicHeight; y++)
     470        {
     471    for(x=0; x<m_iPicWidth; x++)
     472    {
     473      pPelDst[x] = (Pel)( powconv(pPelSrc[x]) + 0.5);
     474    }
     475    pPelDst += pcPicDst->getStride();
     476    pPelSrc += getStride();
     477  }
     478  // Chroma
     479  copyToPicCb(pcPicDst);
     480  copyToPicCr(pcPicDst);
     481}
     482#endif
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPicYuv.h

    r5 r12  
    4444#include "CommonDef.h"
    4545
     46#if POZNAN_NONLINEAR_DEPTH
     47
     48#include <math.h>
     49
     50class TComPowerConverter // OLGIERD - Z-NL-Power conversion
     51{
     52private:
     53  Double m_fMul;
     54  Float m_fPower;
     55
     56public:
     57
     58  TComPowerConverter(Float fPower, Int iInputBitIncrement, Int iOutputBitIncrement)
     59  :m_fPower(fPower)
     60  {
     61    Double fPostMul = (1<<(8+iOutputBitIncrement))-1; // OLGIERD ToDo - should be or not?
     62    Double fPreMul  = 1.0/((1<<(8+iInputBitIncrement))-1);
     63    m_fMul = fPostMul*pow(fPreMul,(Double)fPower);
     64  };
     65
     66  inline Double operator() (Double Value)
     67  {   
     68    if (Value<0) return -pow( -Value,(Double)m_fPower)*m_fMul;
     69    return pow(Value,(Double)m_fPower)*m_fMul;
     70  };
     71};
     72#else
     73class TComPowerConverter // OLGIERD - Z-NL-Power conversion
     74{
     75public:
     76
     77  TComPowerConverter(Float fPower, Int iInputBitIncrement, Int iOutputBitIncrement)
     78  {
     79  };
     80
     81  inline Double operator() (Double Value) { return Value; };
     82};
     83#endif
    4684// ====================================================================================================================
    4785// Class definition
     
    175213  Void  setChromaTo  ( Pel pVal ); 
    176214
     215#if POZNAN_NONLINEAR_DEPTH
     216  Void power(TComPicYuv *pcPicDst, Float p);
     217#endif
    177218};// END CLASS DEFINITION TComPicYuv
    178219
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPrediction.cpp

    r5 r12  
    15161516  {
    15171517    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
     1518
     1519#if POZNAN_EIVD
     1520        if(pcCU->getMergeIndex(uiPartAddr)==POZNAN_EIVD_MRG_CAND)
     1521        {
     1522                motionCompensation_EIVD( pcCU, pcYuvPred, eRefPicList, iPartIdx, bPrdDepthMap );
     1523                return;
     1524        }
     1525#endif
     1526
    15181527    if ( eRefPicList != REF_PIC_LIST_X )
    15191528    {
     
    15381547    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
    15391548
     1549#if POZNAN_EIVD
     1550        if(pcCU->getMergeIndex(uiPartAddr)==POZNAN_EIVD_MRG_CAND)
     1551        {
     1552                motionCompensation_EIVD( pcCU, pcYuvPred, eRefPicList, iPartIdx, bPrdDepthMap );
     1553                continue;
     1554        }
     1555#endif
     1556
    15401557    if ( eRefPicList != REF_PIC_LIST_X )
    15411558    {
     
    15551572  return;
    15561573}
     1574
     1575#if POZNAN_EIVD
     1576Void TComPrediction::motionCompensation_EIVD ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap )
     1577{
     1578  if(!pcCU->getSlice()->getMP()->isEIVDEnabled()) return;
     1579
     1580  Int         iPartIdxOrg = iPartIdx;
     1581  Int         iWidth;
     1582  Int         iHeight;
     1583  UInt        uiPartAddr;
     1584
     1585  Int             x,y;
     1586  Int             px,py,iCUBaseX,iCUBaseY;
     1587  Int             ref_frame0, ref_frame1;
     1588  Int             ref_frame0_idx, ref_frame1_idx;
     1589  TComMv          mv0,mv1;
     1590 
     1591  Int             ref_frame0_idx_2nd, ref_frame1_idx_2nd;
     1592  TComMv          mv0_2nd,mv1_2nd;
     1593
     1594  Pel* piDstCb;
     1595  Pel* piDstCr;
     1596  Pel aiUTab[MAX_CU_SIZE];
     1597  Pel aiVTab[MAX_CU_SIZE];
     1598  Pel iULast;
     1599  Pel iVLast;
     1600  Pel iTemp;
     1601
     1602  TComMP* pcMP = pcCU->getSlice()->getMP();
     1603  UInt uiViewId = pcCU->getSlice()->getSPS()->getViewId();
     1604  Bool bIsDepth = pcCU->getSlice()->getSPS()->isDepth();
     1605
     1606#if POZNAN_EIVD_CALC_PRED_DATA
     1607  UInt uiPointCnt;
     1608#endif
     1609   
     1610  for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartInter(); iPartIdx++ )
     1611  {
     1612        if ( iPartIdxOrg >= 0 ) iPartIdx = iPartIdxOrg;
     1613
     1614    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
     1615
     1616        //get motion data used for no-MP predicted points
     1617#if POZNAN_EIVD_CALC_PRED_DATA
     1618        ref_frame0_idx_2nd = pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getRefIdx(uiPartAddr);
     1619        mv0_2nd = pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->getMv( uiPartAddr );
     1620
     1621        ref_frame1_idx_2nd = pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getRefIdx(uiPartAddr);
     1622        mv1_2nd = pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->getMv( uiPartAddr );
     1623#else
     1624        ref_frame0_idx_2nd = pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiPartAddr);
     1625        mv0_2nd = pcCU->getCUMvField( REF_PIC_LIST_0 )->getMv( uiPartAddr );
     1626
     1627        ref_frame1_idx_2nd = pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiPartAddr);
     1628        mv1_2nd = pcCU->getCUMvField( REF_PIC_LIST_1 )->getMv( uiPartAddr );
     1629#endif
     1630
     1631        iCUBaseX = pcCU->getCUPelX()+g_auiRasterToPelX[ g_auiZscanToRaster[uiPartAddr] ];
     1632        iCUBaseY = pcCU->getCUPelY()+g_auiRasterToPelY[ g_auiZscanToRaster[uiPartAddr] ];
     1633
     1634#if POZNAN_EIVD_CALC_PRED_DATA
     1635        uiPointCnt = 0;
     1636#endif
     1637
     1638        for( py = 0; py < iHeight; py++)
     1639        {
     1640                for( px = 0; px < iWidth; px++)
     1641                {
     1642                        x = iCUBaseX+px;
     1643                        y = iCUBaseY+py;
     1644
     1645                        pcMP->getEIVDPredData(pcCU, x, y, ref_frame0, ref_frame0_idx, mv0, ref_frame0_idx_2nd, mv0_2nd,
     1646                                                                                ref_frame1, ref_frame1_idx, mv1, ref_frame1_idx_2nd, mv1_2nd);
     1647
     1648                        pcCU->getCUMvField(REF_PIC_LIST_0)->setRefIdx(ref_frame0_idx, uiPartAddr);
     1649                        pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv( mv0, uiPartAddr );
     1650
     1651                        pcCU->getCUMvField(REF_PIC_LIST_1)->setRefIdx(ref_frame1_idx, uiPartAddr);
     1652                        pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv( mv1, uiPartAddr );
     1653
     1654                        if ( eRefPicList != REF_PIC_LIST_X )
     1655                        {
     1656                          xPredInterUni_EIVD (pcCU, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap );
     1657#ifdef WEIGHT_PRED
     1658                          if ( pcCU->getSlice()->getPPS()->getUseWP() )
     1659                          {
     1660                                xWeightedPredictionUni_EIVD( pcCU, pcYuvPred, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx );
     1661                          }
     1662#endif 
     1663                        }
     1664                        else
     1665                        {
     1666                          xPredInterBi_EIVD  (pcCU, uiPartAddr, px, py, pcYuvPred, iPartIdx, bPrdDepthMap );
     1667                        }                       
     1668
     1669                        if(!pcCU->getSlice()->getSPS()->isDepth()) // Chroma check only for non depth
     1670                        {
     1671                        piDstCb = pcYuvPred->getCbAddr( uiPartAddr ) + (py>>1)*pcYuvPred->getCStride();
     1672                        piDstCr = pcYuvPred->getCrAddr( uiPartAddr ) + (py>>1)*pcYuvPred->getCStride();
     1673
     1674                        //Chroma decimation 16x16 -> 8x8:
     1675                        if(py%2 && px%2)
     1676                        {
     1677                                iTemp = (aiUTab[px-1] + aiUTab[px] + iULast + piDstCb[px>>1] + 2)>>2;
     1678                                aiUTab[px-1] = iULast;
     1679                                iULast = piDstCb[px>>1];
     1680                                piDstCb[px>>1] = iTemp;
     1681
     1682                                iTemp = (aiVTab[px-1] + aiVTab[px] + iVLast + piDstCr[px>>1] + 2)>>2;
     1683                                aiVTab[px-1] = iVLast;
     1684                                iVLast = piDstCr[px>>1];
     1685                                piDstCr[px>>1] = iTemp;
     1686                        }
     1687                        else
     1688                        {
     1689                                aiUTab[(px==0)? iWidth-1 : (px-1)] = iULast;   
     1690                                iULast = piDstCb[px>>1];
     1691
     1692                                aiVTab[(px==0)? iWidth-1 : (px-1)] = iVLast;                           
     1693                                iVLast = piDstCr[px>>1];
     1694                        }       
     1695                        }
     1696
     1697#if !POZNAN_EIVD_COMPRESS_ME_DATA
     1698                        //save motion data for every CU point
     1699                        pcMP->setL0RefPOC(uiViewId,bIsDepth,x,y,ref_frame0);
     1700                        pcMP->setL0MvX(uiViewId,bIsDepth,x,y,mv0.getHor());
     1701                        pcMP->setL0MvY(uiViewId,bIsDepth,x,y,mv0.getVer());
     1702
     1703                        pcMP->setL1RefPOC(uiViewId,bIsDepth,x,y,ref_frame1);
     1704                        pcMP->setL1MvX(uiViewId,bIsDepth,x,y,mv1.getHor());
     1705                        pcMP->setL1MvY(uiViewId,bIsDepth,x,y,mv1.getVer());
     1706#endif
     1707
     1708#if POZNAN_EIVD_CALC_PRED_DATA
     1709                        pcMP->getTempL0RefIdx()[uiPointCnt] = ref_frame0_idx;
     1710                        pcMP->getTempL0MvX()[uiPointCnt] = mv0.getHor();
     1711                        pcMP->getTempL0MvY()[uiPointCnt] = mv0.getVer();
     1712
     1713                        pcMP->getTempL1RefIdx()[uiPointCnt] = ref_frame1_idx;
     1714                        pcMP->getTempL1MvX()[uiPointCnt] = mv1.getHor();
     1715                        pcMP->getTempL1MvY()[uiPointCnt] = mv1.getVer();                       
     1716                       
     1717                        uiPointCnt++;
     1718#endif
     1719
     1720                }
     1721        }
     1722
     1723        //set motion data representing CU with EIVD
     1724        PartSize ePartSize = pcCU->getPartitionSize( uiPartAddr ); //PartSize ePartSize = pcCU->getPartitionSize( 0 );
     1725#if POZNAN_EIVD_CALC_PRED_DATA
     1726        pcMP->xCalcEIVDPredData(uiPointCnt, ref_frame0_idx, mv0, ref_frame1_idx, mv1);
     1727       
     1728        pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( mv0, ref_frame0_idx, ePartSize, uiPartAddr, iPartIdx, 0 );
     1729        //pcCU->getCUMvField(REF_PIC_LIST_0)->setRefIdx(ref_frame0_idx,uiPartAddr);
     1730        //pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv(mv0, uiPartAddr);
     1731       
     1732        pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( mv1, ref_frame1_idx, ePartSize, uiPartAddr, iPartIdx, 0 );
     1733        //pcCU->getCUMvField(REF_PIC_LIST_1)->setRefIdx(ref_frame1_idx,uiPartAddr);
     1734        //pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv(mv1, uiPartAddr);
     1735#else
     1736        pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( mv0_2nd, ref_frame0_idx_2nd, ePartSize, uiPartAddr, iPartIdx, 0 );
     1737        //pcCU->getCUMvField(REF_PIC_LIST_0)->setRefIdx(ref_frame0_idx_2nd,uiPartAddr);
     1738        //pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv(mv0_2nd, uiPartAddr);
     1739        //pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv(mv0.setZero(), uiPartAddr);
     1740
     1741        pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( mv1_2nd, ref_frame1_idx_2nd, ePartSize, uiPartAddr, iPartIdx, 0 );
     1742        //pcCU->getCUMvField(REF_PIC_LIST_1)->setRefIdx(ref_frame1_idx_2nd,uiPartAddr);
     1743        //pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv(mv1_2nd, uiPartAddr);
     1744        //pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv(mv1.setZero(), uiPartAddr);
     1745#endif
     1746
     1747        if ( iPartIdxOrg >= 0 ) break;
     1748  }
     1749  return;
     1750}
     1751#endif
    15571752
    15581753#if HIGH_ACCURACY_BI
     
    20902285}
    20912286
     2287
     2288
     2289#if POZNAN_EIVD
     2290
     2291#if HIGH_ACCURACY_BI
     2292Void TComPrediction::xPredInterUni_EIVD ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi )
     2293#else
     2294Void TComPrediction::xPredInterUni_EIVD ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
     2295#endif
     2296{
     2297  Int         iRefIdx     = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           assert (iRefIdx >= 0);
     2298  TComMv      cMv         = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );
     2299  pcCU->clipMv(cMv);
     2300
     2301#if DEPTH_MAP_GENERATION
     2302  if( bPrdDepthMap )
     2303  {
     2304#if HIGH_ACCURACY_BI
     2305    UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 );
     2306#else
     2307    UInt uiRShift = 0;
     2308#endif
     2309    xPredInterPrdDepthMap_EIVD( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred, uiRShift, PDM_DEPTH_MAP_MCP_FILTER );
     2310    return;
     2311  }
     2312#endif
     2313
     2314#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     2315  if( pcCU->getSlice()->getSPS()->isDepth() )
     2316  {
     2317#if HIGH_ACCURACY_BI
     2318    UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 );
     2319#else
     2320    UInt uiRShift = 0;
     2321#endif
     2322    xPredInterPrdDepthMap_EIVD( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred, uiRShift, 2 );
     2323  }
     2324  else
     2325  {
     2326#endif
     2327#if HIGH_ACCURACY_BI
     2328  if(!bi)
     2329  {
     2330    xPredInterLumaBlk_EIVD ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred );
     2331  }
     2332  else
     2333  {
     2334    xPredInterLumaBlk_EIVD_ha  ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred );
     2335  }
     2336#else
     2337  xPredInterLumaBlk_EIVD       ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred );
     2338#endif
     2339#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     2340  }
     2341#endif
     2342
     2343#if HIGH_ACCURACY_BI
     2344  if (!bi)
     2345  {
     2346        xPredInterChromaBlk_EIVD     ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred );
     2347  }
     2348  else
     2349  {
     2350        xPredInterChromaBlk_EIVD_ha ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec()    , uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred );
     2351  }
     2352#else
     2353  xPredInterChromaBlk_EIVD     ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred );
     2354#endif
     2355}
     2356
     2357Void TComPrediction::xPredInterBi_EIVD ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
     2358{
     2359  TComYuv* pcMbYuv;
     2360  Int      iRefIdx[2] = {-1, -1};
     2361
     2362  for ( Int iRefList = 0; iRefList < 2; iRefList++ )
     2363  {
     2364    RefPicList eRefPicList = (iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0);
     2365    iRefIdx[iRefList] = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );
     2366
     2367    if ( iRefIdx[iRefList] < 0 )
     2368    {
     2369      continue;
     2370    }
     2371
     2372    assert( iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList) );
     2373
     2374    pcMbYuv = &m_acYuvPred[iRefList];
     2375#if HIGH_ACCURACY_BI
     2376    if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 )
     2377      xPredInterUni_EIVD ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, true );
     2378    else
     2379      xPredInterUni_EIVD ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap );
     2380#else
     2381    xPredInterUni_EIVD ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap );
     2382#endif
     2383  }
     2384
     2385#ifdef WEIGHT_PRED
     2386  if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() )
     2387  {
     2388    xWeightedPredictionBi_EIVD( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred );
     2389  }
     2390  else
     2391#endif
     2392    xWeightedAverage_EIVD( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred );
     2393}
     2394
     2395Void TComPrediction::xPredInterPrdDepthMap_EIVD( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiFilterMode ) // 0:std, 1:bilin, 2:nearest neighbour
     2396{
     2397  AOF( uiFilterMode <= 2 );
     2398
     2399  Int     iFPelMask   = ~3;
     2400  Int     iRefStride  = pcPicYuvRef->getStride();
     2401  Int     iDstStride  = rpcYuv->getStride();
     2402  Int     iHor        = ( uiFilterMode == 2 ? ( pcMv->getHor() + 2 ) & iFPelMask : pcMv->getHor() );
     2403  Int     iVer        = ( uiFilterMode == 2 ? ( pcMv->getVer() + 2 ) & iFPelMask : pcMv->getVer() );
     2404#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     2405  if( pcCU->getSlice()->getSPS()->isDepth() )
     2406  {
     2407    assert( uiFilterMode == 2 );
     2408    iHor = pcMv->getHor() * 4;
     2409    iVer = pcMv->getVer() * 4;
     2410  }
     2411#endif
     2412  Int     iRefOffset  = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride;
     2413  Int     ixFrac      = iHor & 0x3;
     2414  Int     iyFrac      = iVer & 0x3;
     2415  Pel*    piRefY      = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     2416  Pel*    piDstY      = rpcYuv->getLumaAddr( uiPartAddr );
     2417
     2418  piRefY += iPosY*iRefStride+iPosX;
     2419  piDstY += iPosY*iDstStride+iPosX;
     2420
     2421  //  Integer position
     2422  if( ixFrac == 0 && iyFrac == 0 )
     2423  {
     2424    piDstY[ 0 ] = piRefY[ 0 ] << uiRShift;
     2425    return;
     2426  }
     2427
     2428  // bi-linear interpolation
     2429  if( uiFilterMode == 1 )
     2430  {
     2431    Int   iW00    = ( 4 - ixFrac ) * ( 4 - iyFrac );
     2432    Int   iW01    = (     ixFrac ) * ( 4 - iyFrac );
     2433    Int   iW10    = ( 4 - ixFrac ) * (     iyFrac );
     2434    Int   iW11    = (     ixFrac ) * (     iyFrac );
     2435    Pel*  piRefY1 = piRefY + iRefStride;
     2436    Int iSV     = iW00 * piRefY [ 0 ] + iW01 * piRefY [ 1 ]
     2437                + iW10 * piRefY1[ 0 ] + iW11 * piRefY1[ 1 ];
     2438    iSV       <<= uiRShift;
     2439    piDstY[ 0 ] = ( iSV + 8 ) >> 4;
     2440    return;
     2441  }
     2442
     2443  xPredInterLumaBlk_EIVD( pcCU, pcPicYuvRef, uiPartAddr, pcMv, iPosX, iPosY, rpcYuv );
     2444  return;
     2445}
     2446
     2447
     2448#if HIGH_ACCURACY_BI
     2449
     2450Void  TComPrediction::xPredInterLumaBlk_EIVD_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv )
     2451{
     2452  Int     iRefStride = pcPicYuvRef->getStride();
     2453  Int     iDstStride = rpcYuv->getStride();
     2454
     2455  Int     iRefOffset = ( pcMv->getHor() >> 2 ) + ( pcMv->getVer() >> 2 ) * iRefStride;
     2456  Pel*    piRefY     = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     2457
     2458  Int     ixFrac  = pcMv->getHor() & 0x3;
     2459  Int     iyFrac  = pcMv->getVer() & 0x3;
     2460
     2461  Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr );
     2462  UInt shiftNum = 14-g_uiBitDepth-g_uiBitIncrement;
     2463
     2464  piDstY += iPosY*iDstStride+iPosX;
     2465  piRefY += iPosY*iRefStride+iPosX;
     2466
     2467  //  Integer point
     2468  if ( ixFrac == 0 && iyFrac == 0 )
     2469  {
     2470    *piDstY = (*piRefY)<<shiftNum;
     2471    return;
     2472  }
     2473
     2474  Int iWidth = 1;
     2475  Int iHeight = 1;
     2476
     2477  //  Half-pel horizontal
     2478  if ( ixFrac == 2 && iyFrac == 0 )
     2479  {
     2480    xCTI_FilterHalfHor_ha ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2481    return;
     2482  }
     2483
     2484  //  Half-pel vertical
     2485  if ( ixFrac == 0 && iyFrac == 2 )
     2486  {
     2487    xCTI_FilterHalfVer_ha ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2488    return;
     2489  }
     2490
     2491  Int   iExtStride = m_iYuvExtStride;//m_cYuvExt.getStride();
     2492  Int*  piExtY     = m_piYuvExt;//m_cYuvExt.getLumaAddr();
     2493
     2494  //  Half-pel center
     2495  if ( ixFrac == 2 && iyFrac == 2 )
     2496  {
     2497    xCTI_FilterHalfVer (piRefY - 3,  iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY );
     2498    xCTI_FilterHalfHor_ha (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2499    return;
     2500  }
     2501
     2502  //  Quater-pel horizontal
     2503  if ( iyFrac == 0)
     2504  {
     2505    if ( ixFrac == 1)
     2506    {
     2507      xCTI_FilterQuarter0Hor_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2508      return;
     2509    }
     2510    if ( ixFrac == 3)
     2511    {
     2512      xCTI_FilterQuarter1Hor_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2513      return;
     2514    }
     2515  }
     2516  if ( iyFrac == 2 )
     2517  {
     2518    if ( ixFrac == 1)
     2519    {
     2520      xCTI_FilterHalfVer (piRefY -3,  iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY );
     2521      xCTI_FilterQuarter0Hor_ha (piExtY + 3,  iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2522      return;
     2523    }
     2524    if ( ixFrac == 3)
     2525    {
     2526      xCTI_FilterHalfVer (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2527      xCTI_FilterQuarter1Hor_ha (piExtY + 3,  iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2528      return;
     2529    }
     2530  }
     2531
     2532  //  Quater-pel vertical
     2533  if( ixFrac == 0 )
     2534  {
     2535    if( iyFrac == 1 )
     2536    {
     2537      xCTI_FilterQuarter0Ver_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2538      return;
     2539    }
     2540    if( iyFrac == 3 )
     2541    {
     2542      xCTI_FilterQuarter1Ver_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2543      return;
     2544    }
     2545  }
     2546
     2547  if( ixFrac == 2 )
     2548  {
     2549    if( iyFrac == 1 )
     2550    {
     2551      xCTI_FilterQuarter0Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2552      xCTI_FilterHalfHor_ha (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2553
     2554      return;
     2555    }
     2556    if( iyFrac == 3 )
     2557    {
     2558      xCTI_FilterQuarter1Ver (piRefY -3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2559      xCTI_FilterHalfHor_ha (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2560      return;
     2561    }
     2562  }
     2563
     2564  /// Quarter-pel center
     2565  if ( iyFrac == 1)
     2566  {
     2567    if ( ixFrac == 1)
     2568    {
     2569      xCTI_FilterQuarter0Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2570      xCTI_FilterQuarter0Hor_ha (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2571      return;
     2572    }
     2573    if ( ixFrac == 3)
     2574    {
     2575      xCTI_FilterQuarter0Ver (piRefY - 3,  iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY );
     2576      xCTI_FilterQuarter1Hor_ha (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2577
     2578      return;
     2579    }
     2580  }
     2581  if ( iyFrac == 3 )
     2582  {
     2583    if ( ixFrac == 1)
     2584    {
     2585      xCTI_FilterQuarter1Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2586      xCTI_FilterQuarter0Hor_ha (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2587      return;
     2588    }
     2589    if ( ixFrac == 3)
     2590    {
     2591      xCTI_FilterQuarter1Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2592      xCTI_FilterQuarter1Hor_ha (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2593      return;
     2594    }
     2595  }
     2596}
     2597
     2598#endif
     2599
     2600Void  TComPrediction::xPredInterLumaBlk_EIVD( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv )
     2601{
     2602  Int     iRefStride = pcPicYuvRef->getStride();
     2603  Int     iDstStride = rpcYuv->getStride();
     2604
     2605  Int     iRefOffset = ( pcMv->getHor() >> 2 ) + ( pcMv->getVer() >> 2 ) * iRefStride;
     2606  Pel*    piRefY     = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     2607
     2608  Int     ixFrac  = pcMv->getHor() & 0x3;
     2609  Int     iyFrac  = pcMv->getVer() & 0x3;
     2610
     2611  Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr );
     2612 
     2613  piDstY += iPosY*iDstStride+iPosX;
     2614  piRefY += iPosY*iRefStride+iPosX;
     2615
     2616  //  Integer point
     2617  if ( ixFrac == 0 && iyFrac == 0 )
     2618  {
     2619    ::memcpy(piDstY, piRefY, sizeof(Pel));
     2620    return;
     2621  }
     2622
     2623  Int iWidth = 1;
     2624  Int iHeight = 1;
     2625
     2626  //  Half-pel horizontal
     2627  if ( ixFrac == 2 && iyFrac == 0 )
     2628  {
     2629    xCTI_FilterHalfHor ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2630    return;
     2631  }
     2632
     2633  //  Half-pel vertical
     2634  if ( ixFrac == 0 && iyFrac == 2 )
     2635  {
     2636    xCTI_FilterHalfVer ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2637    return;
     2638  }
     2639
     2640  Int   iExtStride = m_iYuvExtStride;//m_cYuvExt.getStride();
     2641  Int*  piExtY     = m_piYuvExt;//m_cYuvExt.getLumaAddr();
     2642
     2643  //  Half-pel center
     2644  if ( ixFrac == 2 && iyFrac == 2 )
     2645  {
     2646
     2647    xCTI_FilterHalfVer (piRefY - 3,  iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY );
     2648    xCTI_FilterHalfHor (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2649    return;
     2650  }
     2651
     2652  //  Quater-pel horizontal
     2653  if ( iyFrac == 0)
     2654  {
     2655    if ( ixFrac == 1)
     2656    {
     2657      xCTI_FilterQuarter0Hor( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2658      return;
     2659    }
     2660    if ( ixFrac == 3)
     2661    {
     2662      xCTI_FilterQuarter1Hor( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2663      return;
     2664    }
     2665  }
     2666  if ( iyFrac == 2 )
     2667  {
     2668    if ( ixFrac == 1)
     2669    {
     2670      xCTI_FilterHalfVer (piRefY -3,  iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY );
     2671      xCTI_FilterQuarter0Hor (piExtY + 3,  iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2672      return;
     2673    }
     2674    if ( ixFrac == 3)
     2675    {
     2676      xCTI_FilterHalfVer (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2677      xCTI_FilterQuarter1Hor (piExtY + 3,  iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2678      return;
     2679    }
     2680  }
     2681
     2682  //  Quater-pel vertical
     2683  if( ixFrac == 0 )
     2684  {
     2685    if( iyFrac == 1 )
     2686    {
     2687      xCTI_FilterQuarter0Ver( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2688      return;
     2689    }
     2690    if( iyFrac == 3 )
     2691    {
     2692      xCTI_FilterQuarter1Ver( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY );
     2693      return;
     2694    }
     2695  }
     2696
     2697  if( ixFrac == 2 )
     2698  {
     2699    if( iyFrac == 1 )
     2700    {
     2701      xCTI_FilterQuarter0Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2702      xCTI_FilterHalfHor (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2703      return;
     2704    }
     2705    if( iyFrac == 3 )
     2706    {
     2707      xCTI_FilterQuarter1Ver (piRefY -3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2708      xCTI_FilterHalfHor (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2709      return;
     2710    }
     2711  }
     2712
     2713  /// Quarter-pel center
     2714  if ( iyFrac == 1)
     2715  {
     2716    if ( ixFrac == 1)
     2717    {
     2718      xCTI_FilterQuarter0Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2719      xCTI_FilterQuarter0Hor (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2720      return;
     2721    }
     2722    if ( ixFrac == 3)
     2723    {
     2724      xCTI_FilterQuarter0Ver (piRefY - 3,  iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY );
     2725      xCTI_FilterQuarter1Hor (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2726      return;
     2727    }
     2728  }
     2729  if ( iyFrac == 3 )
     2730  {
     2731    if ( ixFrac == 1)
     2732    {
     2733      xCTI_FilterQuarter1Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2734      xCTI_FilterQuarter0Hor (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2735      return;
     2736    }
     2737    if ( ixFrac == 3)
     2738    {
     2739      xCTI_FilterQuarter1Ver (piRefY - 3,  iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY );
     2740      xCTI_FilterQuarter1Hor (piExtY + 3,  iExtStride, 1, iWidth    , iHeight, iDstStride, 1, piDstY );
     2741      return;
     2742    }
     2743  }
     2744}
     2745
     2746#if HIGH_ACCURACY_BI
     2747Void TComPrediction::xPredInterChromaBlk_EIVD_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv )
     2748{
     2749  Int     iRefStride  = pcPicYuvRef->getCStride();
     2750  Int     iDstStride  = rpcYuv->getCStride();
     2751
     2752  Int     iRefOffset  = (pcMv->getHor() >> 3) + (pcMv->getVer() >> 3) * iRefStride;
     2753
     2754  Pel*    piRefCb     = pcPicYuvRef->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     2755  Pel*    piRefCr     = pcPicYuvRef->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     2756
     2757  Pel* piDstCb = rpcYuv->getCbAddr( uiPartAddr );
     2758  Pel* piDstCr = rpcYuv->getCrAddr( uiPartAddr );
     2759
     2760  Int     ixFrac  = pcMv->getHor() & 0x7;
     2761  Int     iyFrac  = pcMv->getVer() & 0x7;
     2762  UInt    uiCWidth  = 1;
     2763  UInt    uiCHeight = 1;
     2764
     2765  piDstCb += (iPosY>>1)*iDstStride+(iPosX>>1);
     2766  piDstCr += (iPosY>>1)*iDstStride+(iPosX>>1);
     2767  piRefCb += (iPosY>>1)*iRefStride+(iPosX>>1);
     2768  piRefCr += (iPosY>>1)*iRefStride+(iPosX>>1);
     2769
     2770  xDCTIF_FilterC_ha(piRefCb, iRefStride,piDstCb,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac);
     2771  xDCTIF_FilterC_ha(piRefCr, iRefStride,piDstCr,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac);
     2772  return;
     2773}
     2774#endif
     2775
     2776//--
     2777Void TComPrediction::xPredInterChromaBlk_EIVD( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv )
     2778{
     2779  Int     iRefStride  = pcPicYuvRef->getCStride();
     2780  Int     iDstStride  = rpcYuv->getCStride();
     2781
     2782  Int     iRefOffset  = (pcMv->getHor() >> 3) + (pcMv->getVer() >> 3) * iRefStride;
     2783
     2784  Pel*    piRefCb     = pcPicYuvRef->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     2785  Pel*    piRefCr     = pcPicYuvRef->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     2786
     2787  Pel* piDstCb = rpcYuv->getCbAddr( uiPartAddr );
     2788  Pel* piDstCr = rpcYuv->getCrAddr( uiPartAddr );
     2789
     2790  Int     ixFrac  = pcMv->getHor() & 0x7;
     2791  Int     iyFrac  = pcMv->getVer() & 0x7;
     2792  UInt    uiCWidth  = 1;
     2793  UInt    uiCHeight = 1;
     2794
     2795  piDstCb += (iPosY>>1)*iDstStride+(iPosX>>1);
     2796  piDstCr += (iPosY>>1)*iDstStride+(iPosX>>1);
     2797  piRefCb += (iPosY>>1)*iRefStride+(iPosX>>1);
     2798  piRefCr += (iPosY>>1)*iRefStride+(iPosX>>1);
     2799
     2800  xDCTIF_FilterC(piRefCb, iRefStride,piDstCb,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac);
     2801  xDCTIF_FilterC(piRefCr, iRefStride,piDstCr,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac);
     2802  return;
     2803}
     2804
     2805#endif
     2806
     2807
    20922808Void  TComPrediction::xDCTIF_FilterC ( Pel*  piRefC, Int iRefStride,Pel*  piDstC,Int iDstStride,
    20932809                                       Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac)
     
    21932909  }
    21942910}
     2911
     2912#if POZNAN_EIVD
     2913Void TComPrediction::xWeightedAverage_EIVD( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst )
     2914{
     2915  if( iRefIdx0 >= 0 && iRefIdx1 >= 0 )
     2916  {
     2917#ifdef ROUNDING_CONTROL_BIPRED
     2918    rpcYuvDst->addAvg_EIVD( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, pcCU->getSlice()->isRounding());
     2919#else
     2920    rpcYuvDst->addAvg_EIVD( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY );
     2921#endif
     2922  }
     2923  else if ( iRefIdx0 >= 0 && iRefIdx1 <  0 )
     2924  {
     2925    pcYuvSrc0->copyPartToPartYuv_EIVD( rpcYuvDst, uiPartIdx, iPosX, iPosY );
     2926  }
     2927  else if ( iRefIdx0 <  0 && iRefIdx1 >= 0 )
     2928  {
     2929    pcYuvSrc1->copyPartToPartYuv_EIVD( rpcYuvDst, uiPartIdx, iPosX, iPosY );
     2930  }
     2931  else
     2932  {
     2933    assert (0);
     2934  }
     2935}
     2936#endif
    21952937
    21962938// AMVP
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPrediction.h

    r5 r12  
    5252#endif
    5353
     54#if POZNAN_MP
     55#include "../TLibCommon/TComMP.h"
     56#endif
     57
    5458// ====================================================================================================================
    5559// Class definition
     
    113117#endif
    114118
     119#if POZNAN_EIVD
     120#if HIGH_ACCURACY_BI
     121  Void xPredInterUni_EIVD       ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi=false          );
     122#else
     123  Void xPredInterUni_EIVD       ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap          );
     124#endif
     125  Void xPredInterBi_EIVD        ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iPosX, Int iPosY,                         TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap          );
     126  Void xPredInterPrdDepthMap_EIVD( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY,                     TComYuv*& rpcYuv, UInt uiRShift, UInt uiFilterMode ); // 0:std, 1:bilin, 2:nearest neighbour
     127  Void xPredInterLumaBlk_EIVD   ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY,                         TComYuv*& rpcYuv );
     128  Void xPredInterChromaBlk_EIVD ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY,                         TComYuv*& rpcYuv                            );
     129  Void xWeightedAverage_EIVD    ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst );
     130 
     131#if HIGH_ACCURACY_BI
     132  Void xPredInterLumaBlk_EIVD_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY,                         TComYuv*& rpcYuv );
     133  Void xPredInterChromaBlk_EIVD_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY,                         TComYuv*& rpcYuv                            );
     134#endif
     135#endif
     136
    115137#if HHI_DMM_WEDGE_INTRA
    116138  Void xPredIntraWedgeFull       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, UInt uiTabIdx, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 );
     
    147169  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false );
    148170 
     171#if POZNAN_EIVD
     172  Void motionCompensation_EIVD         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false );
     173#endif
     174
    149175  // motion vector prediction
    150176  Void getMvPredAMVP              ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred );
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r11 r12  
    306306    xSetRecResidualInterCU( pcSubCU, pcSubRes );
    307307    break;
    308 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     308#if POZNAN_CU_SKIP
    309309  case MODE_SYNTH:
    310310    xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function
     
    341341  UInt    uiLumaTrMode, uiChromaTrMode;
    342342  pcCU->convertTransIdx             ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode );
     343#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     344  m_pcTrQuant->setQPforQuant        ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(0/*uiAbsPartIdx*/, false), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     345#else
    343346  m_pcTrQuant->setQPforQuant        ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     347#endif
     348  //m_pcTrQuant->setQPforQuant        ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
    344349  m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pRes, 0, pcCUResidual->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff );
    345350  // chroma Cb
     
    348353  piCoeff     = pcCU->getCoeffCb();
    349354  pRes        = pcCUResidual->getCbAddr();
     355#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     356  m_pcTrQuant->setQPforQuant        ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(0/*uiAbsPartIdx*/, false), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     357#else
    350358  m_pcTrQuant->setQPforQuant        ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     359#endif
     360  //m_pcTrQuant->setQPforQuant        ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
    351361  m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pRes, 0, pcCUResidual->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff );
    352362  // chroma Cr
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp

    r11 r12  
    8585  initWpAcDcParam();
    8686#endif
     87
     88#if POZNAN_MP
     89  m_pcMP = NULL;
     90#endif
    8791}
    8892
    8993TComSlice::~TComSlice()
    9094{
     95#if POZNAN_MP
     96  m_pcMP = NULL;
     97#endif
    9198}
    9299
     
    722729    }
    723730  }
     731#if POZNAN_NONLINEAR_DEPTH
     732  m_fDepthPower = 1.0;
     733#endif
    724734}
    725735
     
    737747  ::memset( m_aaiCodedScale,  0x00, sizeof( m_aaiCodedScale  ) );
    738748  ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) );
     749#if POZNAN_NONLINEAR_DEPTH
     750  m_fDepthPower = 1.0;
     751#endif
    739752}
    740753
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.h

    r11 r12  
    5757#endif
    5858
     59#if POZNAN_MP
     60//#include "../TLibCommon/TComMP.h"
     61class TComMP;
     62#endif
     63
    5964// ====================================================================================================================
    6065// Class definition
     
    153158#if HHI_INTER_VIEW_RESIDUAL_PRED
    154159  TComResidualGenerator* m_pcResidualGenerator;
     160#endif
     161
     162#if POZNAN_NONLINEAR_DEPTH
     163  Float  m_fDepthPower;
     164#endif
     165
     166#if POZNAN_MP
     167  TComMP* m_pcMP;
     168#endif
     169
     170#if POZNAN_STAT_JK
     171  FILE* m_pcStatFile[MAX_INPUT_VIEW_NUM];
    155172#endif
    156173
     
    305322  TComResidualGenerator*  getResidualGenerator()                                              { return m_pcResidualGenerator; }
    306323#endif
     324#if POZNAN_NONLINEAR_DEPTH
     325  inline Void    setDepthPower(Float p)   {m_fDepthPower = p;}
     326  inline Float   getDepthPower()          {return m_fDepthPower;}
     327#else
     328  inline Float   getDepthPower()          {return 1.0f;}
     329#endif
    307330};
    308331
     
    445468#endif
    446469
     470#if POZNAN_MP
     471  TComMP* m_pcMP;
     472#endif
     473
     474#if POZNAN_STAT_JK
     475  FILE* m_pcStatFile;
     476#endif
     477
    447478public:
    448479  TComSlice();
     480#if POZNAN_MP
     481  ~TComSlice();
     482#else
    449483  virtual ~TComSlice();
     484#endif
    450485
    451486  Void      initSlice       ();
     
    605640#endif
    606641
     642#if POZNAN_MP
     643  Void setMP(TComMP* pcMP) { m_pcMP = pcMP; }
     644  TComMP* getMP() { return m_pcMP; }
     645#endif
     646
     647#if POZNAN_STAT_JK
     648  Void setStatFile(FILE* pcStatFile) { m_pcStatFile = pcStatFile; }
     649  FILE* getStatFile() { return m_pcStatFile; }
     650#endif
     651
    607652protected:
    608653#if 0
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComWeightPrediction.cpp

    r5 r12  
    393393}
    394394
     395#if POZNAN_EIVD
     396
     397Void TComWeightPrediction::addWeightBi_EIVD( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* rpcYuvDst, Bool bRound )
     398{
     399  Pel* pSrcY0  = pcYuvSrc0->getLumaAddr( iPartUnitIdx );
     400  Pel* pSrcU0  = pcYuvSrc0->getCbAddr  ( iPartUnitIdx );
     401  Pel* pSrcV0  = pcYuvSrc0->getCrAddr  ( iPartUnitIdx );
     402 
     403  Pel* pSrcY1  = pcYuvSrc1->getLumaAddr( iPartUnitIdx );
     404  Pel* pSrcU1  = pcYuvSrc1->getCbAddr  ( iPartUnitIdx );
     405  Pel* pSrcV1  = pcYuvSrc1->getCrAddr  ( iPartUnitIdx );
     406 
     407  Pel* pDstY   = rpcYuvDst->getLumaAddr( iPartUnitIdx );
     408  Pel* pDstU   = rpcYuvDst->getCbAddr  ( iPartUnitIdx );
     409  Pel* pDstV   = rpcYuvDst->getCrAddr  ( iPartUnitIdx );
     410 
     411  // Luma : --------------------------------------------
     412  Int w0      = wp0[0].w;
     413  Int o0      = wp0[0].o;
     414  Int offset  = wp0[0].offset;
     415  Int shiftNum = 14 - (g_uiBitDepth + g_uiBitIncrement);
     416  Int shift   = wp0[0].shift + shiftNum;
     417  Int round   = (1<<(shift-1)) * bRound;
     418  Int w1      = wp1[0].w;
     419  Int o1      = wp1[0].o;
     420
     421  UInt  iSrc0Stride = pcYuvSrc0->getStride();
     422  UInt  iSrc1Stride = pcYuvSrc1->getStride();
     423  UInt  iDstStride  = rpcYuvDst->getStride();
     424 
     425  pDstY[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcY0[iPosY*iSrc0Stride+iPosX], w1,pSrcY1[iPosY*iSrc1Stride+iPosX], round, shift, offset);
     426   
     427  // Chromas : --------------------------------------------
     428  iSrc0Stride = pcYuvSrc0->getCStride();
     429  iSrc1Stride = pcYuvSrc1->getCStride();
     430  iDstStride  = rpcYuvDst->getCStride();
     431 
     432  iPosX = iPosX>>1;
     433  iPosY = iPosY>>1;
     434
     435  // Chroma U : --------------------------------------------
     436  w0      = wp0[1].w;
     437  o0      = wp0[1].o;
     438  offset  = wp0[1].offset;
     439  shift   = wp0[1].shift + shiftNum;
     440  round   = (1<<(shift-1));
     441  w1      = wp1[1].w;
     442  o1      = wp1[1].o;
     443 
     444  pDstU[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcU0[iPosY*iSrc0Stride+iPosX], w1,pSrcU1[iPosY*iSrc1Stride+iPosX], round, shift, offset);
     445
     446  // Chroma V : --------------------------------------------
     447  w0      = wp0[2].w;
     448  o0      = wp0[2].o;
     449  offset  = wp0[2].offset;
     450  shift   = wp0[2].shift + shiftNum;
     451  round   = (1<<(shift-1));
     452  w1      = wp1[2].w;
     453  o1      = wp1[2].o;
     454
     455  pDstV[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcV0[iPosY*iSrc0Stride+iPosX], w1,pSrcV1[iPosY*iSrc1Stride+iPosX], round, shift, offset);
     456}
     457
     458Void TComWeightPrediction::addWeightUni_EIVD( TComYuv* pcYuvSrc0, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, TComYuv* rpcYuvDst )
     459{
     460  Pel* pSrcY0  = pcYuvSrc0->getLumaAddr( iPartUnitIdx );
     461  Pel* pSrcU0  = pcYuvSrc0->getCbAddr  ( iPartUnitIdx );
     462  Pel* pSrcV0  = pcYuvSrc0->getCrAddr  ( iPartUnitIdx );
     463 
     464  Pel* pDstY   = rpcYuvDst->getLumaAddr( iPartUnitIdx );
     465  Pel* pDstU   = rpcYuvDst->getCbAddr  ( iPartUnitIdx );
     466  Pel* pDstV   = rpcYuvDst->getCrAddr  ( iPartUnitIdx );
     467 
     468  // Luma : --------------------------------------------
     469  Int w0      = wp0[0].w;
     470  Int offset  = wp0[0].offset;
     471  Int shift   = wp0[0].shift;
     472  Int round   = wp0[0].round;
     473
     474  UInt  iSrc0Stride = pcYuvSrc0->getStride();
     475  UInt  iDstStride  = rpcYuvDst->getStride();
     476 
     477  pDstY[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcY0[iPosY*iSrc0Stride+iPosX], round, shift, offset);
     478   
     479  // Chromas : --------------------------------------------
     480  iSrc0Stride = pcYuvSrc0->getCStride();
     481  iDstStride  = rpcYuvDst->getCStride();
     482 
     483  iPosX = iPosX>>1;
     484  iPosY = iPosY>>1;
     485
     486  // Chroma U : --------------------------------------------
     487  w0      = wp0[1].w;
     488  offset  = wp0[1].offset;
     489  shift   = wp0[1].shift;
     490  round   = wp0[1].round;
     491 
     492  pDstU[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcU0[iPosY*iSrc0Stride+iPosX], round, shift, offset);
     493
     494  // Chroma V : --------------------------------------------
     495  w0      = wp0[2].w;
     496  offset  = wp0[2].offset;
     497  shift   = wp0[2].shift;
     498  round   = wp0[2].round;
     499
     500  pDstV[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcV0[iPosY*iSrc0Stride+iPosX], round, shift, offset);
     501}
     502
     503Void TComWeightPrediction::xWeightedPredictionUni_EIVD( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx )
     504{
     505  wpScalingParam  *pwp, *pwpTmp;
     506  Int             iRefIdx   = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );           assert (iRefIdx >= 0);
     507  Int             ibdi = (g_uiBitDepth+g_uiBitIncrement);
     508
     509  if ( eRefPicList == REF_PIC_LIST_0 )
     510  {
     511    getWpScaling(pcCU, iRefIdx, -1, pwp, pwpTmp, ibdi);
     512  }
     513  else
     514  {
     515    getWpScaling(pcCU, -1, iRefIdx, pwpTmp, pwp, ibdi);
     516  }
     517  addWeightUni_EIVD( pcYuvSrc, uiPartAddr, iPosX, iPosY, pwp, rpcYuvPred );
     518}
     519
     520Void TComWeightPrediction::xWeightedPredictionBi_EIVD( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv* rpcYuvDst )
     521{
     522  wpScalingParam  *pwp0, *pwp1;
     523  TComPPS         *pps = pcCU->getSlice()->getPPS();
     524
     525  if ( !pps->getUseWP() ) {
     526    printf("TComWeightPrediction::xWeightedPredictionBi():\tassert failed: useWP is false.\n");
     527    exit(0);
     528  }
     529
     530  Int ibdi = (g_uiBitDepth+g_uiBitIncrement);
     531  getWpScaling(pcCU, iRefIdx0, iRefIdx1, pwp0, pwp1, ibdi);
     532
     533  if( iRefIdx0 >= 0 && iRefIdx1 >= 0 )
     534  {
     535    addWeightBi_EIVD(pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, pwp0, pwp1, rpcYuvDst );
     536  }
     537  else if ( iRefIdx0 >= 0 && iRefIdx1 <  0 )
     538  {
     539    addWeightUni_EIVD( pcYuvSrc0, uiPartIdx, iPosX, iPosY, pwp0, rpcYuvDst );
     540  }
     541  else if ( iRefIdx0 <  0 && iRefIdx1 >= 0 )
     542  {
     543    addWeightUni_EIVD( pcYuvSrc1, uiPartIdx, iPosX, iPosY, pwp1, rpcYuvDst );
     544  }
     545  else
     546    assert (0);
     547
     548}
     549#endif
     550
    395551#endif  // WEIGHT_PRED
    396552
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComWeightPrediction.h

    r2 r12  
    3737  Void  xWeightedPredictionBi( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* rpcYuvDst );
    3838
     39#if POZNAN_EIVD
     40  Void  addWeightBi_EIVD( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* rpcYuvDst, Bool bRound=true );
     41  Void  addWeightUni_EIVD( TComYuv* pcYuvSrc0, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, TComYuv* rpcYuvDst );
     42
     43  Void  xWeightedPredictionUni_EIVD( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx );
     44  Void  xWeightedPredictionBi_EIVD( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv* rpcYuvDst );
     45#endif
     46
    3947  __inline  Pel   xClip  ( Int x );
    4048  __inline  Pel   weightBidir( Int w0, Pel P0, Int w1, Pel P1, Int round, Int shift, Int offset);
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComYuv.cpp

    r5 r12  
    354354}
    355355
     356#if POZNAN_EIVD
     357
     358Void TComYuv::copyPartToPartYuv_EIVD   ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY )
     359{
     360  copyPartToPartLuma_EIVD   (pcYuvDst, uiPartIdx, uiPosX, uiPosY );
     361  copyPartToPartChroma_EIVD (pcYuvDst, uiPartIdx, uiPosX>>1, uiPosY>>1 );
     362}
     363
     364Void TComYuv::copyPartToPartLuma_EIVD  ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY )
     365{
     366  Pel* pSrc =           getLumaAddr(uiPartIdx);
     367  Pel* pDst = pcYuvDst->getLumaAddr(uiPartIdx);
     368  if( pSrc == pDst )
     369  {
     370    //th not a good idea
     371    //th best would be to fix the caller
     372    return ;
     373  }
     374 
     375  UInt  iSrcStride = getStride();
     376  UInt  iDstStride = pcYuvDst->getStride();
     377
     378  ::memcpy( pDst+uiPosY*iDstStride+uiPosX, pSrc+uiPosY*iSrcStride+uiPosX, sizeof(Pel) );
     379}
     380
     381Void TComYuv::copyPartToPartChroma_EIVD( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY )
     382{
     383  Pel*  pSrcU =           getCbAddr(uiPartIdx);
     384  Pel*  pSrcV =           getCrAddr(uiPartIdx);
     385  Pel*  pDstU = pcYuvDst->getCbAddr(uiPartIdx);
     386  Pel*  pDstV = pcYuvDst->getCrAddr(uiPartIdx);
     387 
     388  if( getCbAddr() == NULL || getCrAddr() == NULL || pcYuvDst->getCbAddr() == NULL || pcYuvDst->getCrAddr() == NULL ) //KUBA CHROMA
     389  {
     390    return ;
     391  }
     392  if( pSrcU == pDstU && pSrcV == pDstV)
     393  {
     394    //th not a good idea
     395    //th best would be to fix the caller
     396    return ;
     397  }
     398 
     399  UInt   iSrcStride = getCStride();
     400  UInt   iDstStride = pcYuvDst->getCStride();
     401
     402  ::memcpy( pDstU+uiPosY*iDstStride+uiPosX, pSrcU+uiPosY*iSrcStride+uiPosX, sizeof(Pel) );
     403  ::memcpy( pDstV+uiPosY*iDstStride+uiPosX, pSrcV+uiPosY*iSrcStride+uiPosX, sizeof(Pel) );
     404}
     405
     406#endif
     407
    356408Void TComYuv::addClipPartLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    357409{
     
    801853}
    802854
     855#if POZNAN_EIVD
     856
     857#ifdef ROUNDING_CONTROL_BIPRED
     858
     859Void TComYuv::addAvg_EIVD( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, Bool bRound )
     860{
     861  Pel* pSrcY0  = pcYuvSrc0->getLumaAddr( iPartUnitIdx );
     862  Pel* pSrcU0  = pcYuvSrc0->getCbAddr  ( iPartUnitIdx );
     863  Pel* pSrcV0  = pcYuvSrc0->getCrAddr  ( iPartUnitIdx );
     864 
     865  Pel* pSrcY1  = pcYuvSrc1->getLumaAddr( iPartUnitIdx );
     866  Pel* pSrcU1  = pcYuvSrc1->getCbAddr  ( iPartUnitIdx );
     867  Pel* pSrcV1  = pcYuvSrc1->getCrAddr  ( iPartUnitIdx );
     868 
     869  Pel* pDstY   = getLumaAddr( iPartUnitIdx );
     870  Pel* pDstU   = getCbAddr  ( iPartUnitIdx );
     871  Pel* pDstV   = getCrAddr  ( iPartUnitIdx );
     872 
     873  UInt  iSrc0Stride = pcYuvSrc0->getStride();
     874  UInt  iSrc1Stride = pcYuvSrc1->getStride();
     875  UInt  iDstStride  = getStride();
     876
     877#if HIGH_ACCURACY_BI
     878  Int shiftNum = 15 - (g_uiBitDepth + g_uiBitIncrement);
     879  Int offset = (1<<(shiftNum - 1));
     880 
     881  //Luma
     882  (pDstY+iPosY*iDstStride)[iPosX] = Clip(((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + offset) >> shiftNum );
     883   
     884  iSrc0Stride = pcYuvSrc0->getCStride();
     885  iSrc1Stride = pcYuvSrc1->getCStride();
     886  iDstStride  = getCStride();
     887
     888  //Chroma
     889  (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum );
     890  (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum );
     891 
     892#else
     893
     894  //Luma
     895  (pDstY+iPosY*iDstStride)[iPosX] = ((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + bRound) >> 1;
     896   
     897  iSrc0Stride = pcYuvSrc0->getCStride();
     898  iSrc1Stride = pcYuvSrc1->getCStride();
     899  iDstStride  = getCStride();
     900 
     901  //Chroma
     902  (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + bRound) >> 1;
     903  (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + bRound) >> 1;
     904#endif
     905}
     906
     907#endif
     908
     909Void TComYuv::addAvg_EIVD( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY )
     910{
     911  Pel* pSrcY0  = pcYuvSrc0->getLumaAddr( iPartUnitIdx );
     912  Pel* pSrcU0  = pcYuvSrc0->getCbAddr  ( iPartUnitIdx );
     913  Pel* pSrcV0  = pcYuvSrc0->getCrAddr  ( iPartUnitIdx );
     914 
     915  Pel* pSrcY1  = pcYuvSrc1->getLumaAddr( iPartUnitIdx );
     916  Pel* pSrcU1  = pcYuvSrc1->getCbAddr  ( iPartUnitIdx );
     917  Pel* pSrcV1  = pcYuvSrc1->getCrAddr  ( iPartUnitIdx );
     918 
     919  Pel* pDstY   = getLumaAddr( iPartUnitIdx );
     920  Pel* pDstU   = getCbAddr  ( iPartUnitIdx );
     921  Pel* pDstV   = getCrAddr  ( iPartUnitIdx );
     922 
     923  UInt  iSrc0Stride = pcYuvSrc0->getStride();
     924  UInt  iSrc1Stride = pcYuvSrc1->getStride();
     925  UInt  iDstStride  = getStride();
     926#if HIGH_ACCURACY_BI
     927  Int shiftNum = 15 - (g_uiBitDepth + g_uiBitIncrement);
     928  Int offset = (1<<(shiftNum - 1));
     929 
     930  //Luma
     931  (pDstY+iPosY*iDstStride)[iPosX] = Clip(((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + offset) >> shiftNum );
     932
     933  iSrc0Stride = pcYuvSrc0->getCStride();
     934  iSrc1Stride = pcYuvSrc1->getCStride();
     935  iDstStride  = getCStride();
     936 
     937  //Chroma
     938  (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum );
     939  (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum );
     940
     941#else 
     942  //Luma
     943  (pDstY+iPosY*iDstStride)[iPosX] = ((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + 1) >> 1;
     944   
     945  iSrc0Stride = pcYuvSrc0->getCStride();
     946  iSrc1Stride = pcYuvSrc1->getCStride();
     947  iDstStride  = getCStride();
     948 
     949  //Chroma
     950  (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + 1) >> 1;
     951  (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + 1) >> 1;
     952#endif
     953}
     954
     955#endif
     956
    803957Void TComYuv::removeHighFreq( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight )
    804958{
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TComYuv.h

    r5 r12  
    114114  Void    copyPartToPartChroma  ( TComYuv*    pcYuvDst, UInt uiPartIdx, UInt uiWidth, UInt uiHeight );
    115115 
     116#if POZNAN_EIVD
     117  Void    copyPartToPartYuv_EIVD        ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ); 
     118  Void    copyPartToPartLuma_EIVD   ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY );
     119  Void    copyPartToPartChroma_EIVD ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY );
     120#endif
     121
    116122  // ------------------------------------------------------------------------------------------------------------------
    117123  //  Algebraic operation for YUV buffer
     
    136142  Void    addAvg            ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight );
    137143
     144#if POZNAN_EIVD
     145#ifdef ROUNDING_CONTROL_BIPRED
     146  Void    addAvg_EIVD            ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, Bool bRound );
     147#endif
     148  Void    addAvg_EIVD            ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY );
     149#endif
     150
    138151  //   Remove High frequency
    139152  Void    removeHighFreq    ( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight );
  • branches/0.2-poznan-univ/source/Lib/TLibCommon/TypeDef.h

    r11 r12  
    6565#define POZNAN_CU_SYNTH             1 //Poznan Cu Synth
    6666
    67 #define POZNAN_AVAIL_MAP            1 //Creates Availibity buffers in all needed classes
    68 
    69 #define POZNAN_SYNTH_VIEW           1 //Creates view synthesis buffers in all needed classes
    70 #define POZNAN_SYNTH_DEPTH          1
    71 
    72 #define POZNAN_SYNTH                1 //Creates aligned synthesis classes in encoder and decoder
    73 
    74 #define POZNAN_ENCODE_ONLY_DISOCCLUDED_CU          1 //Poznan CU Skip
    75 #define POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS     1 //Fills not sended CUs with synthesized data
    76 
    77 #define POZNAN_CU_SKIP_PSNR         1 //Poznan Cu Skip Display psnr of the codded CU only
     67#define POZNAN_NONLINEAR_DEPTH              0    /// Non-linear depth processing (Maciej Kurc)
     68#define POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 1    /// Send DepthPower as byte instead of float
     69
     70#if POZNAN_CU_SYNTH
     71#define POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 0 /// increase QP for texture CUs that are in the background (according to proper depth map). This QP change is not encoded in a bitstream
     72#endif
     73#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH     
     74 #define POZNAN_TEXTURE_TU_DELTA_QP_NOT_IN_BASE_VIEW 1     /// should not be disabled in current software version - no depth synthesis map is available for base view anyway 
     75 #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW 1    /// increase of QP param for top and bottom LCU row in frame
     76 #define POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 0 /// used for optimization of function calculating dQP from depth block max value. Standard values set if disabled. If enabled params are set in cfg file for encoder (no decoder is supported in that case).
     77  #if !POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     78    #define POZNAN_TEXTURE_TU_DELTA_QP_OFFSET (-2.6)
     79    #define POZNAN_TEXTURE_TU_DELTA_QP_MUL (1)
     80    #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_ROW_VAL (2)
     81  #endif
     82#endif
     83
     84#define POZNAN_EIVD                                0    // Depth Based Vector Prediction prediction for MERGE
     85#if POZNAN_EIVD
     86#define POZNAN_EIVD_USE_FOR_TEXTURE                  1    //use Depth Based Vector Prediction in texture pictures (0 - no, 1 -yes)
     87#define POZNAN_EIVD_USE_FOR_DEPTH                  1    // use Depth Based Vector Prediction in depth pictures (0 - no, 1 -yes)
     88
     89#define POZNAN_EIVD_CALC_PRED_DATA              1    // Depth Based Vector Prediction motion data used for prediction in other CUs is calculated based on all CU points (otherwise motion data for none-MP points is used for prediction)
     90#define POZNAN_EIVD_COMPRESS_ME_DATA            0    // Depth Based Vector Prediction derives representative motion data from reference CUs even if they are EIVD-based predicted (otherwise motion data is derived with per-point resolution for EIVD-based predicted reference CUs)
     91#define POZNAN_EIVD_USE_IN_NONANCHOR_PIC_ONLY           1    // determines if Depth Based Vector Prediction is used in non-anchor pictures only
     92#endif
     93
     94#endif
     95
     96// ---------------------------------------
     97
     98#define POZNAN_STAT_JK  0 // save CU statistics to file
     99
     100#if POZNAN_STAT_JK
     101#define POZNAN_STAT_JK_FLUSH 1 // flush CU statistics to file after each CU
     102#endif
     103
     104#define POZNAN_CU_SKIP_PSNR         1
    78105//<<<<< Poznan 3DV tools <<<<<<
     106
    79107
    80108////////////////////////////
     
    356384typedef       unsigned long       ULong;
    357385typedef       double              Double;
     386typedef       float               Float;
    358387
    359388// ====================================================================================================================
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r11 r12  
    271271      pcSPS->setUseMVI( uiCode ? true : false );
    272272#endif
     273#if POZNAN_NONLINEAR_DEPTH
     274#if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE
     275      uiCode = 0;
     276      xReadCode(8, uiCode);
     277      pcSPS->setDepthPower(dequantizeDepthPower(uiCode));
     278#else
     279      uiCode = 0;
     280      xReadCode(sizeof(float)*8, uiCode); // We do not send seign
     281      //uiCode &= ~0x80000000;
     282      pcSPS->setDepthPower(*((float*)&uiCode)); 
     283#endif
     284      printf("\nfDepthPower = %f", pcSPS->getDepthPower());
     285#endif
    273286    }
    274287    else
     
    331344    }
    332345  }
    333 
    334346  return;
    335347}
     
    26212633
    26222634
    2623 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     2635#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    26242636Void
    26252637TDecCavlc::parseMergeIndexMV( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth )
     
    26322644    uiNumCand++;
    26332645#endif
     2646#if POZNAN_EIVD
     2647  UInt uiModIdx;
     2648  const Bool bEIVDAvailable = pcCU->getSlice()->getMP()->isEIVDEnabled();
     2649#endif
    26342650  for( UInt uiIdx = 0; uiIdx < MRG_MAX_NUM_CANDS; uiIdx++ )
    26352651  {
     
    26562672    if( uiIdx > uiMviMergePos )
    26572673    {
     2674#if POZNAN_EIVD
     2675          if(bEIVDAvailable)
     2676          {
     2677                  if(uiIdx==POZNAN_EIVD_MERGE_POS) uiModIdx = POZNAN_EIVD_MRG_CAND;
     2678                  else if(uiIdx>POZNAN_EIVD_MERGE_POS) uiModIdx = uiIdx--;
     2679                  else uiModIdx = uiIdx;
     2680          }
     2681          else uiModIdx = uiIdx;
     2682          if( pcCU->getNeighbourCandIdx( uiModIdx-1, uiAbsPartIdx ) != uiModIdx )
     2683          {
     2684        ruiMergeIndex++;
     2685      }
     2686#else
    26582687      if( pcCU->getNeighbourCandIdx( uiIdx - 1, uiAbsPartIdx ) != uiIdx )
    26592688      {
    26602689        ruiMergeIndex++;
    26612690      }
     2691#endif
    26622692    }
    26632693    else if( uiIdx < uiMviMergePos )
    26642694#endif
     2695#if POZNAN_EIVD
     2696        if(bEIVDAvailable)
     2697        {
     2698          if(uiIdx==POZNAN_EIVD_MERGE_POS) uiModIdx = POZNAN_EIVD_MRG_CAND;
     2699          else if(uiIdx>POZNAN_EIVD_MERGE_POS) uiModIdx = uiIdx--;
     2700          else uiModIdx = uiIdx;
     2701        }
     2702        else uiModIdx = uiIdx;
     2703        if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) != uiModIdx + 1 )
     2704        {
     2705          ruiMergeIndex++;
     2706        }
     2707#else
    26652708    if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) != uiIdx + 1 )
    26662709    {
    26672710      ruiMergeIndex++;
    26682711    }
     2712#endif
    26692713  }
    26702714#if HHI_MPI
     
    26762720  {
    26772721    pcCU->setTextureModeDepthSubParts( uiDepth, uiAbsPartIdx, uiDepth );
     2722  }
     2723#endif
     2724#if POZNAN_EIVD
     2725  if(bEIVDAvailable)
     2726  {       
     2727        if(ruiMergeIndex==POZNAN_EIVD_MERGE_POS) ruiMergeIndex = POZNAN_EIVD_MRG_CAND;
     2728        else if(ruiMergeIndex>POZNAN_EIVD_MERGE_POS) ruiMergeIndex--;
    26782729  }
    26792730#endif
     
    26912742Void TDecCavlc::parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth )
    26922743{
    2693 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     2744#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    26942745  if(
    26952746#if HHI_INTER_VIEW_MOTION_PRED
     
    26982749#if HHI_MPI
    26992750      ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ||
     2751#endif
     2752#if     POZNAN_EIVD 
     2753          ( pcCU->getSlice()->getMP()->isEIVDEnabled() ) ||
    27002754#endif
    27012755      0
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.h

    r5 r12  
    195195  Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    196196  Void parseMergeIndex      ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
    197 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     197#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    198198  Void parseMergeIndexMV    ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
    199199#endif
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCu.cpp

    r11 r12  
    4949  m_ppcYuvReco    = NULL;
    5050  m_ppcYuvResPred = NULL;
    51 #if POZNAN_AVAIL_MAP
     51#if POZNAN_CU_SKIP
    5252  m_ppcYuvAvail   = NULL;
    5353#endif
    54 #if POZNAN_SYNTH_VIEW
     54#if POZNAN_CU_SYNTH
    5555  m_ppcYuvSynth   = NULL;
    5656#endif
     
    8181  m_ppcYuvReco    = new TComYuv*    [m_uiMaxDepth-1];
    8282  m_ppcYuvResPred = new TComYuv*    [m_uiMaxDepth-1];
    83 #if POZNAN_AVAIL_MAP
     83#if POZNAN_CU_SKIP
    8484  m_ppcYuvAvail   = new TComYuv*    [m_uiMaxDepth-1];
    8585#endif
    86 #if POZNAN_SYNTH_VIEW
     86#if POZNAN_CU_SYNTH
    8787  m_ppcYuvSynth   = new TComYuv*    [m_uiMaxDepth-1];
    8888#endif
     
    9999    m_ppcYuvReco   [ui] = new TComYuv;    m_ppcYuvReco   [ui]->create( uiWidth, uiHeight );
    100100    m_ppcYuvResPred[ui] = new TComYuv;    m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );
    101 #if POZNAN_AVAIL_MAP
     101#if POZNAN_CU_SKIP
    102102    m_ppcYuvAvail  [ui] = new TComYuv;    m_ppcYuvAvail  [ui]->create( uiWidth, uiHeight );
    103103#endif
    104 #if POZNAN_SYNTH_VIEW
     104#if POZNAN_CU_SYNTH
    105105    m_ppcYuvSynth  [ui] = new TComYuv;    m_ppcYuvSynth  [ui]->create( uiWidth, uiHeight );
    106106#endif
     
    125125    m_ppcYuvReco   [ui]->destroy(); delete m_ppcYuvReco   [ui]; m_ppcYuvReco   [ui] = NULL;
    126126    m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;
    127 #if POZNAN_AVAIL_MAP
     127#if POZNAN_CU_SKIP
    128128    m_ppcYuvAvail  [ui]->destroy(); delete m_ppcYuvAvail  [ui]; m_ppcYuvAvail  [ui] = NULL;
    129129#endif
    130 #if POZNAN_SYNTH_VIEW
     130#if POZNAN_CU_SYNTH
    131131    m_ppcYuvSynth  [ui]->destroy(); delete m_ppcYuvSynth  [ui]; m_ppcYuvSynth  [ui] = NULL;
    132132#endif
     
    137137  delete [] m_ppcYuvReco;    m_ppcYuvReco    = NULL;
    138138  delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;
    139 #if POZNAN_AVAIL_MAP
     139#if POZNAN_CU_SKIP
    140140  delete [] m_ppcYuvAvail;   m_ppcYuvAvail   = NULL;
    141141#endif
    142 #if POZNAN_SYNTH_VIEW
     142#if POZNAN_CU_SYNTH
    143143  delete [] m_ppcYuvSynth;   m_ppcYuvSynth   = NULL;
    144144#endif
     
    217217  TComPic* pcPic = pcCU->getPic();
    218218
    219 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     219#if POZNAN_CU_SKIP
    220220  Bool bWholeCUCanBeSynthesized = false;
    221221  Bool bOneSubCUCanNotBeSynthesied = false;
     
    267267  if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) )
    268268  {
    269 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     269#if POZNAN_CU_SKIP
    270270    if(bOneSubCUCanNotBeSynthesied && (uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )) // KUBA SYNTH check if CU has 3 synthesied subCU - no split flag is send in that case and CU split is assumed
    271271    {
     
    446446{
    447447  TComPic* pcPic = pcCU->getPic();
    448 #if POZNAN_SYNTH_VIEW
     448#if POZNAN_CU_SYNTH
    449449  if(pcPic->getPicYuvSynth())  m_ppcYuvSynth[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx );
    450450#endif
    451 #if POZNAN_AVAIL_MAP
     451#if POZNAN_CU_SKIP
    452452  if(pcPic->getPicYuvAvail())  m_ppcYuvAvail[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx );
    453453#endif
     
    496496      xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
    497497      break;
    498 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     498#if POZNAN_CU_SKIP
    499499    case MODE_SYNTH:
    500500    //  break;
    501 #if POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS
    502501      m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx);
    503 #else
    504       m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx); //Poprawiæ
    505 #endif
     502      //m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx); //Poprawiæ
    506503      //m_ppcYuvReco[uiDepth]->clear();
    507504      break;
     
    581578    m_pcPrediction->predIntraLumaAng( pcPattern, pcCU->getLumaIntraDir(uiPartIdx), pPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail );
    582579   
     580#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     581    m_pcTrQuant->setQPforQuant( pcCU->getQP(uiPartIdx) + pcCU->getQpOffsetForTextCU(uiPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     582#else
    583583    m_pcTrQuant->setQPforQuant( pcCU->getQP(uiPartIdx), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     584#endif
    584585#if INTRA_DST_TYPE_7
    585586  m_pcTrQuant->invtransformNxN(TEXT_LUMA, pcCU->getLumaIntraDir(uiPartIdx), pResi, uiStride, pCoeff, uiWidth, uiHeight );
     
    778779  }
    779780  //===== inverse transform =====
     781#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     782    m_pcTrQuant->setQPforQuant( pcCU->getQP(0) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     783#else
    780784  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     785#endif
    781786#if INTRA_DST_TYPE_7
    782787  m_pcTrQuant->invtransformNxN( TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight );
     
    885890
    886891  //===== inverse transform =====
     892#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     893  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText );
     894#else
    887895  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText );
     896#endif
    888897#if INTRA_DST_TYPE_7
    889898  m_pcTrQuant->invtransformNxN( eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight );
     
    10611070  piCoeff = pcCU->getCoeffY();
    10621071  pResi = m_ppcYuvResi[uiDepth]->getLumaAddr();
     1072#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1073  Int QPoffset = pcCU->getQpOffsetForTextCU(uiAbsPartIdx, false);
     1074  m_pcTrQuant->setQPforQuant  ( pcCU->getQP(uiAbsPartIdx) + QPoffset, !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     1075#else
    10631076  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     1077#endif
    10641078  m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff );
    10651079 
    10661080  // Cb and Cr
     1081#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1082    m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ) + QPoffset, !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     1083#else
    10671084  m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     1085#endif
    10681086 
    10691087  uiWidth  >>= 1;
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCu.h

    r11 r12  
    6161  TComYuv**           m_ppcYuvReco;       ///< array of prediction & reconstruction buffer
    6262  TComYuv**           m_ppcYuvResPred;    ///< residual prediction buffer
    63 #if POZNAN_AVAIL_MAP
     63#if POZNAN_CU_SKIP
    6464  TComYuv**           m_ppcYuvAvail;      ///< array of available map buffer
    6565#endif
    66 #if POZNAN_SYNTH_VIEW
     66#if POZNAN_CU_SYNTH
    6767  TComYuv**           m_ppcYuvSynth;      ///< array of synth buffer
    6868#endif
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecEntropy.cpp

    r5 r12  
    430430  pcCU->setInterDirSubParts( puhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, uiPartIdx, uiDepth );
    431431
     432#if POZNAN_EIVD_CALC_PRED_DATA
     433  Int ref_idx0_EIVD,ref_idx1_EIVD;
     434  TComMv cMv0_EIVD( 0, 0 ),cMv1_EIVD( 0, 0 );
     435  if(uiMergeIndex==POZNAN_EIVD_MRG_CAND)
     436  {     
     437    pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );
     438    pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );     
     439    pcCU->getSlice()->getMP()->calcEIVDPredData(pcCU, uiAbsPartIdx, ref_idx0_EIVD, cMv0_EIVD, ref_idx1_EIVD, cMv1_EIVD);
     440  }
     441#endif
     442
    432443  TComMv cTmpMv( 0, 0 );
    433444  if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_0 ) > 0  ) //if ( ref. frame list0 has at least 1 entry )
     
    436447    pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_0, uiAbsPartIdx, uiPartIdx, uiDepth);
    437448    pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvd( cTmpMv, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );
     449#if POZNAN_EIVD_CALC_PRED_DATA
     450    if(uiMergeIndex==POZNAN_EIVD_MRG_CAND)
     451       pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMv0_EIVD, ref_idx0_EIVD, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );
     452    else
     453#endif
    438454    pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );
    439455
     
    444460    pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_1, uiAbsPartIdx, uiPartIdx, uiDepth);
    445461    pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvd( cTmpMv, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );
     462#if POZNAN_EIVD_CALC_PRED_DATA
     463    if(uiMergeIndex==POZNAN_EIVD_MRG_CAND)
     464       pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMv1_EIVD, ref_idx1_EIVD, eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );
     465    else
     466#endif
    446467    pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getMv(), pcMvFieldNeighbours[ 2*uiMergeIndex + 1 ].getRefIdx(), eCUMode, uiAbsPartIdx, uiPartIdx, uiDepth );
    447468  }
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecGop.cpp

    r5 r12  
    199199#endif
    200200
     201#if POZNAN_MP
     202        if( uiStartCUAddr == 0 )
     203    {
     204#if POZNAN_MP_USE_DEPTH_MAP_GENERATION
     205          pcSlice->getMP()->setDepthMapGenerator(m_pcDepthMapGenerator);
     206#endif
     207      pcSlice->getMP()->pairMultiview(rpcPic);
     208        }
     209#endif
     210
    201211    // decode slice
    202212    m_pcSliceDecoder->decompressSlice(pcBitstream, rpcPic);
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecSbac.cpp

    r5 r12  
    579579
    580580
    581 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     581#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    582582Void TDecSbac::parseMergeIndexMV( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth )
    583583{
     
    585585  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
    586586  const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : MRG_MAX_NUM_CANDS;
     587#endif
     588#if POZNAN_EIVD
     589  const Bool bEIVDAvailable = pcCU->getSlice()->getMP()->isEIVDEnabled();
     590  Bool bEIVDModifyMergeIdx = true;
    587591#endif
    588592  //--- set number of candidates and availability ---
     
    611615    }
    612616  }
     617
     618#if POZNAN_EIVD
     619  if(bEIVDAvailable)
     620  {
     621    UInt uiEIVDMergePos = POZNAN_EIVD_MERGE_POS;
     622#if HHI_MPI
     623        if(bMVIAvailable && uiEIVDMergePos>=uiMviMergePos) uiEIVDMergePos++;
     624#endif
     625        for( Int iIdx = MRG_MAX_NUM_CANDS-2; iIdx >= (Int)uiEIVDMergePos; iIdx-- )
     626        {
     627                Int iWrIdx = iIdx+1;
     628#if HHI_MPI
     629                if(bMVIAvailable)
     630                {
     631                        if(iIdx==(Int)uiMviMergePos) continue;
     632                        if(iWrIdx==(Int)uiMviMergePos) iWrIdx++;
     633                }
     634#endif
     635                if(iWrIdx>=MRG_MAX_NUM_CANDS) continue;
     636
     637                abAvailable[ iWrIdx ] = abAvailable[ iIdx ];
     638        }
     639        abAvailable[ uiEIVDMergePos ] = ( pcCU->getNeighbourCandIdx( POZNAN_EIVD_MRG_CAND, uiAbsPartIdx ) == POZNAN_EIVD_MRG_CAND + 1 );
     640       
     641        uiNumCand = 0; for( UInt uiIdx = 0; uiIdx < MRG_MAX_NUM_CANDS; uiIdx++ ) if(abAvailable[ uiIdx ]) uiNumCand++;
     642  }
     643#endif
     644
    613645  AOF( uiNumCand > 1 );
    614646
     
    665697  {
    666698    pcCU->setTextureModeDepthSubParts( uiDepth, uiAbsPartIdx, uiDepth );
     699#if POZNAN_EIVD
     700        bEIVDModifyMergeIdx = false;
     701#endif
     702  }
     703#endif
     704
     705#if POZNAN_EIVD
     706  if(bEIVDAvailable && bEIVDModifyMergeIdx)
     707  {
     708        if(ruiMergeIndex==POZNAN_EIVD_MERGE_POS) ruiMergeIndex = POZNAN_EIVD_MRG_CAND;
     709        else if(ruiMergeIndex>POZNAN_EIVD_MERGE_POS) ruiMergeIndex--;
    667710  }
    668711#endif
     
    694737Void TDecSbac::parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth )
    695738{
    696 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     739#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    697740  if(
    698741#if HHI_INTER_VIEW_MOTION_PRED
     
    701744#if HHI_MPI
    702745      ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ||
     746#endif
     747#if     POZNAN_EIVD 
     748          ( pcCU->getSlice()->getMP()->isEIVDEnabled() ) ||
    703749#endif
    704750      0
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecSbac.h

    r5 r12  
    144144  Void parseMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    145145  Void parseMergeIndex    ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
    146 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     146#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    147147  Void parseMergeIndexMV  ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth );
    148148#endif
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecSlice.cpp

    r5 r12  
    9898    g_bJustDoIt = g_bEncDecTraceEnable;
    9999#endif
     100
     101        // JK {
     102        DTRACE_CABAC_V( g_nSymbolCounter++ );
     103        DTRACE_CABAC_T( "\tCU: " );
     104        DTRACE_CABAC_V( iCUAddr );
     105        DTRACE_CABAC_T( "\n" );
     106        // JK }
     107
    100108    m_pcCuDecoder->decodeCU     ( pcCU, uiIsLast );
    101109    m_pcCuDecoder->decompressCU ( pcCU );
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp

    r11 r12  
    5353    m_aaiCodedScale       [ uiId ] = new Int [ MAX_NUMBER_VIEWS ];
    5454  }
    55 #if POZNAN_SYNTH
     55#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    5656  xCreateLUTs   ( (UInt)MAX_NUMBER_VIEWS, (UInt)MAX_NUMBER_VIEWS,  m_adBaseViewShiftLUT,  m_aiBaseViewShiftLUT);
    5757
     
    7373  delete [] m_aiViewReceived;
    7474
    75 #if POZNAN_SYNTH
     75#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    7676  xDeleteArray( m_adBaseViewShiftLUT,        MAX_NUMBER_VIEWS, MAX_NUMBER_VIEWS,  2 );
    7777  xDeleteArray( m_aiBaseViewShiftLUT,        MAX_NUMBER_VIEWS, MAX_NUMBER_VIEWS,  2 );
     
    9191}
    9292
    93 #if POZNAN_SYNTH
     93#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    9494/*
    9595Void
     
    294294        m_aaiCodedScale [ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedScale () [ uiBaseId ];
    295295        m_aaiCodedOffset[ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedOffset() [ uiBaseId ];
    296 #if POZNAN_SYNTH
     296#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    297297        xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT);
    298298        xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT);
     
    305305        m_aaiCodedScale [ uiViewId ][ uiBaseId ]  = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ];
    306306        m_aaiCodedOffset[ uiViewId ][ uiBaseId ]  = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ];
    307 #if POZNAN_SYNTH
     307#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    308308        xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT);
    309309        xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT);
     
    323323        m_aaiCodedScale [ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedScale () [ uiBaseId ];
    324324        m_aaiCodedOffset[ uiViewId ][ uiBaseId ]  = pcSlice->getInvCodedOffset() [ uiBaseId ];
    325 #if POZNAN_SYNTH
     325#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    326326        xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT);
    327327        xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT);
     
    411411  m_bFirstSliceInSequence   = true;
    412412  m_pcCamParsCollector = 0;
     413#if POZNAN_MP
     414  m_pcMP = NULL;
     415#endif
    413416}
    414417
     
    441444#if HHI_INTER_VIEW_RESIDUAL_PRED
    442445  m_cResidualGenerator.destroy();
     446#endif
     447
     448#if POZNAN_MP
     449  m_pcMP = NULL;
    443450#endif
    444451}
     
    478485  m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator );
    479486#endif
     487
     488#if POZNAN_MP
     489  m_pcMP = pcTAppDecTop->getMP();
     490#endif
    480491}
    481492
     
    604615    pcPic->removeUsedPelsMapBuffer();
    605616#endif
    606 #if POZNAN_AVAIL_MAP
     617#if POZNAN_CU_SYNTH || POZNAN_CU_SKIP
    607618    pcPic->removeAvailabilityBuffer();
    608619#endif
    609 #if POZNAN_SYNTH_VIEW
     620#if POZNAN_CU_SYNTH
    610621    pcPic->removeSynthesisBuffer();
     622#endif
     623#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     624    pcPic->removeSynthesisDepthBuffer();
    611625#endif
    612626  }
     
    696710      else
    697711      {
     712#if POZNAN_NONLINEAR_DEPTH
     713        // For texture complete depth power information. Depth power is sended, for example, for base view depth map and it should be available prior non-base texture decoding
     714        if(!cTempSPS.isDepth() && cTempSPS.getViewId())
     715        {
     716          Float fDepthPower = getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getDepthPower();
     717          cTempSPS.setDepthPower(fDepthPower);
     718        }
     719#endif
    698720        cComSPS = cTempSPS;
    699721        return false;
    700722      }
     723     
    701724
    702725      // create ALF temporary buffer
     
    710733      }
    711734      m_uiValidPS |= 1;
     735
     736#if POZNAN_MP
     737#if POZNAN_MP_USE_DEPTH_MAP_GENERATION
     738      m_pcMP->init( m_cSPS.getHeight(), m_cSPS.getWidth() );
     739#else
     740      m_pcMP->init( m_cSPS.getHeight(), m_cSPS.getWidth(), m_pcCamParsCollector->getBaseViewShiftLUTI());
     741#endif
     742#endif
    712743
    713744      return false;
     
    820851      m_apcSlicePilot = pcPic->getPicSym()->getSlice(m_uiSliceIdx);
    821852      pcPic->getPicSym()->setSlice(pcSlice, m_uiSliceIdx);
     853
     854#if POZNAN_MP
     855          pcSlice->setMP(m_pcMP);
     856#endif
    822857
    823858      if (bNextSlice)
     
    875910#endif
    876911
    877 #if POZNAN_SYNTH
    878       if( m_pcCamParsCollector)
     912#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH
     913      if( m_pcCamParsCollector )
    879914      {
    880915        m_pcCamParsCollector->setSlice( pcSlice );
    881916      }
    882917      //if(!getIsDepth())
    883       getDecTop()->storeSynthPicsInBuffer(pcSlice->getViewIdx(),pcSlice->getSPS()->getViewOrderIdx(),pcSlice->getPOC(),getIsDepth());
     918        getDecTop()->storeSynthPicsInBuffer(pcSlice->getViewIdx(),pcSlice->getSPS()->getViewOrderIdx(),pcSlice->getPOC(),getIsDepth());
     919#endif
     920
     921#if POZNAN_MP
     922        std::vector<TComPic*> apcSpatDataRefPics = getDecTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), m_cSPS.isDepth() );
     923        pcSlice->getMP()->setRefPicsList(&apcSpatDataRefPics); 
     924#if !POZNAN_MP_USE_DEPTH_MAP_GENERATION
     925        std::vector<TComPic*> apcSpatDepthRefPics = getDecTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), true );
     926        pcSlice->getMP()->setDepthRefPicsList(&apcSpatDepthRefPics);
     927#endif
    884928#endif
    885929
    886930      //  Decode a picture
    887931      m_cGopDecoder.decompressGop ( bEos, pcBitstream, pcPic, false );
     932
     933#if POZNAN_MP
     934          pcSlice->getMP()->disable();
     935#endif
    888936
    889937      if( m_pcCamParsCollector )
  • branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecTop.h

    r11 r12  
    5555#include "TDecCAVLC.h"
    5656
     57#if POZNAN_MP
     58#include "../TLibCommon/TComMP.h"
     59#endif
     60
    5761// ====================================================================================================================
    5862// Class definition
     
    7175  Void  uninit      ();
    7276  Void  setSlice    ( TComSlice* pcSlice );
    73 #if POZNAN_SYNTH
     77#if POZNAN_CU_SKIP || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    7478  Double****          getBaseViewShiftLUTD      ()  { return m_adBaseViewShiftLUT;   }
    7579  Int****             getBaseViewShiftLUTI      ()  { return m_aiBaseViewShiftLUT;   }
     
    99103  UInt    m_uiMaxViewId;
    100104
    101 #if POZNAN_SYNTH
     105#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    102106
    103107  UInt    m_uiBitDepthForLUT;
     
    118122};
    119123
    120 #if POZNAN_SYNTH
     124#if POZNAN_CU_SKIP || POZNAN_CU_SYNTH || (POZNAN_MP && !POZNAN_MP_USE_DEPTH_MAP_GENERATION)
    121125  template <class T>
    122126Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 )
     
    223227#endif
    224228
     229#if POZNAN_MP
     230  TComMP*                                 m_pcMP;
     231#endif
     232
    225233  Bool                    m_bIsDepth;
    226234  Int                     m_iViewIdx;
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.cpp

    r11 r12  
    341341      xWriteFlag( pcSPS->getUseMVI() ? 1 : 0 );
    342342#endif
     343#if POZNAN_NONLINEAR_DEPTH
     344      // Depth power coefficient
     345#if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE
     346      UInt  uiCode = quantizeDepthPower(pcSPS->getDepthPower()); 
     347      xWriteCode(uiCode, 8);
     348#else
     349      float fCode  = pcSPS->getDepthPower();
     350      UInt  uiCode = *((UInt*)&fCode);
     351      //uiCode &= ~0x80000000;
     352      xWriteCode(uiCode, sizeof(float)*8); // we do not send sign?;
     353#endif
     354#endif
    343355    }
    344356    else
     
    353365        for( UInt uiId = 0; uiId < pcSPS->getViewId(); uiId++ )
    354366        {
    355           //printf("From ViewID %d To ViewID: %d\n",pcSPS->getViewId(),uiId);
    356           xWriteSvlc( pcSPS->getCodedScale    ()[ uiId ] ); //printf("SPS Scale: %d\n",pcSPS->getCodedScale    ()[ uiId ]);
    357           xWriteSvlc( pcSPS->getCodedOffset   ()[ uiId ] ); //printf("SPS Offset: %d\n", pcSPS->getCodedOffset   ()[ uiId ]);
     367          xWriteSvlc( pcSPS->getCodedScale    ()[ uiId ] );
     368          xWriteSvlc( pcSPS->getCodedOffset   ()[ uiId ] );
    358369          xWriteSvlc( pcSPS->getInvCodedScale ()[ uiId ] + pcSPS->getCodedScale ()[ uiId ] );
    359370          xWriteSvlc( pcSPS->getInvCodedOffset()[ uiId ] + pcSPS->getCodedOffset()[ uiId ] );
     
    532543      for( UInt uiId = 0; uiId < pcSlice->getSPS()->getViewId(); uiId++ )
    533544      {
    534         printf("From ViewID %d To ViewID: %d\n",pcSlice->getSPS()->getViewId(),uiId);
    535         xWriteSvlc( pcSlice->getCodedScale    ()[ uiId ] ); printf("Slice Scale: %d\n",pcSlice->getCodedScale    ()[ uiId ]);
    536         xWriteSvlc( pcSlice->getCodedOffset   ()[ uiId ] ); printf("Slice Offset: %d\n", pcSlice->getCodedOffset   ()[ uiId ]);
     545        xWriteSvlc( pcSlice->getCodedScale    ()[ uiId ] );
     546        xWriteSvlc( pcSlice->getCodedOffset   ()[ uiId ] );
    537547        xWriteSvlc( pcSlice->getInvCodedScale ()[ uiId ] + pcSlice->getCodedScale ()[ uiId ] );
    538548        xWriteSvlc( pcSlice->getInvCodedOffset()[ uiId ] + pcSlice->getCodedOffset()[ uiId ] );
     
    729739
    730740
    731 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     741#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    732742Void
    733743TEncCavlc::codeMergeIndexMV( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    735745  UInt uiNumCand  = 0;
    736746  UInt uiMergeIdx = pcCU->getMergeIndex( uiAbsPartIdx );
     747
     748#if POZNAN_EIVD
     749  UInt uiModIdx;
     750  const Bool bEIVDAvailable = pcCU->getSlice()->getMP()->isEIVDEnabled();
     751  if(bEIVDAvailable)
     752  {       
     753          if(uiMergeIdx==POZNAN_EIVD_MRG_CAND) uiMergeIdx = POZNAN_EIVD_MERGE_POS;
     754          else if(uiMergeIdx>=POZNAN_EIVD_MERGE_POS) uiMergeIdx++;
     755  }
     756#endif
    737757#if HHI_MPI
    738758  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
     
    752772    if( uiIdx < uiMviMergePos )
    753773    {
     774#if POZNAN_EIVD
     775          if(bEIVDAvailable)
     776          {
     777                  if(uiIdx==POZNAN_EIVD_MERGE_POS) uiModIdx = POZNAN_EIVD_MRG_CAND;
     778                  else if(uiIdx>POZNAN_EIVD_MERGE_POS) uiModIdx = uiIdx--;
     779                  else uiModIdx = uiIdx;
     780          }
     781          else uiModIdx = uiIdx;
     782          if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 )
     783          {
     784        uiNumCand++;
     785      }
     786      else if( uiIdx < uiMergeIdx )
     787      {
     788        uiUnaryIdx--;
     789      }
     790#else
    754791      if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) == uiIdx + 1 )
    755792      {
     
    760797        uiUnaryIdx--;
    761798      }
     799#endif
    762800    }
    763801    else if( uiIdx > uiMviMergePos )
    764802    {
     803#if POZNAN_EIVD
     804          if(bEIVDAvailable)
     805          {
     806                  if(uiIdx==POZNAN_EIVD_MERGE_POS) uiModIdx = POZNAN_EIVD_MRG_CAND;
     807                  else if(uiIdx>POZNAN_EIVD_MERGE_POS) uiModIdx = uiIdx--;
     808                  else uiModIdx = uiIdx;
     809          }
     810          else uiModIdx = uiIdx;
     811          if( pcCU->getNeighbourCandIdx( uiModIdx-1, uiAbsPartIdx ) == uiModIdx )
     812          {
     813        uiNumCand++;
     814      }
     815      else if( uiIdx < uiMergeIdx )
     816      {
     817        uiUnaryIdx--;
     818      }
     819#else
    765820      if( pcCU->getNeighbourCandIdx( uiIdx - 1, uiAbsPartIdx ) == uiIdx )
    766821      {
     
    771826        uiUnaryIdx--;
    772827      }
     828#endif
    773829    }
    774830  }
     
    777833  for( UInt uiIdx = 0; uiIdx < MRG_MAX_NUM_CANDS; uiIdx++ )
    778834  {
     835#if POZNAN_EIVD
     836        if(bEIVDAvailable)
     837        {
     838          if(uiIdx==POZNAN_EIVD_MERGE_POS) uiModIdx = POZNAN_EIVD_MRG_CAND;
     839          else if(uiIdx>POZNAN_EIVD_MERGE_POS) uiModIdx = uiIdx--;
     840          else uiModIdx = uiIdx;
     841        }
     842        else uiModIdx = uiIdx;
     843        if( pcCU->getNeighbourCandIdx( uiModIdx, uiAbsPartIdx ) == uiModIdx + 1 )
     844        {
     845          uiNumCand++;
     846        }
     847        else if( uiIdx < uiMergeIdx )
     848        {
     849          uiUnaryIdx--;
     850        }
     851#else
    779852    if( pcCU->getNeighbourCandIdx( uiIdx, uiAbsPartIdx ) == uiIdx + 1 )
    780853    {
     
    785858      uiUnaryIdx--;
    786859    }
     860#endif
    787861  }
    788862#endif
     
    808882Void TEncCavlc::codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx )
    809883{
    810 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
    811 #if HHI_INTER_VIEW_MOTION_PRED && HHI_MPI
    812   if( ( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ) ||
    813       ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) )
    814 #elif HHI_MPI
    815   if( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    816 #else
    817   if( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE )
    818 #endif
     884#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
     885  if(
     886#if HHI_INTER_VIEW_MOTION_PRED
     887          ( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ) ||
     888#endif
     889#if HHI_MPI
     890          ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ||
     891#endif
     892#if     POZNAN_EIVD 
     893          ( pcCU->getSlice()->getMP()->isEIVDEnabled() ) ||
     894#endif
     895          0
     896    )
    819897  {
    820898    codeMergeIndexMV( pcCU, uiAbsPartIdx );
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.h

    r5 r12  
    228228  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    229229  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    230 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     230#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    231231  Void codeMergeIndexMV  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    232232#endif
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCfg.h

    r5 r12  
    217217#endif
    218218
     219#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     220  Double      m_dTextureCuDeltaQpOffset;
     221  Double      m_dTextureCuDeltaQpMul;
     222  Int         m_iTextureCuDeltaQpTopBottomRow;
     223#endif
     224#if POZNAN_NONLINEAR_DEPTH
     225  Float         m_fDepthPower;
     226#endif
     227
    219228public:
    220229  TEncCfg()          {}
     
    226235  Void      setSourceHeight                 ( Int   i )      { m_iSourceHeight = i; }
    227236  Void      setFrameToBeEncoded             ( Int   i )      { m_iFrameToBeEncoded = i; }
     237
     238#if POZNAN_STAT_JK
     239  FILE* m_pcStatFile;
     240  Void setStatFile(FILE* a) {m_pcStatFile = a;}
     241#endif
    228242
    229243  //====== Coding Structure ========
     
    306320  Void      setAllowNegDist                 ( Bool b  )     { m_bAllowNegDist     = b; };
    307321#endif
     322#endif
     323
     324#if POZNAN_NONLINEAR_DEPTH
     325  inline Float   getDepthPower()               { return m_fDepthPower; }
     326  inline Void    setDepthPower(Float p)        { m_fDepthPower = p; }
     327#else
     328 inline Float    getDepthPower()               { return 1.0f; }
    308329#endif
    309330
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCu.cpp

    r11 r12  
    6767  m_ppcOrigYuv     = new TComYuv*[m_uhTotalDepth-1];
    6868  m_ppcResPredTmp  = new TComYuv*[m_uhTotalDepth-1];
    69 #if POZNAN_AVAIL_MAP
     69#if POZNAN_CU_SKIP
    7070  m_ppcAvailYuv    = new TComYuv*[m_uhTotalDepth-1];
    7171#endif
    72 #if POZNAN_SYNTH_VIEW
     72#if POZNAN_CU_SYNTH
    7373  m_ppcSynthYuv    = new TComYuv*[m_uhTotalDepth-1];
    7474#endif
     
    100100    m_ppcOrigYuv    [i] = new TComYuv; m_ppcOrigYuv    [i]->create(uiWidth, uiHeight);
    101101
    102 #if POZNAN_AVAIL_MAP
     102#if POZNAN_CU_SKIP
    103103    m_ppcAvailYuv   [i] = new TComYuv; m_ppcAvailYuv    [i]->create(uiWidth, uiHeight);
    104104#endif
    105 #if POZNAN_SYNTH_VIEW
     105#if POZNAN_CU_SYNTH
    106106    m_ppcSynthYuv   [i] = new TComYuv; m_ppcSynthYuv    [i]->create(uiWidth, uiHeight);
    107107#endif
     
    165165    if(m_ppcOrigYuv[i])
    166166    {
    167       m_ppcOrigYuv[i]->destroy();     delete m_ppcOrigYuv[i];     m_ppcOrigYuv[i]     = NULL;
    168     }
    169 #if POZNAN_AVAIL_MAP
     167      m_ppcOrigYuv[i]->destroy();     delete m_ppcOrigYuv[i];     m_ppcOrigYuv[i] = NULL;
     168    }
     169#if POZNAN_CU_SKIP
    170170    if(m_ppcAvailYuv[i])
    171171    {
    172       m_ppcAvailYuv[i]->destroy();    delete m_ppcAvailYuv[i];    m_ppcAvailYuv[i]    = NULL;
    173     }
    174 #endif
    175 #if POZNAN_SYNTH_VIEW
     172      m_ppcAvailYuv[i]->destroy();     delete m_ppcAvailYuv[i];   m_ppcAvailYuv[i] = NULL;
     173    }
     174#endif
     175#if POZNAN_CU_SYNTH
    176176    if(m_ppcSynthYuv[i])
    177177    {
    178       m_ppcSynthYuv[i]->destroy();    delete m_ppcSynthYuv[i];    m_ppcSynthYuv[i]    = NULL;
     178      m_ppcSynthYuv[i]->destroy();     delete m_ppcSynthYuv[i];   m_ppcSynthYuv[i] = NULL;
    179179    }
    180180#endif
     
    230230    m_ppcOrigYuv = NULL;
    231231  }
    232 #if POZNAN_AVAIL_MAP
     232#if POZNAN_CU_SKIP
    233233  if(m_ppcAvailYuv)
    234234  {
     
    237237  }
    238238#endif
    239 #if POZNAN_SYNTH_VIEW
     239#if POZNAN_CU_SYNTH
    240240  if(m_ppcSynthYuv)
    241241  {
     
    395395    }
    396396  }
     397
     398#if POZNAN_EIVD & !POZNAN_EIVD_COMPRESS_ME_DATA
     399  //save motion data for every CU point
     400  xSaveEIVDData(m_ppcBestCU[0]);
     401#endif
     402
    397403}
    398404
     
    467473  // get Original YUV data from picture
    468474  m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() );
    469 #if POZNAN_AVAIL_MAP
     475#if POZNAN_CU_SKIP
    470476  if (pcPic->getPicYuvAvail())  m_ppcAvailYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() );
    471477#endif 
    472 #if POZNAN_SYNTH_VIEW
     478#if POZNAN_CU_SYNTH
    473479  if (pcPic->getPicYuvSynth())  m_ppcSynthYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() );
    474480#endif
    475481
    476 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     482#if POZNAN_CU_SKIP
    477483  Bool bWholeCUCanBeSynthesized = false;
    478484  Bool bOneSubCUCanNotBeSynthesied = false;
     
    569575  {
    570576    // do CU Skip
    571 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     577#if POZNAN_CU_SKIP
    572578    if(bWholeCUCanBeSynthesized)
    573579    {
     580//      printf("CUSkip %d %d %d\n",rpcBestCU->getCUPelX(),rpcBestCU->getCUPelY(),rpcBestCU->getWidth());
    574581      rpcBestCU->getTotalCost() = 0;       // Cost of synthesised CU is zero
    575582      rpcBestCU->getTotalBits() = 0;       // Cost of synthesised CU is zero
     
    577584      rpcBestCU->setPredModeSubParts( MODE_SYNTH,      0, uiDepth );
    578585      rpcBestCU->setPartSizeSubParts( SIZE_2Nx2N,      0, uiDepth );
    579 #if POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS
     586#if POZNAN_CU_SYNTH
    580587      m_ppcRecoYuvBest[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU()); // First copy synthesis YUV part to CU encoder reconstruction YUV structure
    581 #else
    582       m_ppcRecoYuvBest[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU()); // First copy synthesis YUV part to CU encoder reconstruction YUV structure
     588      //m_ppcRecoYuvBest[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU()); // First copy synthesis YUV part to CU encoder reconstruction YUV structure
    583589#endif
    584590      UInt uiInitTrDepth  = rpcBestCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1;
     
    10651071  TComPic* pcPic = pcCU->getPic();
    10661072
    1067 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     1073#if POZNAN_CU_SKIP
    10681074  if( pcCU->isCUSkiped( uiAbsPartIdx ) && uiDepth == pcCU->getDepth( uiAbsPartIdx )) //If CU Skiped no information is coded into stream
    10691075    return;
     
    10761082  UInt uiBPelY   = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1;
    10771083
    1078 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     1084#if POZNAN_CU_SKIP
    10791085  Bool bDontSendSplitFlag = false;
    10801086  if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < (g_uiMaxCUDepth-g_uiAddCUDepth) ) ) || bBoundary ) //check if CU has 3 synthesied subCU - no split flag is send in that case
     
    10991105  if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) )
    11001106  {
    1101 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     1107#if POZNAN_CU_SKIP
    11021108    if(!bDontSendSplitFlag)
    11031109#endif
     
    11411147#endif
    11421148      xRestoreDepthWidthHeight( pcCU );
     1149
     1150#if POZNAN_STAT_JK
     1151          if(m_bStatFileEnabled) xStatFile(pcCU, uiAbsPartIdx, uiDepth);
     1152#endif
     1153
    11431154      return;
    11441155    }
     
    11671178    return;
    11681179  }
     1180
     1181#if POZNAN_STAT_JK
     1182  if(m_bStatFileEnabled) xStatFile(pcCU, uiAbsPartIdx, uiDepth);
     1183#endif
    11691184
    11701185#if TSB_ALF_HEADER
     
    12771292  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    12781293  UInt uiNeighbourCandIdx[MRG_MAX_NUM_CANDS]; //MVs with same idx => same cand
     1294#if POZNAN_EIVD_CALC_PRED_DATA
     1295  TComMP* pcMP = rpcTempCU->getSlice()->getMP();
     1296#endif
    12791297
    12801298#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    13331351        rpcTempCU->setNeighbourCandIdxSubParts( uiInner, uiNeighbourCandIdx[uiInner], 0, 0,uhDepth );
    13341352      }
     1353#if POZNAN_EIVD_CALC_PRED_DATA
     1354          if(uiMergeCand==POZNAN_EIVD_MRG_CAND)
     1355          {
     1356                rpcTempCU->getCUMvField2nd( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[0 + 2*uiMergeCand].getRefIdx(), SIZE_2Nx2N, 0, 0, 0 ); // interprets depth relative to rpcTempCU level
     1357                rpcTempCU->getCUMvField2nd( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[1 + 2*uiMergeCand].getRefIdx(), SIZE_2Nx2N, 0, 0, 0 ); // interprets depth relative to rpcTempCU level
     1358          }
     1359          else
     1360#endif
     1361          {
    13351362      rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[0 + 2*uiMergeCand].getRefIdx(), SIZE_2Nx2N, 0, 0, 0 ); // interprets depth relative to rpcTempCU level
    13361363      rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[1 + 2*uiMergeCand].getRefIdx(), SIZE_2Nx2N, 0, 0, 0 ); // interprets depth relative to rpcTempCU level
     1364          }
    13371365
    13381366#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    13481376      if ( uiNoResidual == 0 ){
    13491377#endif
     1378
     1379#if POZNAN_EIVD
     1380                if(uiMergeCand==POZNAN_EIVD_MRG_CAND){
     1381                        m_pcPredSearch->motionCompensation_EIVD ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1382#if POZNAN_EIVD_CALC_PRED_DATA         
     1383                  pcMP->setEIVDPredMVField(REF_PIC_LIST_0, rpcTempCU);
     1384                  pcMP->setEIVDPredMVField(REF_PIC_LIST_1, rpcTempCU);
     1385#endif
     1386                }
     1387                else
    13501388        m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1389#else
     1390        m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1391#endif
    13511392        // save pred adress
    13521393        pcPredYuvTemp = m_ppcPredYuvTemp[uhDepth];
     
    13581399          pcPredYuvTemp = m_ppcPredYuvBest[uhDepth];
    13591400        }
     1401#if POZNAN_EIVD_CALC_PRED_DATA
     1402            if(uiMergeCand==POZNAN_EIVD_MRG_CAND)
     1403            {
     1404              //copy motion data representing CU with EIVD for uiNoResidual==0 case             
     1405              rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->copyFrom(pcMP->getEIVDPredMVField(REF_PIC_LIST_0),rpcTempCU->getTotalNumPart(),0);
     1406              rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->copyFrom(pcMP->getEIVDPredMVField(REF_PIC_LIST_1),rpcTempCU->getTotalNumPart(),0);
     1407            }
     1408#endif
    13601409      }
    13611410#if HHI_VSO
     
    13811430      Bool bQtRootCbf = rpcTempCU->getQtRootCbf(0) == 1;
    13821431#else
     1432#if POZNAN_EIVD
    13831433      // do MC
     1434          if(uiMergeCand==POZNAN_EIVD_MRG_CAND){
     1435                 m_pcPredSearch->motionCompensation_EIVD ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1436#if POZNAN_EIVD_CALC_PRED_DATA         
     1437                 pcMP->setEIVDPredMVField(REF_PIC_LIST_0, rpcTempCU);
     1438                 pcMP->setEIVDPredMVField(REF_PIC_LIST_1, rpcTempCU);
     1439#endif         
     1440          }
     1441          else
    13841442      m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
     1443
     1444#endif
    13851445
    13861446      // estimate residual and encode everything
     
    16711731    {
    16721732      if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui )
    1673 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU
     1733#if POZNAN_CU_SKIP
    16741734        || pcTextureCU->isCUSkiped( rpcTempCU->getZorderIdxInCU() + ui )
    16751735#endif
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCu.h

    r11 r12  
    7878  TComYuv**               m_ppcOrigYuv;     ///< Original Yuv for each depth
    7979  TComYuv**               m_ppcResPredTmp;  ///< Temporary residual prediction for each depth
    80 #if POZNAN_AVAIL_MAP
     80#if POZNAN_CU_SKIP
    8181  TComYuv**               m_ppcAvailYuv;    ///< Avaiability map for each depth 
    8282#endif
    83 #if POZNAN_SYNTH_VIEW
     83#if POZNAN_CU_SYNTH
    8484  TComYuv**               m_ppcSynthYuv;    ///< Synthetized Yuv for each depth
    8585#endif
    86 
     86 
    8787  //  Data : encoder control
    8888  Int                     m_iQp;            ///< Last QP
     
    113113#endif
    114114
     115#if POZNAN_STAT_JK
     116  Bool m_bStatFileEnabled;
     117#endif
     118
    115119public:
    116120  /// copy parameters from encoder class
     
    131135  /// set QP value
    132136  Void  setQpLast           ( Int iQp ) { m_iQp = iQp; }
     137 
     138#if POZNAN_STAT_JK
     139  Void setStatFileEnabled(Bool bStatFileEnabled){m_bStatFileEnabled = bStatFileEnabled;}
     140#endif
    133141 
    134142protected:
     
    162170  Void  xRestoreDepthWidthHeight( TComDataCU* pcCU );
    163171#endif
     172
     173#if POZNAN_EIVD & !POZNAN_EIVD_COMPRESS_ME_DATA
     174  Void  xSaveEIVDData(TComDataCU* pcCU) { pcCU->getSlice()->getMP()->saveEIVDData(pcCU);}
     175#endif
     176
     177#if POZNAN_STAT_JK
     178  Void  xStatFile                       ( TComDataCU*  pcCU, UInt uiAbsPartIdx,           UInt uiDepth        );
     179#endif
    164180};
    165181
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncGOP.cpp

    r11 r12  
    293293#endif
    294294
     295#if POZNAN_MP   
     296#if POZNAN_MP_USE_DEPTH_MAP_GENERATION
     297          pcSlice->getMP()->setDepthMapGenerator(m_pcDepthMapGenerator);
     298#else
     299      std::vector<TComPic*> apcSpatDepthRefPics = m_pcEncTop->getEncTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), true );
     300          pcSlice->getMP()->setDepthRefPicsList(&apcSpatDepthRefPics);
     301#endif
     302          std::vector<TComPic*> apcSpatDataRefPics = m_pcEncTop->getEncTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), m_pcEncTop->isDepthCoder() );
     303          pcSlice->getMP()->setRefPicsList(&apcSpatDataRefPics);
     304          pcSlice->getMP()->pairMultiview(pcPic);
     305#endif
     306
    295307      while(uiNextCUAddr<pcPic->getPicSym()->getNumberOfCUsInFrame()) // determine slice boundaries
    296308      {
     
    615627      pcBitstreamOut->convertRBSPToPayload(0);
    616628
     629#if POZNAN_MP
     630          pcSlice->getMP()->disable();
     631#endif
     632
    617633/*#if AMVP_BUFFERCOMPRESS
    618634      pcPic->compressMotion(); // moved to end of access unit
     
    822838  if(pAvail)
    823839  {
    824     for( y = 0; y < iHeight; y++ )
    825     {
    826       for( x = 0; x < iWidth; x++ )
    827       {
     840  for( y = 0; y < iHeight; y++ )
     841  {
     842    for( x = 0; x < iWidth; x++ )
     843    {
    828844        if(pAvail[x]==0) //If pixel was codded
    829845        {
     
    847863      for( x = 0; x < iWidth; x++ )
    848864      {
    849         Int iDiff = (Int)( pOrg[x] - pRec[x] );
    850         uiSSDY   += iDiff * iDiff;
    851       }
    852       pOrg += iStride;
    853       pRec += iStride;
    854     }
     865      Int iDiff = (Int)( pOrg[x] - pRec[x] );
     866      uiSSDY   += iDiff * iDiff;
     867    }
     868    pOrg += iStride;
     869    pRec += iStride;
     870  }
    855871  }
    856872
     
    869885  {
    870886#if POZNAN_CU_SKIP_PSNR
    871     if(pAvail)
    872     {
    873       iHeight >>= 1;
    874       iWidth  >>= 1;
    875       iStride >>= 1;
    876    
    877       pOrg  = pcPic ->getPicYuvOrg()->getCbAddr();
    878       pRec  = pcPicD->getCbAddr();
    879       pAvail  = pcPic ->getPicYuvAvail()->getLumaAddr();
    880       iPixelsCnt = 0;
    881 
    882       for( y = 0; y < iHeight; y++ )
    883       {
    884         for( x = 0; x < iWidth; x++ )
    885         {
    886           if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0||
    887              pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded
    888           {
    889             Int iDiff = (Int)( pOrg[x] - pRec[x] );
    890             uiSSDU   += iDiff * iDiff;
    891             iPixelsCnt++;
    892           }
    893         }
    894         pOrg += iStride;
    895         pRec += iStride;
    896         pAvail+= (iStride<<2);
    897       }
    898      
    899       fRefValueC = (double) maxval * maxval * iPixelsCnt;
    900 
    901       pOrg  = pcPic ->getPicYuvOrg()->getCrAddr();
    902       pRec  = pcPicD->getCrAddr();
    903       pAvail  = pcPic ->getPicYuvAvail()->getLumaAddr();
    904       for( y = 0; y < iHeight; y++ )
    905       {
    906         for( x = 0; x < iWidth; x++ )
    907         {
    908           if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0||
    909              pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded
    910           {
    911             Int iDiff = (Int)( pOrg[x] - pRec[x] );
    912             uiSSDV   += iDiff * iDiff;
    913           }
    914         }
    915         pOrg += iStride;
    916         pRec += iStride;
    917         pAvail+= iStride<<2;
    918       }
    919     }
    920     else
    921 #endif
    922     {
    923       iHeight >>= 1;
    924       iWidth  >>= 1;
    925       iStride >>= 1;
    926 
    927       pOrg  = pcPic ->getPicYuvOrg()->getCbAddr();
    928       pRec  = pcPicD->getCbAddr();
    929 
    930       for( y = 0; y < iHeight; y++ )
    931       {
    932         for( x = 0; x < iWidth; x++ )
     887  if(pAvail)
     888  {
     889    iHeight >>= 1;
     890    iWidth  >>= 1;
     891    iStride >>= 1;
     892 
     893    pOrg  = pcPic ->getPicYuvOrg()->getCbAddr();
     894    pRec  = pcPicD->getCbAddr();
     895    pAvail  = pcPic ->getPicYuvAvail()->getLumaAddr();
     896    iPixelsCnt = 0;
     897
     898    for( y = 0; y < iHeight; y++ )
     899    {
     900      for( x = 0; x < iWidth; x++ )
     901      {
     902        if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0||
     903           pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded
    933904        {
    934905          Int iDiff = (Int)( pOrg[x] - pRec[x] );
    935906          uiSSDU   += iDiff * iDiff;
    936         }
    937         pOrg += iStride;
    938         pRec += iStride;
    939       }
    940 
    941       pOrg  = pcPic ->getPicYuvOrg()->getCrAddr();
    942       pRec  = pcPicD->getCrAddr();
    943 
    944       for( y = 0; y < iHeight; y++ )
    945       {
    946         for( x = 0; x < iWidth; x++ )
     907          iPixelsCnt++;
     908        }
     909      }
     910      pOrg += iStride;
     911      pRec += iStride;
     912        pAvail+= (iStride<<2);
     913    }
     914
     915    fRefValueC = (double) maxval * maxval * iPixelsCnt;
     916
     917    pOrg  = pcPic ->getPicYuvOrg()->getCrAddr();
     918    pRec  = pcPicD->getCrAddr();
     919    pAvail  = pcPic ->getPicYuvAvail()->getLumaAddr();
     920    for( y = 0; y < iHeight; y++ )
     921    {
     922      for( x = 0; x < iWidth; x++ )
     923      {
     924        if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0||
     925           pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded
    947926        {
    948927          Int iDiff = (Int)( pOrg[x] - pRec[x] );
    949928          uiSSDV   += iDiff * iDiff;
    950929        }
    951         pOrg += iStride;
    952         pRec += iStride;
    953       }
    954     }
    955 
    956     dYPSNR            = ( uiSSDY ? 10.0 * log10( fRefValueY / (Double)uiSSDY ) : 99.99 );
    957     dUPSNR            = ( uiSSDU ? 10.0 * log10( fRefValueC / (Double)uiSSDU ) : 99.99 );
    958     dVPSNR            = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 );
     930      }
     931      pOrg += iStride;
     932      pRec += iStride;
     933        pAvail+= iStride<<2;
     934    }
     935  }
     936  else
     937#endif
     938  {
     939  iHeight >>= 1;
     940  iWidth  >>= 1;
     941  iStride >>= 1;
     942
     943  pOrg  = pcPic ->getPicYuvOrg()->getCbAddr();
     944  pRec  = pcPicD->getCbAddr();
     945
     946  for( y = 0; y < iHeight; y++ )
     947  {
     948    for( x = 0; x < iWidth; x++ )
     949    {
     950      Int iDiff = (Int)( pOrg[x] - pRec[x] );
     951      uiSSDU   += iDiff * iDiff;
     952    }
     953    pOrg += iStride;
     954    pRec += iStride;
     955  }
     956
     957  pOrg  = pcPic ->getPicYuvOrg()->getCrAddr();
     958  pRec  = pcPicD->getCrAddr();
     959
     960  for( y = 0; y < iHeight; y++ )
     961  {
     962    for( x = 0; x < iWidth; x++ )
     963    {
     964      Int iDiff = (Int)( pOrg[x] - pRec[x] );
     965      uiSSDV   += iDiff * iDiff;
     966    }
     967    pOrg += iStride;
     968    pRec += iStride;
     969  }
     970  }
     971
     972  dYPSNR            = ( uiSSDY ? 10.0 * log10( fRefValueY / (Double)uiSSDY ) : 99.99 );
     973  dUPSNR            = ( uiSSDU ? 10.0 * log10( fRefValueC / (Double)uiSSDU ) : 99.99 );
     974  dVPSNR            = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 );
    959975  }
    960976  // fix: total bits should consider slice size bits (32bit)
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncSbac.h

    r5 r12  
    166166  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    167167  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    168 #if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     168#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI || POZNAN_EIVD
    169169  Void codeMergeIndexMV  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    170170#endif
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncSearch.cpp

    r5 r12  
    10421042  UInt uiAbsSum = 0;
    10431043  pcCU       ->setTrIdxSubParts ( uiTrDepth, uiAbsPartIdx, uiFullDepth );
     1044#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1045  m_pcTrQuant->setQPforQuant    ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     1046#else
    10441047  m_pcTrQuant->setQPforQuant    ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     1048#endif
    10451049  m_pcTrQuant->transformNxN     ( pcCU, piResi, uiStride, pcCoeff, uiWidth, uiHeight, uiAbsSum, TEXT_LUMA, uiAbsPartIdx );
    10461050
     
    12081212    //--- transform and quantization ---
    12091213    UInt uiAbsSum = 0;
     1214#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     1215  m_pcTrQuant->setQPforQuant       ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, true), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     1216#else
    12101217    m_pcTrQuant->setQPforQuant     ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     1218#endif
    12111219    m_pcTrQuant->transformNxN      ( pcCU, piResi, uiStride, pcCoeff, uiWidth, uiHeight, uiAbsSum, eText, uiAbsPartIdx );
    12121220    //--- set coded block flag ---
     
    28142822}
    28152823
     2824#if POZNAN_EIVD
     2825Void TEncSearch::xGetInterPredictionError_EIVD( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiErr, Bool bHadamard )
     2826{
     2827  TComYuv cYuvPred;
     2828  cYuvPred.create( pcYuvOrg->getWidth(), pcYuvOrg->getHeight() );
     2829
     2830#ifdef WEIGHT_PRED
     2831  UInt uiAbsPartIdx = 0;
     2832  Int iWidth = 0;
     2833  Int iHeight = 0;
     2834  //Int iRefIdx[2];
     2835  pcCU->getPartIndexAndSize( iPartIdx, uiAbsPartIdx, iWidth, iHeight );
     2836
     2837//???????????????????????????????????????????????????????????????????????????????????
     2838  //iRefIdx[0] = pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiAbsPartIdx );
     2839  //iRefIdx[1] = pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiAbsPartIdx );
     2840  //if ( iRefIdx[0]>=0 && iRefIdx[1]<1 )
     2841  //  setWpScalingDistParam( pcCU, iRefIdx[0], iRefIdx[1], REF_PIC_LIST_0);
     2842  //else
     2843  //  setWpScalingDistParam( pcCU, iRefIdx[0], iRefIdx[1], REF_PIC_LIST_1);
     2844  setWpScalingDistParam( pcCU, -1, -1, REF_PIC_LIST_X);//???
     2845//???????????????????????????????????????????????????????????????????????????????????
     2846  motionCompensation_EIVD( pcCU, &cYuvPred, REF_PIC_LIST_X, iPartIdx );
     2847#else
     2848  motionCompensation_EIVD( pcCU, &cYuvPred, REF_PIC_LIST_X, iPartIdx );
     2849
     2850  UInt uiAbsPartIdx = 0;
     2851  Int iWidth = 0;
     2852  Int iHeight = 0;
     2853  pcCU->getPartIndexAndSize( iPartIdx, uiAbsPartIdx, iWidth, iHeight );
     2854#endif
     2855
     2856  DistParam cDistParam;
     2857#ifdef WEIGHT_PRED
     2858  cDistParam.applyWeight = false;
     2859#endif
     2860  m_pcRdCost->setDistParam( cDistParam,
     2861                            pcYuvOrg->getLumaAddr( uiAbsPartIdx ), pcYuvOrg->getStride(),
     2862                            cYuvPred .getLumaAddr( uiAbsPartIdx ), cYuvPred .getStride(),
     2863                            iWidth, iHeight, m_pcEncCfg->getUseHADME() );
     2864  ruiErr = cDistParam.DistFunc( &cDistParam );
     2865
     2866  cYuvPred.destroy();
     2867}
     2868#endif
     2869
    28162870/** estimation of best merge coding
    28172871 * \param pcCU
     
    28752929      PartSize ePartSize = pcCU->getPartitionSize( 0 );
    28762930
     2931#if POZNAN_EIVD_CALC_PRED_DATA
     2932          if(uiMergeCand==POZNAN_EIVD_MRG_CAND)
     2933          {
     2934                pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[0 + 2*uiMergeCand].getRefIdx(), ePartSize, uiAbsPartIdx, iPUIdx, 0 );
     2935                pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[1 + 2*uiMergeCand].getRefIdx(), ePartSize, uiAbsPartIdx, iPUIdx, 0 );
     2936          }
     2937          else
     2938#endif
     2939          {
    28772940      pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[0 + 2*uiMergeCand].getRefIdx(), ePartSize, uiAbsPartIdx, iPUIdx, 0 );
    28782941      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[1 + 2*uiMergeCand].getRefIdx(), ePartSize, uiAbsPartIdx, iPUIdx, 0 );
    2879 
     2942          }
     2943
     2944#if POZNAN_EIVD
     2945          if(uiMergeCand==POZNAN_EIVD_MRG_CAND)
     2946                xGetInterPredictionError_EIVD( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() );
     2947          else
    28802948      xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() );
     2949#else
     2950      xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() );
     2951#endif
    28812952
    28822953      if( uiNumCand == 1 )
     
    28862957      else
    28872958      {
    2888         if( uiMergeCand == 0 || uiNumCand == 2 )
     2959        UInt uiMergeCandIdx = uiMergeCand;
     2960#if POZNAN_EIVD
     2961                if(pcCU->getSlice()->getMP()->isEIVDEnabled())
     2962                {
     2963                        if(uiMergeCand == POZNAN_EIVD_MRG_CAND) uiMergeCandIdx = POZNAN_EIVD_MERGE_POS;
     2964                        else if(uiMergeCand >= POZNAN_EIVD_MERGE_POS) uiMergeCandIdx++;
     2965                }
     2966#endif
     2967
     2968        if( uiMergeCandIdx == 0 || uiNumCand == 2 )
    28892969        {
    28902970          uiBitsCand = 2;
    28912971        }
    2892         else if( uiMergeCand == 1 || uiNumCand == 3 )
     2972        else if( uiMergeCandIdx == 1 || uiNumCand == 3 )
    28932973        {
    28942974          uiBitsCand = 3;
    28952975        }
    2896         else if( uiMergeCand == 2 || uiNumCand == 4 )
     2976        else if( uiMergeCandIdx == 2 || uiNumCand == 4 )
    28972977        {
    28982978          uiBitsCand = 4;
    28992979        }
     2980                else if( uiMergeCandIdx == 3 || uiNumCand == 5 )
     2981        {
     2982          uiBitsCand = 5;
     2983        }
    29002984        else
    29012985        {
    2902           uiBitsCand = 5;
     2986          uiBitsCand = 6;
    29032987        }
    29042988      }
     
    29102994        pacMvField[0] = cMvFieldNeighbours[0 + 2*uiMergeCand];
    29112995        pacMvField[1] = cMvFieldNeighbours[1 + 2*uiMergeCand];
     2996
     2997#if POZNAN_EIVD_CALC_PRED_DATA
     2998                if(uiMergeCand==POZNAN_EIVD_MRG_CAND)
     2999                {
     3000                        TComCUMvField* pcEIVDPredMvField;
     3001
     3002                        pcEIVDPredMvField = pcCU->getSlice()->getMP()->getEIVDPredMVField(REF_PIC_LIST_0);
     3003                        pcEIVDPredMvField->setMv(pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(uiAbsPartIdx),0);
     3004                        pcEIVDPredMvField->setRefIdx(pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiAbsPartIdx),0);
     3005
     3006                        pcEIVDPredMvField = pcCU->getSlice()->getMP()->getEIVDPredMVField(REF_PIC_LIST_1);
     3007                        pcEIVDPredMvField->setMv(pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(uiAbsPartIdx),0);
     3008                        pcEIVDPredMvField->setRefIdx(pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiAbsPartIdx),0);
     3009                }
     3010#endif
     3011
    29123012        uiInterDir = uhInterDirNeighbours[uiMergeCand];
    29133013        uiMergeIndex = uiMergeCand;
     
    36043704        pcCU->setMergeIndexSubParts( uiMRGIndex,    uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
    36053705        pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     3706
     3707#if POZNAN_EIVD_CALC_PRED_DATA
     3708                if(uiMRGIndex==POZNAN_EIVD_MRG_CAND)
     3709                {
     3710                        TComCUMvField* pcEIVDPredMvField;
     3711                        pcEIVDPredMvField = pcCU->getSlice()->getMP()->getEIVDPredMVField(REF_PIC_LIST_0);
     3712                        pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( pcEIVDPredMvField->getMv(0), pcEIVDPredMvField->getRefIdx(0), ePartSize, uiPartAddr, iPartIdx, 0 );                       
     3713                        pcEIVDPredMvField = pcCU->getSlice()->getMP()->getEIVDPredMVField(REF_PIC_LIST_1);
     3714                        pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( pcEIVDPredMvField->getMv(0), pcEIVDPredMvField->getRefIdx(0), ePartSize, uiPartAddr, iPartIdx, 0 );
     3715
     3716                        pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0].getMv(), cMRGMvField[0].getRefIdx(), ePartSize, uiPartAddr, iPartIdx, 0 );
     3717                        pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1].getMv(), cMRGMvField[1].getRefIdx(), ePartSize, uiPartAddr, iPartIdx, 0 );
     3718                }
     3719                else
     3720#endif
    36063721        {
    36073722          pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0].getMv(), cMRGMvField[0].getRefIdx(), ePartSize, uiPartAddr, iPartIdx, 0 );
     
    49985113      m_pcEntropyCoder->estimateBit(m_pcTrQuant->m_pcEstBitsSbac, 1<< uiLog2TrSize, TEXT_LUMA );
    49995114    }
     5115#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     5116    m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, false), false, pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     5117#else
    50005118    m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), false, pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     5119#endif
    50015120    m_pcTrQuant->transformNxN( pcCU, pcResi->getLumaAddr( uiAbsPartIdx ), pcResi->getStride (), pcCoeffCurrY, 1<< uiLog2TrSize,    1<< uiLog2TrSize,    uiAbsSumY, TEXT_LUMA,     uiAbsPartIdx );
    50025121
     
    50095128        m_pcEntropyCoder->estimateBit(m_pcTrQuant->m_pcEstBitsSbac, 1<<uiLog2TrSizeC, TEXT_CHROMA );
    50105129      }
     5130#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     5131      m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, false), false, pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     5132#else
    50115133      m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), false, pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     5134#endif
    50125135      m_pcTrQuant->transformNxN( pcCU, pcResi->getCbAddr( uiAbsPartIdx ), pcResi->getCStride(), pcCoeffCurrU, 1<<uiLog2TrSizeC, 1<<uiLog2TrSizeC, uiAbsSumU, TEXT_CHROMA_U, uiAbsPartIdx );
    50135136      m_pcTrQuant->transformNxN( pcCU, pcResi->getCrAddr( uiAbsPartIdx ), pcResi->getCStride(), pcCoeffCurrV, 1<<uiLog2TrSizeC, 1<<uiLog2TrSizeC, uiAbsSumV, TEXT_CHROMA_V, uiAbsPartIdx );
     
    50725195    {
    50735196      Pel *pcResiCurrY = m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( uiAbsPartIdx );
     5197#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     5198      m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, false),  false, pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     5199#else
    50745200      m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), false, pcCU->getSlice()->getSliceType(), TEXT_LUMA );
     5201#endif
    50755202#if INTRA_DST_TYPE_7 // Inside Inter Encoder Search. So use conventional DCT.
    50765203    m_pcTrQuant->invtransformNxN( TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),  pcCoeffCurrY, 1<< uiLog2TrSize,    1<< uiLog2TrSize );//this is for inter mode only
     
    51505277      {
    51515278        Pel *pcResiCurrU = m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr( uiAbsPartIdx );
     5279#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     5280        m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, false), false, pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     5281#else
    51525282        m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), false, pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     5283#endif
    51535284#if INTRA_DST_TYPE_7  // Inside Inter Encoder Search. So use conventional DCT.
    51545285        m_pcTrQuant->invtransformNxN( TEXT_CHROMA,REG_DCT, pcResiCurrU, m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), pcCoeffCurrU, 1<<uiLog2TrSizeC, 1<<uiLog2TrSizeC);
     
    51955326        if( !uiAbsSumU )
    51965327        {
     5328#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     5329          m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(uiAbsPartIdx, false), false, pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     5330#else
    51975331          m_pcTrQuant->setQPforQuant( pcCU->getQP( 0 ), false, pcCU->getSlice()->getSliceType(), TEXT_CHROMA );
     5332#endif
    51985333        }
    51995334#if INTRA_DST_TYPE_7   // Inside Inter Encoder Search. So use conventional DCT.
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncSearch.h

    r5 r12  
    185185 
    186186  Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard );
     187#if POZNAN_EIVD
     188  Void xGetInterPredictionError_EIVD( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard );
     189#endif
    187190
    188191public:
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncSlice.cpp

    r5 r12  
    475475  m_pcEntropyCoder->setMaxAlfCtrlDepth(0); //unnecessary
    476476
     477#if POZNAN_STAT_JK
     478  m_pcCuEncoder->setStatFileEnabled(false);
     479#endif
     480
    477481  // for every CU in slice
    478482  for(  uiCUAddr = uiStartCUAddr; uiCUAddr < uiBoundingCUAddr; uiCUAddr++  )
     
    611615#endif
    612616
     617#if POZNAN_STAT_JK
     618  m_pcCuEncoder->setStatFileEnabled(true);
     619#endif
     620
    613621  for(  uiCUAddr = uiStartCUAddr; uiCUAddr<uiBoundingCUAddr; uiCUAddr++  )
    614622  {
     
    618626    g_bJustDoIt = g_bEncDecTraceEnable;
    619627#endif
     628
     629        // JK {
     630        DTRACE_CABAC_V( g_nSymbolCounter++ );
     631        DTRACE_CABAC_T( "\tCU: " );
     632        DTRACE_CABAC_V( uiCUAddr );
     633        DTRACE_CABAC_T( "\n" );
     634        // JK }
     635
    620636    if ( (m_pcCfg->getSliceMode()!=0 || m_pcCfg->getEntropySliceMode()!=0) && uiCUAddr==uiBoundingCUAddr-1 )
    621637    {
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncTop.cpp

    r11 r12  
    6363  m_bSeqFirst = true;
    6464  m_iFrameNumInCodingOrder = 0;
     65   
     66#if POZNAN_MP
     67  m_pcMP=NULL;
     68#endif
     69
    6570}
    6671
     
    98103#endif
    99104
     105#if POZNAN_MP
     106  m_pcMP                                = NULL;
     107#endif
     108
    100109#if MQT_BA_RA && MQT_ALF_NPASS
    101110  if(m_bUseALF)
     
    163172#endif
    164173
     174#if POZNAN_MP
     175  m_pcMP=NULL;
     176#endif
     177
    165178  // SBAC RD
    166179  if( m_bUseSBACRD )
     
    205218  // initialize PPS
    206219  xInitPPS();
     220#endif
     221
     222#if POZNAN_MP
     223  m_pcMP = pcTAppEncTop->getMP();
    207224#endif
    208225
     
    416433  {
    417434    pcPic->removeOriginalBuffer   ();
    418 #if POZNAN_AVAIL_MAP
     435#if POZNAN_CU_SKIP
    419436    pcPic->removeAvailabilityBuffer();
    420437#endif
    421 #if POZNAN_SYNTH_VIEW
     438#if POZNAN_CU_SYNTH
    422439    pcPic->removeSynthesisBuffer();
     440#if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH
     441    pcPic->removeSynthesisDepthBuffer();
     442#endif
    423443#endif
    424444#if HHI_INTER_VIEW_MOTION_PRED
     
    514534  // mark it should be extended
    515535  rpcPic->getPicYuvRec()->setBorderExtension(false);
     536 
     537#if POZNAN_MP
     538        rpcPic->getSlice(0)->setMP(m_pcMP);
     539#endif
     540
     541#if POZNAN_STAT_JK
     542        rpcPic->getSlice(0)->setStatFile(m_pcStatFile);
     543#endif
    516544}
    517545