Changeset 1502 in SHVCSoftware for branches


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
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r1490 r1502  
    328328      if ( !m_reconFileName[curLayerId].empty() && !openedReconFile[curLayerId] )
    329329      {
    330         const BitDepths& bitDepths = m_apcTDecTop[curLayerId]->getParameterSetManager()->getActiveVPS()->getBitDepths( m_apcTDecTop[curLayerId]->getParameterSetManager()->getActiveSPS(), curLayerId );
     330        const BitDepths& bitDepths = m_apcTDecTop[curLayerId]->getParameterSetManager()->getActiveSPS()->getBitDepths();
    331331
    332332        for( UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
     
    786786          if (display)
    787787          {           
    788             UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
     788            UInt chromaFormatIdc = pcPic->getSlice(0)->getSPS()->getChromaFormatIdc();
    789789            Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    790790
     
    881881          const Window  defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();         
    882882
    883           UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
     883          UInt chromaFormatIdc = pcPic->getSlice(0)->getSPS()->getChromaFormatIdc();
    884884          Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    885885
     
    972972          const Bool isTff = pcPicTop->isTopField();         
    973973
    974           UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
     974          UInt chromaFormatIdc = pcPic->getSlice(0)->getSPS()->getChromaFormatIdc();
    975975          Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    976976
     
    10501050          const Window  defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();         
    10511051
    1052           UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
     1052          UInt chromaFormatIdc = pcPic->getSlice(0)->getSPS()->getChromaFormatIdc();
    10531053          Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    10541054
     
    14721472    Int xScal =  1, yScal = 1;
    14731473
    1474     UInt chromaFormatIdc = pic->getSlice(0)->getChromaFormatIdc();
     1474    UInt chromaFormatIdc = pic->getSlice(0)->getSPS()->getChromaFormatIdc();
    14751475    xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    14761476    yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     
    17011701
    17021702        TComPictureHash recon_digest;
    1703         Int numChar = calcMD5(*pic->getPicYuvRec(), recon_digest, pic->getSlice(0)->getBitDepths());
     1703        Int numChar = calcMD5(*pic->getPicYuvRec(), recon_digest, pic->getSlice(0)->getSPS()->getBitDepths());
    17041704        fprintf(fptr, "%8d%9d    MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), hashToString(recon_digest, numChar).c_str());
    17051705        fclose(fptr);
     
    17291729        strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerId ).c_str());
    17301730
    1731         const TComVPS *vps = m_apcTDecTop[layerId]->getParameterSetManager()->getActiveVPS();
    17321731        const TComSPS *sps = m_apcTDecTop[layerId]->getParameterSetManager()->getActiveSPS();
    1733         const BitDepths &bitDpeths = vps->getBitDepths(sps, layerId);
     1732        const BitDepths &bitDpeths = sps->getBitDepths();
    17341733        Int bitDepth[] = {bitDpeths.recon[CHANNEL_TYPE_LUMA], bitDpeths.recon[CHANNEL_TYPE_CHROMA]};
    17351734
     
    17461745        Int xScal = 1, yScal = 1;
    17471746 
    1748         UInt chromaFormatIdc = checkPic.getSlice(0)->getChromaFormatIdc();
     1747        UInt chromaFormatIdc = checkPic.getSlice(0)->getSPS()->getChromaFormatIdc();
    17491748        xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    17501749        yScal = TComSPS::getWinUnitY( chromaFormatIdc );
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1501 r1502  
    140140
    141141#if FORMATIDX_CHECK
    142     for( Int compareLayer = 0; compareLayer < layer; compareLayer++ )
     142    for(Int compareLayer = 0; compareLayer < layer; compareLayer++ )
    143143    {
    144144      if(m_apcLayerCfg[layer]->m_repFormatIdx == m_apcLayerCfg[compareLayer]->m_repFormatIdx && (
  • 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}
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1500 r1502  
    12251225#endif
    12261226
    1227 #if SCALABLE_REXT
    1228   const ChromaFormat chFmt = pcSlice->getChromaFormatIdc();
    1229 #else
    12301227  const ChromaFormat chFmt = sps->getChromaFormatIdc();
    1231 #endif
    12321228  const UInt numValidComp=getNumberValidComponents(chFmt);
    12331229  const Bool bChroma=(chFmt!=CHROMA_400);
     
    12411237    pcSlice->setDependentSliceSegmentFlag(false);
    12421238  }
    1243 #if SVC_EXTENSION
    1244   Int numCTUs = ((pcSlice->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((pcSlice->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight());
    1245 #else
    12461239  Int numCTUs = ((sps->getPicWidthInLumaSamples()+sps->getMaxCUWidth()-1)/sps->getMaxCUWidth())*((sps->getPicHeightInLumaSamples()+sps->getMaxCUHeight()-1)/sps->getMaxCUHeight());
    1247 #endif 
    12481240  UInt sliceSegmentAddress = 0;
    12491241  Int bitsSliceSegmentAddress = 0;
     
    18321824    pcSlice->setSliceQp (26 + pps->getPicInitQPMinus26() + iCode);
    18331825
    1834 #if SVC_EXTENSION
    1835     assert( pcSlice->getSliceQp() >= -pcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA) );
    1836 #else   
    18371826    assert( pcSlice->getSliceQp() >= -sps->getQpBDOffset(CHANNEL_TYPE_LUMA) );
    1838 #endif
    18391827    assert( pcSlice->getSliceQp() <=  51 );
    18401828
     
    23652353#endif
    23662354
    2367 #if SVC_EXTENSION
    2368   Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    2369 #else
    23702355  Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    2371 #endif
    23722356  const Int qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) -  qpBdOffsetY;
    23732357
     
    24292413{
    24302414        WPScalingParam *wp;
    2431 #if SCALABLE_REXT
    2432   const ChromaFormat    chFmt        = pcSlice->getChromaFormatIdc();
    2433 #else
    24342415  const ChromaFormat    chFmt        = sps->getChromaFormatIdc();
    2435 #endif
    24362416  const Int             numValidComp = Int(getNumberValidComponents(chFmt));
    24372417  const Bool            bChroma      = (chFmt!=CHROMA_400);
     
    24962476        wp[COMPONENT_Y].iWeight = (iDeltaWeight + (1<<wp[COMPONENT_Y].uiLog2WeightDenom));
    24972477        READ_SVLC( wp[COMPONENT_Y].iOffset, iNumRef==0?"luma_offset_l0[i]":"luma_offset_l1[i]" );
    2498 #if SVC_EXTENSION
    2499         Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;       
    2500 #else
    25012478        Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;
    2502 #endif
    25032479        assert( wp[0].iOffset >= -range );
    25042480        assert( wp[0].iOffset <   range );
     
    25132489        if ( wp[COMPONENT_Cb].bPresentFlag )
    25142490        {
    2515 #if SVC_EXTENSION
    2516           Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
    2517 #else
    25182491          Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
    2519 #endif
    25202492          for ( Int j=1 ; j<numValidComp ; j++ )
    25212493          {
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1483 r1502  
    219219  UInt uiBPelY   = uiTPelY + (maxCuHeight>>uiDepth) - 1;
    220220
    221 #if SVC_EXTENSION
    222   TComSlice * pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx());
    223 
    224   if( ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) )
    225 #else
    226221  if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) )
    227 #endif
    228222  {
    229223    m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
     
    252246      uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ];
    253247
    254 #if SVC_EXTENSION
    255       if ( !isLastCtuOfSliceSegment && ( uiLPelX < pcCU->getSlice()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getPicHeightInLumaSamples() ) )
    256 #else
    257248      if ( !isLastCtuOfSliceSegment && ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
    258 #endif
    259249      {
    260250        xDecodeCU( pcCU, uiIdx, uiDepth+1, isLastCtuOfSliceSegment );
     
    404394  UInt uiBPelY   = uiTPelY + (sps.getMaxCUHeight()>>uiDepth) - 1;
    405395
    406 #if SVC_EXTENSION
    407   if( ( uiRPelX >= pcSlice->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getPicHeightInLumaSamples() ) )
    408 #else
    409396  if( ( uiRPelX >= sps.getPicWidthInLumaSamples() ) || ( uiBPelY >= sps.getPicHeightInLumaSamples() ) )
    410 #endif
    411397  {
    412398    bBoundary = true;
     
    423409      uiTPelY = pCtu->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ];
    424410
    425 #if SVC_EXTENSION
    426       if( ( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) )
    427 #else
    428411      if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
    429 #endif
    430412      {
    431413        xDecompressCU(pCtu, uiIdx, uiNextDepth );
     
    501483  if  ( pcCU->getQtRootCbf( 0) )
    502484  {
    503 #if SVC_EXTENSION
    504     m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getBitDepths() );
    505 #else
    506485    m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ), pcCU->getSlice()->getSPS()->getBitDepths() );
    507 #endif
    508486  }
    509487  else
     
    647625#endif
    648626
    649 #if SVC_EXTENSION
    650   const Int clipbd = pcCU->getSlice()->getBitDepth(toChannelType(compID));
    651 #else
    652627  const Int clipbd = sps.getBitDepth(toChannelType(compID));
    653 #endif
    654628#if O0043_BEST_EFFORT_DECODING
    655629  const Int bitDepthDelta = sps.getStreamBitDepth(toChannelType(compID)) - clipbd;
     
    834808        Pel* piPicReco         = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiPartIdx);
    835809  const UInt uiPicStride       = pcCU->getPic()->getPicYuvRec()->getStride(compID);
    836 #if SVC_EXTENSION
    837   const UInt uiPcmLeftShiftBit = pcCU->getSlice()->getBitDepth(toChannelType(compID)) - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID));
    838 #else
    839810  const TComSPS &sps           = *(pcCU->getSlice()->getSPS());
    840811  const UInt uiPcmLeftShiftBit = sps.getBitDepth(toChannelType(compID)) - sps.getPCMBitDepth(toChannelType(compID));
    841 #endif
    842812
    843813  for(UInt uiY = 0; uiY < uiHeight; uiY++ )
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp

    r1482 r1502  
    239239      printf ("Warning: Got multiple decoded picture hash SEI messages. Using first.");
    240240    }
    241 #if SVC_EXTENSION
    242     calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getBitDepths(), m_numberOfChecksumErrorsDetected);
    243 #else
    244241    calcAndPrintHashStatus(*(pcPic->getPicYuvRec()), hash, pcSlice->getSPS()->getBitDepths(), m_numberOfChecksumErrorsDetected);
    245 #endif
    246242  }
    247243#if CONFORMANCE_BITSTREAM_MODE
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r1442 r1502  
    951951  {
    952952    UInt uiSign;
    953 #if SVC_EXTENSION
    954     Int qpBdOffsetY = pcCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    955 #else
    956953    Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    957 #endif
    958954    m_pcTDecBinIf->decodeBinEP(uiSign RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(STATS__CABAC_BITS__DELTA_QP_EP));
    959955    iDQp = uiDQp;
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp

    r1287 r1502  
    201201          aboveMergeAvail = pcPic->getSAOMergeAvailability(ctuRsAddr, ctuRsAddr-frameWidthInCtus);
    202202        }
    203 #if SVC_EXTENSION
    204         pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, pcSlice->getBitDepths());
    205 #else
    206203        pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, pcSlice->getSPS()->getBitDepths());
    207 #endif
    208204      }
    209205    }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1499 r1502  
    524524        // it is needed where the VPS is accessed through the slice
    525525        pBLPic->getSlice(0)->setVPS( vps );
     526        pBLPic->getPicSym()->inferSpsForNonHEVCBL();
     527        pBLPic->getSlice(0)->setSPS( &pBLPic->getPicSym()->getSPS() );
    526528      }
    527529    }
     
    596598      assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()         <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma());
    597599    }
     600
     601    updateSPS->inferSPS( m_layerId, vps );
    598602#endif //SVC_EXTENSION
    599603
     
    627631
    628632    // Initialise the various objects for the new set of settings
    629 #if SVC_EXTENSION
    630     m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );
    631 #else
    632633    m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );
    633 #endif
    634634    m_cLoopFilter.create( sps->getMaxTotalCUDepth() );
    635 #if SCALABLE_REXT
    636     m_cPrediction.initTempBuff(pSlice->getChromaFormatIdc());
    637 #else
    638635    m_cPrediction.initTempBuff(sps->getChromaFormatIdc());
    639 #endif
    640636
    641637
     
    692688
    693689    // Recursive structure
    694 #if SVC_EXTENSION
    695     m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() );
     690    m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
     691#if SVC_EXTENSION
    696692    m_cCuDecoder.init   ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId );
    697693#else
    698     m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
    699694    m_cCuDecoder.init   ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
    700695#endif
     
    13991394      if( pFile->good() )
    14001395      {
    1401         Bool is16bit  = pBLPic->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA) > 8 || pBLPic->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA) > 8;
     1396        Bool is16bit  = pBLPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) > 8 || pBLPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) > 8;
    14021397        UInt uiWidth  = pBLPic->getPicYuvRec()->getWidth(COMPONENT_Y);
    14031398        UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(COMPONENT_Y);
     
    17011696        if( pcSlice->getPPS()->getCGSFlag() && m_c3DAsymLUTPPS.isRefLayer( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc) ) )
    17021697        {
    1703           assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_LUMA) == m_c3DAsymLUTPPS.getInputBitDepthY() );
    1704           assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_CHROMA) == m_c3DAsymLUTPPS.getInputBitDepthC() );
    1705           assert( pcSlice->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthY() );
    1706           assert( pcSlice->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthC() );
     1698          assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) == m_c3DAsymLUTPPS.getInputBitDepthY() );
     1699          assert( pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) == m_c3DAsymLUTPPS.getInputBitDepthC() );
     1700          assert( pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthY() );
     1701          assert( pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) >= m_c3DAsymLUTPPS.getOutputBitDepthC() );
    17071702
    17081703          if( !m_pColorMappedPic )
     
    17211716          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    17221717          {
    1723             m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getBitDepth(CHANNEL_TYPE_CHROMA));
     1718            m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic( refLayerIdc )->getSlice( 0 )->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA));
    17241719          }
    17251720        }
     
    18961891        pcSlice->getSPS()->getMaxLog2TrDynamicRange(CHANNEL_TYPE_CHROMA)
    18971892    };
    1898 #if SVC_EXTENSION
    1899     m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getBitDepths());
    1900 #else
    19011893    m_cTrQuant.setFlatScalingList(maxLog2TrDynamicRange, pcSlice->getSPS()->getBitDepths());
    1902 #endif
    19031894    m_cTrQuant.setUseScalingList(false);
    19041895  }
     
    24592450    {
    24602451      m_pColorMappedPic = new TComPicYuv;
    2461       m_pColorMappedPic->create( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL );
     2452      m_pColorMappedPic->create( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL );
    24622453    }
    24632454  }
     
    26142605    TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec();
    26152606
    2616     const Int bitDepthLuma = vps.getBitDepth(CHANNEL_TYPE_LUMA, &sps, m_layerId);
    2617     const Int bitDepthChroma = vps.getBitDepth(CHANNEL_TYPE_CHROMA, &sps, m_layerId);
    2618     const Int refBitDepthLuma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA);
    2619     const Int refBitDepthChroma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA);
     2607    const Int bitDepthLuma = sps.getBitDepth(CHANNEL_TYPE_LUMA);
     2608    const Int bitDepthChroma = sps.getBitDepth(CHANNEL_TYPE_CHROMA);
     2609    const Int refBitDepthLuma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     2610    const Int refBitDepthChroma = (*(pcTDecTopBase->getListPic()->begin()))->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
    26202611   
    26212612    Bool sameBitDepths = ( bitDepthLuma == refBitDepthLuma ) && ( bitDepthChroma == refBitDepthChroma );
    26222613
    2623     if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == vps.getPicWidthInLumaSamples(&sps, m_layerId) && pcPicYuvRecBase->getHeight(COMPONENT_Y) == vps.getPicHeightInLumaSamples(&sps, m_layerId) && equalOffsets && zeroPhase )
     2614    if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == sps.getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == sps.getPicHeightInLumaSamples() && equalOffsets && zeroPhase )
    26242615    {
    26252616      pic->setEqualPictureSizeAndOffsetFlag( i, true );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1497 r1502  
    16321632  Int iDQp  = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx );
    16331633
    1634 #if SVC_EXTENSION
    1635   Int qpBdOffsetY =  pcCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    1636 #else
    16371634  Int qpBdOffsetY =  pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    1638 #endif
    16391635  iDQp = (iDQp + 78 + qpBdOffsetY + (qpBdOffsetY/2)) % (52 + qpBdOffsetY) - 26 - (qpBdOffsetY/2);
    16401636
     
    17331729              WRITE_SVLC( iDeltaWeight, iNumRef==0?"delta_chroma_weight_l0[i]":"delta_chroma_weight_l1[i]" );
    17341730
    1735 #if SVC_EXTENSION
    1736               Int range=pcSlice->getSPS()->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
    1737 #else
    17381731              Int range=pcSlice->getSPS()->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
    1739 #endif
    17401732              Int pred = ( range - ( ( range*wp[j].iWeight)>>(wp[j].uiLog2WeightDenom) ) );
    17411733              Int iDeltaChroma = (wp[j].iOffset - pred);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp

    r1483 r1502  
    397397  {
    398398    Int idQP = m_pcEncCfg->getMaxDeltaQP();
    399 #if SVC_EXTENSION
    400     iMinQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
    401     iMaxQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    402 #else
    403399    iMinQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
    404400    iMaxQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    405 #endif
    406401  }
    407402  else
     
    432427
    433428  TComSlice * pcSlice = rpcTempCU->getPic()->getSlice(rpcTempCU->getPic()->getCurrSliceIdx());
    434 #if SVC_EXTENSION
    435   const Bool bBoundary = !( uiRPelX < rpcBestCU->getSlice()->getPicWidthInLumaSamples() && uiBPelY < rpcBestCU->getSlice()->getPicHeightInLumaSamples() );
    436 #else
    437429  const Bool bBoundary = !( uiRPelX < sps.getPicWidthInLumaSamples() && uiBPelY < sps.getPicHeightInLumaSamples() );
    438 #endif
    439430
    440431  if ( !bBoundary )
     
    735726          && rpcTempCU->getWidth(0) >= (1<<sps.getPCMLog2MinSize()) )
    736727        {
    737 #if SVC_EXTENSION
    738           UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), pcPic->getSlice(0)->getBitDepths().recon);
    739 #else
    740728          UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), sps.getBitDepths().recon);
    741 #endif
    742729          UInt uiBestBits = rpcBestCU->getTotalBits();
    743730          if((uiBestBits > uiRawBits) || (rpcBestCU->getTotalCost() > m_pcRdCost->calcRdCost(uiRawBits, 0)))
     
    794781  {
    795782    Int idQP = m_pcEncCfg->getMaxDeltaQP();
    796 #if SVC_EXTENSION
    797     iMinQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
    798     iMaxQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    799 #else
    800783    iMinQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
    801784    iMaxQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    802 #endif   
    803785  }
    804786  else if( uiDepth < pps.getMaxCuDQPDepth() )
     
    846828        pcSubTempPartCU->initSubCU( rpcTempCU, uiPartUnitIdx, uhNextDepth, iQP );           // clear sub partition datas or init.
    847829
    848 #if SVC_EXTENSION
    849         if( ( pcSubBestPartCU->getCUPelX() < pcSlice->getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < pcSlice->getPicHeightInLumaSamples() ) )
    850 #else
    851830        if( ( pcSubBestPartCU->getCUPelX() < sps.getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < sps.getPicHeightInLumaSamples() ) )
    852 #endif
    853831        {
    854832          if ( 0 == uiPartUnitIdx) //initialize RD with previous depth buffer
     
    10261004    iQpOffset = Int(floor( dQpOffset + 0.49999 ));
    10271005  }
    1028 #if SVC_EXTENSION
    1029   return Clip3(-pcCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQp+iQpOffset );
    1030 #else
    10311006  return Clip3(-pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQp+iQpOffset );
    1032 #endif
    10331007}
    10341008
     
    10621036#endif
    10631037
    1064 #if SVC_EXTENSION
    1065   if( ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) )
    1066 #else
    10671038  if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) )
    1068 #endif
    10691039  {
    10701040    m_pcEntropyCoder->encodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
     
    10931063      uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
    10941064
    1095 #if SVC_EXTENSION
    1096       if( ( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) )
    1097 #else
    10981065      if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
    1099 #endif
    11001066      {
    11011067        xEncodeCU( pcCU, uiAbsPartIdx, uiDepth+1 );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1475 r1502  
    184184  {
    185185    UInt prevLayerIdx = 0;
    186     UInt prevLayerId  = 0;
    187 
    188     if (pcTEncTop->getNumActiveRefLayers() > 0)
     186
     187    if( pcTEncTop->getNumActiveRefLayers() > 0 )
    189188    {
    190189      prevLayerIdx = pcTEncTop->getPredLayerIdx( pcTEncTop->getNumActiveRefLayers() - 1);
    191       prevLayerId  = pcTEncTop->getRefLayerId(prevLayerIdx);     
    192     }
    193 
    194     const TComVPS *vps = pcTEncTop->getVPS();
     190    }
     191
    195192    const TComSPS *sps = pcTEncTop->getSPS();
    196193
    197     const Int bitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, sps, pcTEncTop->getLayerId());
    198     const Int bitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, sps, pcTEncTop->getLayerId());
    199     const Int prevBitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId);
    200     const Int prevBitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId);
     194    const Int bitDepthLuma = sps->getBitDepth(CHANNEL_TYPE_LUMA);
     195    const Int bitDepthChroma = sps->getBitDepth(CHANNEL_TYPE_CHROMA);
     196    const Int prevBitDepthLuma = m_ppcTEncTop[prevLayerIdx]->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     197    const Int prevBitDepthChroma = m_ppcTEncTop[prevLayerIdx]->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
    201198
    202199    m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma , m_pcCfg->getCGSMaxYPartNumLog2() );
    203     m_Enc3DAsymLUTPPS.create( m_pcCfg->getCGSMaxOctantDepth(), prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma , m_pcCfg->getCGSMaxYPartNumLog2() );
     200    m_Enc3DAsymLUTPPS.create( m_pcCfg->getCGSMaxOctantDepth(), prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma, m_pcCfg->getCGSMaxYPartNumLog2() );
    204201
    205202    if(!m_pColorMappedPic)
     
    10711068cabac_zero_word_padding(TComSlice *const pcSlice, TComPic *const pcPic, const std::size_t binCountsInNalUnits, const std::size_t numBytesInVclNalUnits, std::ostringstream &nalUnitData, const Bool cabacZeroWordPaddingEnabled)
    10721069{
    1073 #if !SVC_EXTENSION
    10741070  const TComSPS &sps=*(pcSlice->getSPS());
    1075 #endif
    10761071  const Int log2subWidthCxsubHeightC = (pcPic->getComponentScaleX(COMPONENT_Cb)+pcPic->getComponentScaleY(COMPONENT_Cb));
    10771072  const Int minCuWidth  = pcPic->getMinCUWidth();
    10781073  const Int minCuHeight = pcPic->getMinCUHeight();
    1079 #if SVC_EXTENSION
    1080   const Int paddedWidth = ((pcSlice->getPicWidthInLumaSamples()  + minCuWidth  - 1) / minCuWidth) * minCuWidth;
    1081   const Int paddedHeight= ((pcSlice->getPicHeightInLumaSamples() + minCuHeight - 1) / minCuHeight) * minCuHeight;
    1082   const Int rawBits = paddedWidth * paddedHeight *
    1083                          (pcSlice->getBitDepth(CHANNEL_TYPE_LUMA) + 2*(pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA)>>log2subWidthCxsubHeightC));
    1084 #else
    10851074  const Int paddedWidth = ((sps.getPicWidthInLumaSamples()  + minCuWidth  - 1) / minCuWidth) * minCuWidth;
    10861075  const Int paddedHeight= ((sps.getPicHeightInLumaSamples() + minCuHeight - 1) / minCuHeight) * minCuHeight;
    10871076  const Int rawBits = paddedWidth * paddedHeight *
    10881077                         (sps.getBitDepth(CHANNEL_TYPE_LUMA) + 2*(sps.getBitDepth(CHANNEL_TYPE_CHROMA)>>log2subWidthCxsubHeightC));
    1089 #endif
    10901078  const std::size_t threshold = (32/3)*numBytesInVclNalUnits + (rawBits/32);
    10911079  if (binCountsInNalUnits >= threshold)
     
    16671655          {
    16681656            //downsampling
    1669             xDownScalePic(pcPic->getPicYuvOrg(), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg(), pcSlice->getBitDepths(), pcPic->getPosScalingFactor(refLayerIdc, 0));
     1657            xDownScalePic(pcPic->getPicYuvOrg(), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg(), pcSlice->getSPS()->getBitDepths(), pcPic->getPosScalingFactor(refLayerIdc, 0));
    16701658           
    16711659            m_Enc3DAsymLUTPPS.setDsOrigPic(pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg());
     
    16981686          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
    16991687          {
    1700             m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA) );
     1688            m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) );
    17011689          }
    17021690        }
     
    23832371      }
    23842372
    2385 #if SVC_EXTENSION
    2386       sliceQP = Clip3( -pcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, sliceQP );
    2387 #else
    23882373      sliceQP = Clip3( -pcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, sliceQP );
    2389 #endif
    23902374      m_pcRateCtrl->getRCPic()->setPicEstQP( sliceQP );
    23912375
     
    27002684    {
    27012685      SEIDecodedPictureHash *decodedPictureHashSei = new SEIDecodedPictureHash();
    2702 #if SVC_EXTENSION
    2703       m_seiEncoder.initDecodedPictureHashSEI(decodedPictureHashSei, pcPic, digestStr, pcSlice->getBitDepths());
    2704 #else
    27052686      m_seiEncoder.initDecodedPictureHashSEI(decodedPictureHashSei, pcPic, digestStr, pcSlice->getSPS()->getBitDepths());
    2706 #endif
    27072687      trailingSeiMessages.push_back(decodedPictureHashSei);
    27082688    }
     
    28822862  if (!bCalcDist)
    28832863  {
    2884 #if SVC_EXTENSION
    2885     ruiDist = xFindDistortionFrame(pcPic->getPicYuvOrg(), pcPic->getPicYuvRec(), pcPic->getSlice(0)->getBitDepths());
    2886 #else
    28872864    ruiDist = xFindDistortionFrame(pcPic->getPicYuvOrg(), pcPic->getPicYuvRec(), pcPic->getPicSym()->getSPS().getBitDepths());
    2888 #endif
    28892865  }
    28902866}
     
    30983074      pRec += iRecStride;
    30993075    }
    3100 #if SVC_EXTENSION
    3101     const Int maxval = 255 << (pcPic->getSlice(0)->getBitDepth(toChannelType(ch)) - 8);
    3102 #else
    31033076    const Int maxval = 255 << (pcPic->getPicSym()->getSPS().getBitDepth(toChannelType(ch)) - 8);
    3104 #endif
    31053077    const Double fRefValue = (Double) maxval * maxval * iSize;
    31063078    dPSNR[ch]         = ( uiSSDtemp ? 10.0 * log10( fRefValue / (Double)uiSSDtemp ) : 999.99 );
     
    32543226                                           const InputColourSpaceConversion conversion, const Bool printFrameMSE )
    32553227{
    3256 #if !SVC_EXTENSION
    32573228  const TComSPS &sps=pcPicOrgFirstField->getPicSym()->getSPS();
    3258 #endif
    32593229  Double  dPSNR[MAX_NUM_COMPONENT];
    32603230  TComPic    *apcPicOrgFields[2]={pcPicOrgFirstField, pcPicOrgSecondField};
     
    33173287      }
    33183288    }
    3319 #if SVC_EXTENSION
    3320     const Int maxval = 255 << (pcPicOrgFirstField->getSlice(0)->getBitDepth(toChannelType(ch)) - 8);
    3321 #else
    33223289    const Int maxval = 255 << (sps.getBitDepth(toChannelType(ch)) - 8);
    3323 #endif
    33243290    const Double fRefValue = (Double) maxval * maxval * iSize*2;
    33253291    dPSNR[ch]         = ( uiSSDtemp ? 10.0 * log10( fRefValue / (Double)uiSSDtemp ) : 999.99 );
     
    36013567
    36023568  Int qp = pcPic->getSlice(0)->getSliceQp();
    3603 #if SVC_EXTENSION
    3604   const Int bitDepthLuma=pcPic->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA);
    3605 #else
    36063569  const Int bitDepthLuma=pcPic->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
    3607 #endif
    36083570  Int bitdepthScale = 1 << (bitDepthLuma-8);
    36093571  Int beta = TComLoopFilter::getBeta( qp ) * bitdepthScale;
     
    40964058}
    40974059
    4098 Void TEncGOP::xDownScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, BitDepths& bitDepth, const Int posScalingFactorX)
     4060Void TEncGOP::xDownScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, const BitDepths& bitDepth, const Int posScalingFactorX)
    40994061{
    41004062  pcYuvSrc->setBorderExtension(false);
     
    41584120#endif
    41594121#endif
    4160 Void TEncGOP::xFilterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height, Int width, BitDepths& bitDepth, ComponentID comp )
     4122Void TEncGOP::xFilterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height, Int width, const BitDepths& bitDepth, ComponentID comp )
    41614123{
    41624124  Int height2, width2;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h

    r1460 r1502  
    277277#if CGS_3D_ASYMLUT
    278278  Void xDetermine3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg , Bool bSignalPPS );
    279   Void xDownScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, BitDepths& bitDepth, const Int posScalingFactorX);
     279  Void xDownScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, const BitDepths& bitDepth, const Int posScalingFactorX);
    280280  Void xDownScaleComponent2x2( const Pel* pSrc, Pel* pDest, const Int iSrcStride, const Int iDestStride, const Int iSrcWidth, const Int iSrcHeight, const Int inputBitDepth, const Int outputBitDepth );
    281281  inline Short xClip( Short x, Int bitdepth );
    282282  Void xInitDs( const Int iWidth, const Int iHeight, const Bool allIntra, const Int posScalingFactorX);
    283   Void xFilterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height, Int width, BitDepths& bitDepth, ComponentID comp );
     283  Void xFilterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height, Int width, const BitDepths& bitDepth, ComponentID comp );
    284284
    285285  Int  xCreate2DArray(Int ***array2D, Int dim0, Int dim1, Int iPadY, Int iPadX);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp

    r1290 r1502  
    128128{
    129129  TComPic::create( vps, sps, pps, bIsVirtual, layerId );
    130 
    131   const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
    132   const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    133130#else
    134131Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual )
    135132{
    136133  TComPic::create( sps, pps, bIsVirtual );
     134#endif
    137135  const Int  iWidth      = sps.getPicWidthInLumaSamples();
    138136  const Int  iHeight     = sps.getPicHeightInLumaSamples();
    139 #endif
    140 
    141137  const UInt uiMaxWidth  = sps.getMaxCUWidth();
    142138  const UInt uiMaxHeight = sps.getMaxCUHeight();
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r1442 r1502  
    320320      Pel* orgBlk     = orgYuv->getAddr(component) + ((yPos >> componentScaleY) * orgStride) + (xPos >> componentScaleX);
    321321
    322 #if SVC_EXTENSION
    323       getBlkStats(component, pPic->getSlice(0)->getBitDepth(toChannelType(component)), blkStats[ctuRsAddr][component]
    324 #else
    325322      getBlkStats(component, pPic->getPicSym()->getSPS().getBitDepth(toChannelType(component)), blkStats[ctuRsAddr][component]
    326 #endif
    327323                , srcBlk, orgBlk, srcStride, orgStride, (width  >> componentScaleX), (height >> componentScaleY)
    328324                , isLeftAvail,  isRightAvail, isAboveAvail, isBelowAvail, isAboveLeftAvail, isAboveRightAvail
     
    813809      case SAO_MODE_NEW:
    814810        {
    815 #if SVC_EXTENSION
    816           deriveModeNewRDO(pic->getSlice(0)->getBitDepths(), ctuRsAddr, mergeList, sliceEnabled, blkStats, modeParam, modeCost, m_pppcRDSbacCoder, SAO_CABACSTATE_BLK_CUR);
    817 #else
    818811          deriveModeNewRDO(pic->getPicSym()->getSPS().getBitDepths(), ctuRsAddr, mergeList, sliceEnabled, blkStats, modeParam, modeCost, m_pppcRDSbacCoder, SAO_CABACSTATE_BLK_CUR);
    819 #endif
    820 
    821812        }
    822813        break;
    823814      case SAO_MODE_MERGE:
    824815        {
    825 #if SVC_EXTENSION
    826           deriveModeMergeRDO(pic->getSlice(0)->getBitDepths(), ctuRsAddr, mergeList, sliceEnabled, blkStats , modeParam, modeCost, m_pppcRDSbacCoder, SAO_CABACSTATE_BLK_CUR);
    827 #else
    828816          deriveModeMergeRDO(pic->getPicSym()->getSPS().getBitDepths(), ctuRsAddr, mergeList, sliceEnabled, blkStats , modeParam, modeCost, m_pppcRDSbacCoder, SAO_CABACSTATE_BLK_CUR);
    829 #endif
    830817        }
    831818        break;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp

    r1316 r1502  
    883883Void TEncSbac::codeDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx )
    884884{
    885   Int iDQp  = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx );
    886  
    887 #if SVC_EXTENSION 
    888   Int qpBdOffsetY =  pcCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    889 #else
     885  Int iDQp  = pcCU->getQP( uiAbsPartIdx ) - pcCU->getRefQP( uiAbsPartIdx ); 
    890886  Int qpBdOffsetY =  pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    891 #endif
    892887  iDQp = (iDQp + 78 + qpBdOffsetY + (qpBdOffsetY/2)) % (52 + qpBdOffsetY) - 26 - (qpBdOffsetY/2);
    893888
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1487 r1502  
    11291129  const ChromaFormat   chFmt            = pcOrgYuv->getChromaFormat();
    11301130  const ChannelType    chType           = toChannelType(compID);
    1131 #if SVC_EXTENSION
    1132   const Int            bitDepth         = pcCU->getSlice()->getBitDepth(chType);
    1133 #else
    11341131  const Int            bitDepth         = sps.getBitDepth(chType);
    1135 #endif
    1136 
    11371132  const UInt           uiWidth          = rect.width;
    11381133  const UInt           uiHeight         = rect.height;
     
    22942289      DistParam distParam;
    22952290      const Bool bUseHadamard=pcCU->getCUTransquantBypass(0) == 0;
    2296 #if SVC_EXTENSION
    2297       m_pcRdCost->setDistParam(distParam, pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA), piOrg, uiStride, piPred, uiStride, puRect.width, puRect.height, bUseHadamard);
    2298 #else
    22992291      m_pcRdCost->setDistParam(distParam, sps.getBitDepth(CHANNEL_TYPE_LUMA), piOrg, uiStride, piPred, uiStride, puRect.width, puRect.height, bUseHadamard);
    2300 #endif
    23012292      distParam.bApplyWeight = false;
    23022293      for( Int modeIdx = 0; modeIdx < numModesAvailable; modeIdx++ )
     
    27742765  const UInt uiReconStride   = pcCU->getPic()->getPicYuvRec()->getStride(compID);
    27752766  const UInt uiPCMBitDepth   = pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID));
    2776 #if SVC_EXTENSION
    2777   const Int  channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID));
    2778 #else
    27792767  const Int  channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    2780 #endif
    27812768  Pel* pRecoPic = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiAbsPartIdx);
    27822769
     
    28662853
    28672854
    2868 #if SVC_EXTENSION
    2869   m_pcRdCost->setDistParam( cDistParam, pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA),
    2870 #else
    28712855  m_pcRdCost->setDistParam( cDistParam, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA),
    2872 #endif
    28732856                            pcYuvOrg->getAddr( COMPONENT_Y, uiAbsPartIdx ), pcYuvOrg->getStride(COMPONENT_Y),
    28742857                            m_tmpYuvPred .getAddr( COMPONENT_Y, uiAbsPartIdx ), m_tmpYuvPred.getStride(COMPONENT_Y),
     
    38133796#endif
    38143797  {
    3815 #if SVC_EXTENSION
    3816     xPredInterBlk( COMPONENT_Y, pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, true, pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA) );
    3817 #else
    38183798    xPredInterBlk( COMPONENT_Y, pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, true, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );
    3819 #endif
    38203799  }
    38213800  else
    38223801  {
    3823 #if SVC_EXTENSION
    3824     xPredInterBlk( COMPONENT_Y, pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false, pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA) );
    3825 #else
    38263802    xPredInterBlk( COMPONENT_Y, pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );
    3827 #endif
    38283803  }
    38293804
     
    38403815  // calc distortion
    38413816
    3842 #if SVC_EXTENSION
    3843   uiCost = m_pcRdCost->getDistPart( pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA), pcTemplateCand->getAddr(COMPONENT_Y, uiPartAddr), pcTemplateCand->getStride(COMPONENT_Y), pcOrgYuv->getAddr(COMPONENT_Y, uiPartAddr), pcOrgYuv->getStride(COMPONENT_Y), iSizeX, iSizeY, COMPONENT_Y, DF_SAD );
    3844 #else
    38453817  uiCost = m_pcRdCost->getDistPart( pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA), pcTemplateCand->getAddr(COMPONENT_Y, uiPartAddr), pcTemplateCand->getStride(COMPONENT_Y), pcOrgYuv->getAddr(COMPONENT_Y, uiPartAddr), pcOrgYuv->getStride(COMPONENT_Y), iSizeX, iSizeY, COMPONENT_Y, DF_SAD );
    3846 #endif
    38473818  uiCost = (UInt) m_pcRdCost->calcRdCost( m_auiMVPIdxCost[iMVPIdx][iMVPNum], uiCost, DF_SAD );
    38483819  return uiCost;
     
    38913862                             iRoiHeight,
    38923863                             pcYuv->getStride(COMPONENT_Y),
    3893 #if SVC_EXTENSION
    3894                              pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA) );
    3895 #else
    38963864                             pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );
    3897 #endif
    38983865
    38993866  Pel*        piRefY      = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPicYuvRec()->getAddr( COMPONENT_Y, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu() + uiPartAddr );
     
    46334600  const UInt cuHeightPixels     = pcCU->getHeight( 0 );
    46344601  const Int  numValidComponents = pcCU->getPic()->getNumberValidComponents();
    4635 #if !SVC_EXTENSION
    46364602  const TComSPS &sps=*(pcCU->getSlice()->getSPS());
    4637 #endif
    46384603
    46394604  // The pcCU is not marked as skip-mode at this point, and its m_pcTrCoeff, m_pcArlCoeff, m_puhCbf, m_puhTrIdx will all be 0.
     
    46544619      const UInt csx=pcYuvOrg->getComponentScaleX(compID);
    46554620      const UInt csy=pcYuvOrg->getComponentScaleY(compID);
    4656 #if SVC_EXTENSION
    4657       distortion += m_pcRdCost->getDistPart( pcCU->getSlice()->getBitDepth(toChannelType(compID)), pcYuvRec->getAddr(compID), pcYuvRec->getStride(compID), pcYuvOrg->getAddr(compID),
    4658 #else
    46594621      distortion += m_pcRdCost->getDistPart( sps.getBitDepth(toChannelType(compID)), pcYuvRec->getAddr(compID), pcYuvRec->getStride(compID), pcYuvOrg->getAddr(compID),
    4660 #endif
    46614622                                               pcYuvOrg->getStride(compID), cuWidthPixels >> csx, cuHeightPixels >> csy, compID);
    46624623    }
     
    47584719  m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_TEMP_BEST ] );
    47594720
    4760 #if SVC_EXTENSION
    4761   pcYuvRec->addClip ( pcYuvPred, pcYuvResiBest, 0, cuWidthPixels, pcCU->getSlice()->getBitDepths() );
    4762 #else
    47634721  pcYuvRec->addClip ( pcYuvPred, pcYuvResiBest, 0, cuWidthPixels, sps.getBitDepths() );
    4764 #endif
    47654722
    47664723  // update with clipped distortion and cost (previously unclipped reconstruction values were used)
     
    47704727  {
    47714728    const ComponentID compID=ComponentID(comp);
    4772 #if SVC_EXTENSION
    4773     finalDistortion += m_pcRdCost->getDistPart( pcCU->getSlice()->getBitDepth(toChannelType(compID)), pcYuvRec->getAddr(compID ), pcYuvRec->getStride(compID ), pcYuvOrg->getAddr(compID ), pcYuvOrg->getStride(compID), cuWidthPixels >> pcYuvOrg->getComponentScaleX(compID), cuHeightPixels >> pcYuvOrg->getComponentScaleY(compID), compID);
    4774 #else
    47754729    finalDistortion += m_pcRdCost->getDistPart( sps.getBitDepth(toChannelType(compID)), pcYuvRec->getAddr(compID ), pcYuvRec->getStride(compID ), pcYuvOrg->getAddr(compID ), pcYuvOrg->getStride(compID), cuWidthPixels >> pcYuvOrg->getComponentScaleX(compID), cuHeightPixels >> pcYuvOrg->getComponentScaleY(compID), compID);
    4776 #endif
    47774730  }
    47784731
     
    48644817      checkTransformSkip[i]=false;
    48654818      const ComponentID compID=ComponentID(i);
    4866 #if SVC_EXTENSION
    4867       const Int channelBitDepth=pcCU->getSlice()->getBitDepth(toChannelType(compID));
    4868 #else
    48694819      const Int channelBitDepth=pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID));
    4870 #endif
    48714820      pcCoeffCurr[compID]    = m_ppcQTTempCoeff[compID][uiQTTempAccessLayer] + rTu.getCoefficientOffset(compID);
    48724821#if ADAPTIVE_QP_SELECTION
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r1474 r1502  
    173173
    174174  // store lambda
    175 #if SVC_EXTENSION
    176   m_pcRdCost ->setLambda( dLambda, slice->getBitDepths() );
    177 #else
    178175  m_pcRdCost ->setLambda( dLambda, slice->getSPS()->getBitDepths() );
    179 #endif
    180176
    181177  // for RDO
     
    193189    {
    194190      dLambdas[0] = dLambda * 1.1;
    195       m_pcRdCost->setLambda( dLambdas[0], slice->getBitDepths() );
     191      m_pcRdCost->setLambda( dLambdas[0], slice->getSPS()->getBitDepths() );
    196192
    197193      m_pcRdCost->setDistortionWeight(compID, tmpWeight * 1.15);
     
    337333  if(eSliceType!=I_SLICE)
    338334  {
    339 #if SVC_EXTENSION
    340     if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA) ) && (rpcSlice->getPPS()->getTransquantBypassEnableFlag())))
    341 #else
    342335    if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA) ) && (rpcSlice->getPPS()->getTransquantBypassEnableFlag())))
    343 #endif
    344336    {
    345337      dQP += m_pcCfg->getGOPEntry(iGOPid).m_QPOffset;
     
    378370
    379371#if FULL_NBIT
    380 #if SVC_EXTENSION
    381     Int    bitdepth_luma_qp_scale = 6 * (rpcSlice->getBitDepth(CHANNEL_TYPE_LUMA) - 8);
    382 #else
    383372    Int    bitdepth_luma_qp_scale = 6 * (rpcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) - 8);
    384 #endif
    385373#else
    386374    Int    bitdepth_luma_qp_scale = 0;
     
    423411    }
    424412
    425 #if SVC_EXTENSION
    426     iQP = max( -rpcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) );
    427 #else
    428413    iQP = max( -rpcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) );
    429 #endif
    430414
    431415    m_pdRdPicLambda[iDQpIdx] = dLambda;
     
    489473  {
    490474    dQP = xGetQPValueAccordingToLambda( dLambda );
    491 #if SVC_EXTENSION
    492     iQP = max( -rpcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) );
    493 #else
    494475    iQP = max( -rpcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), min( MAX_QP, (Int) floor( dQP + 0.5 ) ) );
    495 #endif
    496476  }
    497477
     
    669649  Double dFrameLambda;
    670650#if FULL_NBIT
    671 #if SVC_EXTENSION
    672   Int    SHIFT_QP = 12 + 6 * (pcSlice->getBitDepth(CHANNEL_TYPE_LUMA) - 8);
    673 #else
    674651  Int    SHIFT_QP = 12 + 6 * (pcSlice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) - 8);
    675 #endif
    676652#else
    677653  Int    SHIFT_QP = 12;
     
    732708  TComSlice * const pcSlice           = pcPic->getSlice(getSliceIdx());
    733709  const TComSPS    &sps               = *(pcSlice->getSPS());
    734 #if SVC_EXTENSION
    735   const Int         shift             = pcSlice->getBitDepth(CHANNEL_TYPE_LUMA)-8;
    736 #else
    737710  const Int         shift             = sps.getBitDepth(CHANNEL_TYPE_LUMA)-8;
    738 #endif
    739711  const Int         offset            = (shift>0)?(1<<(shift-1)):0;
    740712
     
    752724    pCtu->initCtu( pcPic, ctuRsAddr );
    753725
    754 #if SVC_EXTENSION
    755     Int height  = min( sps.getMaxCUHeight(),pcSlice->getPicHeightInLumaSamples() - ctuRsAddr / pcPic->getFrameWidthInCtus() * sps.getMaxCUHeight() );
    756     Int width   = min( sps.getMaxCUWidth(),pcSlice->getPicWidthInLumaSamples() - ctuRsAddr % pcPic->getFrameWidthInCtus() * sps.getMaxCUWidth() );
    757 #else
    758726    Int height  = min( sps.getMaxCUHeight(),sps.getPicHeightInLumaSamples() - ctuRsAddr / pcPic->getFrameWidthInCtus() * sps.getMaxCUHeight() );
    759727    Int width   = min( sps.getMaxCUWidth(), sps.getPicWidthInLumaSamples()  - ctuRsAddr % pcPic->getFrameWidthInCtus() * sps.getMaxCUWidth() );
    760 #endif
    761728
    762729    Int iSumHad = m_pcCuEncoder->updateCtuDataISlice(pCtu, width, height);
     
    938905        }
    939906
    940 #if SVC_EXTENSION
    941         estQP     = Clip3( -pcSlice->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, estQP );
    942 
    943         m_pcRdCost->setLambda(estLambda, pcSlice->getBitDepths());
    944 #else
    945907        estQP     = Clip3( -pcSlice->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, estQP );
    946908
    947909        m_pcRdCost->setLambda(estLambda, pcSlice->getSPS()->getBitDepths());
    948 #endif       
    949910
    950911#if RDOQ_CHROMA_LAMBDA
     
    10401001        actualQP = pCtu->getQP( 0 );
    10411002      }
    1042 #if SVC_EXTENSION
    1043       m_pcRdCost->setLambda(oldLambda, pcSlice->getBitDepths());
    1044 #else
    10451003      m_pcRdCost->setLambda(oldLambda, pcSlice->getSPS()->getBitDepths());
    1046 #endif
    10471004      m_pcRateCtrl->getRCPic()->updateAfterCTU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda,
    10481005                                                pCtu->getSlice()->getSliceType() == I_SLICE ? 0 : m_pcCfg->getLCULevelRC() );
     
    12011158        }
    12021159
    1203 #if SVC_EXTENSION
    1204         m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, pcPic->getPicSym()->getSlice(0)->getBitDepths(), sliceEnabled, leftMergeAvail, aboveMergeAvail);
    1205 #else
    12061160        m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, pcPic->getPicSym()->getSPS().getBitDepths(), sliceEnabled, leftMergeAvail, aboveMergeAvail);
    1207 #endif
    12081161      }
    12091162    }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1459 r1502  
    288288  if(getUseScalingListId() == SCALING_LIST_OFF)
    289289  {
    290 #if SVC_EXTENSION
    291     getTrQuant()->setFlatScalingList( maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId) );
    292 #else
    293290    getTrQuant()->setFlatScalingList(maxLog2TrDynamicRange, m_cSPS.getBitDepths());
    294 #endif
    295291    getTrQuant()->setUseScalingList(false);
    296292    m_cSPS.setScalingListPresentFlag(false);
     
    311307
    312308      // infer the scaling list from the reference layer
    313       getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId) );
     309      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getBitDepths() );
    314310    }
    315311    else
     
    320316    m_cPPS.setScalingListPresentFlag(false);
    321317
    322 #if SVC_EXTENSION
    323     getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId));
    324 #else
    325318    getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), maxLog2TrDynamicRange, m_cSPS.getBitDepths());
    326 #endif
    327319#if SVC_EXTENSION
    328320    }
     
    344336
    345337      // infer the scaling list from the reference layer
    346       getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_cVPS.getBitDepths(&m_cSPS, m_layerId) );
     338      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), maxLog2TrDynamicRange, m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getBitDepths() );
    347339    }
    348340    else
     
    731723          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
    732724
    733           UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i);
    734 
    735           const Int bitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, &m_cSPS, m_layerId);
    736           const Int bitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, &m_cSPS, m_layerId);
    737           const Int refBitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, pcEncTopBase->getSPS(), refLayerId);
    738           const Int refBitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, pcEncTopBase->getSPS(), refLayerId);
     725          const Int bitDepthLuma = m_cSPS.getBitDepth(CHANNEL_TYPE_LUMA);
     726          const Int bitDepthChroma = m_cSPS.getBitDepth(CHANNEL_TYPE_CHROMA);
     727          const Int refBitDepthLuma = pcEncTopBase->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     728          const Int refBitDepthChroma = pcEncTopBase->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA);
    739729
    740730          Bool sameBitDepths = ( bitDepthLuma == refBitDepthLuma ) && ( bitDepthChroma == refBitDepthChroma );
     
    781771          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
    782772
    783           UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i);
    784 
    785           const Int bitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, &m_cSPS, m_layerId);
    786           const Int bitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, &m_cSPS, m_layerId);
    787           const Int refBitDepthLuma = m_cVPS.getBitDepth(CHANNEL_TYPE_LUMA, pcEncTopBase->getSPS(), refLayerId);
    788           const Int refBitDepthChroma = m_cVPS.getBitDepth(CHANNEL_TYPE_CHROMA, pcEncTopBase->getSPS(), refLayerId);
     773          const Int bitDepthLuma = m_cSPS.getBitDepth(CHANNEL_TYPE_LUMA);
     774          const Int bitDepthChroma = m_cSPS.getBitDepth(CHANNEL_TYPE_CHROMA);
     775          const Int refBitDepthLuma = m_cSPS.getBitDepth(CHANNEL_TYPE_LUMA);
     776          const Int refBitDepthChroma = m_cSPS.getBitDepth(CHANNEL_TYPE_CHROMA);
    789777
    790778          Bool sameBitDepths = ( bitDepthLuma == refBitDepthLuma ) && ( bitDepthChroma == refBitDepthChroma );
     
    10341022  m_cSPS.getSpsRangeExtension().setPersistentRiceAdaptationEnabledFlag(m_persistentRiceAdaptationEnabledFlag);
    10351023  m_cSPS.getSpsRangeExtension().setCabacBypassAlignmentEnabledFlag(m_cabacBypassAlignmentEnabledFlag);
     1024
     1025#if SVC_EXTENSION
     1026  m_cSPS.inferSPS( m_layerId, &m_cVPS );
     1027#endif
    10361028}
    10371029
  • branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r1411 r1502  
    432432      {
    433433        const ComponentID compID        = ComponentID(comp);
    434 #if SVC_EXTENSION
    435         const Int         bitDepth      = slice->getBitDepth(toChannelType(compID));
    436 #else
    437434        const Int         bitDepth      = slice->getSPS()->getBitDepth(toChannelType(compID));
    438 #endif
    439435        const Int         range         = bUseHighPrecisionWeighting ? (1<<bitDepth)/2 : 128;
    440436        const Int         realLog2Denom = log2Denom + (bUseHighPrecisionWeighting ? RExt__PREDICTION_WEIGHTING_ANALYSIS_DC_PRECISION : (bitDepth - 8));
     
    453449          refAC = ( refAC * currWeightACDCParam[comp].numSamples ) / refWeightACDCParam[comp].numSamples;
    454450
    455           const Int bitDepthLuma = slice->getBitDepth(CHANNEL_TYPE_LUMA);
    456           const Int refBitDepthLuma  = slice->getRefPic(eRefPicList, refIdxTemp)->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA);
     451          const Int bitDepthLuma = slice->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
     452          const Int refBitDepthLuma  = slice->getRefPic(eRefPicList, refIdxTemp)->getSlice(0)->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA);
    457453          const Int delta = bitDepthLuma - refBitDepthLuma;
    458454
     
    557553        const Int          width      = pPic->getWidth(compID);
    558554        const Int          height     = pPic->getHeight(compID);
    559 #if SVC_EXTENSION
    560         const Int          bitDepth   = slice->getBitDepth(toChannelType(compID));
    561 #else
    562555        const Int          bitDepth   = slice->getSPS()->getBitDepth(toChannelType(compID));
    563 #endif
    564556              WPScalingParam &wp      = m_wp[refList][refIdxTemp][compID];
    565557              Int          weight     = wp.iWeight;
     
    679671        const Int          width     = pPic->getWidth(compID);
    680672        const Int          height    = pPic->getHeight(compID);
    681 #if SVC_EXTENSION
    682         const Int          bitDepth   = slice->getBitDepth(toChannelType(compID));
    683 #else
    684673        const Int          bitDepth   = slice->getSPS()->getBitDepth(toChannelType(compID));
    685 #endif
    686674
    687675        // calculate SAD costs with/without wp for luma
Note: See TracChangeset for help on using the changeset viewer.