Changeset 140 in SHVCSoftware for branches/SHM-2.0-dev/source


Ignore:
Timestamp:
2 May 2013, 19:26:04 (12 years ago)
Author:
seregin
Message:

clean up macros REUSE_BLKMAPPING, REUSE_MVSCALE

Location:
branches/SHM-2.0-dev/source/Lib/TLibCommon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.cpp

    r133 r140  
    585585
    586586#if REF_IDX_MFM
    587 #if !REUSE_BLKMAPPING
    588 Void TComPic::deriveUnitIdxBase( UInt upsamplePelX, UInt upsamplePelY, UInt ratio, UInt& baseCUAddr, UInt& baseAbsPartIdx )
    589 {
    590   //pixel in the base layer
    591 
    592   UInt pelX       = (upsamplePelX<<1)/ratio;
    593   UInt pelY       = (upsamplePelY<<1)/ratio;
    594   UInt baseWidth  = getPicYuvRec()->getWidth();
    595   UInt baseHeight = getPicYuvRec()->getHeight();
    596  
    597   UInt widthInCU       = ( baseWidth % g_uiMaxCUWidth  ) ? baseWidth /g_uiMaxCUWidth  + 1 : baseWidth /g_uiMaxCUWidth;
    598 
    599 #if MFM_CLIPPING_FIX
    600   pelX     = (UInt)Clip3<UInt>(0, getPicYuvRec()->getWidth() - 1, pelX);
    601   pelY     = (UInt)Clip3<UInt>(0, getPicYuvRec()->getHeight() - 1, pelY);
    602 #else
    603   UInt heightInCU      = ( baseHeight% g_uiMaxCUHeight ) ? baseHeight/ g_uiMaxCUHeight + 1 : baseHeight/ g_uiMaxCUHeight;
    604 
    605   pelX     = (UInt)Clip3<UInt>(0, widthInCU * g_uiMaxCUWidth - 1, pelX);
    606   pelY     = (UInt)Clip3<UInt>(0, heightInCU * g_uiMaxCUHeight - 1, pelY);
    607 #endif
    608  
    609   baseCUAddr = pelY / g_uiMaxCUHeight * widthInCU + pelX / g_uiMaxCUWidth;
    610 
    611   UInt widthMinPU = g_uiMaxCUWidth / (1<<g_uiMaxCUDepth);
    612   UInt heightMinPU = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);
    613  
    614   UInt absPelX = pelX - (pelX / g_uiMaxCUWidth) * g_uiMaxCUWidth;
    615   UInt absPelY = pelY - (pelY / g_uiMaxCUHeight) * g_uiMaxCUHeight;
    616 
    617   UInt rasterIdx = absPelY / heightMinPU * (g_uiMaxCUWidth/widthMinPU) + absPelX / widthMinPU;
    618   baseAbsPartIdx = g_auiRasterToZscan[rasterIdx];
    619 
    620   return;
    621 }
    622 #endif
    623 
    624587Void TComPic::copyUpsampledMvField(TComPic* pcPicBase)
    625588{
    626 #if !REUSE_MVSCALE || !REUSE_BLKMAPPING || AVC_SYNTAX
     589#if AVC_SYNTAX
    627590  const Window &confBL = pcPicBase->getConformanceWindow();
    628591  const Window &confEL = getPicYuvRec()->getConformanceWindow();
     
    633596  Int widthEL   = getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
    634597  Int heightEL  = getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
    635 #endif
    636  
    637 #if !REUSE_MVSCALE  || !REUSE_BLKMAPPING
    638   UInt upSampleRatio = 0;
    639   if(widthEL == widthBL && heightEL == heightBL)
    640   {
    641     upSampleRatio = 2;
    642   }
    643   else if(2*widthEL == 3*widthBL && 2*heightEL == 3*heightBL)
    644   {
    645     upSampleRatio = 3;
    646   }
    647   else if(widthEL == 2*widthBL && heightEL == 2*heightBL)
    648   {
    649     upSampleRatio = 4;
    650   }
    651   else
    652   {
    653     assert(0);
    654   }
    655598#endif
    656599
     
    671614      UInt baseCUAddr, baseAbsPartIdx;
    672615
    673 #if REUSE_BLKMAPPING
    674616      TComDataCU *pcColCU = 0;
    675617      pcColCU = pcCUDes->getBaseColCU(pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx);
    676 #else
    677       pcPicBase->deriveUnitIdxBase(pelX + 8, pelY + 8, upSampleRatio, baseCUAddr, baseAbsPartIdx);
    678 #endif
    679618
    680619#if AVC_SYNTAX
     
    682621      Int yBL = ( (pelY + 8) * heightBL+ heightEL/2 ) / heightEL;
    683622
    684 #if REUSE_BLKMAPPING
    685623      if( ( xBL < widthBL && yBL < heightBL ) && pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
    686624#else
    687       if( ( xBL < widthBL && yBL < heightBL ) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
    688 #endif
    689 #else
    690 #if REUSE_BLKMAPPING
    691625      if( pcColCU && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcColCU->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
    692 #else
    693       if( (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_NONE) && (pcPicBase->getCU(baseCUAddr)->getPredictionMode(baseAbsPartIdx) != MODE_INTRA) )  //base layer unit not skip and invalid mode
    694 #endif
    695626#endif
    696627      {
    697628        for(UInt refPicList = 0; refPicList < 2; refPicList++)  //for each reference list
    698629        {
    699 #if REUSE_MVSCALE
    700630          TComMvField sMvFieldBase, sMvField;
    701 #if REUSE_BLKMAPPING
    702631          pcColCU->getMvField( pcColCU, baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase);
    703 #else
    704           pcPicBase->getCU(baseCUAddr)->getMvField( pcPicBase->getCU(baseCUAddr), baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase);
    705 #endif
    706632          pcCUDes->scaleBaseMV( sMvField, sMvFieldBase );
    707 #else
    708           TComMv cMv = pcPicBase->getCU(baseCUAddr)->getCUMvField((RefPicList)refPicList)->getMv(baseAbsPartIdx);
    709           Int refIdx = pcPicBase->getCU(baseCUAddr)->getCUMvField((RefPicList)refPicList)->getRefIdx(baseAbsPartIdx);
    710 
    711           Int hor =  ((Int)upSampleRatio * cMv.getHor())/2 ;
    712           Int ver =  ((Int)upSampleRatio * cMv.getVer())/2 ;
    713 
    714           TComMv cScaledMv(hor, ver);
    715           TComMvField sMvField;
    716           sMvField.setMvField(cScaledMv, refIdx);
    717 #endif
    718633
    719634          pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, absPartIdx);
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.h

    r134 r140  
    129129#if REF_IDX_MFM
    130130  Void          copyUpsampledMvField  (  TComPic* pcPicBase );
    131 #if !REUSE_BLKMAPPING
    132   Void          deriveUnitIdxBase     (  UInt upsamplePelX, UInt upsamplePelY, UInt ratio, UInt& baseCUAddr, UInt& baseAbsPartIdx );
    133 #endif
    134131#if RAP_MFM_INIT
    135132  Void          initUpsampledMvField  ();
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp

    r133 r140  
    26072607  assert(thePoc == pcRefPicBL->getPOC());
    26082608
    2609 #if REUSE_MVSCALE || REUSE_BLKMAPPING
    26102609  ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL );
    2611 #endif
    26122610
    26132611  //copy reference pictures marking from the reference layer
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h

    r139 r140  
    8888
    8989#if REF_IDX_MFM
    90 #define REUSE_MVSCALE                    1      ///< using the base layer MV scaling function
    91 #define REUSE_BLKMAPPING                 1      ///< using the base layer get co-located block function
    9290#define RAP_MFM_INIT                     1      ///< initilizing MFM when base layer is RAP picture
    9391#define REF_LIST_BUGFIX                  1
Note: See TracChangeset for help on using the changeset viewer.