Changeset 1433 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 11 Aug 2015, 20:22:28 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1424 r1433 399 399 }; 400 400 401 #if U0132_TARGET_BITS_SATURATION 402 UInt g_uiMaxCpbSize[2][21] = 403 { 404 // LEVEL1, LEVEL2,LEVEL2_1, LEVEL3, LEVEL3_1, LEVEL4, LEVEL4_1, LEVEL5, LEVEL5_1, LEVEL5_2, LEVEL6, LEVEL6_1, LEVEL6_2 405 { 0, 0, 0, 350000, 0, 0, 1500000, 3000000, 0, 6000000, 10000000, 0, 12000000, 20000000, 0, 25000000, 40000000, 60000000, 60000000, 120000000, 240000000 }, 406 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30000000, 50000000, 0, 100000000, 160000000, 240000000, 240000000, 480000000, 800000000 } 407 }; 408 #endif 409 401 410 static const struct MapStrToCostMode 402 411 { … … 826 835 Int* cfg_RCInitialQP [MAX_LAYERS]; 827 836 Bool* cfg_RCForceIntraQP [MAX_LAYERS]; 837 838 #if U0132_TARGET_BITS_SATURATION 839 Bool* cfg_RCCpbSaturationEnabled[MAX_LAYERS]; 840 UInt* cfg_RCCpbSize [MAX_LAYERS]; 841 Double* cfg_RCInitialCpbFullness [MAX_LAYERS]; 842 #endif 828 843 #endif 829 844 … … 916 931 cfg_RCInitialQP[layer] = &m_apcLayerCfg[layer]->m_RCInitialQP; 917 932 cfg_RCForceIntraQP[layer] = &m_apcLayerCfg[layer]->m_RCForceIntraQP; 933 934 #if U0132_TARGET_BITS_SATURATION 935 cfg_RCCpbSaturationEnabled[layer] = &m_apcLayerCfg[layer]->m_RCCpbSaturationEnabled; 936 cfg_RCCpbSize[layer] = &m_apcLayerCfg[layer]->m_RCCpbSize; 937 cfg_RCInitialCpbFullness[layer] = &m_apcLayerCfg[layer]->m_RCInitialCpbFullness; 938 #endif 918 939 #endif 919 940 … … 1248 1269 ("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") 1249 1270 ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1, or none") 1250 ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)") 1251 1271 ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)") 1252 1272 ("MaxBitDepthConstraint", m_bitDepthConstraint, 0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1253 1273 ("MaxChromaFormatConstraint", tmpConstraintChromaFormat, 0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") … … 1449 1469 ("InitialQP%d", cfg_RCInitialQP, 0, m_numLayers, "Rate control: initial QP") 1450 1470 ("RCForceIntraQP%d", cfg_RCForceIntraQP, false, m_numLayers, "Rate control: force intra QP to be equal to initial QP") 1471 #if U0132_TARGET_BITS_SATURATION 1472 ( "RCCpbSaturation%d", cfg_RCCpbSaturationEnabled, false, m_numLayers, "Rate control: enable target bits saturation to avoid CPB overflow and underflow" ) 1473 ( "RCCpbSize%d", cfg_RCCpbSize, 0u, m_numLayers, "Rate control: CPB size" ) 1474 ( "RCInitialCpbFullness%d", cfg_RCInitialCpbFullness, 0.9, m_numLayers, "Rate control: initial CPB fullness" ) 1475 #endif 1451 1476 #else 1452 1477 ( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" ) … … 1457 1482 ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" ) 1458 1483 ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" ) 1484 #if U0132_TARGET_BITS_SATURATION 1485 ( "RCCpbSaturation", m_RCCpbSaturationEnabled, false, "Rate control: enable target bits saturation to avoid CPB overflow and underflow" ) 1486 ( "RCCpbSize", m_RCCpbSize, 0u, "Rate control: CPB size" ) 1487 ( "RCInitialCpbFullness", m_RCInitialCpbFullness, 0.9, "Rate control: initial CPB fullness" ) 1488 #endif 1459 1489 #endif 1460 1490 … … 4199 4229 } 4200 4230 } 4201 } 4202 xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); 4231 xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); 4232 #if U0132_TARGET_BITS_SATURATION 4233 Int layerPTLIdx = m_apcLayerCfg[layerIdx]->m_layerPTLIdx; 4234 4235 if( m_apcLayerCfg[layerIdx]->m_RCCpbSaturationEnabled && m_levelList[layerPTLIdx]!=Level::NONE && m_profileList[layerPTLIdx]!=Profile::NONE ) 4236 { 4237 UInt uiLevelIdx = (m_levelList[layerPTLIdx] / 10) + (UInt)((m_levelList[layerPTLIdx] % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3); 4238 xConfirmPara( m_apcLayerCfg[layerIdx]->m_RCCpbSize > g_uiMaxCpbSize[m_levelTierList[layerPTLIdx]][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level"); 4239 xConfirmPara( m_apcLayerCfg[layerIdx]->m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1"); 4240 } 4241 #endif 4242 } 4243 #if U0132_TARGET_BITS_SATURATION 4244 else 4245 { 4246 xConfirmPara( m_apcLayerCfg[layerIdx]->m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" ); 4247 } 4248 #endif 4203 4249 #else 4204 4250 if ( m_RCEnableRateControl ) … … 4213 4259 } 4214 4260 xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); 4215 } 4261 #if U0132_TARGET_BITS_SATURATION 4262 if ((m_RCCpbSaturationEnabled) && (m_level!=Level::NONE) && (m_profile!=Profile::NONE)) 4263 { 4264 UInt uiLevelIdx = (m_level / 10) + (UInt)((m_level % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3); 4265 xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level"); 4266 xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1"); 4267 } 4268 #endif 4269 } 4270 #if U0132_TARGET_BITS_SATURATION 4271 else 4272 { 4273 xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" ); 4274 } 4275 #endif 4216 4276 #endif 4217 4277 … … 4504 4564 printf("InitialQP : %d\n", m_RCInitialQP ); 4505 4565 printf("ForceIntraQP : %d\n", m_RCForceIntraQP ); 4566 #if U0132_TARGET_BITS_SATURATION 4567 printf("CpbSaturation : %d\n", m_RCCpbSaturationEnabled ); 4568 if (m_RCCpbSaturationEnabled) 4569 { 4570 printf("CpbSize : %d\n", m_RCCpbSize); 4571 printf("InitalCpbFullness : %.2f\n", m_RCInitialCpbFullness); 4572 } 4573 #endif 4506 4574 } 4507 4575 #endif … … 4571 4639 4572 4640 printf(" SignBitHidingFlag:%d ", m_signHideFlag); 4573 printf("RecalQP:%d 4641 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 4574 4642 4575 4643 #if SVC_EXTENSION
Note: See TracChangeset for help on using the changeset viewer.