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


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

Poznan Tools

  • Depth base motion vector prediction
Location:
branches/0.2-poznan-univ/source/Lib/TLibEncoder
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • 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
     
    624652#if HHI_MPI
    625653  m_cSPS.setUseMVI( m_bUseMVI );
     654#endif
     655
     656#if POZNAN_NONLINEAR_DEPTH
     657  m_cSPS.setDepthPower  ( m_fDepthPower );
    626658#endif
    627659
     
    824856
    825857  pcPic->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset );
    826 }
     858
     859#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     860  pcPic->setTextureCuDeltaQpOffset( getTextureCuDeltaQpOffset() );
     861  pcPic->setTextureCuDeltaQpMul   ( getTextureCuDeltaQpMul() );
     862  pcPic->setTextureCuDeltaQpTopBottomRow( getTextureCuDeltaQpTopBottomRow() ); 
     863#endif
     864}
  • branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncTop.h

    r5 r12  
    6464#include "TEncAnalyze.h"
    6565
     66#if POZNAN_MP
     67#include "../TLibCommon/TComMP.h"
     68#endif         
    6669
    6770// ====================================================================================================================
     
    131134
    132135  PicOrderCnt             m_iFrameNumInCodingOrder;
     136#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     137  Double                  m_dTextureCuDeltaQpOffset;
     138  Double                  m_dTextureCuDeltaQpMul;
     139  Int                     m_iTextureCuDeltaQpTopBottomRow;
     140#endif
     141
     142#if POZNAN_MP
     143  TComMP*                                 m_pcMP;
     144#endif
    133145
    134146protected:
     
    217229  Void encode    ( bool bEos, std::map<PicOrderCnt, TComPicYuv*>& rcMapPicYuvRecOut, TComBitstream* pcBitstreamOut, Bool& bNewPicNeeded );
    218230  Void receivePic( bool bEos, TComPicYuv* pcPicYuvOrg, TComPicYuv* pcPicYuvRec, TComPicYuv* pcOrgPdmDepth = 0 );
     231
     232#if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC
     233  Double getTextureCuDeltaQpOffset( )      { return m_dTextureCuDeltaQpOffset;}
     234  Double getTextureCuDeltaQpMul( )         { return m_dTextureCuDeltaQpMul;}
     235  Int    getTextureCuDeltaQpTopBottomRow( ){ return m_iTextureCuDeltaQpTopBottomRow;}
     236  Void   setTextureCuDeltaQpOffset      ( Double dTextureCuDeltaQpOffset    ){ m_dTextureCuDeltaQpOffset       = dTextureCuDeltaQpOffset; }
     237  Void   setTextureCuDeltaQpMul         ( Double dTextureCuDeltaQpMul       ){ m_dTextureCuDeltaQpMul          = dTextureCuDeltaQpMul; }
     238  Void   setTextureCuDeltaQpTopBottomRow( Int iTextureCuDeltaQpTopBottomRow ){ m_iTextureCuDeltaQpTopBottomRow = iTextureCuDeltaQpTopBottomRow; } 
     239#endif
    219240};
    220241
Note: See TracChangeset for help on using the changeset viewer.