Ignore:
Timestamp:
13 Jul 2015, 20:38:11 (9 years ago)
Author:
seregin
Message:

port rev 4219 and rev 4246

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1233 r1235  
    750750  Int*    cfg_conformanceMode  [MAX_LAYERS];
    751751  Bool*   cfg_useExtendedPrecision [MAX_LAYERS];
    752 #if LAYER_CTB
     752
     753  Int*    cfg_maxCuDQPDepth[MAX_LAYERS];
     754
    753755  // coding unit (CU) definition
    754   UInt*      cfg_uiMaxCUWidth[MAX_LAYERS];                                   ///< max. CU width in pixel
    755   UInt*      cfg_uiMaxCUHeight[MAX_LAYERS];                                  ///< max. CU height in pixel
    756   UInt*      cfg_uiMaxCUDepth[MAX_LAYERS];                                   ///< max. CU depth
     756  UInt*   cfg_uiMaxCUWidth[MAX_LAYERS];                                   ///< max. CU width in pixel
     757  UInt*   cfg_uiMaxCUHeight[MAX_LAYERS];                                  ///< max. CU height in pixel
     758  UInt*   cfg_uiMaxCUDepth[MAX_LAYERS];                                   ///< max. CU depth
     759
     760  // transfom unit (TU) definition
     761  UInt*   cfg_uiQuadtreeTULog2MaxSize[MAX_LAYERS];
     762  UInt*   cfg_uiQuadtreeTULog2MinSize[MAX_LAYERS];
    757763 
    758   // transfom unit (TU) definition
    759   UInt*      cfg_uiQuadtreeTULog2MaxSize[MAX_LAYERS];
    760   UInt*      cfg_uiQuadtreeTULog2MinSize[MAX_LAYERS];
    761  
    762   UInt*      cfg_uiQuadtreeTUMaxDepthInter[MAX_LAYERS];
    763   UInt*      cfg_uiQuadtreeTUMaxDepthIntra[MAX_LAYERS];
    764 #endif
     764  UInt*   cfg_uiQuadtreeTUMaxDepthInter[MAX_LAYERS];
     765  UInt*   cfg_uiQuadtreeTUMaxDepthIntra[MAX_LAYERS];
     766
    765767#if AUXILIARY_PICTURES
    766768  Int*    cfg_auxId[MAX_LAYERS];
     
    860862    cfg_aiPadY[layer]               = &m_acLayerCfg[layer].m_aiPad[1];
    861863    cfg_useExtendedPrecision[layer] = &m_acLayerCfg[layer].m_useExtendedPrecision;
    862 #if LAYER_CTB
     864
     865    cfg_maxCuDQPDepth[layer]        = &m_acLayerCfg[layer].m_iMaxCuDQPDepth;
     866
    863867    // coding unit (CU) definition
    864868    cfg_uiMaxCUWidth[layer]  = &m_acLayerCfg[layer].m_uiMaxCUWidth;
     
    872876    cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter;
    873877    cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra;
    874 #endif
    875878
    876879    cfg_numSamplePredRefLayers  [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers;
     
    12011204  ("LayerPTLIndex%d",                                 cfg_layerPTLIdx,               0, MAX_VPS_LAYER_IDX_PLUS1, "Index of PTL for each layer")
    12021205  ("ListOfProfileTierLevelOls%d",                     cfg_listOfLayerPTLOfOlss, string(""), MAX_VPS_OUTPUT_LAYER_SETS_PLUS1, "PTL Index for each layer in each OLS except the first OLS. The PTL index for layer in the first OLS is set to 1")
     1206
     1207  // Unit definition parameters
     1208  ("MaxCUWidth%d",                                    cfg_uiMaxCUWidth,                       64u, MAX_LAYERS, "Maximum CU width")
     1209  ("MaxCUHeight%d",                                   cfg_uiMaxCUHeight,                      64u, MAX_LAYERS, "Maximum CU height")
     1210  // todo: remove defaults from MaxCUSize
     1211  ("MaxCUSize%d,s",                                   cfg_uiMaxCUWidth,                       64u, MAX_LAYERS, "Maximum CU size")
     1212  ("MaxCUSize%d,s",                                   cfg_uiMaxCUHeight,                      64u, MAX_LAYERS, "Maximum CU size")
     1213  ("MaxPartitionDepth%d,h%d",                         cfg_uiMaxCUDepth,                        4u, MAX_LAYERS, "CU depth")
     1214
     1215  ("QuadtreeTULog2MaxSize%d",                         cfg_uiQuadtreeTULog2MaxSize,             5u, MAX_LAYERS, "Maximum TU size in logarithm base 2")
     1216  ("QuadtreeTULog2MinSize%d",                         cfg_uiQuadtreeTULog2MinSize,             2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")
     1217                                                                                               
     1218  ("QuadtreeTUMaxDepthIntra%d",                       cfg_uiQuadtreeTUMaxDepthIntra,           3u, MAX_LAYERS, "Depth of TU tree for intra CUs")
     1219  ("QuadtreeTUMaxDepthInter%d",                       cfg_uiQuadtreeTUMaxDepthInter,           3u, MAX_LAYERS, "Depth of TU tree for inter CUs")
    12031220#else
    12041221  ("Profile",                                         extendedProfile,                                   NONE, "Profile name to use for encoding. Use main (for main), main10 (for main10), main-still-picture, main-RExt (for Range Extensions profile), any of the RExt specific profile names, or none")
     
    12141231  ("NonPackedSource",                                 m_nonPackedConstraintFlag,                        false, "Indicate that source does not contain frame packing")
    12151232  ("FrameOnly",                                       m_frameOnlyConstraintFlag,                        false, "Indicate that the bitstream contains only frames")
    1216 #endif
    1217 
    1218 #if LAYER_CTB
    1219   // Unit definition parameters
    1220   ("MaxCUWidth%d",                                    cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU width")
    1221   ("MaxCUHeight%d",                                   cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU height")
    1222   // todo: remove defaults from MaxCUSize
    1223   ("MaxCUSize%d,s%d",                                 cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU size")
    1224   ("MaxCUSize%d,s%d",                                 cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU size")
    1225   ("MaxPartitionDepth%d,h%d",                         cfg_uiMaxCUDepth,              4u, MAX_LAYERS, "CU depth")
    1226  
    1227   ("QuadtreeTULog2MaxSize%d",                         cfg_uiQuadtreeTULog2MaxSize,   6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")
    1228   ("QuadtreeTULog2MinSize%d",                         cfg_uiQuadtreeTULog2MinSize,   2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")
    1229  
    1230   ("QuadtreeTUMaxDepthIntra%d",                       cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")
    1231   ("QuadtreeTUMaxDepthInter%d",                       cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")
    1232 
    1233 
    1234   // set the same CU realted settings across all the layers if config file parameters are not layer specific
    1235   ("MaxCUWidth",                                      cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU width")
    1236   ("MaxCUHeight",                                     cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU height")
    1237   // todo: remove defaults from MaxCUSize
    1238   ("MaxCUSize,s",                                     cfg_uiMaxCUWidth,             64u, MAX_LAYERS, "Maximum CU size")
    1239   ("MaxCUSize,s",                                     cfg_uiMaxCUHeight,            64u, MAX_LAYERS, "Maximum CU size")
    1240   ("MaxPartitionDepth,h",                             cfg_uiMaxCUDepth,              4u, MAX_LAYERS, "CU depth")
    1241  
    1242   ("QuadtreeTULog2MaxSize",                           cfg_uiQuadtreeTULog2MaxSize,   6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")
    1243   ("QuadtreeTULog2MinSize",                           cfg_uiQuadtreeTULog2MinSize,   2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")
    1244  
    1245   ("QuadtreeTUMaxDepthIntra",                         cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")
    1246   ("QuadtreeTUMaxDepthInter",                         cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")
    1247 #else
     1233
    12481234  // Unit definition parameters
    12491235  ("MaxCUWidth",                                      m_uiMaxCUWidth,                                     64u)
     
    13031289  ("DeltaQpRD,-dqr",                                  m_uiDeltaQpRD,                                       0u, "max dQp offset for slice")
    13041290  ("MaxDeltaQP,d",                                    m_iMaxDeltaQP,                                        0, "max dQp offset for block")
     1291#if SVC_EXTENSION
     1292  ("MaxCuDQPDepth%d,-dqd",                            cfg_maxCuDQPDepth,                        0, MAX_LAYERS, "max depth for a minimum CuDQP")
     1293#else
    13051294  ("MaxCuDQPDepth,-dqd",                              m_iMaxCuDQPDepth,                                     0, "max depth for a minimum CuDQP")
     1295#endif
    13061296  ("MaxCUChromaQpAdjustmentDepth",                    m_maxCUChromaQpAdjustmentDepth,                      -1, "Maximum depth for CU chroma Qp adjustment - set less than 0 to disable")
    13071297
     
    17321722  m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    17331723#if Q0074_COLOUR_REMAPPING_SEI
    1734   m_colourRemapSEIFileRoot = cfg_colourRemapSEIFileRoot.empty() ? NULL : strdup(cfg_colourRemapSEIFileRoot.c_str());
     1724  if( !cfg_colourRemapSEIFileRoot.empty() )
     1725  {
     1726    m_colourRemapSEIFileRoot = strdup(cfg_colourRemapSEIFileRoot.c_str());
     1727  }
    17351728#endif
    17361729#endif //SVC_EXTENSION
     
    25942587      fclose(fpt);
    25952588    }
    2596   }
    2597   m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
    2598 #endif
     2589  } 
     2590#endif
     2591
    25992592  if( m_masteringDisplay.colourVolumeSEIEnabled )
    26002593  {
     
    28142807
    28152808  // set global varibles
    2816 #if LAYER_CTB
    2817   for(Int layer = 0; layer < MAX_LAYERS; layer++)
     2809#if SVC_EXTENSION
     2810  for(Int layer = 0; layer < m_numLayers; layer++)
    28182811  {
    28192812    xSetGlobal(layer);
     
    31003093  xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
    31013094  xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
    3102 #if LAYER_CTB
    3103   for(UInt layer = 0; layer < MAX_LAYERS; layer++)
    3104   {
    3105     xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1,                "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
    3106   }
    3107 #else
     3095#if !SVC_EXTENSION 
    31083096  xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1,                                          "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
    31093097#endif
     
    31203108    xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize ,                      "Intra period must be larger than GOP size for periodic IDR pictures");
    31213109  }
    3122 #endif
    3123 #if !LAYER_CTB
    31243110  xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
    31253111  xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4,                                    "Minimum partition height size should be larger than or equal to 8");
    31263112  xConfirmPara( m_uiMaxCUWidth < 16,                                                        "Maximum partition width size should be larger than or equal to 16");
    31273113  xConfirmPara( m_uiMaxCUHeight < 16,                                                       "Maximum partition height size should be larger than or equal to 16");
    3128 #endif
    3129 #if !SVC_EXTENSION
    31303114  xConfirmPara( (m_iSourceWidth  % (m_uiMaxCUWidth  >> (m_uiMaxCUDepth-1)))!=0,             "Resulting coded frame width must be a multiple of the minimum CU size");
    31313115  xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0,             "Resulting coded frame height must be a multiple of the minimum CU size");
    3132 #endif
    3133  
    3134 #if !LAYER_CTB
     3116
    31353117  xConfirmPara( m_uiQuadtreeTULog2MinSize < 2,                                        "QuadtreeTULog2MinSize must be 2 or greater.");
    31363118  xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5,                                        "QuadtreeTULog2MaxSize must be 5 or smaller.");
     
    32053187    xConfirmPara( m_defDispWinBottomOffset % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling");
    32063188  }
    3207 #endif
    3208 
    3209 #if !LAYER_CTB
     3189
    32103190  // max CU width and height should be power of 2
    32113191  UInt ui = m_uiMaxCUWidth;
     
    39253905  Int m_iSourceWidth = m_acLayerCfg[layerIdx].m_iSourceWidth;
    39263906  Int m_iSourceHeight = m_acLayerCfg[layerIdx].m_iSourceHeight;
    3927 #if LAYER_CTB
    39283907  Int m_uiMaxCUWidth = m_acLayerCfg[layerIdx].m_uiMaxCUWidth;
    39293908  Int m_uiMaxCUHeight = m_acLayerCfg[layerIdx].m_uiMaxCUHeight;
    3930 #endif
    39313909
    39323910  Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 );
     
    40103988#if !SVC_EXTENSION
    40113989  xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
    4012   xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" );
    4013   xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_iWaveFrontSynchro, "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" );
    40143990#endif
    40153991
     
    42324208}
    42334209#else
     4210#if SVC_EXTENSION
     4211Void TAppEncCfg::xSetGlobal(UInt layerId)
     4212#else
    42344213Void TAppEncCfg::xSetGlobal()
     4214#endif
    42354215{
    42364216#if SVC_EXTENSION
     
    42444224
    42454225  // set max CU width & height
     4226#if SVC_EXTENSION
     4227  g_uiMaxCUWidth  = m_acLayerCfg[layerId].m_uiMaxCUWidth;
     4228  g_uiMaxCUHeight = m_acLayerCfg[layerId].m_uiMaxCUHeight;
     4229
     4230  // compute actual CU depth with respect to config depth and max transform size
     4231  g_uiAddCUDepth  = 0;
     4232  while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth )  ) ) g_uiAddCUDepth++;
     4233
     4234  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.
     4235
     4236  m_acLayerCfg[layerId].m_uiMaxCUDepth += g_uiAddCUDepth;
     4237  g_uiAddCUDepth++;
     4238  g_uiMaxCUDepth = m_acLayerCfg[layerId].m_uiMaxCUDepth;
     4239#else
    42464240  g_uiMaxCUWidth  = m_uiMaxCUWidth;
    42474241  g_uiMaxCUHeight = m_uiMaxCUHeight;
     
    42564250  g_uiAddCUDepth++;
    42574251  g_uiMaxCUDepth = m_uiMaxCUDepth;
     4252#endif
    42584253
    42594254  // set internal bit-depth and constants
     
    43584353    printf("Profile                           : %s\n", profileToString(m_profile) );
    43594354  }
    4360 #endif
    4361 #if !LAYER_CTB
     4355
    43624356  printf("CU size / depth                   : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth );
    43634357  printf("RQT trans. size (min / max)       : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
     
    43734367#if !SVC_EXTENSION
    43744368  printf("QP                                : %5.2f\n", m_fQP );
    4375 #endif
    43764369  printf("Max dQP signaling depth           : %d\n", m_iMaxCuDQPDepth);
     4370#endif
    43774371
    43784372  printf("Cb QP Offset                      : %d\n", m_cbQpOffset   );
     
    44654459  printf("CIP:%d ", m_bUseConstrainedIntraPred);
    44664460  printf("SAO:%d ", (m_bUseSAO)?(1):(0));
    4467 #if !LAYER_CTB
     4461#if !SVC_EXTENSION
    44684462  printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
    44694463#endif
     
    44824476  printf("PME:%d ", m_log2ParallelMergeLevel);
    44834477#if !SVC_EXTENSION
     4478  const Int iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
    44844479  printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d",
    4485           m_iWaveFrontSynchro, m_iWaveFrontSubstreams);
     4480          m_iWaveFrontSynchro, iWaveFrontSubstreams);
    44864481#endif
    44874482  printf(" ScalingList:%d ", m_useScalingListId );
     
    44974492  printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV);
    44984493  printf("ENCODER_FAST_MODE: %d ", ENCODER_FAST_MODE);
     4494#if CGS_3D_ASYMLUT
     4495  printf("CGS: %d CGSMaxOctantDepth: %d CGSMaxYPartNumLog2: %d CGSLUTBit:%d ", m_nCGSFlag, m_nCGSMaxOctantDepth, m_nCGSMaxYPartNumLog2, m_nCGSLUTBit );
     4496  printf("CGSAdaptC:%d ", m_nCGSAdaptiveChroma );
     4497#if R0179_ENC_OPT_3DLUT_SIZE
     4498  printf("CGSSizeRDO:%d ", m_nCGSLutSizeRDO );
     4499#endif
     4500#endif
    44994501#else
    45004502  printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
    4501 #endif
    4502 #if CGS_3D_ASYMLUT
    4503   printf("CGS: %d CGSMaxOctantDepth: %d CGSMaxYPartNumLog2: %d CGSLUTBit:%d " , m_nCGSFlag , m_nCGSMaxOctantDepth , m_nCGSMaxYPartNumLog2 , m_nCGSLUTBit );
    4504 #endif
    4505   printf("CGSAdaptC:%d " , m_nCGSAdaptiveChroma );
    4506 #if R0179_ENC_OPT_3DLUT_SIZE
    4507   printf("CGSSizeRDO:%d " , m_nCGSLutSizeRDO );
    45084503#endif
    45094504
Note: See TracChangeset for help on using the changeset viewer.