Changeset 1290 in SHVCSoftware for branches/SHM-dev/source/App


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/App
Files:
6 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  }
Note: See TracChangeset for help on using the changeset viewer.