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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 );
Note: See TracChangeset for help on using the changeset viewer.