Changeset 1235 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 13 Jul 2015, 20:38:11 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1233 r1235 750 750 Int* cfg_conformanceMode [MAX_LAYERS]; 751 751 Bool* cfg_useExtendedPrecision [MAX_LAYERS]; 752 #if LAYER_CTB 752 753 Int* cfg_maxCuDQPDepth[MAX_LAYERS]; 754 753 755 // 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]; 757 763 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 765 767 #if AUXILIARY_PICTURES 766 768 Int* cfg_auxId[MAX_LAYERS]; … … 860 862 cfg_aiPadY[layer] = &m_acLayerCfg[layer].m_aiPad[1]; 861 863 cfg_useExtendedPrecision[layer] = &m_acLayerCfg[layer].m_useExtendedPrecision; 862 #if LAYER_CTB 864 865 cfg_maxCuDQPDepth[layer] = &m_acLayerCfg[layer].m_iMaxCuDQPDepth; 866 863 867 // coding unit (CU) definition 864 868 cfg_uiMaxCUWidth[layer] = &m_acLayerCfg[layer].m_uiMaxCUWidth; … … 872 876 cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter; 873 877 cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra; 874 #endif875 878 876 879 cfg_numSamplePredRefLayers [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers; … … 1201 1204 ("LayerPTLIndex%d", cfg_layerPTLIdx, 0, MAX_VPS_LAYER_IDX_PLUS1, "Index of PTL for each layer") 1202 1205 ("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") 1203 1220 #else 1204 1221 ("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") … … 1214 1231 ("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing") 1215 1232 ("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 1248 1234 // Unit definition parameters 1249 1235 ("MaxCUWidth", m_uiMaxCUWidth, 64u) … … 1303 1289 ("DeltaQpRD,-dqr", m_uiDeltaQpRD, 0u, "max dQp offset for slice") 1304 1290 ("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 1305 1294 ("MaxCuDQPDepth,-dqd", m_iMaxCuDQPDepth, 0, "max depth for a minimum CuDQP") 1295 #endif 1306 1296 ("MaxCUChromaQpAdjustmentDepth", m_maxCUChromaQpAdjustmentDepth, -1, "Maximum depth for CU chroma Qp adjustment - set less than 0 to disable") 1307 1297 … … 1732 1722 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 1733 1723 #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 } 1735 1728 #endif 1736 1729 #endif //SVC_EXTENSION … … 2594 2587 fclose(fpt); 2595 2588 } 2596 } 2597 m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 2598 #endif 2589 } 2590 #endif 2591 2599 2592 if( m_masteringDisplay.colourVolumeSEIEnabled ) 2600 2593 { … … 2814 2807 2815 2808 // set global varibles 2816 #if LAYER_CTB2817 for(Int layer = 0; layer < MAX_LAYERS; layer++)2809 #if SVC_EXTENSION 2810 for(Int layer = 0; layer < m_numLayers; layer++) 2818 2811 { 2819 2812 xSetGlobal(layer); … … 3100 3093 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 3101 3094 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 3108 3096 xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 3109 3097 #endif … … 3120 3108 xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 3121 3109 } 3122 #endif3123 #if !LAYER_CTB3124 3110 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); 3125 3111 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); 3126 3112 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 3127 3113 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 3128 #endif3129 #if !SVC_EXTENSION3130 3114 xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); 3131 3115 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 3135 3117 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); 3136 3118 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); … … 3205 3187 xConfirmPara( m_defDispWinBottomOffset % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling"); 3206 3188 } 3207 #endif 3208 3209 #if !LAYER_CTB 3189 3210 3190 // max CU width and height should be power of 2 3211 3191 UInt ui = m_uiMaxCUWidth; … … 3925 3905 Int m_iSourceWidth = m_acLayerCfg[layerIdx].m_iSourceWidth; 3926 3906 Int m_iSourceHeight = m_acLayerCfg[layerIdx].m_iSourceHeight; 3927 #if LAYER_CTB3928 3907 Int m_uiMaxCUWidth = m_acLayerCfg[layerIdx].m_uiMaxCUWidth; 3929 3908 Int m_uiMaxCUHeight = m_acLayerCfg[layerIdx].m_uiMaxCUHeight; 3930 #endif3931 3909 3932 3910 Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 ); … … 4010 3988 #if !SVC_EXTENSION 4011 3989 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" );4014 3990 #endif 4015 3991 … … 4232 4208 } 4233 4209 #else 4210 #if SVC_EXTENSION 4211 Void TAppEncCfg::xSetGlobal(UInt layerId) 4212 #else 4234 4213 Void TAppEncCfg::xSetGlobal() 4214 #endif 4235 4215 { 4236 4216 #if SVC_EXTENSION … … 4244 4224 4245 4225 // 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 4246 4240 g_uiMaxCUWidth = m_uiMaxCUWidth; 4247 4241 g_uiMaxCUHeight = m_uiMaxCUHeight; … … 4256 4250 g_uiAddCUDepth++; 4257 4251 g_uiMaxCUDepth = m_uiMaxCUDepth; 4252 #endif 4258 4253 4259 4254 // set internal bit-depth and constants … … 4358 4353 printf("Profile : %s\n", profileToString(m_profile) ); 4359 4354 } 4360 #endif 4361 #if !LAYER_CTB 4355 4362 4356 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 4363 4357 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); … … 4373 4367 #if !SVC_EXTENSION 4374 4368 printf("QP : %5.2f\n", m_fQP ); 4375 #endif4376 4369 printf("Max dQP signaling depth : %d\n", m_iMaxCuDQPDepth); 4370 #endif 4377 4371 4378 4372 printf("Cb QP Offset : %d\n", m_cbQpOffset ); … … 4465 4459 printf("CIP:%d ", m_bUseConstrainedIntraPred); 4466 4460 printf("SAO:%d ", (m_bUseSAO)?(1):(0)); 4467 #if ! LAYER_CTB4461 #if !SVC_EXTENSION 4468 4462 printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); 4469 4463 #endif … … 4482 4476 printf("PME:%d ", m_log2ParallelMergeLevel); 4483 4477 #if !SVC_EXTENSION 4478 const Int iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 4484 4479 printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", 4485 m_iWaveFrontSynchro, m_iWaveFrontSubstreams);4480 m_iWaveFrontSynchro, iWaveFrontSubstreams); 4486 4481 #endif 4487 4482 printf(" ScalingList:%d ", m_useScalingListId ); … … 4497 4492 printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV); 4498 4493 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 4499 4501 #else 4500 4502 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 4501 #endif4502 #if CGS_3D_ASYMLUT4503 printf("CGS: %d CGSMaxOctantDepth: %d CGSMaxYPartNumLog2: %d CGSLUTBit:%d " , m_nCGSFlag , m_nCGSMaxOctantDepth , m_nCGSMaxYPartNumLog2 , m_nCGSLUTBit );4504 #endif4505 printf("CGSAdaptC:%d " , m_nCGSAdaptiveChroma );4506 #if R0179_ENC_OPT_3DLUT_SIZE4507 printf("CGSSizeRDO:%d " , m_nCGSLutSizeRDO );4508 4503 #endif 4509 4504
Note: See TracChangeset for help on using the changeset viewer.