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


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

port rev 4323 (g_uiMaxCUWidth, g_uiMaxCUHeight)

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

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1287 r1289  
    145145
    146146  Int       m_maxTempLayer;                      ///< Max temporal layer
    147   Bool m_useAMP;
     147  Bool      m_useAMP;
     148  UInt      m_maxCUWidth;
     149  UInt      m_maxCUHeight;
    148150  //======= Transform =============
    149151  UInt      m_uiQuadtreeTULog2MaxSize;
     
    511513  Int       getMaxTempLayer                 ()                              { return m_maxTempLayer;              }
    512514  Void      setMaxTempLayer                 ( Int maxTempLayer )            { m_maxTempLayer = maxTempLayer;      }
     515  Void      setMaxCUWidth                   ( UInt  u )      { m_maxCUWidth  = u; }
     516  Void      setMaxCUHeight                  ( UInt  u )      { m_maxCUHeight = u; }
     517
    513518  //======== Transform =============
    514519  Void      setQuadtreeTULog2MaxSize        ( UInt  u )      { m_uiQuadtreeTULog2MaxSize = u; }
     
    970975  Void  setTMVPConstraintsSEIEnabled(Int b)                  { m_TMVPConstraintsSEIEnabled = b; }
    971976  Int   getTMVPConstraintsSEIEnabled()                       {  return m_TMVPConstraintsSEIEnabled; }
    972 
    973977#endif
    974978#if P0123_ALPHA_CHANNEL_SEI
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp

    r1287 r1289  
    372372  TComPic* pcPic = rpcBestCU->getPic();
    373373  DEBUG_STRING_NEW(sDebug)
     374  const TComPPS &pps=*(rpcTempCU->getSlice()->getPPS());
     375  const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS());
     376  const UInt maxCUWidth = sps.getMaxCUWidth();
    374377
    375378  // get Original YUV data from picture
     
    396399  const UInt numberValidComponents = rpcBestCU->getPic()->getNumberValidComponents();
    397400
    398   if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
     401  if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression
    399402  {
    400403    Int idQP = m_pcEncCfg->getMaxDeltaQP();
     
    403406    iMaxQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    404407#else
    405     iMinQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
    406     iMaxQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
     408    iMinQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
     409    iMaxQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    407410#endif
    408411  }
     
    423426  const Int lowestQP = iMinQP; // For TQB, use this QP which is the lowest non TQB QP tested (rather than QP'=0) - that way delta QPs are smaller, and TQB can be tested at all CU levels.
    424427
    425   if ( (rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) )
     428  if ( (pps.getTransquantBypassEnableFlag()) )
    426429  {
    427430    isAddLowestQP = true; // mark that the first iteration is to cost TQB mode.
     
    439442       ( uiBPelY < rpcBestCU->getSlice()->getPicHeightInLumaSamples() ) )
    440443#else
    441   if ( ( uiRPelX < rpcBestCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) &&
    442        ( uiBPelY < rpcBestCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )
     444  if ( ( uiRPelX < sps.getPicWidthInLumaSamples() ) &&
     445       ( uiBPelY < sps.getPicHeightInLumaSamples() ) )
    443446#endif
    444447  {
     
    492495         * block position
    493496         */
    494         Int lgMinCuSize = pcSlice->getSPS()->getLog2MinCodingBlockSize() +
    495                           std::max<Int>(0, pcSlice->getSPS()->getLog2DiffMaxMinCodingBlockSize()-Int(pcSlice->getPPS()->getMaxCuChromaQpAdjDepth()));
    496         m_ChromaQpAdjIdc = ((uiLPelX >> lgMinCuSize) + (uiTPelY >> lgMinCuSize)) % (pcSlice->getPPS()->getChromaQpAdjTableSize() + 1);
     497        Int lgMinCuSize = sps.getLog2MinCodingBlockSize() +
     498                          std::max<Int>(0, sps.getLog2DiffMaxMinCodingBlockSize()-Int(pps.getMaxCuChromaQpAdjDepth()));
     499        m_ChromaQpAdjIdc = ((uiLPelX >> lgMinCuSize) + (uiTPelY >> lgMinCuSize)) % (pps.getChromaQpAdjTableSize() + 1);
    497500      }
    498501
     
    591594
    592595          //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
    593           if(pcSlice->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
     596          if(sps.getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
    594597          {
    595598#if AMP_ENC_SPEEDUP
     
    720723          if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
    721724          {
    722             if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
     725            if( rpcTempCU->getWidth(0) > ( 1 << sps.getQuadtreeTULog2MinSize() ) )
    723726            {
    724727              Double tmpIntraCost;
     
    731734
    732735        // test PCM
    733         if(pcPic->getSlice(0)->getSPS()->getUsePCM()
    734           && rpcTempCU->getWidth(0) <= (1<<pcPic->getSlice(0)->getSPS()->getPCMLog2MaxSize())
    735           && rpcTempCU->getWidth(0) >= (1<<pcPic->getSlice(0)->getSPS()->getPCMLog2MinSize()) )
     736        if(sps.getUsePCM()
     737          && rpcTempCU->getWidth(0) <= (1<<sps.getPCMLog2MaxSize())
     738          && rpcTempCU->getWidth(0) >= (1<<sps.getPCMLog2MinSize()) )
    736739        {
    737740#if SVC_EXTENSION
    738741          UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), pcPic->getSlice(0)->getBitDepths().recon);
    739742#else
    740           UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), pcPic->getSlice(0)->getSPS()->getBitDepths().recon);
     743          UInt uiRawBits = getTotalBits(rpcBestCU->getWidth(0), rpcBestCU->getHeight(0), rpcBestCU->getPic()->getChromaFormat(), sps.getBitDepths().recon);
    741744#endif
    742745          UInt uiBestBits = rpcBestCU->getTotalBits();
     
    799802  }
    800803
    801   if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
     804  if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression
    802805  {
    803806    Int idQP = m_pcEncCfg->getMaxDeltaQP();
     
    806809    iMaxQP = Clip3( -rpcTempCU->getSlice()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    807810#else
    808     iMinQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
    809     iMaxQP = Clip3( -rpcTempCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
     811    iMinQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP-idQP );
     812    iMaxQP = Clip3( -sps.getQpBDOffset(CHANNEL_TYPE_LUMA), MAX_QP, iBaseQP+idQP );
    810813#endif   
    811814  }
    812   else if( (g_uiMaxCUWidth>>uiDepth) > (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
     815  else if( (maxCUWidth>>uiDepth) > (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression
    813816  {
    814817    iMinQP = iBaseQP;
     
    855858        if( ( pcSubBestPartCU->getCUPelX() < pcSlice->getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < pcSlice->getPicHeightInLumaSamples() ) )
    856859#else
    857         if( ( pcSubBestPartCU->getCUPelX() < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < pcSlice->getSPS()->getPicHeightInLumaSamples() ) )
     860        if( ( pcSubBestPartCU->getCUPelX() < sps.getPicWidthInLumaSamples() ) && ( pcSubBestPartCU->getCUPelY() < sps.getPicHeightInLumaSamples() ) )
    858861#endif
    859862        {
     
    903906      rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    904907
    905       if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && rpcTempCU->getSlice()->getPPS()->getUseDQP())
     908      if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
    906909      {
    907910        Bool hasResidual = false;
     
    10451048Void TEncCu::xEncodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    10461049{
    1047   TComPic* pcPic = pcCU->getPic();
    1048 
    1049   Bool bBoundary = false;
    1050   UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
    1051   UInt uiRPelX   = uiLPelX + (g_uiMaxCUWidth>>uiDepth)  - 1;
    1052   UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
    1053   UInt uiBPelY   = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1;
    1054 
    1055   TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx());
     1050        TComPic   *const pcPic   = pcCU->getPic();
     1051        TComSlice *const pcSlice = pcCU->getSlice();
     1052  const TComSPS   &sps =*(pcSlice->getSPS());
     1053  const TComPPS   &pps =*(pcSlice->getPPS());
     1054
     1055  const UInt maxCUWidth  = sps.getMaxCUWidth();
     1056  const UInt maxCUHeight = sps.getMaxCUHeight();
     1057
     1058        Bool bBoundary = false;
     1059        UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
     1060  const UInt uiRPelX   = uiLPelX + (maxCUWidth>>uiDepth)  - 1;
     1061        UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
     1062  const UInt uiBPelY   = uiTPelY + (maxCUHeight>>uiDepth) - 1;
     1063
    10561064#if HIGHER_LAYER_IRAP_SKIP_FLAG
    10571065  if (m_pcEncCfg->getSkipPictureAtArcSwitch() && m_pcEncCfg->getAdaptiveResolutionChange() > 0 && pcSlice->getLayerId() == 1 && pcSlice->getPOC() == m_pcEncCfg->getAdaptiveResolutionChange())
     
    10641072  if( ( uiRPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getPicHeightInLumaSamples() ) )
    10651073#else
    1066   if( ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) )
     1074  if( ( uiRPelX < sps.getPicWidthInLumaSamples() ) && ( uiBPelY < sps.getPicHeightInLumaSamples() ) )
    10671075#endif
    10681076  {
     
    10771085  {
    10781086    UInt uiQNumParts = ( pcPic->getNumPartitionsInCtu() >> (uiDepth<<1) )>>2;
    1079     if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())
     1087    if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
    10801088    {
    10811089      setdQPFlag(true);
    10821090    }
    10831091
    1084     if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj())
     1092    if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression
    10851093    {
    10861094      setCodeChromaQpAdjFlag(true);
     
    10951103      if( ( uiLPelX < pcSlice->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getPicHeightInLumaSamples() ) )
    10961104#else
    1097       if( ( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) )
     1105      if( ( uiLPelX < sps.getPicWidthInLumaSamples() ) && ( uiTPelY < sps.getPicHeightInLumaSamples() ) )
    10981106#endif
    10991107      {
     
    11041112  }
    11051113
    1106   if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())
     1114  if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
    11071115  {
    11081116    setdQPFlag(true);
    11091117  }
    11101118
    1111   if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj())
     1119  if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression
    11121120  {
    11131121    setCodeChromaQpAdjFlag(true);
    11141122  }
    11151123
    1116   if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     1124  if (pps.getTransquantBypassEnableFlag())
    11171125  {
    11181126    m_pcEntropyCoder->encodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx );
    11191127  }
    11201128
    1121   if( !pcCU->getSlice()->isIntra() )
     1129  if( !pcSlice->isIntra() )
    11221130  {
    11231131    m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx );
     
    16391647  UInt uiDepth = pcCU->getDepth( 0 );
    16401648
    1641   if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
     1649  const TComPPS &pps = *(pcCU->getSlice()->getPPS());
     1650  const TComSPS &sps = *(pcCU->getSlice()->getSPS());
     1651  if ( pps.getUseDQP() && (sps.getMaxCUWidth()>>uiDepth) >= (sps.getMaxCUWidth() >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression
    16421652  {
    16431653    if ( pcCU->getQtRootCbf( 0) )
     
    17551765  TCoeff* pCoeffY = pCtu->getCoeff(COMPONENT_Y);
    17561766  TCoeff* pArlCoeffY = pCtu->getArlCoeff(COMPONENT_Y);
    1757 
    1758   UInt uiMinCUWidth = g_uiMaxCUWidth >> g_uiMaxCUDepth;
     1767  const TComSPS &sps = *(pCtu->getSlice()->getSPS());
     1768
     1769  const UInt uiMinCUWidth = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
    17591770  UInt uiMinNumCoeffInCU = 1 << uiMinCUWidth;
    17601771
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1287 r1289  
    210210    m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, bitDepthChroma , m_pcCfg->getCGSMaxYPartNumLog2() );
    211211    m_Enc3DAsymLUTPPS.create( m_pcCfg->getCGSMaxOctantDepth(), prevBitDepthLuma, prevBitDepthChroma, bitDepthLuma, prevBitDepthChroma , m_pcCfg->getCGSMaxYPartNumLog2() );
     212
    212213    if(!m_pColorMappedPic)
    213214    {
    214215      m_pColorMappedPic = new TComPicYuv;
    215       m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL );
     216      m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), pcTEncTop->getSPS()->getMaxCUWidth(), pcTEncTop->getSPS()->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );
    216217    }
    217218  }
     
    31623163  if (conversion!=IPCOLOURSPACE_UNCHANGED)
    31633164  {
    3164     cscd.create(pcPicD->getWidth(COMPONENT_Y), pcPicD->getHeight(COMPONENT_Y), pcPicD->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
     3165    cscd.create(pcPicD->getWidth(COMPONENT_Y), pcPicD->getHeight(COMPONENT_Y), pcPicD->getChromaFormat(), pcPicD->getWidth(COMPONENT_Y), pcPicD->getHeight(COMPONENT_Y), 0, false);
    31653166#if SVC_EXTENSION
    31663167    TVideoIOYuv::ColourSpaceConvert(*pcPicD, cscd, conversion, pcPic->getSlice(0)->getBitDepths().recon, false);
     
    33853386    {
    33863387      TComPicYuv &reconField=*(apcPicRecFields[fieldNum]);
    3387       cscd[fieldNum].create(reconField.getWidth(COMPONENT_Y), reconField.getHeight(COMPONENT_Y), reconField.getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
     3388      cscd[fieldNum].create(reconField.getWidth(COMPONENT_Y), reconField.getHeight(COMPONENT_Y), reconField.getChromaFormat(), reconField.getWidth(COMPONENT_Y), reconField.getHeight(COMPONENT_Y), 0, false);
    33883389#if SVC_EXTENSION
    33893390      TVideoIOYuv::ColourSpaceConvert(reconField, cscd[fieldNum], conversion, pcPicOrgFirstField->getSlice(0)->getBitDepths().recon, false);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h

    r1287 r1289  
    194194 
    195195#if !SVC_EXTENSION
    196   Void  printOutSummary      ( UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE );
     196  Void  printOutSummary      ( UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const BitDepths &bitDepths );
    197197#endif
    198198  Void  preLoopFilterPicAll  ( TComPic* pcPic, UInt64& ruiDist );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp

    r1260 r1289  
    128128#if SVC_EXTENSION
    129129// * \param vps reference to used VPS
    130 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId )
     130Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId )
    131131{
    132   TComPic::create( vps, sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual, layerId );
     132  TComPic::create( vps, sps, pps, uiMaxDepth, bIsVirtual, layerId );
    133133
    134134  const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
    135135  const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    136136#else
    137 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual )
     137Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual )
    138138{
    139   TComPic::create( sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual );
    140   const Int iWidth  = sps.getPicWidthInLumaSamples();
    141   const Int iHeight = sps.getPicHeightInLumaSamples();
     139  TComPic::create( sps, pps, uiMaxDepth, bIsVirtual );
     140  const Int  iWidth      = sps.getPicWidthInLumaSamples();
     141  const Int  iHeight    = sps.getPicHeightInLumaSamples();
    142142#endif
     143
     144  const UInt uiMaxWidth  = sps.getMaxCUWidth();
     145  const UInt uiMaxHeight = sps.getMaxCUHeight();
    143146  m_uiMaxAQDepth = uiMaxAQDepth;
    144147  if ( uiMaxAQDepth > 0 )
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h

    r1259 r1289  
    106106
    107107#if SVC_EXTENSION
    108   Void          create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId );
     108  Void          create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId );
    109109#else  //SVC_EXTENSION
    110   Void          create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ );
     110  Void          create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ );
    111111#endif //SVC_EXTENSION
    112112
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1287 r1289  
    204204                      Int           bipredSearchRange,
    205205                      Int           iFastSearch,
     206                      const UInt    maxCUWidth,
     207                      const UInt    maxCUHeight,
    206208                      TEncEntropy*  pcEntropyCoder,
    207209                      TComRdCost*   pcRdCost,
     
    250252  initTempBuff(cform);
    251253
    252   m_pTempPel = new Pel[g_uiMaxCUWidth*g_uiMaxCUHeight];
     254  m_pTempPel = new Pel[maxCUWidth*maxCUHeight];
    253255
    254256  const UInt uiNumLayersToAllocate = pcEncCfg->getQuadtreeTULog2MaxSize()-pcEncCfg->getQuadtreeTULog2MinSize()+1;
     
    259261    const UInt csy=::getComponentScaleY(ComponentID(ch), cform);
    260262    m_ppcQTTempCoeff[ch] = new TCoeff* [uiNumLayersToAllocate];
    261     m_pcQTTempCoeff[ch]   = new TCoeff [(g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy)   ];
     263    m_pcQTTempCoeff[ch]   = new TCoeff [(maxCUWidth*maxCUHeight)>>(csx+csy)   ];
    262264#if ADAPTIVE_QP_SELECTION
    263265    m_ppcQTTempArlCoeff[ch]  = new TCoeff*[uiNumLayersToAllocate];
    264     m_pcQTTempArlCoeff[ch]   = new TCoeff [(g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy)   ];
     266    m_pcQTTempArlCoeff[ch]   = new TCoeff [(maxCUWidth*maxCUHeight)>>(csx+csy)   ];
    265267#endif
    266268    m_puhQTTempCbf[ch] = new UChar  [uiNumPartitions];
     
    268270    for (UInt layer = 0; layer < uiNumLayersToAllocate; layer++)
    269271    {
    270       m_ppcQTTempCoeff[ch][layer] = new TCoeff[(g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy)];
     272      m_ppcQTTempCoeff[ch][layer] = new TCoeff[(maxCUWidth*maxCUHeight)>>(csx+csy)];
    271273#if ADAPTIVE_QP_SELECTION
    272       m_ppcQTTempArlCoeff[ch][layer]  = new TCoeff[(g_uiMaxCUWidth*g_uiMaxCUHeight)>>(csx+csy) ];
     274      m_ppcQTTempArlCoeff[ch][layer]  = new TCoeff[(maxCUWidth*maxCUHeight)>>(csx+csy) ];
    273275#endif
    274276    }
     
    286288  for( UInt ui = 0; ui < uiNumLayersToAllocate; ++ui )
    287289  {
    288     m_pcQTTempTComYuv[ui].create( g_uiMaxCUWidth, g_uiMaxCUHeight, pcEncCfg->getChromaFormatIdc() );
    289   }
    290   m_pcQTTempTransformSkipTComYuv.create( g_uiMaxCUWidth, g_uiMaxCUHeight, pcEncCfg->getChromaFormatIdc() );
     290    m_pcQTTempTComYuv[ui].create( maxCUWidth, maxCUHeight, pcEncCfg->getChromaFormatIdc() );
     291  }
     292  m_pcQTTempTransformSkipTComYuv.create( maxCUWidth, maxCUHeight, pcEncCfg->getChromaFormatIdc() );
    291293  m_tmpYuvPred.create(MAX_CU_SIZE, MAX_CU_SIZE, pcEncCfg->getChromaFormatIdc());
    292294}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h

    r1259 r1289  
    138138            Int           bipredSearchRange,
    139139            Int           iFastSearch,
     140            const UInt    maxCUWidth,
     141            const UInt    maxCUHeight,
    140142            TEncEntropy*  pcEntropyCoder,
    141143            TComRdCost*   pcRdCost,
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r1288 r1289  
    6868  {
    6969    m_apcPicYuvPred  = new TComPicYuv;
    70     m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth );
     70    m_apcPicYuvPred->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true );
    7171  }
    7272
     
    7575  {
    7676    m_apcPicYuvResi  = new TComPicYuv;
    77     m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth );
     77    m_apcPicYuvResi->create( iWidth, iHeight, chromaFormat, iMaxCUWidth, iMaxCUHeight, uhTotalDepth, true );
    7878  }
    7979}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1288 r1289  
    117117  m_cGOPEncoder.        create( );
    118118#endif
    119   m_cSliceEncoder.      create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );
    120   m_cCuEncoder.         create( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, m_chromaFormatIDC );
     119  m_cSliceEncoder.      create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth );
     120  m_cCuEncoder.         create( g_uiMaxCUDepth, m_maxCUWidth, m_maxCUHeight, m_chromaFormatIDC );
    121121  if (m_bUseSAO)
    122122  {
    123     m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] );
     123    m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] );
    124124#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
    125125    m_cEncSAO.createEncData(getSaoCtuBoundary());
     
    140140  {
    141141    m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
    142                       g_uiMaxCUWidth, g_uiMaxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
     142        m_maxCUWidth, m_maxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
    143143  }
    144144
     
    258258
    259259  // initialize encoder search class
    260   m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
     260  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, m_maxCUWidth, m_maxCUHeight, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
    261261
    262262  m_iMaxRefPicNum = 0;
     
    579579        {
    580580          rpcPicYuvRec = new TComPicYuv;
    581           rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
     581          rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true);
    582582        }
    583583        rcListPicYuvRecOut.pushBack( rpcPicYuvRec );
     
    620620        {
    621621          rpcPicYuvRec = new TComPicYuv;
    622           rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);
     622          rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true);
    623623        }
    624624        rcListPicYuvRecOut.pushBack( rpcPicYuvRec );
     
    750750      }
    751751
    752       pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);
     752      pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);
    753753#else  //SVC_EXTENSION
    754       pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false);
     754      pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false);
    755755#endif //SVC_EXTENSION
    756756      rpcPic = pcEPic;
     
    800800      }
    801801
    802       rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false, m_layerId );
     802      rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, false, m_layerId );
    803803#else  //SVC_EXTENSION
    804       rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false );
     804      rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth, false );
    805805#endif //SVC_EXTENSION
    806806    }
     
    887887  m_cSPS.setPicHeightInLumaSamples        ( m_iSourceHeight     );
    888888  m_cSPS.setConformanceWindow             ( m_conformanceWindow );
    889   m_cSPS.setMaxCUWidth    ( g_uiMaxCUWidth      );
    890   m_cSPS.setMaxCUHeight   ( g_uiMaxCUHeight     );
     889  m_cSPS.setMaxCUWidth    ( m_maxCUWidth      );
     890  m_cSPS.setMaxCUHeight   ( m_maxCUHeight     );
    891891  m_cSPS.setMaxCUDepth    ( g_uiMaxCUDepth      );
    892892  m_cSPS.setChromaFormatIdc( m_chromaFormatIDC);
     
    14301430Void  TEncCfg::xCheckGSParameters()
    14311431{
    1432   Int   iWidthInCU = ( m_iSourceWidth%g_uiMaxCUWidth ) ? m_iSourceWidth/g_uiMaxCUWidth + 1 : m_iSourceWidth/g_uiMaxCUWidth;
    1433   Int   iHeightInCU = ( m_iSourceHeight%g_uiMaxCUHeight ) ? m_iSourceHeight/g_uiMaxCUHeight + 1 : m_iSourceHeight/g_uiMaxCUHeight;
     1432  Int   iWidthInCU = ( m_iSourceWidth%m_maxCUWidth ) ? m_iSourceWidth/m_maxCUWidth + 1 : m_iSourceWidth/m_maxCUWidth;
     1433  Int   iHeightInCU = ( m_iSourceHeight%m_maxCUHeight ) ? m_iSourceHeight/m_maxCUHeight + 1 : m_iSourceHeight/m_maxCUHeight;
    14341434  UInt  uiCummulativeColumnWidth = 0;
    14351435  UInt  uiCummulativeRowHeight = 0;
     
    15051505  if( m_layerId > 0 )
    15061506  {
    1507     g_uiMaxCUWidth  = m_cSPS.getMaxCUWidth();
    1508     g_uiMaxCUHeight = m_cSPS.getMaxCUHeight();
    15091507    g_uiMaxCUDepth  = m_cSPS.getMaxCUDepth();
    15101508    g_uiAddCUDepth  = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() );
     
    15151513      {
    15161514        m_cIlpPic[j] = new TComPic;
    1517         m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId);
     1515        m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, true, m_layerId);
    15181516        for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++)
    15191517        {
Note: See TracChangeset for help on using the changeset viewer.