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


Ignore:
Timestamp:
11 Dec 2015, 00:05:48 (9 years ago)
Author:
seregin
Message:

infer parameters in SPS after activation, fixing chroma scaling for non 4:2:0

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

Legend:

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

    r1483 r1502  
    411411  const TComSPS &sps=*(getSlice()->getSPS());
    412412
    413 #if SVC_EXTENSION
    414   TComSlice * pcSlice = m_pcPic->getSlice(m_pcPic->getCurrSliceIdx());
    415   const UInt picWidth = pcSlice->getPicWidthInLumaSamples();
    416   const UInt picHeight = pcSlice->getPicHeightInLumaSamples();
    417 #else
    418413  const UInt picWidth = sps.getPicWidthInLumaSamples();
    419414  const UInt picHeight = sps.getPicHeightInLumaSamples();
    420 #endif
    421415  const UInt granularityWidth = sps.getMaxCUWidth();
    422416
     
    11541148  UInt uiAbsZorderCUIdxLB = g_auiZscanToRaster[ m_absZIdxInCtu ] + ((m_puhHeight[0] / m_pcPic->getMinCUHeight()) - 1)*numPartInCtuWidth;
    11551149
    1156 #if SVC_EXTENSION
    1157   if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicHeightInLumaSamples())
    1158 #else
    11591150  if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples())
    1160 #endif
    11611151  {
    11621152    uiBLPartUnitIdx = MAX_UINT;
     
    12021192  const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
    12031193
    1204 #if SVC_EXTENSION
    1205   if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicWidthInLumaSamples() )
    1206 #else
    12071194  if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
    1208 #endif
    12091195  {
    12101196    uiARPartUnitIdx = MAX_UINT;
     
    23942380    Int ctuRsAddr = -1;
    23952381
    2396 #if SVC_EXTENSION
    2397     if (   ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getPicWidthInLumaSamples() )  // image boundary check
    2398         && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getPicHeightInLumaSamples() ) )
    2399 #else
    24002382    if (   ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples () )  // image boundary check
    24012383        && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) )
    2402 #endif   
    24032384    {
    24042385      if ( ( uiAbsPartIdxTmp % numPartInCtuWidth < numPartInCtuWidth - 1 ) &&           // is not at the last column of CTU
     
    27312712    Int ctuRsAddr = -1;
    27322713
    2733 #if SVC_EXTENSION
    2734     if (  ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[absPartIdx] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getPicWidthInLumaSamples())   // image boundary check
    2735        && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[absPartIdx] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getPicHeightInLumaSamples() ) )   
    2736 #else
    27372714    if (  ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[absPartIdx] + m_pcPic->getMinCUWidth () ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples () )  // image boundary check
    27382715       && ( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[absPartIdx] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) )
    2739 #endif   
    27402716    {
    27412717      if ( ( absPartIdx % numPartInCtuWidth < numPartInCtuWidth - 1 ) &&  // is not at the last column of CTU
     
    28042780  Int  iMvShift = 2;
    28052781  Int iOffset = 8;
    2806 #if SVC_EXTENSION
    2807   Int iHorMax = ( m_pcSlice->getPicWidthInLumaSamples() + iOffset - (Int)m_uiCUPelX - 1 ) << iMvShift;
    2808 #else
    28092782  Int iHorMax = ( sps.getPicWidthInLumaSamples() + iOffset - (Int)m_uiCUPelX - 1 ) << iMvShift;
    2810 #endif
    28112783  Int iHorMin = (      -(Int)sps.getMaxCUWidth() - iOffset - (Int)m_uiCUPelX + 1 ) << iMvShift;
    28122784
    2813 #if SVC_EXTENSION
    2814   Int iVerMax = ( m_pcSlice->getPicHeightInLumaSamples() + iOffset - (Int)m_uiCUPelY - 1 ) << iMvShift;
    2815 #else
    28162785  Int iVerMax = ( sps.getPicHeightInLumaSamples() + iOffset - (Int)m_uiCUPelY - 1 ) << iMvShift;
    2817 #endif
    28182786  Int iVerMin = (      -(Int)sps.getMaxCUHeight() - iOffset - (Int)m_uiCUPelY + 1 ) << iMvShift;
    28192787
  • branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp

    r1465 r1502  
    185185      UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ];
    186186      UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ];
    187 #if SVC_EXTENSION
    188       if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) )
    189 #else
    190187      if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
    191 #endif
    192188      {
    193189        xDeblockCU( pcCU, uiAbsZorderIdx, uiDepth+1, edgeDir );
     
    566562  const TComSPS    &sps                           = *(pcCU->getSlice()->getSPS());
    567563  const Bool        ppsTransquantBypassEnableFlag = pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag();
    568 
    569 #if SVC_EXTENSION
    570   const Int bitDepthLuma                          = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA);
    571 #else
    572564  const Int         bitDepthLuma                  = sps.getBitDepth(CHANNEL_TYPE_LUMA);
    573 #endif
    574 
    575565  const Bool        lfCrossSliceBoundaryFlag      = pcCU->getSlice()->getLFCrossSliceBoundaryFlag();
    576566
     
    691681        Pel        *piSrcCr        = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
    692682  const TComSPS    &sps            = *(pcCU->getSlice()->getSPS());
    693 #if SVC_EXTENSION
    694   const Int         bitDepthChroma = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_CHROMA);
    695 #else 
    696683  const Int         bitDepthChroma = sps.getBitDepth(CHANNEL_TYPE_CHROMA);
    697 #endif
    698684
    699685  const UInt  uiPelsInPartChromaH = sps.getMaxCUWidth() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));
     
    757743  }
    758744
    759 #if SVC_EXTENSION
    760   const Int iBitdepthScale = 1 << (pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_CHROMA)-8);
    761 #else
    762745  const Int iBitdepthScale = 1 << (pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA)-8);
    763 #endif
    764746
    765747  for ( UInt iIdx = 0; iIdx < uiNumParts; iIdx++ )
  • branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp

    r1465 r1502  
    132132  const Int  iAboveUnits      = iTUWidthInUnits  << 1;
    133133  const Int  iLeftUnits       = iTUHeightInUnits << 1;
    134 #if SVC_EXTENSION
    135   const Int  bitDepthForChannel = pcCU->getSlice()->getBitDepth(chType);
    136 #else
    137134  const Int  bitDepthForChannel = sps.getBitDepth(chType);
    138 #endif
    139135
    140136  assert(iTUHeightInUnits > 0 && iTUWidthInUnits > 0);
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp

    r1487 r1502  
    7979Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual, const UInt layerId )
    8080{
    81   const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId);
    82   const Int          iWidth          = vps.getPicWidthInLumaSamples(&sps, layerId);
    83   const Int          iHeight         = vps.getPicHeightInLumaSamples(&sps, layerId);
     81  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
     82  const Int          iWidth          = sps.getPicWidthInLumaSamples();
     83  const Int          iHeight         = sps.getPicHeightInLumaSamples();
    8484  const UInt         uiMaxCuWidth    = sps.getMaxCUWidth();
    8585  const UInt         uiMaxCuHeight   = sps.getMaxCUHeight();
    8686  const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
    87  
    88   const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId );
     87  const Window& conformanceWindow    = sps.getConformanceWindow();
    8988
    9089  m_layerId = layerId;
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1465 r1502  
    161161  Void          clearSliceBuffer()           {m_picSym.clearSliceBuffer();         }
    162162
    163 #if SVC_EXTENSION
    164   const Window& getConformanceWindow() const { return m_picSym.getSlice(0)->getConformanceWindow(); }
    165 #else
    166163  const Window& getConformanceWindow() const { return m_picSym.getSPS().getConformanceWindow(); }
    167 #endif
    168164  Window        getDefDisplayWindow() const  { return m_picSym.getSPS().getVuiParametersPresentFlag() ? m_picSym.getSPS().getVuiParameters()->getDefaultDisplayWindow() : Window(); }
    169165
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp

    r1496 r1502  
    8484Void TComPicSym::create  ( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const UInt layerId )
    8585{
     86  m_vps = vps;
     87#else
     88Void TComPicSym::create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth )
     89{
     90#endif
    8691  UInt i;
    8792  m_sps = sps;
    8893  m_pps = pps;
    89   m_vps = vps;
    90  
    91   const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId);
    92   const Int iPicWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
    93   const Int iPicHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    94 #else
    95 Void TComPicSym::create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth )
    96 {
    97   UInt i;
    98   m_sps = sps;
    99   m_pps = pps;
    10094
    10195  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
    10296  const Int iPicWidth      = sps.getPicWidthInLumaSamples();
    10397  const Int iPicHeight     = sps.getPicHeightInLumaSamples();
    104 #endif
    10598
    10699  const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h

    r1497 r1502  
    198198  Bool         getSkippedTileSetFlag( Int i )                        { return *(m_pbSkippedTileSetFlag + i); }
    199199#endif
     200  Void         inferSpsForNonHEVCBL()                                { m_sps.inferSPS(0, &m_vps); }
    200201#endif //SVC_EXTENSION
    201202
  • branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r1483 r1502  
    460460      const Int channelsBitDepthForPrediction = rTu.getCU()->getSlice()->getSPS()->getStreamBitDepth(channelType);
    461461#else
    462 #if SVC_EXTENSION
    463       const Int channelsBitDepthForPrediction = rTu.getCU()->getSlice()->getBitDepth(channelType);
    464 #else
    465462      const Int channelsBitDepthForPrediction = rTu.getCU()->getSlice()->getSPS()->getBitDepth(channelType);
    466 #endif
    467463#endif
    468464      xPredIntraAng( channelsBitDepthForPrediction, ptrSrc+sw+1, sw, pDst, uiStride, iWidth, iHeight, channelType, uiDirMode, enableEdgeFilters );
     
    605601  {
    606602    const ComponentID compID=ComponentID(comp);
    607 #if SVC_EXTENSION
    608     xPredInterBlk  (compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getBitDepth(toChannelType(compID)) );
    609 #else
    610603    xPredInterBlk  (compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) );
    611 #endif
    612604  }
    613605}
     
    659651  else
    660652  {
    661 #if SVC_EXTENSION
    662     xWeightedAverage( &m_acYuvPred[REF_PIC_LIST_0], &m_acYuvPred[REF_PIC_LIST_1], iRefIdx[REF_PIC_LIST_0], iRefIdx[REF_PIC_LIST_1], uiPartAddr, iWidth, iHeight, pcYuvPred, pcCU->getSlice()->getBitDepths() );
    663 #else
    664653    xWeightedAverage( &m_acYuvPred[REF_PIC_LIST_0], &m_acYuvPred[REF_PIC_LIST_1], iRefIdx[REF_PIC_LIST_0], iRefIdx[REF_PIC_LIST_1], uiPartAddr, iWidth, iHeight, pcYuvPred, pcCU->getSlice()->getSPS()->getBitDepths() );
    665 #endif
    666654  }
    667655}
  • branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r1442 r1502  
    599599      Pel* resBlk     = resYuv->getAddr(component) + blkYPos*resStride + blkXPos;
    600600
    601 #if SVC_EXTENSION
    602       offsetBlock( pPic->getSlice(0)->getBitDepth(toChannelType(component)), ctbOffset.typeIdc, ctbOffset.offset
    603 #else
    604601      offsetBlock( pPic->getPicSym()->getSPS().getBitDepth(toChannelType(component)), ctbOffset.typeIdc, ctbOffset.offset
    605 #endif
    606602                  , srcBlk, resBlk, srcStride, resStride, blkWidth, blkHeight
    607603                  , isLeftAvail, isRightAvail
     
    688684      UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsZorderIdx] ];
    689685      UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsZorderIdx] ];
    690 #if SVC_EXTENSION
    691       if( ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) )
    692 #else
    693686      if( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )
    694 #endif
    695687      {
    696688        xPCMCURestoration( pcCU, uiAbsZorderIdx, uiDepth+1 );
     
    739731  else
    740732  {
    741 #if SVC_EXTENSION
    742     uiPcmLeftShiftBit = pcCU->getSlice()->getBitDepth(toChannelType(compID)) - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID));
    743 #else
    744733    uiPcmLeftShiftBit = sps.getBitDepth(toChannelType(compID)) - sps.getPCMBitDepth(toChannelType(compID));
    745 #endif
    746734  }
    747735
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1497 r1502  
    506506                            );
    507507
    508         Bool sameBitDepths = ( getBitDepth(CHANNEL_TYPE_LUMA) == ilpPic[refLayerIdc]->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA) ) && ( getBitDepth(CHANNEL_TYPE_CHROMA) == ilpPic[refLayerIdc]->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA) );
     508        Bool sameBitDepths = ( m_pcSPS->getBitDepth(CHANNEL_TYPE_LUMA) == ilpPic[refLayerIdc]->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ) && ( m_pcSPS->getBitDepth(CHANNEL_TYPE_CHROMA) == ilpPic[refLayerIdc]->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) );
    509509
    510510        // motion resampling constraint
     
    18241824        }
    18251825
    1826 #if SVC_EXTENSION
    1827         const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (getBitDepth(toChannelType(ComponentID(yuv)))-8));
    1828 #else
    18291826        const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (sps->getBitDepth(toChannelType(ComponentID(yuv)))-8));
    1830 #endif
    18311827
    18321828        pwp->w      = pwp->iWeight;
     
    32803276}
    32813277
    3282 UInt TComSlice::getPicWidthInLumaSamples()
    3283 {
    3284   UInt retVal, layerId = getLayerId();
    3285 
    3286   if ( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
    3287   {
    3288     if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
    3289     {
    3290       retVal = m_pcVPS->getVpsRepFormat(layerId)->getPicWidthVpsInLumaSamples();
    3291     }
    3292     else
    3293     {
    3294       retVal = m_pcSPS->getPicWidthInLumaSamples();
    3295     }
    3296   }
    3297   else
    3298   {
    3299     retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getPicWidthVpsInLumaSamples();
    3300   }
    3301 
    3302   return retVal;
    3303 }
    3304 
    3305 UInt TComVPS::getPicWidthInLumaSamples( const TComSPS* sps, const UInt layerId ) const
    3306 {
    3307   UInt retVal;
    3308 
    3309   if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    3310   {
    3311     if( layerId == 0 && m_nonHEVCBaseLayerFlag )
    3312     {
    3313       retVal = m_vpsRepFormat[layerId].getPicWidthVpsInLumaSamples();
    3314     }
    3315     else
    3316     {
    3317       retVal = sps->getPicWidthInLumaSamples();
    3318     }
    3319   }
    3320   else
    3321   {
    3322     retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getPicWidthVpsInLumaSamples();
    3323   }
    3324 
    3325   return retVal;
    3326 }
    3327 
    3328 UInt TComSlice::getPicHeightInLumaSamples()
    3329 {
    3330   UInt retVal, layerId = getLayerId();
    3331 
    3332   if ( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
    3333   {
    3334     if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
    3335     {
    3336       retVal = m_pcVPS->getVpsRepFormat(layerId)->getPicHeightVpsInLumaSamples();
    3337     }
    3338     else
    3339     {
    3340       retVal = m_pcSPS->getPicHeightInLumaSamples();
    3341     }
    3342   }
    3343   else
    3344   {
    3345     retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getPicHeightVpsInLumaSamples();
    3346   }
    3347 
    3348   return retVal;
    3349 }
    3350 
    3351 UInt TComVPS::getPicHeightInLumaSamples( const TComSPS* sps, const UInt layerId ) const
    3352 {
    3353   UInt retVal;
    3354 
    3355   if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    3356   {
    3357     if( layerId == 0 && m_nonHEVCBaseLayerFlag )
    3358     {
    3359       retVal = m_vpsRepFormat[layerId].getPicHeightVpsInLumaSamples();
    3360     }
    3361     else
    3362     {
    3363       retVal = sps->getPicHeightInLumaSamples();
    3364     }
    3365   }
    3366   else
    3367   {
    3368     retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getPicHeightVpsInLumaSamples();
    3369   }
    3370 
    3371   return retVal;
    3372 }
    3373 
    3374 ChromaFormat TComSlice::getChromaFormatIdc()
    3375 {
    3376   ChromaFormat retVal;
    3377   UInt layerId = getLayerId();
    3378 
    3379   if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
    3380   {
    3381     if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
    3382     {
    3383       retVal = m_pcVPS->getVpsRepFormat(layerId)->getChromaFormatVpsIdc();
    3384     }
    3385     else
    3386     {
    3387       retVal = m_pcSPS->getChromaFormatIdc();
    3388     }
    3389   }
    3390   else
    3391   {
    3392     retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getChromaFormatVpsIdc();
    3393   }
    3394 
    3395   return retVal;
    3396 }
    3397 
    3398 ChromaFormat TComVPS::getChromaFormatIdc( const TComSPS* sps, const UInt layerId ) const
    3399 {
    3400   ChromaFormat retVal;
    3401 
    3402   if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    3403   {
    3404     if( layerId == 0 && m_nonHEVCBaseLayerFlag )
    3405     {
    3406       retVal = m_vpsRepFormat[layerId].getChromaFormatVpsIdc();
    3407     }
    3408     else
    3409     {
    3410       retVal = sps->getChromaFormatIdc();
    3411     }
    3412   }
    3413   else
    3414   {
    3415     retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getChromaFormatVpsIdc();
    3416   }
    3417 
    3418   return retVal;
    3419 }
    3420 
    3421 BitDepths& TComSlice::getBitDepths()
    3422 {
    3423   static BitDepths bitDepths;
    3424 
    3425   bitDepths.recon[CHANNEL_TYPE_LUMA] = getBitDepth(CHANNEL_TYPE_LUMA);
    3426   bitDepths.recon[CHANNEL_TYPE_CHROMA] = getBitDepth(CHANNEL_TYPE_CHROMA);
    3427 
    3428   return bitDepths;
    3429 }
    3430 
    3431 UInt TComSlice::getBitDepth(ChannelType type) const
    3432 {
    3433   UInt retVal, layerId = getLayerId();
    3434 
    3435   if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
    3436   {
    3437     if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
    3438     {
    3439       retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVps(type);
    3440     }
    3441     else
    3442     {
    3443       retVal = m_pcSPS->getBitDepth(type);
    3444     }
    3445   }
    3446   else
    3447   {
    3448     retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVps(type);
    3449   }
    3450 
    3451   return retVal;
    3452 }
    3453 
    3454 UInt TComVPS::getBitDepth( ChannelType type, const TComSPS* sps, const UInt layerId ) const
    3455 {
    3456   UInt retVal;
    3457 
    3458   if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    3459   {
    3460     if( layerId == 0 && m_nonHEVCBaseLayerFlag )
    3461     {
    3462       retVal = m_vpsRepFormat[layerId].getBitDepthVps(type);
    3463     }
    3464     else
    3465     {
    3466       retVal = sps->getBitDepth(type);
    3467     }
    3468   }
    3469   else
    3470   {
    3471     retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVps(type);
    3472   }
    3473 
    3474   return retVal;
    3475 }
    3476 
    3477 const BitDepths& TComVPS::getBitDepths( const TComSPS* sps, const UInt layerId ) const
    3478 {
    3479   static BitDepths bitDepths;
    3480   bitDepths.recon[CHANNEL_TYPE_LUMA]   = getBitDepth(CHANNEL_TYPE_LUMA, sps, layerId);
    3481   bitDepths.recon[CHANNEL_TYPE_CHROMA] = getBitDepth(CHANNEL_TYPE_CHROMA, sps, layerId);
    3482   return bitDepths;
    3483 }
    3484 
    3485 const Window& TComSlice::getConformanceWindow() const
    3486 {
    3487   if ( m_layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
    3488   {
    3489     if( m_layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
    3490     {
    3491       return m_pcVPS->getVpsRepFormat(m_layerId)->getConformanceWindowVps();
    3492     }
    3493     else
    3494     {
    3495       return m_pcSPS->getConformanceWindow();
    3496     }
    3497   }
    3498   else
    3499   {
    3500     return m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(m_layerId)))->getConformanceWindowVps();
    3501   }
    3502 }
    3503 
    3504 const Window& TComVPS::getConformanceWindow( const TComSPS* sps, const UInt layerId ) const
    3505 {
    3506   if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    3507   {
    3508     if( layerId == 0 && m_nonHEVCBaseLayerFlag )
    3509     {
    3510       return m_vpsRepFormat[layerId].getConformanceWindowVps();
    3511     }
    3512     else
    3513     {
    3514       return sps->getConformanceWindow();
    3515     }
    3516   }
    3517   else
    3518   {
    3519     return m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getConformanceWindowVps();
    3520   }
    3521 }
    3522 
    35233278RepFormat::RepFormat()
    35243279#if AUXILIARY_PICTURES
     
    38563611  return numPocBeforeCurr;
    38573612}
     3613
     3614Void TComSPS::inferSPS( const UInt layerId, TComVPS* vps )
     3615{
     3616  RepFormat* repFormat = NULL;
     3617
     3618  if( layerId == 0 || m_bV1CompatibleSPSFlag == 1 )
     3619  {
     3620    if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() )
     3621    {
     3622      repFormat = vps->getVpsRepFormat(layerId);
     3623    }
     3624  }
     3625  else
     3626  {
     3627    repFormat = vps->getVpsRepFormat(m_updateRepFormatFlag ? m_updateRepFormatIndex : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)));
     3628  }
     3629
     3630  if( repFormat )
     3631  {
     3632    m_chromaFormatIdc = repFormat->getChromaFormatVpsIdc();
     3633    m_picWidthInLumaSamples = repFormat->getPicWidthVpsInLumaSamples();
     3634    m_picHeightInLumaSamples = repFormat->getPicHeightVpsInLumaSamples();
     3635
     3636    m_bitDepths.recon[CHANNEL_TYPE_LUMA] = repFormat->getBitDepthVps(CHANNEL_TYPE_LUMA);
     3637    m_bitDepths.recon[CHANNEL_TYPE_CHROMA] = repFormat->getBitDepthVps(CHANNEL_TYPE_CHROMA);
     3638
     3639    m_qpBDOffset[CHANNEL_TYPE_LUMA] = (m_bitDepths.recon[CHANNEL_TYPE_LUMA] - 8) * 6;
     3640    m_qpBDOffset[CHANNEL_TYPE_CHROMA] = (m_bitDepths.recon[CHANNEL_TYPE_CHROMA] - 8) * 6;
     3641
     3642    m_conformanceWindow = repFormat->getConformanceWindowVps();
     3643  }
     3644}
    38583645#endif //SVC_EXTENSION
    38593646
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1497 r1502  
    11301130  Void              checkNecessaryLayerFlagCondition();
    11311131  Void              calculateMaxSLInLayerSets();
    1132 
    1133   ChromaFormat      getChromaFormatIdc( const TComSPS* sps, const UInt layerId ) const;
    1134   UInt              getPicHeightInLumaSamples( const TComSPS* sps, const UInt layerId ) const;
    1135   UInt              getPicWidthInLumaSamples( const TComSPS* sps, const UInt layerId ) const;
    1136   UInt              getBitDepth( ChannelType type, const TComSPS* sps, const UInt layerId ) const;
    1137   const BitDepths&  getBitDepths( const TComSPS* sps, const UInt layerId ) const;
    1138   const Window&     getConformanceWindow( const TComSPS* sps, const UInt layerId ) const;
    11391132#endif //SVC_EXTENSION
    11401133};
     
    16041597  Void                   setInferScalingListFlag( Bool flag )                                            { m_inferScalingListFlag = flag;                                       }
    16051598  Void                   setScalingListRefLayerId( UInt layerId )                                        { m_scalingListRefLayerId = layerId;                                   }
     1599
     1600  Void                   inferSPS( const UInt layerId, TComVPS* vps );
    16061601#endif //SVC_EXTENSION
    16071602};
     
    23992394  Bool                        getCrossLayerBLAFlag  ()                               { return m_bCrossLayerBLAFlag;                                  }
    24002395  Void                        setCrossLayerBLAFlag  (Bool b)                         { m_bCrossLayerBLAFlag = b;                                     }
    2401 
    24022396  Int                         getNumNegativeRpsCurrTempList();
    2403 
    2404   UInt                        getPicWidthInLumaSamples();
    2405   UInt                        getPicHeightInLumaSamples();
    2406   ChromaFormat                getChromaFormatIdc();
    2407   UInt                        getBitDepth(ChannelType type) const;
    2408   BitDepths&                  getBitDepths();
    2409   Int                         getQpBDOffset(ChannelType type) const                  { return (getBitDepth(type) - 8) * 6;                           }
    2410 
    2411   const Window&               getConformanceWindow() const;
    2412 
    24132397  Void                        setILRPic(TComPic **pcIlpPic);
    2414 
    24152398  Int                         getPocResetIdc()                                       { return m_pocResetIdc;                                         }
    24162399  Void                        setPocResetIdc(Int b)                                  { m_pocResetIdc = b;                                            }
  • branches/SHM-dev/source/Lib/TLibCommon/TComTU.cpp

    r1499 r1502  
    4747
    4848TComTU::TComTU(TComDataCU *pcCU, const UInt absPartIdxCU, const UInt cuDepth, const UInt initTrDepthRelCU)
    49 #if SCALABLE_REXT
    50   : mChromaFormat(pcCU->getSlice()->getChromaFormatIdc()),
    51 #else
    5249  : mChromaFormat(pcCU->getSlice()->getSPS()->getChromaFormatIdc()),
    53 #endif
    5450    mbProcessLastOfLevel(true), // does not matter. the top level is not 4 quadrants.
    5551    mCuDepth(cuDepth),
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r1335 r1502  
    114114  *this = QpParam(cu.getQP( 0 ),
    115115                  toChannelType(compID),
    116 #if SVC_EXTENSION
    117                   cu.getSlice()->getQpBDOffset(toChannelType(compID)),
    118 #else
    119116                  cu.getSlice()->getSPS()->getQpBDOffset(toChannelType(compID)),
    120 #endif
    121117                  chromaQpOffset,
    122118                  cu.getPic()->getChromaFormat());
     
    11431139  TComDataCU* pcCU          = rTu.getCU();
    11441140  const UInt uiAbsPartIdx   = rTu.GetAbsPartIdxTU();
    1145 #if SVC_EXTENSION
    1146   const Int channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID));
    1147 #else
    11481141  const Int channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    1149 #endif
    11501142
    11511143  TCoeff* piCoef    = pSrc;
     
    13451337  const Int                  channelBitDepth    = pcCU->getSlice()->getSPS()->getStreamBitDepth(toChannelType(compID));
    13461338#else
    1347 #if SVC_EXTENSION
    1348   const Int                  channelBitDepth    = pcCU->getSlice()->getBitDepth(toChannelType(compID));
    1349 #else
    13501339  const Int                  channelBitDepth    = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    1351 #endif
    13521340#endif
    13531341
     
    15291517      else
    15301518      {
    1531 #if SVC_EXTENSION
    1532         const Int channelBitDepth=pcCU->getSlice()->getBitDepth(toChannelType(compID));
    1533 #else
    15341519        const Int channelBitDepth=pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    1535 #endif
    15361520        xT( channelBitDepth, rTu.useDST(compID), pcResidual, uiStride, m_plTempCoeff, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) );
    15371521      }
     
    16671651      const Int channelBitDepth = pcCU->getSlice()->getSPS()->getStreamBitDepth(toChannelType(compID));
    16681652#else
    1669 #if SVC_EXTENSION
    1670       const Int channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID));
    1671 #else
    16721653      const Int channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    1673 #endif
    16741654#endif
    16751655      xIT( channelBitDepth, rTu.useDST(compID), m_plTempCoeff, pcResidual, uiStride, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) );
     
    20452025  const Int height          = rect.height;
    20462026  const Int maxLog2TrDynamicRange = rTu.getCU()->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(component));
    2047 #if SVC_EXTENSION
    2048   const Int channelBitDepth = rTu.getCU()->getSlice()->getBitDepth(toChannelType(component));
    2049 #else
    20502027  const Int channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getBitDepth(toChannelType(component));
    2051 #endif
    20522028
    20532029  Int iTransformShift = getTransformShift(channelBitDepth, rTu.GetEquivalentLog2TrSize(component), maxLog2TrDynamicRange);
     
    21012077  const Int channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getStreamBitDepth(toChannelType(component));
    21022078#else
    2103 #if SVC_EXTENSION
    2104   const Int channelBitDepth = rTu.getCU()->getSlice()->getBitDepth(toChannelType(component));
    2105 #else
    21062079  const Int channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getBitDepth(toChannelType(component));
    2107 #endif
    21082080#endif
    21092081
     
    21752147  const Bool             extendedPrecision = pcCU->getSlice()->getSPS()->getSpsRangeExtension().getExtendedPrecisionProcessingFlag();
    21762148  const Int              maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID));
    2177 #if SVC_EXTENSION
    2178   const Int              channelBitDepth = rTu.getCU()->getSlice()->getBitDepth(channelType);
    2179 #else
    21802149  const Int              channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getBitDepth(channelType);
    2181 #endif
    21822150
    21832151  /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
     
    33643332  const UInt           uiHeight                       = rect.height;
    33653333  const Int            maxLog2TrDynamicRange          = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID));
    3366 #if SVC_EXTENSION
    3367   const Int            channelBitDepth                = pcCU->getSlice()->getBitDepth(toChannelType(compID));
    3368 #else
    33693334  const Int            channelBitDepth                = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    3370 #endif
    33713335  const Int            iTransformShift                = getTransformShift(channelBitDepth, rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange);
    33723336  const Int            scalingListType                = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID);
     
    34313395  const Int            channelBitDepth    = pcCU->getSlice()->getSPS()->getStreamBitDepth(toChannelType(compID));
    34323396#else
    3433 #if SVC_EXTENSION
    3434   const Int            channelBitDepth    = pcCU->getSlice()->getBitDepth(toChannelType(compID));
    3435 #else
    34363397  const Int            channelBitDepth    = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    3437 #endif
    34383398#endif
    34393399  const Int            iTransformShift    = getTransformShift(channelBitDepth, rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange);
  • branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r1500 r1502  
    6464  const Window &windowRL = currSlice->getPPS()->getRefLayerWindowForLayer(refLayerId);
    6565
    66   Int bitDepthLuma = currSlice->getBitDepth(CHANNEL_TYPE_LUMA);
    67   Int bitDepthChroma = currSlice->getBitDepth(CHANNEL_TYPE_CHROMA);
     66  Int bitDepthLuma = currSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     67  Int bitDepthChroma = currSlice->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
    6868
    6969  //========== Y component upsampling ===========
     
    7676  Int strideEL  = pcUsPic->getStride(COMPONENT_Y);
    7777
    78   ChromaFormat chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
     78  ChromaFormat chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getSPS()->getChromaFormatIdc();
     79#if SCALABLE_REXT
     80  Int chromaHorScalingEL = TComSPS::getWinUnitX( currSlice->getSPS()->getChromaFormatIdc() );
     81  Int chromaVerScalingEL = TComSPS::getWinUnitY( currSlice->getSPS()->getChromaFormatIdc() );
     82
     83  Int chromaHorScalingBL = TComSPS::getWinUnitX( chromaFormatIdc );
     84  Int chromaVerScalingBL = TComSPS::getWinUnitY( chromaFormatIdc );
     85#else
    7986  Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    8087  Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     88#endif
    8189
    8290  const ResamplingPhase &resamplingPhase = currSlice->getPPS()->getResamplingPhase( refLayerId );
     
    151159
    152160#if SCALABLE_REXT
    153   if(chromaFormatIdc != 0)
     161  if( chromaFormatIdc != CHROMA_400 )
    154162  {
    155 #endif
     163    widthEL  /= chromaHorScalingEL;
     164    heightEL /= chromaVerScalingEL;
     165    widthBL  /= chromaHorScalingBL;
     166    heightBL /= chromaVerScalingBL;
     167#else
    156168    widthEL  >>= 1;
    157169    heightEL >>= 1;
     
    159171    widthBL  >>= 1;
    160172    heightBL >>= 1;
     173#endif
    161174
    162175    strideBL = pcBasePic->getStride( COMPONENT_Cb );
     
    166179    piSrcV = piSrcBufV;
    167180
     181#if SCALABLE_REXT
     182    piDstU = piDstBufU + ( scalEL.getWindowLeftOffset() / chromaHorScalingEL ) + ( scalEL.getWindowTopOffset() / chromaVerScalingEL ) * strideEL;
     183    piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() / chromaHorScalingEL ) + ( scalEL.getWindowTopOffset() / chromaVerScalingEL ) * strideEL;
     184#else
    168185    piDstU = piDstBufU + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
    169186    piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
     187#endif
    170188
    171189    shift = bitDepthChroma - refBitDepthChroma;
     
    309327
    310328#if SCALABLE_REXT
    311   if(chromaFormatIdc != 0)
     329  if( chromaFormatIdc != CHROMA_400 )
    312330  {
    313 #endif
     331    widthEL  /= chromaHorScalingEL;
     332    heightEL /= chromaVerScalingEL;
     333    widthBL  /= chromaHorScalingBL;
     334    heightBL /= chromaVerScalingBL;
     335#else
    314336    widthEL  >>= 1;
    315337    heightEL >>= 1;
    316338    widthBL  >>= 1;
    317339    heightBL >>= 1;
     340#endif
    318341
    319342    strideBL  = pcBasePic->getStride( COMPONENT_Cb );
    320343    strideEL  = pcUsPic->getStride( COMPONENT_Cb );
    321344
     345#if SCALABLE_REXT
     346    Int srlLOffsetC = scalEL.getWindowLeftOffset() / chromaHorScalingEL;
     347    Int srlTOffsetC = scalEL.getWindowTopOffset() / chromaVerScalingEL;
     348#else
    322349    Int srlLOffsetC = scalEL.getWindowLeftOffset() >> 1;
    323350    Int srlTOffsetC = scalEL.getWindowTopOffset() >> 1;
     351#endif
     352
    324353    rlClipL = -(NTAPS_US_CHROMA>>1);
    325354    rlClipR = widthBL -1 + (NTAPS_US_CHROMA>>1);
     
    331360    addX = ( ( resamplingPhase.phaseHorChroma * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    332361    addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
     362
     363#if SCALABLE_REXT
     364    Int refOffsetXC = (windowRL.getWindowLeftOffset() / chromaHorScalingBL) << 4;
     365    Int refOffsetYC = (windowRL.getWindowTopOffset()  / chromaVerScalingBL) << 4;
     366#else
    333367    Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4;
    334368    Int refOffsetYC = (windowRL.getWindowTopOffset()  / yScal) << 4;
     369#endif
    335370
    336371    shiftXM4 = shiftX - 4;
    337372    shiftYM4 = shiftY - 4;
    338373
     374#if SCALABLE_REXT
     375    widthEL   = pcUsPic->getWidth (COMPONENT_Y) / chromaHorScalingEL;
     376    heightEL  = pcUsPic->getHeight(COMPONENT_Y) / chromaVerScalingEL;
     377
     378    widthBL   = pcBasePic->getWidth (COMPONENT_Y) / chromaHorScalingBL;
     379    heightBL  = min<Int>( pcBasePic->getHeight(COMPONENT_Y) / chromaVerScalingBL, heightEL );
     380#else
    339381    widthEL   = pcUsPic->getWidth (COMPONENT_Y) >> 1;
    340382    heightEL  = pcUsPic->getHeight(COMPONENT_Y) >> 1;
     
    342384    widthBL   = pcBasePic->getWidth (COMPONENT_Y) >> 1;
    343385    heightBL  = min<Int>( pcBasePic->getHeight(COMPONENT_Y) >> 1, heightEL );
     386#endif
    344387
    345388    // shift1 should be calculated using BL bit-depth
     
    382425    //========== vertical upsampling ===========
    383426    pcTempPic->setBorderExtension(false);
     427#if SCALABLE_REXT
     428    pcTempPic->setHeight(heightBL * chromaVerScalingBL);
     429#else
    384430    pcTempPic->setHeight(heightBL << 1);
     431#endif
    385432    pcTempPic->extendPicBorder   (); // extend the border.
     433#if SCALABLE_REXT
     434    pcTempPic->setHeight(heightEL * chromaVerScalingEL);
     435#else
    386436    pcTempPic->setHeight(heightEL << 1);
     437#endif
    387438
    388439    nShift = 20 - bitDepthChroma;
     
    390441    iOffset = 1 << (nShift - 1);
    391442
     443#if SCALABLE_REXT
     444    for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y) / chromaVerScalingEL; j++ )
     445#else
    392446    for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y) >> 1; j++ )
     447#endif
    393448    {
    394449      Int y = j;
     
    408463      piDstV = piDstV0;
    409464
     465#if SCALABLE_REXT
     466      for( i = pcTempPic->getWidth(COMPONENT_Y) / chromaHorScalingEL; i > 0; i-- )
     467#else
    410468      for( i = pcTempPic->getWidth(COMPONENT_Y) >> 1; i > 0; i-- )
     469#endif
    411470      {
    412471        *piDstU = ClipBD( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift), bitDepthChroma );
  • branches/SHM-dev/source/Lib/TLibCommon/TComWeightPrediction.cpp

    r1399 r1502  
    290290    for ( Int yuv=0 ; yuv<numValidComponent ; yuv++ )
    291291    {
    292 #if SVC_EXTENSION
    293       const Int bitDepth            = pcSlice->getBitDepth(toChannelType(ComponentID(yuv)));
    294 #else
    295292      const Int bitDepth            = pcSlice->getSPS()->getBitDepth(toChannelType(ComponentID(yuv)));
    296 #endif
    297293      const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (bitDepth-8));
    298294
     
    315311    for ( Int yuv=0 ; yuv<numValidComponent ; yuv++ )
    316312    {
    317 #if SVC_EXTENSION
    318       const Int bitDepth            = pcSlice->getBitDepth(toChannelType(ComponentID(yuv)));
    319 #else
    320313      const Int bitDepth            = pcSlice->getSPS()->getBitDepth(toChannelType(ComponentID(yuv)));
    321 #endif
    322314      const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (bitDepth-8));
    323315
     
    351343  if( iRefIdx0 >= 0 && iRefIdx1 >= 0 )
    352344  {
    353 #if SVC_EXTENSION
    354     addWeightBi(pcYuvSrc0, pcYuvSrc1, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst );
    355 #else
    356345    addWeightBi(pcYuvSrc0, pcYuvSrc1, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst );
    357 #endif
    358346  }
    359347  else if ( iRefIdx0 >= 0 && iRefIdx1 <  0 )
    360348  {
    361 #if SVC_EXTENSION
    362     addWeightUni( pcYuvSrc0, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst );
    363 #else
    364349    addWeightUni( pcYuvSrc0, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst );
    365 #endif
    366350  }
    367351  else if ( iRefIdx0 <  0 && iRefIdx1 >= 0 )
    368352  {
    369 #if SVC_EXTENSION
    370     addWeightUni( pcYuvSrc1, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst );
    371 #else
    372353    addWeightUni( pcYuvSrc1, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst );
    373 #endif
    374354  }
    375355  else
     
    407387    getWpScaling(pcCU, -1, iRefIdx, pwpTmp, pwp);
    408388  }
    409 #if SVC_EXTENSION
    410   addWeightUni( pcYuvSrc, pcCU->getSlice()->getBitDepths(), uiPartAddr, iWidth, iHeight, pwp, pcYuvPred );
    411 #else
    412389  addWeightUni( pcYuvSrc, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartAddr, iWidth, iHeight, pwp, pcYuvPred );
    413 #endif
    414 }
     390}
Note: See TracChangeset for help on using the changeset viewer.