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


Ignore:
Timestamp:
18 Jul 2015, 00:52:46 (10 years ago)
Author:
seregin
Message:

port rev 4323 (g_uiMaxCUWidth, g_uiMaxCUHeight)

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

Legend:

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

    r1260 r1289  
    425425Bool TComDataCU::isLastSubCUOfCtu(const UInt absPartIdx)
    426426{
    427   TComPic* pcPic = getPic();
    428   TComSlice * pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx());
     427  const TComSPS &sps=*(getSlice()->getSPS());
    429428
    430429#if SVC_EXTENSION
     430  TComSlice * pcSlice = m_pcPic->getSlice(m_pcPic->getCurrSliceIdx());
    431431  const UInt picWidth = pcSlice->getPicWidthInLumaSamples();
    432432  const UInt picHeight = pcSlice->getPicHeightInLumaSamples();
    433433#else
    434   const UInt picWidth = pcSlice->getSPS()->getPicWidthInLumaSamples();
    435   const UInt picHeight = pcSlice->getSPS()->getPicHeightInLumaSamples();
     434  const UInt picWidth = sps.getPicWidthInLumaSamples();
     435  const UInt picHeight = sps.getPicHeightInLumaSamples();
    436436#endif
    437   const UInt granularityWidth = g_uiMaxCUWidth;
     437  const UInt granularityWidth = sps.getMaxCUWidth();
    438438
    439439  const UInt cuPosX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[absPartIdx] ];
     
    461461{
    462462
     463  const UInt maxCUWidth = pcPic->getPicSym()->getSPS().getMaxCUWidth();
     464  const UInt maxCUHeight= pcPic->getPicSym()->getSPS().getMaxCUHeight();
    463465  m_pcPic              = pcPic;
    464466  m_pcSlice            = pcPic->getSlice(pcPic->getCurrSliceIdx());
    465467  m_ctuRsAddr          = ctuRsAddr;
    466   m_uiCUPelX           = ( ctuRsAddr % pcPic->getFrameWidthInCtus() ) * g_uiMaxCUWidth;
    467   m_uiCUPelY           = ( ctuRsAddr / pcPic->getFrameWidthInCtus() ) * g_uiMaxCUHeight;
     468  m_uiCUPelX           = ( ctuRsAddr % pcPic->getFrameWidthInCtus() ) * maxCUWidth;
     469  m_uiCUPelY           = ( ctuRsAddr / pcPic->getFrameWidthInCtus() ) * maxCUHeight;
    468470  m_absZIdxInCtu       = 0;
    469471  m_dTotalCost         = MAX_DOUBLE;
     
    484486  memset( m_puhDepth          , 0,                          m_uiNumPartition * sizeof( *m_puhDepth ) );
    485487  memset( m_puhTrIdx          , 0,                          m_uiNumPartition * sizeof( *m_puhTrIdx ) );
    486   memset( m_puhWidth          , g_uiMaxCUWidth,             m_uiNumPartition * sizeof( *m_puhWidth ) );
    487   memset( m_puhHeight         , g_uiMaxCUHeight,            m_uiNumPartition * sizeof( *m_puhHeight ) );
     488  memset( m_puhWidth          , maxCUWidth,                 m_uiNumPartition * sizeof( *m_puhWidth ) );
     489  memset( m_puhHeight         , maxCUHeight,                m_uiNumPartition * sizeof( *m_puhHeight ) );
    488490  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    489491  {
     
    510512  memset( m_pbIPCMFlag        , false,                    m_uiNumPartition * sizeof( *m_pbIPCMFlag ) );
    511513
    512   const UInt numCoeffY    = g_uiMaxCUWidth*g_uiMaxCUHeight;
     514  const UInt numCoeffY    = maxCUWidth*maxCUHeight;
    513515  for (UInt comp=0; comp<MAX_NUM_COMPONENT; comp++)
    514516  {
     
    585587  m_uiTotalBins        = 0;
    586588
    587   UChar uhWidth  = g_uiMaxCUWidth  >> uiDepth;
    588   UChar uhHeight = g_uiMaxCUHeight >> uiDepth;
     589  const UChar uhWidth  = getSlice()->getSPS()->getMaxCUWidth()  >> uiDepth;
     590  const UChar uhHeight = getSlice()->getSPS()->getMaxCUHeight() >> uiDepth;
    589591
    590592  for (UInt ui = 0; ui < m_uiNumPartition; ui++)
     
    656658
    657659  m_pcPic              = pcCU->getPic();
    658   m_pcSlice            = m_pcPic->getSlice(m_pcPic->getCurrSliceIdx());
     660  m_pcSlice            = pcCU->getSlice();
    659661  m_ctuRsAddr          = pcCU->getCtuRsAddr();
    660662  m_absZIdxInCtu       = pcCU->getZorderIdxInCtu() + uiPartOffset;
    661663
    662   m_uiCUPelX           = pcCU->getCUPelX() + ( g_uiMaxCUWidth>>uiDepth  )*( uiPartUnitIdx &  1 );
    663   m_uiCUPelY           = pcCU->getCUPelY() + ( g_uiMaxCUHeight>>uiDepth  )*( uiPartUnitIdx >> 1 );
     664  const UChar uhWidth  = getSlice()->getSPS()->getMaxCUWidth()  >> uiDepth;
     665  const UChar uhHeight = getSlice()->getSPS()->getMaxCUHeight() >> uiDepth;
     666
     667  m_uiCUPelX           = pcCU->getCUPelX() + ( uhWidth )*( uiPartUnitIdx &  1 );
     668  m_uiCUPelY           = pcCU->getCUPelY() + ( uhHeight)*( uiPartUnitIdx >> 1 );
    664669
    665670  m_dTotalCost         = MAX_DOUBLE;
     
    693698
    694699  memset( m_puhDepth,     uiDepth, iSizeInUchar );
    695 
    696   UChar uhWidth  = g_uiMaxCUWidth  >> uiDepth;
    697   UChar uhHeight = g_uiMaxCUHeight >> uiDepth;
    698700  memset( m_puhWidth,          uhWidth,  iSizeInUchar );
    699701  memset( m_puhHeight,         uhHeight, iSizeInUchar );
     
    744746Void TComDataCU::setOutsideCUPart( UInt uiAbsPartIdx, UInt uiDepth )
    745747{
    746   UInt uiNumPartition = m_uiNumPartition >> (uiDepth << 1);
    747   UInt uiSizeInUchar = sizeof( UChar  ) * uiNumPartition;
    748 
    749   UChar uhWidth  = g_uiMaxCUWidth  >> uiDepth;
    750   UChar uhHeight = g_uiMaxCUHeight >> uiDepth;
     748  const UInt    uiNumPartition = m_uiNumPartition >> (uiDepth << 1);
     749  const UInt     uiSizeInUchar = sizeof( UChar  ) * uiNumPartition;
     750  const TComSPS &sps            = *(getSlice()->getSPS());
     751  const UChar    uhWidth        = sps.getMaxCUWidth()  >> uiDepth;
     752  const UChar    uhHeight       = sps.getMaxCUHeight() >> uiDepth;
    751753  memset( m_puhDepth    + uiAbsPartIdx,     uiDepth,  uiSizeInUchar );
    752754  memset( m_puhWidth    + uiAbsPartIdx,     uhWidth,  uiSizeInUchar );
     
    952954  }
    953955
    954   const UInt numCoeffY = g_uiMaxCUWidth*g_uiMaxCUHeight >> (uiDepth<<1);
     956  const UInt numCoeffY = (pcCU->getSlice()->getSPS()->getMaxCUWidth()*pcCU->getSlice()->getSPS()->getMaxCUHeight()) >> (uiDepth<<1);
    955957  const UInt offsetY   = uiPartUnitIdx*numCoeffY;
    956958  for (UInt ch=0; ch<numValidComp; ch++)
     
    10301032  memcpy( pCtu->getIPCMFlag() + m_absZIdxInCtu, m_pbIPCMFlag,         iSizeInBool  );
    10311033
    1032   const UInt numCoeffY    = (g_uiMaxCUWidth*g_uiMaxCUHeight)>>(uhDepth<<1);
     1034  const UInt numCoeffY    = (pCtu->getSlice()->getSPS()->getMaxCUWidth()*pCtu->getSlice()->getSPS()->getMaxCUHeight())>>(uhDepth<<1);
    10331035  const UInt offsetY      = m_absZIdxInCtu*m_pcPic->getMinCUWidth()*m_pcPic->getMinCUHeight();
    10341036  for (UInt comp=0; comp<numValidComp; comp++)
     
    29542956Void TComDataCU::clipMv    (TComMv&  rcMv)
    29552957{
     2958  const TComSPS &sps=*(m_pcSlice->getSPS());
    29562959  Int  iMvShift = 2;
    29572960  Int iOffset = 8;
    29582961#if SVC_EXTENSION
    2959   Int iHorMax = ( m_pcSlice->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift;
     2962  Int iHorMax = ( m_pcSlice->getPicWidthInLumaSamples() + iOffset - (Int)m_uiCUPelX - 1 ) << iMvShift;
    29602963#else
    2961   Int iHorMax = ( m_pcSlice->getSPS()->getPicWidthInLumaSamples() + iOffset - m_uiCUPelX - 1 ) << iMvShift;
     2964  Int iHorMax = ( sps.getPicWidthInLumaSamples() + iOffset - (Int)m_uiCUPelX - 1 ) << iMvShift;
    29622965#endif
    2963   Int iHorMin = (       -(Int)g_uiMaxCUWidth - iOffset - (Int)m_uiCUPelX + 1 ) << iMvShift;
     2966  Int iHorMin = (      -(Int)sps.getMaxCUWidth() - iOffset - (Int)m_uiCUPelX + 1 ) << iMvShift;
    29642967 
    29652968#if SVC_EXTENSION
    2966   Int iVerMax = ( m_pcSlice->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift;
     2969  Int iVerMax = ( m_pcSlice->getPicHeightInLumaSamples() + iOffset - (Int)m_uiCUPelY - 1 ) << iMvShift;
    29672970#else
    2968   Int iVerMax = ( m_pcSlice->getSPS()->getPicHeightInLumaSamples() + iOffset - m_uiCUPelY - 1 ) << iMvShift;
     2971  Int iVerMax = ( sps.getPicHeightInLumaSamples() + iOffset - (Int)m_uiCUPelY - 1 ) << iMvShift;
    29692972#endif
    2970   Int iVerMin = (       -(Int)g_uiMaxCUHeight - iOffset - (Int)m_uiCUPelY + 1 ) << iMvShift;
     2973  Int iVerMin = (      -(Int)sps.getMaxCUHeight() - iOffset - (Int)m_uiCUPelY + 1 ) << iMvShift;
    29712974
    29722975  rcMv.setHor( min (iHorMax, max (iHorMin, rcMv.getHor())) );
     
    34833486  }
    34843487
    3485 #if LAYER_CTB
    3486   UInt baseMaxCUHeight = baseColPic->getPicSym()->getMaxCUHeight();
    3487   UInt baseMaxCUWidth  = baseColPic->getPicSym()->getMaxCUWidth();
     3488  UInt baseMaxCUHeight = baseColPic->getSlice(0)->getSPS()->getMaxCUHeight();
     3489  UInt baseMaxCUWidth  = baseColPic->getSlice(0)->getSPS()->getMaxCUWidth();
    34883490  UInt baseMinUnitSize = baseColPic->getMinCUWidth();
    34893491 
    34903492  uiCUAddrBase = ( iBY / baseMaxCUHeight ) * baseColPic->getFrameWidthInCtus() + ( iBX / baseMaxCUWidth );
    3491 #else
    3492   uiCUAddrBase = (iBY/g_uiMaxCUHeight)*baseColPic->getFrameWidthInCtus() + (iBX/g_uiMaxCUWidth);
    3493 #endif
    34943493
    34953494  assert(uiCUAddrBase < baseColPic->getNumberOfCtusInFrame());
    34963495
     3496  UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * baseColPic->getNumPartInCtuWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize; 
     3497
    34973498#if LAYER_CTB
    3498   UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * baseColPic->getNumPartInCtuWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize;
    3499  
    35003499  uiAbsPartIdxBase = g_auiLayerRasterToZscan[baseColPic->getLayerId()][uiRasterAddrBase];
    35013500#else
    3502   UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*baseColPic->getNumPartInCtuWidth() + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize;
    3503 
    35043501  uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase];
    35053502#endif
  • branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp

    r1287 r1289  
    177177  UInt uiCurNumParts = pcPic->getNumPartitionsInCtu() >> (uiDepth<<1);
    178178  UInt uiQNumParts   = uiCurNumParts>>2;
     179  const TComSPS &sps = *(pcCU->getSlice()->getSPS());
    179180
    180181  if( pcCU->getDepth(uiAbsZorderIdx) > uiDepth )
     
    187188      if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) )
    188189#else
    189       if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )
     190      if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
    190191#endif
    191192      {
     
    201202  xSetEdgefilterPU   ( pcCU, uiAbsZorderIdx );
    202203
     204  const UInt uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
     205
    203206  for( UInt uiPartIdx = uiAbsZorderIdx; uiPartIdx < uiAbsZorderIdx + uiCurNumParts; uiPartIdx++ )
    204207  {
    205208    UInt uiBSCheck;
    206     if( (g_uiMaxCUWidth >> g_uiMaxCUDepth) == 4 )
     209    if( uiPelsInPart == 4 )
    207210    {
    208211      uiBSCheck = (edgeDir == EDGE_VER && uiPartIdx%2 == 0) || (edgeDir == EDGE_HOR && (uiPartIdx-((uiPartIdx>>2)<<2))/2 == 0);
     
    219222  }
    220223
    221   UInt uiPelsInPart = g_uiMaxCUWidth >> g_uiMaxCUDepth;
    222224  UInt PartIdxIncr = DEBLOCK_SMALLEST_BLOCK / uiPelsInPart ? DEBLOCK_SMALLEST_BLOCK / uiPelsInPart : 1 ;
    223225
     
    290292
    291293  const TComRectangle &rect = rTu.getRect(COMPONENT_Y);
    292 
    293   const UInt uiWidthInBaseUnits  = rect.width / (g_uiMaxCUWidth >> g_uiMaxCUDepth);
    294   const UInt uiHeightInBaseUnits = rect.height / (g_uiMaxCUWidth >> g_uiMaxCUDepth);
     294  const TComSPS &sps=*(pcCU->getSlice()->getSPS());
     295
     296  const UInt uiWidthInBaseUnits  = rect.width  / (sps.getMaxCUWidth()  >> g_uiMaxCUDepth);
     297  const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> g_uiMaxCUDepth);
    295298
    296299  xSetEdgefilterMultiple( pcCU, rTu.GetAbsPartIdxCU(), uiTransDepthTotal, EDGE_VER, 0, m_stLFCUParam.bInternalEdge, uiWidthInBaseUnits, uiHeightInBaseUnits, &rect );
     
    559562
    560563
    561 Void TComLoopFilter::xEdgeFilterLuma( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, DeblockEdgeDir edgeDir, Int iEdge  )
    562 {
    563   TComPicYuv* pcPicYuvRec = pcCU->getPic()->getPicYuvRec();
    564   Pel* piSrc    = pcPicYuvRec->getAddr(COMPONENT_Y, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
    565   Pel* piTmpSrc = piSrc;
     564Void TComLoopFilter::xEdgeFilterLuma( TComDataCU* const pcCU, const UInt uiAbsZorderIdx, const UInt uiDepth, const DeblockEdgeDir edgeDir, const Int iEdge  )
     565{
     566        TComPicYuv *pcPicYuvRec                   = pcCU->getPic()->getPicYuvRec();
     567        Pel        *piSrc                         = pcPicYuvRec->getAddr(COMPONENT_Y, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
     568        Pel        *piTmpSrc                      = piSrc;
     569  const TComSPS    &sps                           = *(pcCU->getSlice()->getSPS());
     570  const Bool        ppsTransquantBypassEnableFlag = pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag();
     571
    566572#if SVC_EXTENSION
    567   const Int bitDepthLuma = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA);
     573  const Int bitDepthLuma                          = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA);
    568574#else
    569   const Int bitDepthLuma = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     575  const Int         bitDepthLuma                  = sps.getBitDepth(CHANNEL_TYPE_LUMA);
    570576#endif
    571577
    572   const Bool lfCrossSliceBoundaryFlag=pcCU->getSlice()->getLFCrossSliceBoundaryFlag();
     578  const Bool        lfCrossSliceBoundaryFlag      = pcCU->getSlice()->getLFCrossSliceBoundaryFlag();
    573579
    574580  Int  iStride = pcPicYuvRec->getStride(COMPONENT_Y);
     
    578584  UInt uiNumParts = pcCU->getPic()->getNumPartInCtuWidth()>>uiDepth;
    579585
    580   UInt  uiPelsInPart = g_uiMaxCUWidth >> g_uiMaxCUDepth;
     586  UInt  uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
    581587  UInt  uiBsAbsIdx = 0, uiBs = 0;
    582588  Int   iOffset, iSrcStep;
    583589
    584   Bool  bPCMFilter = (pcCU->getSlice()->getSPS()->getUsePCM() && pcCU->getSlice()->getSPS()->getPCMFilterDisableFlag())? true : false;
     590  Bool  bPCMFilter = (sps.getUsePCM() && sps.getPCMFilterDisableFlag())? true : false;
    585591  Bool  bPartPNoFilter = false;
    586592  Bool  bPartQNoFilter = false;
     
    622628      else  // (iDir == EDGE_HOR)
    623629      {
    624         pcCUP = pcCUQ->getPUAbove(uiPartPIdx, uiPartQIdx,!pcCU->getSlice()->getLFCrossSliceBoundaryFlag(), false, !m_bLFCrossTileBoundary);
     630        pcCUP = pcCUQ->getPUAbove(uiPartPIdx, uiPartQIdx,!lfCrossSliceBoundaryFlag, false, !m_bLFCrossTileBoundary);
    625631      }
    626632
     
    651657        Int d =  d0 + d3;
    652658
    653         if (bPCMFilter || pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     659        if (bPCMFilter || ppsTransquantBypassEnableFlag)
    654660        {
    655661          // Check if each of PUs is I_PCM with LF disabling
     
    681687
    682688
    683 Void TComLoopFilter::xEdgeFilterChroma( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, DeblockEdgeDir edgeDir, Int iEdge )
    684 {
    685   TComPicYuv* pcPicYuvRec = pcCU->getPic()->getPicYuvRec();
    686   Int         iStride     = pcPicYuvRec->getStride(COMPONENT_Cb);
    687   Pel*        piSrcCb     = pcPicYuvRec->getAddr( COMPONENT_Cb, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
    688   Pel*        piSrcCr     = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
     689Void TComLoopFilter::xEdgeFilterChroma( TComDataCU* const pcCU, const UInt uiAbsZorderIdx, const UInt uiDepth, const DeblockEdgeDir edgeDir, const Int iEdge )
     690{
     691        TComPicYuv *pcPicYuvRec    = pcCU->getPic()->getPicYuvRec();
     692        Int         iStride        = pcPicYuvRec->getStride(COMPONENT_Cb);
     693        Pel        *piSrcCb        = pcPicYuvRec->getAddr( COMPONENT_Cb, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
     694        Pel        *piSrcCr        = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
     695
     696  const TComSPS    &sps            = *(pcCU->getSlice()->getSPS());
    689697#if SVC_EXTENSION
    690   const Int bitDepthChroma = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_CHROMA);
    691 #else
    692   const Int bitDepthChroma = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
     698  const Int         bitDepthChroma = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_CHROMA);
     699#else 
     700  const Int         bitDepthChroma = sps.getBitDepth(CHANNEL_TYPE_CHROMA);
    693701#endif
     702
     703  const UInt  uiPelsInPartChromaH = sps.getMaxCUWidth() >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));
     704  const UInt  uiPelsInPartChromaV = sps.getMaxCUHeight() >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));
     705
    694706  Int iQP = 0;
    695707  Int iQP_P = 0;
    696708  Int iQP_Q = 0;
    697 
    698   UInt  uiPelsInPartChromaH = g_uiMaxCUWidth >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));
    699   UInt  uiPelsInPartChromaV = g_uiMaxCUWidth >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));
    700709
    701710  Int   iOffset, iSrcStep;
     
    777786      else  // (edgeDir == EDGE_HOR)
    778787      {
    779         pcCUP = pcCUQ->getPUAbove(uiPartPIdx, uiPartQIdx,!pcCU->getSlice()->getLFCrossSliceBoundaryFlag(), false, !m_bLFCrossTileBoundary);
     788        pcCUP = pcCUQ->getPUAbove(uiPartPIdx, uiPartQIdx,!lfCrossSliceBoundaryFlag, false, !m_bLFCrossTileBoundary);
    780789      }
    781790
  • branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.h

    r1287 r1289  
    105105                               );
    106106
    107   Void xEdgeFilterLuma            ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, DeblockEdgeDir edgeDir, Int iEdge );
    108   Void xEdgeFilterChroma          ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, DeblockEdgeDir edgeDir, Int iEdge );
     107  Void xEdgeFilterLuma            ( TComDataCU* const pcCU, const UInt uiAbsZorderIdx, const UInt uiDepth, const DeblockEdgeDir edgeDir, const Int iEdge );
     108  Void xEdgeFilterChroma          ( TComDataCU* const pcCU, const UInt uiAbsZorderIdx, const UInt uiDepth, const DeblockEdgeDir edgeDir, const Int iEdge );
    109109
    110110  __inline Void xPelFilterLuma( Pel* piSrc, Int iOffset, Int tc, Bool sw, Bool bPartPNoFilter, Bool bPartQNoFilter, Int iThrCut, Bool bFilterSecondP, Bool bFilterSecondQ, const Int bitDepthLuma);
  • branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp

    r1287 r1289  
    110110
    111111  TComDataCU *pcCU=rTu.getCU();
     112  const TComSPS &sps = *(pcCU->getSlice()->getSPS());
    112113  const UInt uiZorderIdxInPart=rTu.GetAbsPartIdxTU();
    113114  const UInt uiTuWidth        = rTu.getRect(compID).width;
     
    116117  const UInt uiTuHeight2      = uiTuHeight << 1;
    117118
    118   const Int  iBaseUnitSize    = g_uiMaxCUWidth >> g_uiMaxCUDepth;
     119  const Int  iBaseUnitSize    = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
    119120  const Int  iUnitWidth       = iBaseUnitSize  >> pcCU->getPic()->getPicYuvRec()->getComponentScaleX(compID);
    120121  const Int  iUnitHeight      = iBaseUnitSize  >> pcCU->getPic()->getPicYuvRec()->getComponentScaleY(compID);
     
    126127  const Int  bitDepthForChannel = pcCU->getSlice()->getBitDepth(chType);
    127128#else
    128   const Int  bitDepthForChannel = pcCU->getSlice()->getSPS()->getBitDepth(chType);
     129  const Int  bitDepthForChannel = sps.getBitDepth(chType);
    129130#endif
    130131
     
    164165    Pel *piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiZorderIdxInPart);
    165166#if O0043_BEST_EFFORT_DECODING
    166     const Int  bitDepthForChannelInStream = pcCU->getSlice()->getSPS()->getStreamBitDepth(chType);
     167    const Int  bitDepthForChannelInStream = sps.getStreamBitDepth(chType);
    167168    fillReferenceSamples (bitDepthForChannelInStream, bitDepthForChannelInStream - bitDepthForChannel, pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor,  iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits,
    168169#else
     
    202203      //------------------------------------------------
    203204
    204       Bool useStrongIntraSmoothing = isLuma(chType) && pcCU->getSlice()->getSPS()->getUseStrongIntraSmoothing();
     205      Bool useStrongIntraSmoothing = isLuma(chType) && sps.getUseStrongIntraSmoothing();
    205206
    206207      const Pel bottomLeft = piAdiTemp[stride * uiTuHeight2];
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp

    r1259 r1289  
    7575}
    7676#if SVC_EXTENSION
    77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual, const UInt layerId )
     77Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual, const UInt layerId )
    7878{
    7979  const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId);
    8080  const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
    8181  const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
     82  const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
     83  const UInt uiMaxCuHeight = sps.getMaxCUHeight();
    8284 
    8385  const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId );
    8486
    85   m_picSym.create( vps, sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, layerId );
     87  m_picSym.create( vps, sps, pps, uiMaxDepth, layerId );
    8688
    8789  if (!bIsVirtual)
    8890  {
    89     m_apcPicYuv[PIC_YUV_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
    90     m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
    91   }
    92   m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     91    m_apcPicYuv[PIC_YUV_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
     92    m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
     93  }
     94  m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
    9395
    9496  for( Int i = 0; i < MAX_LAYERS; i++ )
     
    9698    if( m_bSpatialEnhLayer[i] )
    9799    {
    98       m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
     100      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow );
    99101    }
    100102  }   
     
    108110}
    109111#else
    110 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual)
     112Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual)
    111113{
    112114  const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc();
    113   const Int iWidth  = sps.getPicWidthInLumaSamples();
    114   const Int iHeight = sps.getPicHeightInLumaSamples();
    115 
    116   m_picSym.create( sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     115  const Int  iWidth        = sps.getPicWidthInLumaSamples();
     116  const Int  iHeight       = sps.getPicHeightInLumaSamples();
     117  const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
     118  const UInt uiMaxCuHeight = sps.getMaxCUHeight();
     119
     120  m_picSym.create( sps, pps, uiMaxDepth );
    117121  if (!bIsVirtual)
    118122  {
    119     m_apcPicYuv[PIC_YUV_ORG    ]   = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG     ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    120     m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    121   }
    122   m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     123    m_apcPicYuv[PIC_YUV_ORG    ]   = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG     ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
     124    m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
     125  }
     126  m_apcPicYuv[PIC_YUV_REC]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true );
    123127
    124128  // there are no SEI messages associated with this picture initially
     
    256260}
    257261
    258 Void TComPic::copyUpsampledMvField(UInt refLayerIdc, TComPic* pcPicBase)
     262Void TComPic::copyUpsampledMvField(UInt refLayerIdc)
    259263{
    260264  UInt numPartitions = 1<<(g_uiMaxCUDepth<<1);
    261   UInt widthMinPU    = g_uiMaxCUWidth/(1<<g_uiMaxCUDepth);
    262   UInt heightMinPU   = g_uiMaxCUHeight/(1<<g_uiMaxCUDepth);
    263   Int  unitNum       = max (1, (Int)((16/widthMinPU)*(16/heightMinPU)) );
     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)) );
    264268
    265269  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++)  //each LCU
     
    270274    {
    271275      //pixel position of each unit in up-sampled layer
    272       UInt  pelX = pcCUDes->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[absPartIdx] ];
    273       UInt  pelY = pcCUDes->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[absPartIdx] ];
     276      UInt pelX = pcCUDes->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[absPartIdx] ];
     277      UInt pelY = pcCUDes->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[absPartIdx] ];
    274278      UInt baseCUAddr, baseAbsPartIdx;
    275279
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1259 r1289  
    9999
    100100#if SVC_EXTENSION
    101   Void          create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/, const UInt layerId );
     101  Void          create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/, const UInt layerId );
    102102#else
    103   Void          create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/ );
     103  Void          create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/ );
    104104#endif
    105105
     
    121121  TComDataCU*   getCtu( UInt ctuRsAddr )           { return  m_picSym.getCtu( ctuRsAddr ); }
    122122  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return  m_picSym.getCtu( ctuRsAddr ); }
    123 
    124123
    125124  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[PIC_YUV_ORG]; }
     
    186185
    187186#if SVC_EXTENSION
    188   Void          setLayerId (UInt layerId)   { m_layerId = layerId; }
    189   UInt          getLayerId ()               { return m_layerId; }
    190   UInt          getLayerIdx()               { return getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId); }
    191   Bool          isSpatialEnhLayer(UInt refLayerIdc)             { return m_bSpatialEnhLayer[refLayerIdc]; }
    192   Void          setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b) { m_bSpatialEnhLayer[refLayerIdc] = b; }
    193   Void          setFullPelBaseRec   (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; }
    194   TComPicYuv*   getFullPelBaseRec   (UInt refLayerIdc)  { return  m_pcFullPelBaseRec[refLayerIdc];  }
    195   Bool          isILR( UInt currLayerId )   { return ( m_bIsLongTerm && m_layerId < currLayerId ); }
    196   Bool          equalPictureSizeAndOffsetFlag(UInt refLayerIdc)             { return m_equalPictureSizeAndOffsetFlag[refLayerIdc]; }
    197   Void          setEqualPictureSizeAndOffsetFlag(UInt refLayerIdc, Bool b)  { m_equalPictureSizeAndOffsetFlag[refLayerIdc] = b;    }
    198   Void          copyUpsampledMvField  ( UInt refLayerIdc, TComPic* pcPicBase );
    199   Void          initUpsampledMvField  ();
     187  Void          setLayerId(UInt layerId)                                    { m_layerId = layerId;                                      }
     188  UInt          getLayerId()                                                { return m_layerId;                                          }
     189  UInt          getLayerIdx()                                               { return getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId); }
     190  Bool          isSpatialEnhLayer(UInt refLayerIdc)                         { return m_bSpatialEnhLayer[refLayerIdc];                    }
     191  Void          setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b)           { m_bSpatialEnhLayer[refLayerIdc] = b;                      }
     192  Void          setFullPelBaseRec   (UInt refLayerIdc, TComPicYuv* p)       { m_pcFullPelBaseRec[refLayerIdc] = p;                      }
     193  TComPicYuv*   getFullPelBaseRec   (UInt refLayerIdc)                      { return  m_pcFullPelBaseRec[refLayerIdc];                   }
     194  Bool          isILR( UInt currLayerId )                                   { return ( m_bIsLongTerm && m_layerId < currLayerId );      }
     195  Bool          equalPictureSizeAndOffsetFlag(UInt refLayerIdc)             { return m_equalPictureSizeAndOffsetFlag[refLayerIdc];       }
     196  Void          setEqualPictureSizeAndOffsetFlag(UInt refLayerIdc, Bool b)  { m_equalPictureSizeAndOffsetFlag[refLayerIdc] = b;          }
     197  Void          copyUpsampledMvField(UInt refLayerIdc);
     198  Void          initUpsampledMvField();
    200199  Bool          checkSameRefInfo();
    201200  Void          copyUpsampledPictureYuv(TComPicYuv*   pcPicYuvIn, TComPicYuv*   pcPicYuvOut);
    202201#if CGS_3D_ASYMLUT
    203   Void          setFrameBit( Int n )  { m_nFrameBit = n;    }
    204   Int           getFrameBit()         { return m_nFrameBit; }
    205 #endif
    206   Bool          isCurrAu() { return m_currAuFlag; }
    207   Void          setCurrAuFlag(Bool x) {m_currAuFlag = x; }
     202  Void          setFrameBit( Int n )                                        { m_nFrameBit = n;     }
     203  Int           getFrameBit()                                               { return m_nFrameBit; }
     204#endif
     205  Bool          isCurrAu()                                                  { return m_currAuFlag; }
     206  Void          setCurrAuFlag(Bool x)                                       { m_currAuFlag = x;    }
    208207#endif //SVC_EXTENSION
    209208};// END CLASS DEFINITION TComPic
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp

    r1259 r1289  
    5050:m_frameWidthInCtus(0)
    5151,m_frameHeightInCtus(0)
    52 ,m_uiMaxCUWidth(0)
    53 ,m_uiMaxCUHeight(0)
    5452,m_uiMinCUWidth(0)
    5553,m_uiMinCUHeight(0)
     
    7775
    7876#if SVC_EXTENSION
    79 Void TComPicSym::create  ( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, const UInt layerId )
     77Void TComPicSym::create  ( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const UInt layerId )
    8078{
    8179  UInt i;
     
    8886  const Int iPicHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    8987#else
    90 Void TComPicSym::create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )
     88Void TComPicSym::create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth )
    9189{
    9290  UInt i;
     
    9492  m_pps = pps;
    9593
    96   const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc();
    97   const Int iPicWidth  = sps.getPicWidthInLumaSamples();
    98   const Int iPicHeight = sps.getPicHeightInLumaSamples();
    99 #endif
     94  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
     95  const Int iPicWidth      = sps.getPicWidthInLumaSamples();
     96  const Int iPicHeight     = sps.getPicHeightInLumaSamples();
     97#endif
     98
     99  const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
     100  const UInt uiMaxCuHeight = sps.getMaxCUHeight();
    100101
    101102  m_uhTotalDepth       = uiMaxDepth;
    102103  m_numPartitionsInCtu = 1<<(m_uhTotalDepth<<1);
    103104
    104   m_uiMaxCUWidth       = uiMaxWidth;
    105   m_uiMaxCUHeight      = uiMaxHeight;
    106 
    107   m_uiMinCUWidth       = uiMaxWidth  >> m_uhTotalDepth;
    108   m_uiMinCUHeight      = uiMaxHeight >> m_uhTotalDepth;
    109 
    110   m_numPartInCtuWidth  = m_uiMaxCUWidth  / m_uiMinCUWidth;  // equivalent to 1<<m_uhTotalDepth
    111   m_numPartInCtuHeight = m_uiMaxCUHeight / m_uiMinCUHeight; // equivalent to 1<<m_uhTotalDepth
    112 
    113   m_frameWidthInCtus   = ( iPicWidth %m_uiMaxCUWidth  ) ? iPicWidth /m_uiMaxCUWidth  + 1 : iPicWidth /m_uiMaxCUWidth;
    114   m_frameHeightInCtus  = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight;
     105  m_uiMinCUWidth       = uiMaxCuWidth  >> m_uhTotalDepth;
     106  m_uiMinCUHeight      = uiMaxCuHeight >> m_uhTotalDepth;
     107
     108  m_numPartInCtuWidth  = uiMaxCuWidth  / m_uiMinCUWidth;  // equivalent to 1<<m_uhTotalDepth
     109  m_numPartInCtuHeight = uiMaxCuHeight / m_uiMinCUHeight; // equivalent to 1<<m_uhTotalDepth
     110
     111  m_frameWidthInCtus   = ( iPicWidth %uiMaxCuWidth  ) ? iPicWidth /uiMaxCuWidth  + 1 : iPicWidth /uiMaxCuWidth;
     112  m_frameHeightInCtus  = ( iPicHeight%uiMaxCuHeight ) ? iPicHeight/uiMaxCuHeight + 1 : iPicHeight/uiMaxCuHeight;
    115113
    116114  m_numCtusInFrame     = m_frameWidthInCtus * m_frameHeightInCtus;
     
    123121  {
    124122    m_pictureCtuArray[i] = new TComDataCU;
    125     m_pictureCtuArray[i]->create( chromaFormatIDC, m_numPartitionsInCtu, m_uiMaxCUWidth, m_uiMaxCUHeight, false, m_uiMaxCUWidth >> m_uhTotalDepth
     123    m_pictureCtuArray[i]->create( chromaFormatIDC, m_numPartitionsInCtu, uiMaxCuWidth, uiMaxCuHeight, false, uiMaxCuWidth >> m_uhTotalDepth
    126124#if ADAPTIVE_QP_SELECTION
    127125      , true
     
    291289    if (m_pps.getTilesEnabledFlag())
    292290    {
    293       minHeight = 64  / g_uiMaxCUHeight;
    294       minWidth  = 256 / g_uiMaxCUWidth;
     291      minHeight = 64  / m_sps.getMaxCUHeight();
     292      minWidth  = 256 / m_sps.getMaxCUWidth();
    295293    }
    296294  }
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h

    r1259 r1289  
    8787  UInt          m_frameHeightInCtus;
    8888
    89   UInt          m_uiMaxCUWidth;
    90   UInt          m_uiMaxCUHeight;
    9189  UInt          m_uiMinCUWidth;
    9290  UInt          m_uiMinCUHeight;
     
    9997
    10098  std::deque<TComSlice*> m_apSlices;
    101 
    102   TComSlice**   m_apcTComSlice;
    103   UInt          m_uiNumAllocatedSlice;
    10499  TComDataCU**  m_pictureCtuArray;        ///< array of CU data.
    105100
     
    133128public:
    134129#if SVC_EXTENSION
    135   Void               create  ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, const UInt layerId );
     130  Void               create  ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const UInt layerId );
    136131#if CGS_3D_ASYMLUT
    137132  TComPPS*           getPPSToUpdate()                                      { return &m_pps; }
    138133#endif
    139134#else
    140   Void               create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
     135  Void               create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth );
    141136#endif
    142137  Void               destroy ();
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp

    r1287 r1289  
    7676}
    7777
     78Void TComPicYuv::create ( const Int iPicWidth,
     79                          const Int iPicHeight,
     80                          const ChromaFormat chromaFormatIDC,
     81                          const UInt uiMaxCUWidth,  ///< used for generating offsets to CUs. Can use iPicWidth if no offsets are required
     82                          const UInt uiMaxCUHeight, ///< used for generating offsets to CUs. Can use iPicHeight if no offsets are required
     83                          const UInt uiMaxCUDepth,  ///< used for generating offsets to CUs. Can use 0 if no offsets are required
    7884#if SVC_EXTENSION
    79 Void TComPicYuv::create( const Int iPicWidth, const Int iPicHeight, const ChromaFormat chromaFormatIDC, const UInt uiMaxCUWidth, const UInt uiMaxCUHeight, const UInt uiMaxCUDepth, const Window* conformanceWindow )
     85                          const Bool bUseMargin,     ///< if true, then a margin of uiMaxCUWidth+16 and uiMaxCUHeight+16 is created around the image.
     86                          const Window* conformanceWindow)
    8087#else
    81 Void TComPicYuv::create( const Int  iPicWidth,    const  Int iPicHeight,    const ChromaFormat chromaFormatIDC,
    82                          const UInt uiMaxCUWidth, const UInt uiMaxCUHeight, const UInt uiMaxCUDepth )
     88                          const Bool bUseMargin)    ///< if true, then a margin of uiMaxCUWidth+16 and uiMaxCUHeight+16 is created around the image.
    8389#endif
    8490{
     91#if SVC_EXTENSION
     92  if(conformanceWindow != NULL)
     93  {
     94    m_conformanceWindow = *conformanceWindow;
     95  }
     96#endif
     97
    8598  m_iPicWidth         = iPicWidth;
    8699  m_iPicHeight        = iPicHeight;
    87100  m_chromaFormatIDC   = chromaFormatIDC;
    88  
    89 #if SVC_EXTENSION
    90   if(conformanceWindow != NULL)
    91   {
    92     m_conformanceWindow = *conformanceWindow;
    93   }
    94 #endif
    95  
    96 #if LAYER_CTB
    97   m_iMarginX    = uiMaxCUWidth  + 16; // for 16-byte alignment
    98   m_iMarginY    = uiMaxCUHeight + 16;  // margin for 8-tap filter and infinite padding
    99 #else
    100   m_iMarginX          = g_uiMaxCUWidth  + 16; // for 16-byte alignment
    101   m_iMarginY          = g_uiMaxCUHeight + 16;  // margin for 8-tap filter and infinite padding
    102 #endif
    103  
     101  m_iMarginX          = (bUseMargin?uiMaxCUWidth:0) + 16; // for 16-byte alignment
     102  m_iMarginY          = (bUseMargin?uiMaxCUHeight:0) + 16;  // margin for 8-tap filter and infinite padding
    104103  m_bIsBorderExtended = false;
    105104
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h

    r1287 r1289  
    9595  //  Memory management
    9696  // ------------------------------------------------------------------------------------------------
    97 #if SVC_EXTENSION
    98   Void  create      ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, const Window* conformanceWindow = NULL);
    99 #else
     97
    10098  Void          create            (const Int iPicWidth,
    10199                                   const Int iPicHeight,
    102100                                   const ChromaFormat chromaFormatIDC,
    103                                    const UInt uiMaxCUWidth,
    104                                    const UInt uiMaxCUHeight,
    105                                    const UInt uiMaxCUDepth );
     101                                   const UInt uiMaxCUWidth,  ///< used for generating offsets to CUs. Can use iPicWidth if no offsets are required
     102                                   const UInt uiMaxCUHeight, ///< used for generating offsets to CUs. Can use iPicHeight if no offsets are required
     103                                   const UInt uiMaxCUDepth,  ///< used for generating offsets to CUs. Can use 0 if no offsets are required
     104#if SVC_EXTENSION
     105                                   const Bool bUseMargin,    ///< if true, then a margin of uiMaxCUWidth+16 and uiMaxCUHeight+16 is created around the image.
     106                                   const Window* conformanceWindow = NULL);
     107#else
     108                                   const Bool bUseMargin);   ///< if true, then a margin of uiMaxCUWidth+16 and uiMaxCUHeight+16 is created around the image.
    106109#endif
    107110 
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1287 r1289  
    249249// ====================================================================================================================
    250250
    251 UInt g_uiMaxCUWidth  = MAX_CU_SIZE;
    252 UInt g_uiMaxCUHeight = MAX_CU_SIZE;
    253251UInt g_uiMaxCUDepth  = MAX_CU_DEPTH;
    254252UInt g_uiAddCUDepth  = 0;
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.h

    r1287 r1289  
    8686
    8787// global variable (CTU width/height, max. CU depth)
    88 extern       UInt g_uiMaxCUWidth;
    89 extern       UInt g_uiMaxCUHeight;
    9088extern       UInt g_uiMaxCUDepth;
    9189extern       UInt g_uiAddCUDepth;
  • branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r1287 r1289  
    145145  {
    146146    m_tempPicYuv = new TComPicYuv;
    147     m_tempPicYuv->create( m_picWidth, m_picHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, maxCUDepth );
     147    m_tempPicYuv->create( m_picWidth, m_picHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, maxCUDepth, true );
    148148  }
    149149
     
    729729  const Pel *piPcm = pcCU->getPCMSample(compID) + uiOffset;
    730730  const UInt uiStride  = pcPicYuvRec->getStride(compID);
    731   const UInt uiWidth  = ((g_uiMaxCUWidth >> uiDepth) >> csx);
    732   const UInt uiHeight = ((g_uiMaxCUWidth >> uiDepth) >> csy);
     731  const TComSPS &sps = *(pcCU->getSlice()->getSPS());
     732  const UInt uiWidth  = ((sps.getMaxCUWidth()  >> uiDepth) >> csx);
     733  const UInt uiHeight = ((sps.getMaxCUHeight() >> uiDepth) >> csy);
    733734
    734735  if ( pcCU->isLosslessCoded(uiAbsZorderIdx) && !pcCU->getIPCMFlag(uiAbsZorderIdx) )
     
    741742    uiPcmLeftShiftBit = pcCU->getSlice()->getBitDepth(toChannelType(compID)) - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID));
    742743#else
    743     uiPcmLeftShiftBit = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID));
     744    uiPcmLeftShiftBit = sps.getBitDepth(toChannelType(compID)) - sps.getPCMBitDepth(toChannelType(compID));
    744745#endif
    745746  }
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1287 r1289  
    37903790        }
    37913791
    3792         pcIlpPic[refLayerIdc]->copyUpsampledMvField( refLayerIdc, m_pcBaseColPic[refLayerIdc] );
     3792        pcIlpPic[refLayerIdc]->copyUpsampledMvField(refLayerIdc);
    37933793      }
    37943794      else
Note: See TracChangeset for help on using the changeset viewer.