Changeset 1290 in SHVCSoftware


Ignore:
Timestamp:
18 Jul 2015, 01:59:29 (10 years ago)
Author:
seregin
Message:

port rev 4324 (g_uiMaxDepth, g_uiAddDepth)

Location:
branches/SHM-dev/source
Files:
33 edited

Legend:

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

    r1289 r1290  
    19351935#if SVC_EXTENSION
    19361936#if AUXILIARY_PICTURES
    1937     picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );
    1938 #else
    1939     picColourRemapped.create( pic.getWidth(), pic.getHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );
    1940 #endif
    1941 #else
    1942     picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), g_uiMaxCUDepth, true );
     1937    picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true, NULL );
     1938#else
     1939    picColourRemapped.create( pic.getWidth(), pic.getHeight(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true, NULL );
     1940#endif
     1941#else
     1942    picColourRemapped.create( pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), pic.getChromaFormat(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true );
    19431943#endif
    19441944    YUVOut[0] = picColourRemapped.getAddr(COMPONENT_Y);
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1289 r1290  
    28522852#endif
    28532853
    2854   // set global varibles
     2854  // compute actual CU depth with respect to config depth and max transform size
    28552855#if SVC_EXTENSION
    2856   for(Int layer = 0; layer < m_numLayers; layer++)
    2857   {
    2858     xSetGlobal(layer);
    2859   }
    2860 #else
    2861   xSetGlobal();
     2856  for(Int layerIdx = 0; layerIdx < m_numLayers; layerIdx++)
     2857  {
     2858    UInt uiAddCUDepth  = 0;
     2859    while( (m_acLayerCfg[layerIdx].m_uiMaxCUWidth>>m_acLayerCfg[layerIdx].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerIdx].m_uiQuadtreeTULog2MinSize + uiAddCUDepth )  ) )
     2860    {
     2861      uiAddCUDepth++;
     2862    }
     2863
     2864    m_acLayerCfg[layerIdx].m_uiMaxTotalCUDepth = m_acLayerCfg[layerIdx].m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_acLayerCfg[layerIdx].m_chromaFormatIDC, m_acLayerCfg[layerIdx].m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.
     2865    uiAddCUDepth++;
     2866    m_acLayerCfg[layerIdx].m_uiLog2DiffMaxMinCodingBlockSize = m_acLayerCfg[layerIdx].m_uiMaxCUDepth - 1;
     2867  }
     2868#else 
     2869  UInt uiAddCUDepth  = 0;
     2870  while( (m_uiMaxCUWidth>>m_uiMaxCUDepth) > ( 1 << ( m_uiQuadtreeTULog2MinSize + uiAddCUDepth )  ) )
     2871  {
     2872    uiAddCUDepth++;
     2873  }
     2874
     2875  m_uiMaxTotalCUDepth = m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_chromaFormatIDC, m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.
     2876  uiAddCUDepth++;
     2877  m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1;
    28622878#endif
    28632879 
     
    42344250}
    42354251
    4236 /** \todo use of global variables should be removed later
    4237  */
    4238 #if LAYER_CTB
    4239 Void TAppEncCfg::xSetGlobal(UInt layerId)
    4240 {
    4241   // set max CU width & height
    4242   g_auiLayerMaxCUWidth[layerId]  = m_acLayerCfg[layerId].m_uiMaxCUWidth;
    4243   g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight;
    4244  
    4245   // compute actual CU depth with respect to config depth and max transform size
    4246   g_auiLayerAddCUDepth[layerId]  = 0;
    4247   while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] )  ) ) g_auiLayerAddCUDepth[layerId]++;
    4248  
    4249   m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId];
    4250   g_auiLayerAddCUDepth[layerId]++;
    4251   g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth;
    4252  
    4253   // set internal bit-depth to constant value to make sure to be updated later
    4254   g_bitDepthY = -1;
    4255   g_bitDepthC = -1;
    4256  
    4257   g_uiPCMBitDepthLuma = -1;
    4258   g_uiPCMBitDepthChroma = -1;
    4259 }
    4260 #else
    4261 #if SVC_EXTENSION
    4262 Void TAppEncCfg::xSetGlobal(UInt layerId)
    4263 #else
    4264 Void TAppEncCfg::xSetGlobal()
    4265 #endif
    4266 {
    4267 #if SVC_EXTENSION
    4268   // Check for layerIdx equal to 0, it has to pe extended to other layers.
    4269   UInt layerIdx = 0;
    4270   ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerIdx].m_chromaFormatIDC;
    4271 #endif
    4272 
    4273   // set max CU width & height
    4274 #if SVC_EXTENSION
    4275   // compute actual CU depth with respect to config depth and max transform size
    4276   g_uiAddCUDepth  = 0;
    4277   while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth )  ) )
    4278   {
    4279     g_uiAddCUDepth++;
    4280   }
    4281 
    4282   g_uiAddCUDepth+=getMaxCUDepthOffset(m_chromaFormatIDC, m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.
    4283 
    4284   m_acLayerCfg[layerId].m_uiMaxCUDepth += g_uiAddCUDepth;
    4285   g_uiAddCUDepth++;
    4286   g_uiMaxCUDepth = m_acLayerCfg[layerId].m_uiMaxCUDepth;
    4287 #else
    4288   // compute actual CU depth with respect to config depth and max transform size
    4289   g_uiAddCUDepth  = 0;
    4290   while( (m_uiMaxCUWidth>>m_uiMaxCUDepth) > ( 1 << ( m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth )  ) )
    4291   {
    4292     g_uiAddCUDepth++;
    4293   }
    4294 
    4295   g_uiAddCUDepth+=getMaxCUDepthOffset(m_chromaFormatIDC, m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.
    4296 
    4297   m_uiMaxCUDepth += g_uiAddCUDepth;
    4298   g_uiAddCUDepth++;
    4299   g_uiMaxCUDepth = m_uiMaxCUDepth;
    4300 #endif
    4301 }
    4302 #endif
    4303 
    43044252const Char *profileToString(const Profile::Name profile)
    43054253{
     
    43954343    printf("Profile                           : %s\n", profileToString(m_profile) );
    43964344  }
    4397 
    4398   printf("CU size / depth                   : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );
     4345  printf("CU size / depth / total-depth     : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth );
    43994346  printf("RQT trans. size (min / max)       : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
    44004347  printf("Max RQT depth inter               : %d\n", m_uiQuadtreeTUMaxDepthInter);
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1259 r1290  
    216216  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
    217217  UInt      m_uiMaxCUHeight;                                  ///< max. CU height in pixel
    218   UInt      m_uiMaxCUDepth;                                   ///< max. CU depth
     218  UInt      m_uiMaxCUDepth;                                   ///< max. CU depth (as specified by command line)
     219  UInt      m_uiMaxTotalCUDepth;                              ///< max. total CU depth - includes depth of transform-block structure
     220  UInt      m_uiLog2DiffMaxMinCodingBlockSize;                ///< difference between largest and smallest CU depth
    219221
    220222  // transfom unit (TU) definition
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r1235 r1290  
    247247  }
    248248  printf("\n");
    249   printf("CU size / depth                   : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );
     249  printf("CU size / depth / total-depth     : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth );
    250250  printf("RQT trans. size (min / max)       : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
    251251  printf("Max RQT depth inter               : %d\n", m_uiQuadtreeTUMaxDepthInter);
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r1284 r1290  
    6565  UInt      m_uiMaxCUWidth;                                   ///< max. CU width in pixel
    6666  UInt      m_uiMaxCUHeight;                                  ///< max. CU height in pixel
    67   UInt      m_uiMaxCUDepth;                                   ///< max. CU depth
     67  UInt      m_uiMaxCUDepth;                                   ///< max. CU depth (as specified by command line)
     68  UInt      m_uiMaxTotalCUDepth;                              ///< max. total CU depth - includes depth of transform-block structure
     69  UInt      m_uiLog2DiffMaxMinCodingBlockSize;                ///< difference between largest and smallest CU depth
    6870 
    6971  // transfom unit (TU) definition
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1289 r1290  
    438438    m_acTEncTop[layer].setMaxCUWidth                                       ( m_acLayerCfg[layer].m_uiMaxCUWidth );
    439439    m_acTEncTop[layer].setMaxCUHeight                                      ( m_acLayerCfg[layer].m_uiMaxCUHeight );
     440    m_acTEncTop[layer].setMaxTotalCUDepth                                  ( m_acLayerCfg[layer].m_uiMaxTotalCUDepth );
     441    m_acTEncTop[layer].setLog2DiffMaxMinCodingBlockSize                    ( m_acLayerCfg[layer].m_uiLog2DiffMaxMinCodingBlockSize );
    440442
    441443    m_acTEncTop[layer].setQuadtreeTULog2MaxSize                            ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize );
     
    868870  m_cTEncTop.setMaxCUWidth                                        ( m_uiMaxCUWidth );
    869871  m_cTEncTop.setMaxCUHeight                                       ( m_uiMaxCUHeight );
     872  m_cTEncTop.setMaxTotalCUDepth                                   ( m_uiMaxTotalCUDepth );
     873  m_cTEncTop.setLog2DiffMaxMinCodingBlockSize                     ( m_uiLog2DiffMaxMinCodingBlockSize );
    870874  m_cTEncTop.setQuadtreeTULog2MaxSize                             ( m_uiQuadtreeTULog2MaxSize );
    871875  m_cTEncTop.setQuadtreeTULog2MinSize                             ( m_uiQuadtreeTULog2MinSize );
     
    16841688    if( m_isField )
    16851689    {
    1686       pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, true, NULL );
    1687       acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, true, NULL );
     1690      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );
     1691      acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );
    16881692    }
    16891693    else
    16901694    {
    1691       pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, true, NULL );
    1692       acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, true, NULL );
     1695      pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );
     1696      acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );
    16931697    }
    16941698  }
     
    20342038  if( m_isField )
    20352039  {
    2036     pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true );
    2037   cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true);
     2040    pcPicYuvOrg->create  ( m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
     2041    cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true);
    20382042  }
    20392043  else
    20402044  {
    2041     pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true );
    2042   cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true );
     2045    pcPicYuvOrg->create  ( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
     2046    cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
    20432047  }
    20442048
     
    21292133    rpcPicYuvRec = new TComPicYuv;
    21302134
    2131     rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, true, NULL );
     2135    rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxTotalCUDepth, true, NULL );
    21322136  }
    21332137  m_acListPicYuvRec[layer].pushBack( rpcPicYuvRec );
     
    22592263    rpcPicYuvRec = new TComPicYuv;
    22602264
    2261     rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, true );
     2265    rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
    22622266
    22632267  }
  • branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.h

    r1287 r1290  
    127127//returns the part index of the luma region that is co-located with the specified chroma region
    128128
    129 static inline UInt getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu, const ChromaFormat chFmt)
    130 {
    131   return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~((1<<(2*g_uiAddCUDepth))-1)); //(lumaZOrderIdxInCtu/numParts)*numParts;
     129static inline UInt
     130getChromasCorrespondingPULumaIdx(const UInt lumaZOrderIdxInCtu,
     131                                 const ChromaFormat chFmt,
     132                                 const Int partsPerMinCU  // 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()))
     133                                 )
     134{
     135  return enable4ChromaPUsInIntraNxNCU(chFmt) ? lumaZOrderIdxInCtu : lumaZOrderIdxInCtu & (~(partsPerMinCU-1));
    132136}
    133137
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r1289 r1290  
    13921392{
    13931393  const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
    1394   UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth -getSlice()->getPPS()->getMaxCuDQPDepth())<<1);
     1394  const UInt maxCUDepth        = getSlice()->getSPS()->getMaxTotalCUDepth();
     1395  const UInt maxCuDQPDepth     = getSlice()->getPPS()->getMaxCuDQPDepth();
     1396  const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1);
     1397  UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference;
    13951398  UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx];
    13961399
     
    14161419{
    14171420  const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth();
    1418   UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1);
     1421  const UInt maxCUDepth        = getSlice()->getSPS()->getMaxTotalCUDepth();
     1422  const UInt maxCuDQPDepth     = getSlice()->getPPS()->getMaxCuDQPDepth();
     1423  const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1);
     1424  UInt absZorderQpMinCUIdx = (uiCurrAbsIdxInCtu>>doubleDepthDifference)<<doubleDepthDifference;
    14191425  UInt absRorderQpMinCUIdx = g_auiZscanToRaster[absZorderQpMinCUIdx];
    14201426
     
    14611467Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )
    14621468{
    1463   UInt uiQUPartIdxMask = ~((1<<((g_uiMaxCUDepth - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1);
     1469  UInt uiQUPartIdxMask = ~((1<<((getSlice()->getSPS()->getMaxTotalCUDepth() - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1);
    14641470  Int iLastValidPartIdx = getLastValidPartIdx( uiAbsPartIdx&uiQUPartIdxMask ); // A idx will be invalid if it is off the right or bottom edge of the picture.
    14651471  // If this CU is in the first CTU of the slice and there is no valid part before this one, use slice QP
     
    15451551  UInt        AbovePartIdx = MAX_UINT;
    15461552  Int         iLeftIntraDir, iAboveIntraDir;
     1553  const TComSPS *sps=getSlice()->getSPS();
     1554  const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
    15471555
    15481556  const ChannelType chType = toChannelType(compID);
     
    15531561  if (isChroma(compID))
    15541562  {
    1555     LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm);
     1563    LeftPartIdx = getChromasCorrespondingPULumaIdx(LeftPartIdx, chForm, partsPerMinCU);
    15561564  }
    15571565  iLeftIntraDir  = pcCULeft ? ( pcCULeft->isIntra( LeftPartIdx ) ? pcCULeft->getIntraDir( chType, LeftPartIdx ) : DC_IDX ) : DC_IDX;
     
    15621570  if (isChroma(compID))
    15631571  {
    1564     AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm);
     1572    AbovePartIdx = getChromasCorrespondingPULumaIdx(AbovePartIdx, chForm, partsPerMinCU);
    15651573  }
    15661574  iAboveIntraDir = pcCUAbove ? ( pcCUAbove->isIntra( AbovePartIdx ) ? pcCUAbove->getIntraDir( chType, AbovePartIdx ) : DC_IDX ) : DC_IDX;
     
    34063414  if (uiDirMode==DM_CHROMA_IDX)
    34073415  {
    3408     uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat()));
     3416    const TComSPS *sps=getSlice()->getSPS();
     3417    const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
     3418    uiDirMode = getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, getPic()->getChromaFormat(), partsPerMinCU));
    34093419  }
    34103420
  • branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp

    r1289 r1290  
    202202  xSetEdgefilterPU   ( pcCU, uiAbsZorderIdx );
    203203
    204   const UInt uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
     204  const UInt uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth();
    205205
    206206  for( UInt uiPartIdx = uiAbsZorderIdx; uiPartIdx < uiAbsZorderIdx + uiCurNumParts; uiPartIdx++ )
     
    294294  const TComSPS &sps=*(pcCU->getSlice()->getSPS());
    295295
    296   const UInt uiWidthInBaseUnits  = rect.width  / (sps.getMaxCUWidth()  >> g_uiMaxCUDepth);
    297   const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> g_uiMaxCUDepth);
     296  const UInt uiWidthInBaseUnits  = rect.width  / (sps.getMaxCUWidth()  >> sps.getMaxTotalCUDepth());
     297  const UInt uiHeightInBaseUnits = rect.height / (sps.getMaxCUHeight() >> sps.getMaxTotalCUDepth());
    298298
    299299  xSetEdgefilterMultiple( pcCU, rTu.GetAbsPartIdxCU(), uiTransDepthTotal, EDGE_VER, 0, m_stLFCUParam.bInternalEdge, uiWidthInBaseUnits, uiHeightInBaseUnits, &rect );
     
    584584  UInt uiNumParts = pcCU->getPic()->getNumPartInCtuWidth()>>uiDepth;
    585585
    586   UInt  uiPelsInPart = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
     586  UInt  uiPelsInPart = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth();
    587587  UInt  uiBsAbsIdx = 0, uiBs = 0;
    588588  Int   iOffset, iSrcStep;
     
    693693        Pel        *piSrcCb        = pcPicYuvRec->getAddr( COMPONENT_Cb, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
    694694        Pel        *piSrcCr        = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx );
    695 
    696695  const TComSPS    &sps            = *(pcCU->getSlice()->getSPS());
    697696#if SVC_EXTENSION
     
    701700#endif
    702701
    703   const UInt  uiPelsInPartChromaH = sps.getMaxCUWidth() >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));
    704   const UInt  uiPelsInPartChromaV = sps.getMaxCUHeight() >> (g_uiMaxCUDepth+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));
     702  const UInt  uiPelsInPartChromaH = sps.getMaxCUWidth() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleX(COMPONENT_Cb));
     703  const UInt  uiPelsInPartChromaV = sps.getMaxCUHeight() >> (sps.getMaxTotalCUDepth()+pcPicYuvRec->getComponentScaleY(COMPONENT_Cb));
    705704
    706705  Int iQP = 0;
  • branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp

    r1289 r1290  
    117117  const UInt uiTuHeight2      = uiTuHeight << 1;
    118118
    119   const Int  iBaseUnitSize    = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
     119  const Int  iBaseUnitSize    = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth();
    120120  const Int  iUnitWidth       = iBaseUnitSize  >> pcCU->getPic()->getPicYuvRec()->getComponentScaleX(compID);
    121121  const Int  iUnitHeight      = iBaseUnitSize  >> pcCU->getPic()->getPicYuvRec()->getComponentScaleY(compID);
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp

    r1289 r1290  
    7575}
    7676#if SVC_EXTENSION
    77 Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual, const UInt layerId )
     77Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual, const UInt layerId )
    7878{
    7979  const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId);
    80   const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
    81   const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    82   const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
    83   const UInt uiMaxCuHeight = sps.getMaxCUHeight();
     80  const Int          iWidth          = vps.getPicWidthInLumaSamples(&sps, layerId);
     81  const Int          iHeight         = vps.getPicHeightInLumaSamples(&sps, layerId);
     82  const UInt         uiMaxCuWidth    = sps.getMaxCUWidth();
     83  const UInt         uiMaxCuHeight   = sps.getMaxCUHeight();
     84  const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
    8485 
    8586  const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId );
     
    110111}
    111112#else
    112 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual)
    113 {
    114   const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc();
    115   const Int  iWidth        = sps.getPicWidthInLumaSamples();
    116   const Int  iHeight       = sps.getPicHeightInLumaSamples();
    117   const UInt uiMaxCuWidth  = sps.getMaxCUWidth();
    118   const UInt uiMaxCuHeight = sps.getMaxCUHeight();
     113Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual)
     114{
     115  const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc();
     116  const Int          iWidth          = sps.getPicWidthInLumaSamples();
     117  const Int          iHeight         = sps.getPicHeightInLumaSamples();
     118  const UInt         uiMaxCuWidth    = sps.getMaxCUWidth();
     119  const UInt         uiMaxCuHeight   = sps.getMaxCUHeight();
     120  const UInt         uiMaxDepth      = sps.getMaxTotalCUDepth();
    119121
    120122  m_picSym.create( sps, pps, uiMaxDepth );
     
    262264Void TComPic::copyUpsampledMvField(UInt refLayerIdc)
    263265{
    264   UInt numPartitions = 1<<(g_uiMaxCUDepth<<1);
    265   UInt widthMinPU    = getSlice(0)->getSPS()->getMaxCUWidth()  / (1<<g_uiMaxCUDepth);
    266   UInt heightMinPU   = getSlice(0)->getSPS()->getMaxCUHeight() / (1<<g_uiMaxCUDepth);
    267   Int  unitNum       = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) );
     266  const TComSPS *sps       = getSlice(0)->getSPS();
     267  const UInt uiMaxDepth    = sps->getMaxTotalCUDepth();
     268  const UInt numPartitions = 1<<(uiMaxDepth<<1);
     269  const UInt widthMinPU    = sps->getMaxCUWidth()  / (1<<uiMaxDepth);
     270  const UInt heightMinPU   = sps->getMaxCUHeight() / (1<<uiMaxDepth);
     271  const Int  unitNum       = max( 1, (Int)((16/widthMinPU)*(16/heightMinPU)) );
    268272
    269273  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++)  //each LCU
     
    314318Void TComPic::initUpsampledMvField()
    315319{
    316   UInt uiNumPartitions   = 1<<(g_uiMaxCUDepth<<1);
     320  const TComSPS *sps         = getSlice(0)->getSPS();
     321  const UInt uiMaxDepth      = sps->getMaxTotalCUDepth();
     322  const UInt uiNumPartitions = 1<<(uiMaxDepth<<1);
    317323
    318324  for(UInt cuIdx = 0; cuIdx < getPicSym()->getNumberOfCtusInFrame(); cuIdx++)  //each LCU
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1289 r1290  
    9999
    100100#if SVC_EXTENSION
    101   Void          create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/, const UInt layerId );
     101  Void          create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/, const UInt layerId );
    102102#else
    103   Void          create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/ );
     103  Void          create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/ );
    104104#endif
    105105
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp

    r1289 r1290  
    249249// ====================================================================================================================
    250250
    251 UInt g_uiMaxCUDepth  = MAX_CU_DEPTH;
    252 UInt g_uiAddCUDepth  = 0;
    253251UInt g_auiZscanToRaster [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
    254252UInt g_auiRasterToZscan [ MAX_NUM_SPU_W*MAX_NUM_SPU_W ] = { 0, };
  • branches/SHM-dev/source/Lib/TLibCommon/TComRom.h

    r1289 r1290  
    8585Void         initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth );
    8686
    87 // global variable (CTU width/height, max. CU depth)
    88 extern       UInt g_uiMaxCUDepth;
    89 extern       UInt g_uiAddCUDepth;
    90 
    9187extern       UInt g_auiPUOffset[NUMBER_OF_PART_SIZES];
    9288
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1289 r1290  
    20572057, m_uiMaxCUWidth              ( 32)
    20582058, m_uiMaxCUHeight             ( 32)
    2059 , m_uiMaxCUDepth              (  3)
     2059, m_uiMaxTotalCUDepth         (  3)
    20602060, m_bLongTermRefsPresent      (false)
    20612061, m_uiQuadtreeTULog2MaxSize   (  0)
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1287 r1290  
    13231323  UInt             m_uiMaxCUWidth;
    13241324  UInt             m_uiMaxCUHeight;
    1325   UInt             m_uiMaxCUDepth;
     1325  UInt             m_uiMaxTotalCUDepth; ///< Total CU depth, relative to the smallest possible transform block size.
    13261326
    13271327  Window           m_conformanceWindow;
     
    14451445  Void                   setMaxCUHeight( UInt u )                                                        { m_uiMaxCUHeight = u;                                                 }
    14461446  UInt                   getMaxCUHeight() const                                                          { return  m_uiMaxCUHeight;                                             }
    1447   Void                   setMaxCUDepth( UInt u )                                                         { m_uiMaxCUDepth = u;                                                  }
    1448   UInt                   getMaxCUDepth() const                                                           { return  m_uiMaxCUDepth;                                              }
     1447  Void                   setMaxTotalCUDepth( UInt u )                                                    { m_uiMaxTotalCUDepth = u;                                             }
     1448  UInt                   getMaxTotalCUDepth() const                                                      { return  m_uiMaxTotalCUDepth;                                         }
    14491449  Void                   setUsePCM( Bool b )                                                             { m_usePCM = b;                                                        }
    14501450  Bool                   getUsePCM() const                                                               { return m_usePCM;                                                     }
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r1288 r1290  
    17601760    const ChannelType chType = toChannelType(compID);
    17611761    const UInt uiChPredMode  = pcCU->getIntraDir( chType, uiAbsPartIdx );
    1762     const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode;
     1762    const TComSPS *sps=pcCU->getSlice()->getSPS();
     1763    const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
     1764    const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode;
    17631765    const UInt uiChFinalMode = ((chFmt == CHROMA_422)       && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
    17641766
     
    18301832      const ChannelType chType = toChannelType(compID);
    18311833      const UInt uiChPredMode  = pcCU->getIntraDir( chType, uiAbsPartIdx );
    1832       const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode;
     1834      const TComSPS *sps=pcCU->getSlice()->getSPS();
     1835      const UInt partsPerMinCU = 1<<(2*(sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()));
     1836      const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && isChroma(compID)) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode;
    18331837      const UInt uiChFinalMode = ((chFmt == CHROMA_422)       && isChroma(compID)) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
    18341838
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1287 r1290  
    868868
    869869  Int addCuDepth = max (0, log2MinCUSize - (Int)pcSPS->getQuadtreeTULog2MinSize() );
    870   pcSPS->setMaxCUDepth( maxCUDepthDelta + addCuDepth  + getMaxCUDepthOffset(pcSPS->getChromaFormatIdc(), pcSPS->getQuadtreeTULog2MinSize()) );
     870  pcSPS->setMaxTotalCUDepth( maxCUDepthDelta + addCuDepth  + getMaxCUDepthOffset(pcSPS->getChromaFormatIdc(), pcSPS->getQuadtreeTULog2MinSize()) );
    871871
    872872  READ_FLAG( uiCode, "scaling_list_enabled_flag" );                 pcSPS->setScalingListFlag ( uiCode );
     
    23472347Void TDecCavlc::parseDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    23482348{
    2349   Int qp;
    23502349  Int  iDQp;
    23512350
     
    23612360  Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffset(CHANNEL_TYPE_LUMA);
    23622361#endif
    2363   qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) -  qpBdOffsetY;
    2364 
    2365   UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>((g_uiMaxCUDepth - pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())<<1))<<((g_uiMaxCUDepth - pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())<<1) ;
    2366   UInt uiQpCUDepth =   min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ;
     2362  const Int qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) -  qpBdOffsetY;
     2363
     2364  const UInt maxCUDepth        = pcCU->getSlice()->getSPS()->getMaxTotalCUDepth();
     2365  const UInt maxCuDQPDepth     = pcCU->getSlice()->getPPS()->getMaxCuDQPDepth();
     2366  const UInt doubleDepthDifference = ((maxCUDepth - maxCuDQPDepth)<<1);
     2367  const UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>doubleDepthDifference)<<doubleDepthDifference ;
     2368  const UInt uiQpCUDepth =   min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ;
    23672369
    23682370  pcCU->setQPSubParts( qp, uiAbsQpCUPartIdx, uiQpCUDepth );
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1289 r1290  
    235235    bBoundary = true;
    236236  }
    237 
    238   if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary )
     237  if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary )
    239238  {
    240239    UInt uiIdx = uiAbsPartIdx;
    241     if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
     240    if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
    242241    {
    243242      setdQPFlag(true);
     
    245244    }
    246245
    247     if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) // TODO: tidy expression
     246    if( uiDepth == pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
    248247    {
    249248      setIsChromaQpAdjCoded(true);
     
    270269      uiIdx += uiQNumParts;
    271270    }
    272     if( (maxCuWidth>>uiDepth) == (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
     271    if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
    273272    {
    274273      if ( getdQPFlag() )
     
    281280  }
    282281
    283   if( (maxCuWidth>>uiDepth) >= (maxCuWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
     282  if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP())
    284283  {
    285284    setdQPFlag(true);
     
    287286  }
    288287
    289   if( (maxCuWidth>>uiDepth) >= (maxCuWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) // TODO: tidy expression
     288  if( uiDepth <= pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
    290289  {
    291290    setIsChromaQpAdjCoded(true);
     
    416415  }
    417416
    418   if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary )
     417  if( ( ( uiDepth < pCtu->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary )
    419418  {
    420419    UInt uiNextDepth = uiDepth + 1;
     
    569568
    570569  const UInt uiChPredMode  = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx );
    571   const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode;
     570  const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize()));
     571  const UInt uiChCodedMode = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode;
    572572  const UInt uiChFinalMode = ((chFmt == CHROMA_422)       && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
    573573
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.cpp

    r1286 r1290  
    184184  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    185185  UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) );
    186   UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
     186  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4;
    187187
    188188  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r1289 r1290  
    510510Void TDecSbac::parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    511511{
    512   if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     512  if( uiDepth == pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() )
    513513  {
    514514    pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx );
     
    540540  const UChar cuWidth =UChar(pcCU->getSlice()->getSPS()->getMaxCUWidth()>>uiDepth);
    541541  const UChar cuHeight=UChar(pcCU->getSlice()->getSPS()->getMaxCUHeight()>>uiDepth);
     542  const Int log2DiffMaxMinCodingBlockSize = pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize();
    542543
    543544#if RExt__DECODER_DEBUG_BIT_STATISTICS
     
    545546#endif
    546547
     548  assert ( pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() == log2DiffMaxMinCodingBlockSize);
    547549  if ( pcCU->isIntra( uiAbsPartIdx ) )
    548550  {
    549551    uiSymbol = 1;
    550     if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     552    if( uiDepth == log2DiffMaxMinCodingBlockSize )
    551553    {
    552554      m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
     
    570572    UInt uiMaxNumBits = 2;
    571573
    572     if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( cuWidth == 8 && cuHeight == 8 ) )
     574    if( uiDepth == log2DiffMaxMinCodingBlockSize && !( cuWidth == 8 && cuHeight == 8 ) )
    573575    {
    574576      uiMaxNumBits ++;
     
    585587    }
    586588    eMode = (PartSize) uiMode;
    587     if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
     589    if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize )
    588590    {
    589591      if (eMode == SIZE_2NxN)
     
    12331235  const UInt uiHeight=rRect.height;
    12341236  TCoeff* pcCoef=(pcCU->getCoeff(compID)+rTu.getCoefficientOffset(compID));
     1237  const TComSPS &sps=*(pcCU->getSlice()->getSPS());
    12351238
    12361239  DTRACE_CABAC_VL( g_nSymbolCounter++ )
     
    12651268  //--------------------------------------------------------------------------------------------------
    12661269
    1267   if( uiWidth > pcCU->getSlice()->getSPS()->getMaxTrSize() )
     1270  if( uiWidth > sps.getMaxTrSize() )
    12681271  {
    12691272    std::cerr << "ERROR: parseCoeffNxN was passed a TU with dimensions larger than the maximum allowed size" << std::endl;
     
    12831286
    12841287  const ChannelType  channelType       = toChannelType(compID);
    1285   const Bool         extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision();
    1286 
    1287   const Bool         alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass();
    1288   const Int          maxLog2TrDynamicRange  = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType);
     1288  const Bool         extendedPrecision = sps.getUseExtendedPrecision();
     1289
     1290  const Bool         alignCABACBeforeBypass = sps.getAlignCABACBeforeBypass();
     1291  const Int          maxLog2TrDynamicRange  = sps.getMaxLog2TrDynamicRange(channelType);
    12891292
    12901293#if RExt__DECODER_DEBUG_BIT_STATISTICS
     
    13331336  if ( isIntra && pcCU->isRDPCMEnabled(uiAbsPartIdx) )
    13341337  {
     1338    const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize()));
    13351339    uiIntraMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx );
    1336     uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat())) : uiIntraMode;
     1340    uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat(), partsPerMinCU)) : uiIntraMode;
    13371341    uiIntraMode = ((rTu.GetChromaFormat() == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiIntraMode] : uiIntraMode;
    13381342
     
    13471351  //--------------------------------------------------------------------------------------------------
    13481352
    1349   const Bool  bUseGolombRiceParameterAdaptation = pcCU->getSlice()->getSPS()->getUseGolombRiceParameterAdaptation();
     1353  const Bool  bUseGolombRiceParameterAdaptation = sps.getUseGolombRiceParameterAdaptation();
    13501354        UInt &currentGolombRiceStatistic        = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)];
    13511355
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1289 r1290  
    254254    }
    255255
    256     rpcPic->create( vps, sps, pps, g_uiMaxCUDepth, true, m_layerId);
     256    rpcPic->create( vps, sps, pps, true, m_layerId);
    257257#else //SVC_EXTENSION
    258     rpcPic->create ( sps, pps, g_uiMaxCUDepth, true);
     258    rpcPic->create ( sps, pps, true);
    259259#endif //SVC_EXTENSION
    260260   
     
    303303  }
    304304
    305   rpcPic->create( vps, sps, pps, g_uiMaxCUDepth, true, m_layerId);
     305  rpcPic->create( vps, sps, pps, true, m_layerId);
    306306#else  //SVC_EXTENSION
    307   rpcPic->create ( sps, pps, g_uiMaxCUDepth, true);
     307  rpcPic->create ( sps, pps, true);
    308308#endif //SVC_EXTENSION
    309309}
     
    493493        UInt refLayerId = 0;
    494494
    495         pBLPic->create( *vps, *sps, *pps, sps->getMaxCUDepth(), true, refLayerId);
     495        pBLPic->create( *vps, *sps, *pps, true, refLayerId);
    496496
    497497        // it is needed where the VPS is accessed through the slice
     
    571571#endif //SVC_EXTENSION
    572572
    573     // TODO: remove the use of the following globals:
    574     g_uiMaxCUDepth  = sps->getMaxCUDepth();
    575 #if SVC_EXTENSION
    576     g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(vps->getChromaFormatIdc(sps, m_apcSlicePilot->getLayerId()), sps->getQuadtreeTULog2MinSize()));
    577 #else
    578     g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize()));
    579 #endif
     573    // NOTE: globals were set up here originally. You can now use:
     574    // g_uiMaxCUDepth = sps->getMaxTotalCUDepth();
     575    // g_uiAddCUDepth = sps->getMaxTotalCUDepth() - sps->getLog2DiffMaxMinCodingBlockSize()
    580576
    581577    //  Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use.
     
    605601    // Initialise the various objects for the new set of settings
    606602#if SVC_EXTENSION
    607     m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
     603    m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
    608604#else
    609     m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
    610 #endif
    611     m_cLoopFilter.create( sps->getMaxCUDepth() );
     605    m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
     606#endif
     607    m_cLoopFilter.create( sps->getMaxTotalCUDepth() );
    612608    m_cPrediction.initTempBuff(sps->getChromaFormatIdc());
    613609
     
    666662    // Recursive structure
    667663#if SVC_EXTENSION
    668     m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() );
     664    m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() );
    669665    m_cCuDecoder.init   ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId );
    670666#else
    671     m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
     667    m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
    672668    m_cCuDecoder.init   ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
    673669#endif
     
    21982194  if( m_layerId > 0 )
    21992195  {
    2200     g_uiMaxCUDepth  = sps->getMaxCUDepth();
    2201     g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() );
    2202 
    22032196    if (m_cIlpPic[0] == NULL)
    22042197    {
     
    22072200        m_cIlpPic[j] = new  TComPic;
    22082201
    2209         m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), g_uiMaxCUDepth, true, m_layerId);
     2202        m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), true, m_layerId);
    22102203
    22112204        for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++)
     
    23792372Void TDecTop::initAsymLut(TComSlice *pcSlice)
    23802373{
    2381   if(m_layerId>0)
    2382   {
    2383     if(!m_pColorMappedPic)
    2384     {
    2385       Int picWidth    = pcSlice->getPicWidthInLumaSamples();
    2386       Int picHeight   = pcSlice->getPicHeightInLumaSamples();
     2374  if( m_layerId > 0 )
     2375  {
     2376    if( !m_pColorMappedPic )
     2377    {
    23872378      m_pColorMappedPic = new TComPicYuv;
    2388       m_pColorMappedPic->create( picWidth, picHeight, pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), g_uiMaxCUDepth, true, NULL );
     2379      m_pColorMappedPic->create( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc()/*CHROMA_420*/, pcSlice->getSPS()->getMaxCUWidth(), pcSlice->getSPS()->getMaxCUHeight(), pcSlice->getSPS()->getMaxTotalCUDepth(), true, NULL );
    23892380    }
    23902381  }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1287 r1290  
    642642#endif
    643643  assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() );
    644 
    645644  WRITE_UVLC( pcSPS->getLog2MinCodingBlockSize() - 3,                                "log2_min_luma_coding_block_size_minus3" );
    646645  WRITE_UVLC( pcSPS->getLog2DiffMaxMinCodingBlockSize(),                             "log2_diff_max_min_luma_coding_block_size" );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1289 r1290  
    148148  UInt      m_maxCUWidth;
    149149  UInt      m_maxCUHeight;
     150  UInt      m_maxTotalCUDepth;
     151  UInt      m_log2DiffMaxMinCodingBlockSize;
     152
    150153  //======= Transform =============
    151154  UInt      m_uiQuadtreeTULog2MaxSize;
     
    515518  Void      setMaxCUWidth                   ( UInt  u )      { m_maxCUWidth  = u; }
    516519  Void      setMaxCUHeight                  ( UInt  u )      { m_maxCUHeight = u; }
     520  Void      setMaxTotalCUDepth              ( UInt  u )      { m_maxTotalCUDepth = u; }
     521  Void      setLog2DiffMaxMinCodingBlockSize( UInt  u )      { m_log2DiffMaxMinCodingBlockSize = u; }
    517522
    518523  //======== Transform =============
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp

    r1289 r1290  
    374374  const TComPPS &pps=*(rpcTempCU->getSlice()->getPPS());
    375375  const TComSPS &sps=*(rpcTempCU->getSlice()->getSPS());
    376   const UInt maxCUWidth = sps.getMaxCUWidth();
    377376
    378377  // get Original YUV data from picture
     
    399398  const UInt numberValidComponents = rpcBestCU->getPic()->getNumberValidComponents();
    400399
    401   if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression
     400  if( uiDepth <= pps.getMaxCuDQPDepth() )
    402401  {
    403402    Int idQP = m_pcEncCfg->getMaxDeltaQP();
     
    565564        {
    566565          // 2Nx2N, NxN
     566
    567567          if(!( (rpcBestCU->getWidth(0)==8) && (rpcBestCU->getHeight(0)==8) ))
    568568          {
    569             if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu)
     569            if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() && doNotBlockPu)
    570570            {
    571571              xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN DEBUG_STRING_PASS_INTO(sDebug)   );
     
    594594
    595595          //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
    596           if(sps.getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
     596          if(sps.getUseAMP() && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() )
    597597          {
    598598#if AMP_ENC_SPEEDUP
     
    721721          xCheckRDCostIntra( rpcBestCU, rpcTempCU, intraCost, SIZE_2Nx2N DEBUG_STRING_PASS_INTO(sDebug) );
    722722          rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    723           if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     723          if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() )
    724724          {
    725725            if( rpcTempCU->getWidth(0) > ( 1 << sps.getQuadtreeTULog2MinSize() ) )
     
    802802  }
    803803
    804   if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression
     804  if( uiDepth == pps.getMaxCuDQPDepth() )
    805805  {
    806806    Int idQP = m_pcEncCfg->getMaxDeltaQP();
     
    813813#endif   
    814814  }
    815   else if( (maxCUWidth>>uiDepth) > (maxCUWidth >> ( pps.getMaxCuDQPDepth())) ) // TODO: tidy expression
     815  else if( uiDepth < pps.getMaxCuDQPDepth() )
    816816  {
    817817    iMinQP = iBaseQP;
     
    843843
    844844    // further split
    845     if( bSubBranch && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )
     845    if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() )
    846846    {
    847847      UChar       uhNextDepth         = uiDepth+1;
     
    906906      rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    907907
    908       if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
     908      if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
    909909      {
    910910        Bool hasResidual = false;
     
    10821082  }
    10831083
    1084   if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < (g_uiMaxCUDepth-g_uiAddCUDepth) ) ) || bBoundary )
     1084  if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() ) ) || bBoundary )
    10851085  {
    10861086    UInt uiQNumParts = ( pcPic->getNumPartitionsInCtu() >> (uiDepth<<1) )>>2;
    1087     if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
     1087    if( uiDepth == pps.getMaxCuDQPDepth() && pps.getUseDQP())
    10881088    {
    10891089      setdQPFlag(true);
    10901090    }
    10911091
    1092     if( (maxCUWidth>>uiDepth) == (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression
     1092    if( uiDepth == pps.getMaxCuChromaQpAdjDepth() && pcSlice->getUseChromaQpAdj())
    10931093    {
    10941094      setCodeChromaQpAdjFlag(true);
     
    11121112  }
    11131113
    1114   if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuDQPDepth())) && pps.getUseDQP()) // TODO: tidy expression
     1114  if( uiDepth <= pps.getMaxCuDQPDepth() && pps.getUseDQP())
    11151115  {
    11161116    setdQPFlag(true);
    11171117  }
    11181118
    1119   if( (maxCUWidth>>uiDepth) >= (maxCUWidth >> ( pps.getMaxCuChromaQpAdjDepth())) && pcSlice->getUseChromaQpAdj()) // TODO: tidy expression
     1119  if( uiDepth <= pps.getMaxCuChromaQpAdjDepth() && pcSlice->getUseChromaQpAdj())
    11201120  {
    11211121    setCodeChromaQpAdjFlag(true);
     
    16481648
    16491649  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
     1650  if ( pps.getUseDQP() && uiDepth <= pps.getMaxCuDQPDepth() )
    16521651  {
    16531652    if ( pcCU->getQtRootCbf( 0) )
     
    17671766  const TComSPS &sps = *(pCtu->getSlice()->getSPS());
    17681767
    1769   const UInt uiMinCUWidth = sps.getMaxCUWidth() >> g_uiMaxCUDepth;
    1770   UInt uiMinNumCoeffInCU = 1 << uiMinCUWidth;
     1768  const UInt uiMinCUWidth = sps.getMaxCUWidth() >> sps.getMaxTotalCUDepth(); // NOTE: ed - this is not the minimum CU width. It is the square-root of the number of coefficients per part.
     1769  const UInt uiMinNumCoeffInCU = 1 << uiMinCUWidth;                          // NOTE: ed - what is this?
    17711770
    17721771  memset( cSum, 0, sizeof( Double )*(LEVEL_RANGE+1) );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1286 r1290  
    473473  UInt uiNumPU = ( ePartSize == SIZE_2Nx2N ? 1 : ( ePartSize == SIZE_NxN ? 4 : 2 ) );
    474474  UInt uiDepth = pcCU->getDepth( uiAbsPartIdx );
    475   UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
     475  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4;
    476476
    477477  for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1289 r1290  
    202202
    203203    const TComVPS *vps = pcTEncTop->getVPS();
    204 
    205     const Int bitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, pcTEncTop->getSPS(), pcTEncTop->getLayerId());
    206     const Int bitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, pcTEncTop->getSPS(), pcTEncTop->getLayerId());
     204    const TComSPS *sps = pcTEncTop->getSPS();
     205
     206    const Int bitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, sps, pcTEncTop->getLayerId());
     207    const Int bitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, sps, pcTEncTop->getLayerId());
    207208    const Int prevBitDepthLuma = vps->getBitDepth(CHANNEL_TYPE_LUMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId);
    208209    const Int prevBitDepthChroma = vps->getBitDepth(CHANNEL_TYPE_CHROMA, m_ppcTEncTop[prevLayerIdx]->getSPS(), prevLayerId);
     
    214215    {
    215216      m_pColorMappedPic = new TComPicYuv;
    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 );
     217      m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), true, NULL );
    217218    }
    218219  }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp

    r1289 r1290  
    119119 * \param sps reference to used SPS
    120120 * \param pps reference to used PPS
    121  * \param uiMaxWidth Maximum CU width
    122  * \param uiMaxHeight Maximum CU height
    123  * \param uiMaxDepth Maximum CU depth
    124  * \param uiMaxAQDepth Maximum depth of unit block for assigning QP adaptive to local image characteristics
     121 * \param uiMaxAdaptiveQPDepth Maximum depth of unit block for assigning QP adaptive to local image characteristics
    125122 * \param bIsVirtual
    126123 */
     
    128125#if SVC_EXTENSION
    129126// * \param vps reference to used VPS
    130 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId )
     127Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual, const UInt layerId )
    131128{
    132   TComPic::create( vps, sps, pps, uiMaxDepth, bIsVirtual, layerId );
     129  TComPic::create( vps, sps, pps, bIsVirtual, layerId );
    133130
    134131  const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
    135132  const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    136133#else
    137 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual )
     134Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual )
    138135{
    139   TComPic::create( sps, pps, uiMaxDepth, bIsVirtual );
     136  TComPic::create( sps, pps, bIsVirtual );
    140137  const Int  iWidth      = sps.getPicWidthInLumaSamples();
    141138  const Int  iHeight     = sps.getPicHeightInLumaSamples();
     
    144141  const UInt uiMaxWidth  = sps.getMaxCUWidth();
    145142  const UInt uiMaxHeight = sps.getMaxCUHeight();
    146   m_uiMaxAQDepth = uiMaxAQDepth;
    147   if ( uiMaxAQDepth > 0 )
     143  m_uiMaxAQDepth = uiMaxAdaptiveQPDepth;
     144  if ( uiMaxAdaptiveQPDepth > 0 )
    148145  {
    149146    m_acAQLayer = new TEncPicQPAdaptationLayer[ m_uiMaxAQDepth ];
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h

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

    r1287 r1290  
    441441{
    442442  PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
     443  const UInt log2DiffMaxMinCodingBlockSize = pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize();
    443444
    444445  if ( pcCU->isIntra( uiAbsPartIdx ) )
    445446  {
    446     if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     447    if( uiDepth == log2DiffMaxMinCodingBlockSize )
    447448    {
    448449      m_pcBinIf->encodeBin( eSize == SIZE_2Nx2N? 1 : 0, m_cCUPartSizeSCModel.get( 0, 0, 0 ) );
     
    464465      m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    465466      m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    466       if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
     467      if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize )
    467468      {
    468469        if (eSize == SIZE_2NxN)
     
    485486      m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    486487
    487       if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )
     488      if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )
    488489      {
    489490        m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 2) );
    490491      }
    491492
    492       if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
     493      if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize )
    493494      {
    494495        if (eSize == SIZE_Nx2N)
     
    506507    case SIZE_NxN:
    507508    {
    508       if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )
     509      if( uiDepth == log2DiffMaxMinCodingBlockSize && !( pcCU->getWidth(uiAbsPartIdx) == 8 && pcCU->getHeight(uiAbsPartIdx) == 8 ) )
    509510      {
    510511        m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );
     
    617618Void TEncSbac::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    618619{
    619   if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
     620  if( uiDepth == pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() )
    620621  {
    621622    return;
     
    11941195  const UInt uiWidth=tuRect.width;
    11951196  const UInt uiHeight=tuRect.height;
     1197  const TComSPS &sps=*(pcCU->getSlice()->getSPS());
    11961198
    11971199  DTRACE_CABAC_VL( g_nSymbolCounter++ )
     
    12251227  //--------------------------------------------------------------------------------------------------
    12261228
    1227   if( uiWidth > m_pcSlice->getSPS()->getMaxTrSize() )
     1229  if( uiWidth > sps.getMaxTrSize() )
    12281230  {
    12291231    std::cerr << "ERROR: codeCoeffNxN was passed a TU with dimensions larger than the maximum allowed size" << std::endl;
     
    12511253
    12521254  const ChannelType  channelType       = toChannelType(compID);
    1253   const Bool         extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision();
    1254 
    1255   const Bool         alignCABACBeforeBypass = pcCU->getSlice()->getSPS()->getAlignCABACBeforeBypass();
    1256   const Int          maxLog2TrDynamicRange  = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(channelType);
     1255  const Bool         extendedPrecision = sps.getUseExtendedPrecision();
     1256
     1257  const Bool         alignCABACBeforeBypass = sps.getAlignCABACBeforeBypass();
     1258  const Int          maxLog2TrDynamicRange  = sps.getMaxLog2TrDynamicRange(channelType);
    12571259
    12581260  Bool beValid;
     
    12661268      uiIntraMode = pcCU->getIntraDir( toChannelType(compID), uiAbsPartIdx );
    12671269
    1268       uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat())) : uiIntraMode;
     1270      const UInt partsPerMinCU = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize()));
     1271      uiIntraMode = (uiIntraMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, rTu.GetChromaFormat(), partsPerMinCU)) : uiIntraMode;
    12691272      uiIntraMode = ((rTu.GetChromaFormat() == CHROMA_422) && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiIntraMode] : uiIntraMode;
    12701273    }
     
    13071310  //--------------------------------------------------------------------------------------------------
    13081311
    1309   const Bool  bUseGolombRiceParameterAdaptation = pcCU->getSlice()->getSPS()->getUseGolombRiceParameterAdaptation();
     1312  const Bool  bUseGolombRiceParameterAdaptation = sps.getUseGolombRiceParameterAdaptation();
    13101313        UInt &currentGolombRiceStatistic        = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)];
    13111314
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1289 r1290  
    206206                      const UInt    maxCUWidth,
    207207                      const UInt    maxCUHeight,
     208                      const UInt    maxTotalCUDepth,
    208209                      TEncEntropy*  pcEntropyCoder,
    209210                      TComRdCost*   pcRdCost,
     
    255256
    256257  const UInt uiNumLayersToAllocate = pcEncCfg->getQuadtreeTULog2MaxSize()-pcEncCfg->getQuadtreeTULog2MinSize()+1;
    257   const UInt uiNumPartitions = 1<<(g_uiMaxCUDepth<<1);
     258  const UInt uiNumPartitions = 1<<(maxTotalCUDepth<<1);
    258259  for (UInt ch=0; ch<MAX_NUM_COMPONENT; ch++)
    259260  {
     
    11071108    return;
    11081109  }
    1109   const Bool       bIsLuma = isLuma(compID);
    1110   const TComRectangle &rect= rTu.getRect(compID);
    1111   TComDataCU *pcCU=rTu.getCU();
    1112   const UInt uiAbsPartIdx=rTu.GetAbsPartIdxTU();
    1113 
    1114   const UInt uiTrDepth=rTu.GetTransformDepthRelAdj(compID);
    1115   const UInt uiFullDepth   = rTu.GetTransformDepthTotal();
    1116   const UInt uiLog2TrSize  = rTu.GetLog2LumaTrSize();
    1117   const ChromaFormat chFmt = pcOrgYuv->getChromaFormat();
    1118   const ChannelType chType = toChannelType(compID);
     1110  const Bool           bIsLuma          = isLuma(compID);
     1111  const TComRectangle &rect             = rTu.getRect(compID);
     1112        TComDataCU    *pcCU             = rTu.getCU();
     1113  const UInt           uiAbsPartIdx     = rTu.GetAbsPartIdxTU();
     1114  const TComSPS       &sps              = *(pcCU->getSlice()->getSPS());
     1115
     1116  const UInt           uiTrDepth        = rTu.GetTransformDepthRelAdj(compID);
     1117  const UInt           uiFullDepth      = rTu.GetTransformDepthTotal();
     1118  const UInt           uiLog2TrSize     = rTu.GetLog2LumaTrSize();
     1119  const ChromaFormat   chFmt            = pcOrgYuv->getChromaFormat();
     1120  const ChannelType    chType           = toChannelType(compID);
    11191121#if SVC_EXTENSION
    1120   const Int  bitDepth = pcCU->getSlice()->getBitDepth(chType);
     1122  const Int            bitDepth        = pcCU->getSlice()->getBitDepth(chType);
    11211123#else
    1122   const Int  bitDepth = pcCU->getSlice()->getSPS()->getBitDepth(chType);
    1123 #endif
    1124 
    1125   const UInt    uiWidth           = rect.width;
    1126   const UInt    uiHeight          = rect.height;
    1127   const UInt    uiStride          = pcOrgYuv ->getStride (compID);
    1128         Pel*    piOrg             = pcOrgYuv ->getAddr( compID, uiAbsPartIdx );
    1129         Pel*    piPred            = pcPredYuv->getAddr( compID, uiAbsPartIdx );
    1130         Pel*    piResi            = pcResiYuv->getAddr( compID, uiAbsPartIdx );
    1131         Pel*    piReco            = pcPredYuv->getAddr( compID, uiAbsPartIdx );
    1132   const UInt    uiQTLayer           = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize;
    1133         Pel*    piRecQt           = m_pcQTTempTComYuv[ uiQTLayer ].getAddr( compID, uiAbsPartIdx );
    1134   const UInt    uiRecQtStride     = m_pcQTTempTComYuv[ uiQTLayer ].getStride(compID);
    1135   const UInt    uiZOrder            = pcCU->getZorderIdxInCtu() + uiAbsPartIdx;
    1136         Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getAddr( compID, pcCU->getCtuRsAddr(), uiZOrder );
    1137         UInt    uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride  ( compID );
    1138         TCoeff* pcCoeff           = m_ppcQTTempCoeff[compID][uiQTLayer] + rTu.getCoefficientOffset(compID);
    1139         Bool    useTransformSkip = pcCU->getTransformSkip(uiAbsPartIdx, compID);
     1124  const Int            bitDepth         = sps.getBitDepth(chType);
     1125#endif
     1126
     1127  const UInt           uiWidth          = rect.width;
     1128  const UInt           uiHeight         = rect.height;
     1129  const UInt           uiStride         = pcOrgYuv ->getStride (compID);
     1130        Pel           *piOrg            = pcOrgYuv ->getAddr( compID, uiAbsPartIdx );
     1131        Pel           *piPred           = pcPredYuv->getAddr( compID, uiAbsPartIdx );
     1132        Pel           *piResi           = pcResiYuv->getAddr( compID, uiAbsPartIdx );
     1133        Pel           *piReco           = pcPredYuv->getAddr( compID, uiAbsPartIdx );
     1134  const UInt           uiQTLayer        = sps.getQuadtreeTULog2MaxSize() - uiLog2TrSize;
     1135        Pel           *piRecQt          = m_pcQTTempTComYuv[ uiQTLayer ].getAddr( compID, uiAbsPartIdx );
     1136  const UInt           uiRecQtStride    = m_pcQTTempTComYuv[ uiQTLayer ].getStride(compID);
     1137  const UInt           uiZOrder         = pcCU->getZorderIdxInCtu() + uiAbsPartIdx;
     1138        Pel           *piRecIPred       = pcCU->getPic()->getPicYuvRec()->getAddr( compID, pcCU->getCtuRsAddr(), uiZOrder );
     1139        UInt           uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride  ( compID );
     1140        TCoeff        *pcCoeff          = m_ppcQTTempCoeff[compID][uiQTLayer] + rTu.getCoefficientOffset(compID);
     1141        Bool           useTransformSkip = pcCU->getTransformSkip(uiAbsPartIdx, compID);
    11401142
    11411143#if ADAPTIVE_QP_SELECTION
    1142         TCoeff*    pcArlCoeff     = m_ppcQTTempArlCoeff[compID][ uiQTLayer ] + rTu.getCoefficientOffset(compID);
    1143 #endif
    1144 
    1145   const UInt uiChPredMode         = pcCU->getIntraDir( chType, uiAbsPartIdx );
    1146   const UInt uiChCodedMode        = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt)) : uiChPredMode;
    1147   const UInt uiChFinalMode        = ((chFmt == CHROMA_422)       && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
    1148 
    1149   const Int         blkX                                 = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
    1150   const Int         blkY                                 = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
    1151   const Int         bufferOffset                         = blkX + (blkY * MAX_CU_SIZE);
    1152         Pel  *const encoderLumaResidual                  = resiLuma[RESIDUAL_ENCODER_SIDE ] + bufferOffset;
    1153         Pel  *const reconstructedLumaResidual            = resiLuma[RESIDUAL_RECONSTRUCTED] + bufferOffset;
    1154   const Bool        bUseCrossCPrediction                 = isChroma(compID) && (uiChPredMode == DM_CHROMA_IDX) && checkCrossCPrediction;
    1155   const Bool        bUseReconstructedResidualForEstimate = m_pcEncCfg->getUseReconBasedCrossCPredictionEstimate();
    1156         Pel *const  lumaResidualForEstimate              = bUseReconstructedResidualForEstimate ? reconstructedLumaResidual : encoderLumaResidual;
     1144        TCoeff        *pcArlCoeff       = m_ppcQTTempArlCoeff[compID][ uiQTLayer ] + rTu.getCoefficientOffset(compID);
     1145#endif
     1146
     1147  const UInt           uiChPredMode     = pcCU->getIntraDir( chType, uiAbsPartIdx );
     1148  const UInt           partsPerMinCU    = 1<<(2*(sps.getMaxTotalCUDepth() - sps.getLog2DiffMaxMinCodingBlockSize()));
     1149  const UInt           uiChCodedMode    = (uiChPredMode==DM_CHROMA_IDX && !bIsLuma) ? pcCU->getIntraDir(CHANNEL_TYPE_LUMA, getChromasCorrespondingPULumaIdx(uiAbsPartIdx, chFmt, partsPerMinCU)) : uiChPredMode;
     1150  const UInt           uiChFinalMode    = ((chFmt == CHROMA_422)       && !bIsLuma) ? g_chroma422IntraAngleMappingTable[uiChCodedMode] : uiChCodedMode;
     1151
     1152  const Int            blkX                                 = g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
     1153  const Int            blkY                                 = g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
     1154  const Int            bufferOffset                         = blkX + (blkY * MAX_CU_SIZE);
     1155        Pel  *const    encoderLumaResidual                  = resiLuma[RESIDUAL_ENCODER_SIDE ] + bufferOffset;
     1156        Pel  *const    reconstructedLumaResidual            = resiLuma[RESIDUAL_RECONSTRUCTED] + bufferOffset;
     1157  const Bool           bUseCrossCPrediction                 = isChroma(compID) && (uiChPredMode == DM_CHROMA_IDX) && checkCrossCPrediction;
     1158  const Bool           bUseReconstructedResidualForEstimate = m_pcEncCfg->getUseReconBasedCrossCPredictionEstimate();
     1159        Pel *const     lumaResidualForEstimate              = bUseReconstructedResidualForEstimate ? reconstructedLumaResidual : encoderLumaResidual;
    11571160
    11581161#ifdef DEBUG_STRING
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h

    r1289 r1290  
    140140            const UInt    maxCUWidth,
    141141            const UInt    maxCUHeight,
     142            const UInt    maxTotalCUDepth,
    142143            TEncEntropy*  pcEntropyCoder,
    143144            TComRdCost*   pcRdCost,
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1289 r1290  
    117117  m_cGOPEncoder.        create( );
    118118#endif
    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 );
     119  m_cSliceEncoder.      create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth );
     120  m_cCuEncoder.         create( m_maxTotalCUDepth, m_maxCUWidth, m_maxCUHeight, m_chromaFormatIDC );
    121121  if (m_bUseSAO)
    122122  {
    123     m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] );
     123    m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] );
    124124#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
    125125    m_cEncSAO.createEncData(getSaoCtuBoundary());
     
    135135#endif
    136136
    137   m_cLoopFilter.create( g_uiMaxCUDepth );
     137  m_cLoopFilter.create( m_maxTotalCUDepth );
    138138
    139139  if ( m_RCEnableRateControl )
     
    143143  }
    144144
    145   m_pppcRDSbacCoder = new TEncSbac** [g_uiMaxCUDepth+1];
     145  m_pppcRDSbacCoder = new TEncSbac** [m_maxTotalCUDepth+1];
    146146#if FAST_BIT_EST
    147   m_pppcBinCoderCABAC = new TEncBinCABACCounter** [g_uiMaxCUDepth+1];
     147  m_pppcBinCoderCABAC = new TEncBinCABACCounter** [m_maxTotalCUDepth+1];
    148148#else
    149   m_pppcBinCoderCABAC = new TEncBinCABAC** [g_uiMaxCUDepth+1];
    150 #endif
    151 
    152   for ( Int iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
     149  m_pppcBinCoderCABAC = new TEncBinCABAC** [m_maxTotalCUDepth+1];
     150#endif
     151
     152  for ( Int iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ )
    153153  {
    154154    m_pppcRDSbacCoder[iDepth] = new TEncSbac* [CI_NUM];
     
    190190  m_cRateCtrl.          destroy();
    191191  Int iDepth;
    192   for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
     192  for ( iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ )
    193193  {
    194194    for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
     
    199199  }
    200200
    201   for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
     201  for ( iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ )
    202202  {
    203203    delete [] m_pppcRDSbacCoder[iDepth];
     
    258258
    259259  // initialize encoder search class
    260   m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, m_maxCUWidth, m_maxCUHeight, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
     260  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, &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, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true);
     581          rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, true);
    582582        }
    583583        rcListPicYuvRecOut.pushBack( rpcPicYuvRec );
     
    620620        {
    621621          rpcPicYuvRec = new TComPicYuv;
    622           rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, g_uiMaxCUDepth, true);
     622          rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, true);
    623623        }
    624624        rcListPicYuvRecOut.pushBack( rpcPicYuvRec );
     
    750750      }
    751751
    752       pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);
     752      pcEPic->create( m_cVPS, m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);
    753753#else  //SVC_EXTENSION
    754       pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false);
     754      pcEPic->create( m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, false);
    755755#endif //SVC_EXTENSION
    756756      rpcPic = pcEPic;
     
    800800      }
    801801
    802       rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, false, m_layerId );
     802      rpcPic->create( m_cVPS, m_cSPS, m_cPPS, false, m_layerId );
    803803#else  //SVC_EXTENSION
    804       rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUDepth, false );
     804      rpcPic->create( m_cSPS, m_cPPS, false );
    805805#endif //SVC_EXTENSION
    806806    }
     
    884884   * that chooses the actual compatibility based upon options */
    885885
    886   m_cSPS.setPicWidthInLumaSamples         ( m_iSourceWidth      );
    887   m_cSPS.setPicHeightInLumaSamples        ( m_iSourceHeight     );
    888   m_cSPS.setConformanceWindow             ( m_conformanceWindow );
    889   m_cSPS.setMaxCUWidth    ( m_maxCUWidth      );
    890   m_cSPS.setMaxCUHeight   ( m_maxCUHeight     );
    891   m_cSPS.setMaxCUDepth    ( g_uiMaxCUDepth      );
     886  m_cSPS.setPicWidthInLumaSamples  ( m_iSourceWidth      );
     887  m_cSPS.setPicHeightInLumaSamples ( m_iSourceHeight     );
     888  m_cSPS.setConformanceWindow      ( m_conformanceWindow );
     889  m_cSPS.setMaxCUWidth             ( m_maxCUWidth        );
     890  m_cSPS.setMaxCUHeight            ( m_maxCUHeight       );
     891  m_cSPS.setMaxTotalCUDepth        ( m_maxTotalCUDepth   );
    892892  m_cSPS.setChromaFormatIdc( m_chromaFormatIDC);
    893 
    894   Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getMaxCUDepth()-g_uiAddCUDepth );
     893  m_cSPS.setLog2DiffMaxMinCodingBlockSize(m_log2DiffMaxMinCodingBlockSize);
     894
     895  Int minCUSize = m_cSPS.getMaxCUWidth() >> ( m_cSPS.getLog2DiffMaxMinCodingBlockSize() );
    895896  Int log2MinCUSize = 0;
    896897  while(minCUSize > 1)
     
    901902
    902903  m_cSPS.setLog2MinCodingBlockSize(log2MinCUSize);
    903   m_cSPS.setLog2DiffMaxMinCodingBlockSize(m_cSPS.getMaxCUDepth()-g_uiAddCUDepth-getMaxCUDepthOffset(m_cSPS.getChromaFormatIdc(), m_cSPS.getQuadtreeTULog2MinSize()));
     904 
    904905#if SVC_EXTENSION
    905906  m_cSPS.setSPSId         ( m_iSPSIdCnt       );
     
    924925  {
    925926#if SVC_EXTENSION
    926     m_cSPS.setBitDepth    (ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType))            );
     927    m_cSPS.setBitDepth    (ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType))            );   
     928#if O0043_BEST_EFFORT_DECODING
     929    m_cSPS.setStreamBitDepth(ChannelType(channelType), m_bitDepth[channelType] );
     930#endif
    927931    m_cSPS.setQpBDOffset  (ChannelType(channelType), (6 * (m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) - 8)));
    928 #if O0043_BEST_EFFORT_DECODING
    929     m_cSPS.setStreamBitDepth(ChannelType(channelType), m_cVPS.getVpsRepFormat( m_cVPS.getVpsRepFormatIdx( m_cVPS.getLayerIdxInVps( m_layerId ) ) )->getBitDepthVps(ChannelType(channelType)) );
    930 #endif
    931932#else
     933    m_cSPS.setBitDepth      (ChannelType(channelType), m_bitDepth[channelType] );
    932934#if O0043_BEST_EFFORT_DECODING
    933935    m_cSPS.setStreamBitDepth(ChannelType(channelType), m_bitDepth[channelType] );
     
    15051507  if( m_layerId > 0 )
    15061508  {
    1507     g_uiMaxCUDepth  = m_cSPS.getMaxCUDepth();
    1508     g_uiAddCUDepth  = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() );
    1509 
    1510     if (m_cIlpPic[0] == NULL)
     1509    if( m_cIlpPic[0] == NULL )
    15111510    {
    15121511      for (Int j=0; j < m_numDirectRefLayers; j++)
    15131512      {
    15141513        m_cIlpPic[j] = new TComPic;
    1515         m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUDepth, true, m_layerId);
     1514        m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, true, m_layerId);
    15161515        for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++)
    15171516        {
Note: See TracChangeset for help on using the changeset viewer.