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


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

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

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

Legend:

Unmodified
Added
Removed
  • 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.