Changeset 1290 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon


Ignore:
Timestamp:
18 Jul 2015, 01:59:29 (10 years ago)
Author:
seregin
Message:

port rev 4324 (g_uiMaxDepth, g_uiAddDepth)

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.h

    r1287 r1290  
    127127//returns the part index of the luma region that is co-located with the specified chroma region
    128128
    129 static inline UInt getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu, const ChromaFormat chFmt)
    130 {
    131   return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~((1<<(2*g_uiAddCUDepth))-1)); //(lumaZOrderIdxInCtu/numParts)*numParts;
     129static inline UInt
     130getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu,
     131                                 const ChromaFormat chFmt,
     132                                 const Int partsPerMinCU  // 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()))
     133                                 )
     134{
     135  return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~(partsPerMinCU-1));
    132136}
    133137
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r1289 r1290  
    13921392{
    13931393  const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
    1394   UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth -getSlice()->getPPS()->getMaxCuDQPDepth())<<1);
     1394  const UInt maxCUDepth        = getSlice()->getSPS()->getMaxTotalCUDepth();
     1395  const UInt maxCuDQPDepth     = getSlice()->getPPS()->getMaxCuDQPDepth();
     1396  const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1);
     1397  UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference;
    13951398  UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx];
    13961399
     
    14161419{
    14171420  const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
    1418   UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1);
     1421  const UInt maxCUDepth        = getSlice()->getSPS()->getMaxTotalCUDepth();
     1422  const UInt maxCuDQPDepth     = getSlice()->getPPS()->getMaxCuDQPDepth();
     1423  const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1);
     1424  UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference;
    14191425  UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx];
    14201426
     
    14611467Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )
    14621468{
    1463   UInt uiQUPartIdxMask = ~((1<<((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1);
     1469  UInt uiQUPartIdxMask = ~((1<<((getSlice()->getSPS()->getMaxTotalCUDepth() - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1);
    14641470  Int iLastValidPartIdx = getLastValidPartIdx( uiAbsPartIdx&uiQUPartIdxMask ); // A idx will be invalid if it is off the right or bottom edge of the picture.
    14651471  // If this CU is in the first CTU of the slice and there is no valid part before this one, use slice QP
     
    15451551  UInt        AbovePartIdx = MAX_UINT;
    15461552  Int         iLeftIntraDir, iAboveIntraDir;
     1553  const TComSPS *sps=getSlice()->getSPS();
     1554  const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
    15471555
    15481556  const ChannelType chType = toChannelType(compID);
     
    15531561  if (isChroma(compID))
    15541562  {
    1555     LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm);
     1563    LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm, partsPerMinCU);
    15561564  }
    15571565  iLeftIntraDir  = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX;
     
    15621570  if (isChroma(compID))
    15631571  {
    1564     AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm);
     1572    AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm, partsPerMinCU);
    15651573  }
    15661574  iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX;
     
    34063414  if (uiDirMode==DM_CHROMA_IDX)
    34073415  {
    3408     uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat()));
     3416    const TComSPS *sps=getSlice()->getSPS();
     3417    const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
     3418    uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat(), partsPerMinCU));
    34093419  }
    34103420
  • branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp

    r1289 r1290  
    202202  xSetEdgefilterPU   ( pcCU, uiAbsZorderIdx );
    203203
    204   const UInt uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
     204  const UInt uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth();
    205205
    206206  for( UInt uiPartIdx = uiAbsZorderIdx; uiPartIdx < uiAbsZorderIdx + uiCurNumParts; uiPartIdx++ )
     
    294294  const TComSPS &sps=*(pcCU->getSlice()->getSPS());
    295295
    296   const UInt uiWidthInBaseUnits  = rect.width  / (sps.getMaxCUWidth()  >> g_uiMaxCUDepth);
    297   const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> g_uiMaxCUDepth);
     296  const UInt uiWidthInBaseUnits  = rect.width  / (sps.getMaxCUWidth()  >> sps.getMaxTotalCUDepth());
     297  const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> sps.getMaxTotalCUDepth());
    298298
    299299  xSetEdgefilterMultiple( pcCU, rTu.GetAbsPartIdxCU(), uiTransDepthTotal, EDGE_VER, 0, m_stLFCUParam.bInternalEdge, uiWidthInBaseUnits, uiHeightInBaseUnits, &rect );
     
    584584  UInt uiNumParts = pcCU->getPic()->getNumPartInCtuWidth()>>uiDepth;
    585585
    586   UInt  uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
     586  UInt  uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth();
    587587  UInt  uiBsAbsIdx = 0, uiBs = 0;
    588588  Int   iOffset, iSrcStep;
     
    693693        Pel        *piSrcCb        = pcPicYuvRec->getAddr( COMPONENT_Cb, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
    694694        Pel        *piSrcCr        = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
    695 
    696695  const TComSPS    &sps            = *(pcCU->getSlice()->getSPS());
    697696#if SVC_EXTENSION
     
    701700#endif
    702701
    703   const UInt  uiPelsInPartChromaH = sps.getMaxCUWidth() >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));
    704   const UInt  uiPelsInPartChromaV = sps.getMaxCUHeight() >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));
     702  const UInt  uiPelsInPartChromaH = sps.getMaxCUWidth() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));
     703  const UInt  uiPelsInPartChromaV = sps.getMaxCUHeight() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));
    705704
    706705  Int iQP = 0;
  • branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp

    r1289 r1290  
    117117  const UInt uiTuHeight2      = uiTuHeight << 1;
    118118
    119   const Int  iBaseUnitSize    = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
     119  const Int  iBaseUnitSize    = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth();
    120120  const Int  iUnitWidth       = iBaseUnitSize  >> pcCU->getPic()->getPicYuvRec()->getComponentScaleX(compID);
    121121  const Int  iUnitHeight      = iBaseUnitSize  >> pcCU->getPic()->getPicYuvRec()->getComponentScaleY(compID);
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp

    r1289 r1290  
    7575}
    7676#if SVC_EXTENSION
    77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual, const UInt layerId )
     77Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual, const UInt layerId )
    7878{
    7979  const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId);
    80   const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
    81   const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    82   const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
    83   const UInt uiMaxCuHeight = sps.getMaxCUHeight();
     80  const Int          iWidth          = vps.getPicWidthInLumaSamples(&sps, layerId);
     81  const Int          iHeight         = vps.getPicHeightInLumaSamples(&sps, layerId);
     82  const UInt         uiMaxCuWidth    = sps.getMaxCUWidth();
     83  const UInt         uiMaxCuHeight   = sps.getMaxCUHeight();
     84  const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
    8485 
    8586  const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId );
     
    110111}
    111112#else
    112 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual)
    113 {
    114   const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc();
    115   const Int  iWidth        = sps.getPicWidthInLumaSamples();
    116   const Int  iHeight       = sps.getPicHeightInLumaSamples();
    117   const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
    118   const UInt uiMaxCuHeight = sps.getMaxCUHeight();
     113Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual)
     114{
     115  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
     116  const Int          iWidth          = sps.getPicWidthInLumaSamples();
     117  const Int          iHeight         = sps.getPicHeightInLumaSamples();
     118  const UInt         uiMaxCuWidth    = sps.getMaxCUWidth();
     119  const UInt         uiMaxCuHeight   = sps.getMaxCUHeight();
     120  const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
    119121
    120122  m_picSym.create( sps, pps, uiMaxDepth );
     
    262264Void TComPic::copyUpsampledMvField(UInt refLayerIdc)
    263265{
    264   UInt numPartitions = 1<<(g_uiMaxCUDepth<<1);
    265   UInt widthMinPU    = getSlice(0)->getSPS()->getMaxCUWidth()  / (1<<g_uiMaxCUDepth);
    266   UInt heightMinPU   = getSlice(0)->getSPS()->getMaxCUHeight() / (1<<g_uiMaxCUDepth);
    267   Int  unitNum       = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) );
     266  const TComSPS *sps       = getSlice(0)->getSPS();
     267  const UInt uiMaxDepth    = sps->getMaxTotalCUDepth();
     268  const UInt numPartitions = 1<<(uiMaxDepth<<1);
     269  const UInt widthMinPU    = sps->getMaxCUWidth()  / (1<<uiMaxDepth);
     270  const UInt heightMinPU   = sps->getMaxCUHeight() / (1<<uiMaxDepth);
     271  const Int  unitNum       = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) );
    268272
    269273  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++)  //each LCU
     
    314318Void TComPic::initUpsampledMvField()
    315319{
    316   UInt uiNumPartitions   = 1<<(g_uiMaxCUDepth<<1);
     320  const TComSPS *sps         = getSlice(0)->getSPS();
     321  const UInt uiMaxDepth      = sps->getMaxTotalCUDepth();
     322  const UInt uiNumPartitions = 1<<(uiMaxDepth<<1);
    317323
    318324  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++)  //each LCU
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1289 r1290  
    9999
    100100#if SVC_EXTENSION
    101   Void          create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/, const UInt layerId );
     101  Void          create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/, const UInt layerId );
    102102#else
    103   Void          create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/ );
     103  Void          create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/ );
    104104#endif
    105105
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1289 r1290  
    249249// ====================================================================================================================
    250250
    251 UInt g_uiMaxCUDepth  = MAX_CU_DEPTH;
    252 UInt g_uiAddCUDepth  = 0;
    253251UInt g_auiZscanToRaster [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
    254252UInt g_auiRasterToZscan [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.h

    r1289 r1290  
    8585Void         initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth );
    8686
    87 // global variable (CTU width/height, max. CU depth)
    88 extern       UInt g_uiMaxCUDepth;
    89 extern       UInt g_uiAddCUDepth;
    90 
    9187extern       UInt g_auiPUOffset[NUMBER_OF_PART_SIZES];
    9288
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1289 r1290  
    20572057, m_uiMaxCUWidth              ( 32)
    20582058, m_uiMaxCUHeight             ( 32)
    2059 , m_uiMaxCUDepth              (  3)
     2059, m_uiMaxTotalCUDepth         (  3)
    20602060, m_bLongTermRefsPresent      (false)
    20612061, m_uiQuadtreeTULog2MaxSize   (  0)
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1287 r1290  
    13231323  UInt             m_uiMaxCUWidth;
    13241324  UInt             m_uiMaxCUHeight;
    1325   UInt             m_uiMaxCUDepth;
     1325  UInt             m_uiMaxTotalCUDepth; ///< Total CU depth, relative to the smallest possible transform block size.
    13261326
    13271327  Window           m_conformanceWindow;
     
    14451445  Void                   setMaxCUHeight( UInt u )                                                        { m_uiMaxCUHeight = u;                                                 }
    14461446  UInt                   getMaxCUHeight() const                                                          { return  m_uiMaxCUHeight;                                             }
    1447   Void                   setMaxCUDepth( UInt u )                                                         { m_uiMaxCUDepth = u;                                                  }
    1448   UInt                   getMaxCUDepth() const                                                           { return  m_uiMaxCUDepth;                                              }
     1447  Void                   setMaxTotalCUDepth( UInt u )                                                    { m_uiMaxTotalCUDepth = u;                                             }
     1448  UInt                   getMaxTotalCUDepth() const                                                      { return  m_uiMaxTotalCUDepth;                                         }
    14491449  Void                   setUsePCM( Bool b )                                                             { m_usePCM = b;                                                        }
    14501450  Bool                   getUsePCM() const                                                               { return m_usePCM;                                                     }
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r1288 r1290  
    17601760    const ChannelType chType = toChannelType(compID);
    17611761    const UInt uiChPredMode  = pcCU->getIntraDir( chType, uiAbsPartIdx );
    1762     const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode;
     1762    const TComSPS *sps=pcCU->getSlice()->getSPS();
     1763    const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
     1764    const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode;
    17631765    const UInt uiChFinalMode = ((chFmt == CHROMA_422)       && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
    17641766
     
    18301832      const ChannelType chType = toChannelType(compID);
    18311833      const UInt uiChPredMode  = pcCU->getIntraDir( chType, uiAbsPartIdx );
    1832       const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode;
     1834      const TComSPS *sps=pcCU->getSlice()->getSPS();
     1835      const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
     1836      const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode;
    18331837      const UInt uiChFinalMode = ((chFmt == CHROMA_422)       && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
    18341838
Note: See TracChangeset for help on using the changeset viewer.