Changeset 1356 in SHVCSoftware for branches/SHM-dev/source/App
- Timestamp:
- 22 Jul 2015, 04:03:45 (9 years ago)
- Location:
- branches/SHM-dev/source/App/TAppEncoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp ¶
r1336 r1356 74 74 // The enumeration indicates the bit-depth constraint in the bottom 2 digits 75 75 // the chroma format in the next digit 76 // the intra constraint in the top digit 76 // the intra constraint in the next digit 77 // If it is a RExt still picture, there is a '1' for the top digit. 77 78 MONOCHROME_8 = 1008, 78 79 MONOCHROME_12 = 1012, … … 93 94 MAIN_444_10_INTRA = 2310, 94 95 MAIN_444_12_INTRA = 2312, 95 MAIN_444_16_INTRA = 2316 96 MAIN_444_16_INTRA = 2316, 97 MAIN_444_STILL_PICTURE = 11308, 98 MAIN_444_16_STILL_PICTURE = 12316 96 99 }; 97 100 … … 309 312 strToExtendedProfile[] = 310 313 { 311 {"none", NONE }, 312 {"main", MAIN }, 313 {"main10", MAIN10 }, 314 {"main-still-picture", MAINSTILLPICTURE }, 315 {"main-RExt", MAINREXT }, 316 {"high-throughput-RExt", HIGHTHROUGHPUTREXT }, 317 {"monochrome", MONOCHROME_8 }, 318 {"monochrome12", MONOCHROME_12 }, 319 {"monochrome16", MONOCHROME_16 }, 320 {"main12", MAIN_12 }, 321 {"main_422_10", MAIN_422_10 }, 322 {"main_422_12", MAIN_422_12 }, 323 {"main_444", MAIN_444 }, 324 {"main_444_10", MAIN_444_10 }, 325 {"main_444_12", MAIN_444_12 }, 326 {"main_444_16", MAIN_444_16 }, 327 {"main_intra", MAIN_INTRA }, 328 {"main_10_intra", MAIN_10_INTRA }, 329 {"main_12_intra", MAIN_12_INTRA }, 330 {"main_422_10_intra", MAIN_422_10_INTRA}, 331 {"main_422_12_intra", MAIN_422_12_INTRA}, 332 {"main_444_intra", MAIN_444_INTRA }, 333 {"main_444_10_intra", MAIN_444_10_INTRA}, 334 {"main_444_12_intra", MAIN_444_12_INTRA}, 335 {"main_444_16_intra", MAIN_444_16_INTRA}, 314 {"none", NONE }, 315 {"main", MAIN }, 316 {"main10", MAIN10 }, 317 {"main_still_picture", MAINSTILLPICTURE }, 318 {"main-still-picture", MAINSTILLPICTURE }, 319 {"main_RExt", MAINREXT }, 320 {"main-RExt", MAINREXT }, 321 {"main_rext", MAINREXT }, 322 {"main-rext", MAINREXT }, 323 {"high_throughput_RExt", HIGHTHROUGHPUTREXT }, 324 {"high-throughput-RExt", HIGHTHROUGHPUTREXT }, 325 {"high_throughput_rext", HIGHTHROUGHPUTREXT }, 326 {"high-throughput-rext", HIGHTHROUGHPUTREXT }, 327 {"monochrome", MONOCHROME_8 }, 328 {"monochrome12", MONOCHROME_12 }, 329 {"monochrome16", MONOCHROME_16 }, 330 {"main12", MAIN_12 }, 331 {"main_422_10", MAIN_422_10 }, 332 {"main_422_12", MAIN_422_12 }, 333 {"main_444", MAIN_444 }, 334 {"main_444_10", MAIN_444_10 }, 335 {"main_444_12", MAIN_444_12 }, 336 {"main_444_16", MAIN_444_16 }, 337 {"main_intra", MAIN_INTRA }, 338 {"main_10_intra", MAIN_10_INTRA }, 339 {"main_12_intra", MAIN_12_INTRA }, 340 {"main_422_10_intra", MAIN_422_10_INTRA}, 341 {"main_422_12_intra", MAIN_422_12_INTRA}, 342 {"main_444_intra", MAIN_444_INTRA }, 343 {"main_444_still_picture", MAIN_444_STILL_PICTURE }, 344 {"main_444_10_intra", MAIN_444_10_INTRA}, 345 {"main_444_12_intra", MAIN_444_12_INTRA}, 346 {"main_444_16_intra", MAIN_444_16_INTRA}, 347 {"main_444_16_still_picture", MAIN_444_16_STILL_PICTURE }, 336 348 #if SVC_EXTENSION 337 {"multiview-main", MULTIVIEWMAIN },338 {"scalable-main", SCALABLEMAIN },339 {"scalable-main10", SCALABLEMAIN10 },349 {"multiview-main", MULTIVIEWMAIN }, 350 {"scalable-main", SCALABLEMAIN }, 351 {"scalable-main10", SCALABLEMAIN10 }, 340 352 #endif 341 353 }; … … 849 861 Int* cfg_layerSwitchOffBegin[MAX_LAYERS]; 850 862 Int* cfg_layerSwitchOffEnd[MAX_LAYERS]; 851 852 Bool tmpIntraConstraintFlag;853 Bool tmpLowerBitRateConstraintFlag;854 UInt tmpBitDepthConstraint;855 863 Int* cfg_layerPTLIdx[MAX_VPS_LAYER_IDX_PLUS1]; 856 864 … … 1215 1223 ("Level%d", m_levelList, Level::NONE, (MAX_NUM_LAYER_IDS + 1), "Level limit to be used, eg 5.1, or none") 1216 1224 ("Tier%d", m_levelTierList, Level::MAIN, (MAX_NUM_LAYER_IDS + 1), "Tier to use for interpretation of --Level (main or high only)") 1217 ("MaxBitDepthConstraint", tmpBitDepthConstraint, 0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1225 #endif 1226 ("MaxBitDepthConstraint", m_bitDepthConstraint, 0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1218 1227 ("MaxChromaFormatConstraint", tmpConstraintChromaFormat, 0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1219 ("IntraConstraintFlag", tmpIntraConstraintFlag, false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1220 ("LowerBitRateConstraintFlag", tmpLowerBitRateConstraintFlag, true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles") 1221 1228 ("IntraConstraintFlag", m_intraConstraintFlag, false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1229 ("OnePictureOnlyConstraintFlag", m_onePictureOnlyConstraintFlag, false, "Value of general_one_picture_only_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1230 ("LowerBitRateConstraintFlag", m_lowerBitRateConstraintFlag, true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles") 1231 #if SVC_EXTENSION 1222 1232 ("ProfileCompatibility%d", m_profileCompatibility, Profile::NONE, (MAX_NUM_LAYER_IDS + 1), "Compatible profile to be used when encoding") 1223 1233 ("ProgressiveSource%d", m_progressiveSourceFlagList, false, (MAX_NUM_LAYER_IDS + 1), "Indicate that source is progressive") … … 1245 1255 ("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") 1246 1256 ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1, or none") 1247 ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)") 1248 ("MaxBitDepthConstraint", m_bitDepthConstraint, 0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1249 ("MaxChromaFormatConstraint", tmpConstraintChromaFormat, 0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters") 1250 ("IntraConstraintFlag", m_intraConstraintFlag, false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)") 1251 ("LowerBitRateConstraintFlag", m_lowerBitRateConstraintFlag, true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles") 1257 ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)") 1252 1258 1253 1259 ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive") … … 1886 1892 } 1887 1893 1888 m_acLayerCfg[layer].m_bitDepthConstraint = tmpBitDepthConstraint;1889 m_acLayerCfg[layer].m_intraConstraintFlag = tmpIntraConstraintFlag;1890 m_acLayerCfg[layer].m_lowerBitRateConstraintFlag = tmpLowerBitRateConstraintFlag;1894 m_acLayerCfg[layer].m_bitDepthConstraint = m_bitDepthConstraint; 1895 m_acLayerCfg[layer].m_intraConstraintFlag = m_intraConstraintFlag; 1896 m_acLayerCfg[layer].m_lowerBitRateConstraintFlag = m_lowerBitRateConstraintFlag; 1891 1897 1892 1898 for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++) … … 2005 2011 m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat))); 2006 2012 2007 if (extendedProfile >= 1000 && extendedProfile <= 2316)2013 if (extendedProfile >= 1000 && extendedProfile <= 12316) 2008 2014 { 2009 2015 m_profile = Profile::MAINREXT; … … 2013 2019 exit(EXIT_FAILURE); 2014 2020 } 2015 m_bitDepthConstraint = (extendedProfile%100); 2016 m_intraConstraintFlag = (extendedProfile>=2000); 2021 m_bitDepthConstraint = (extendedProfile%100); 2022 m_intraConstraintFlag = ((extendedProfile%10000)>=2000); 2023 m_onePictureOnlyConstraintFlag = (extendedProfile >= 10000); 2017 2024 switch ((extendedProfile/100)%10) 2018 2025 { … … 2050 2057 const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0; 2051 2058 const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag; 2052 m_chromaFormatConstraint = NUM_CHROMA_FORMAT; 2053 automaticallySelectRExtProfile(bUsingGeneralRExtTools, 2054 bUsingChromaQPAdjustment, 2055 bUsingExtendedPrecision, 2056 m_intraConstraintFlag, 2057 m_bitDepthConstraint, 2058 m_chromaFormatConstraint, 2059 m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]), 2060 m_chromaFormatIDC); 2059 if (m_onePictureOnlyConstraintFlag) 2060 { 2061 m_chromaFormatConstraint = CHROMA_444; 2062 if (m_intraConstraintFlag != true) 2063 { 2064 fprintf(stderr, "Error: Intra constraint flag must be true when one_picture_only_constraint_flag is true\n"); 2065 exit(EXIT_FAILURE); 2066 } 2067 const Int maxBitDepth = m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 2068 m_bitDepthConstraint = maxBitDepth>8 ? 16:8; 2069 } 2070 else 2071 { 2072 m_chromaFormatConstraint = NUM_CHROMA_FORMAT; 2073 automaticallySelectRExtProfile(bUsingGeneralRExtTools, 2074 bUsingChromaQPAdjustment, 2075 bUsingExtendedPrecision, 2076 m_intraConstraintFlag, 2077 m_bitDepthConstraint, 2078 m_chromaFormatConstraint, 2079 m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]), 2080 m_chromaFormatIDC); 2081 } 2061 2082 } 2062 2083 else if (m_bitDepthConstraint == 0 || tmpConstraintChromaFormat == 0) … … 3028 3049 xConfirmPara(bUsingGeneralRExtTools, "Combination of tools and profiles are not possible in the specified RExt profile."); 3029 3050 } 3051 xConfirmPara( m_onePictureOnlyConstraintFlag && m_chromaFormatConstraint!=CHROMA_444, "chroma format constraint must be 4:4:4 when one-picture-only constraint flag is 1"); 3052 xConfirmPara( m_onePictureOnlyConstraintFlag && m_bitDepthConstraint != 8 && m_bitDepthConstraint != 16, "bit depth constraint must be 8 or 16 when one-picture-only constraint flag is 1"); 3053 xConfirmPara( m_onePictureOnlyConstraintFlag && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when one-picture-only constraint flag is 1."); 3054 3030 3055 if (!m_intraConstraintFlag && m_bitDepthConstraint==16 && m_chromaFormatConstraint==CHROMA_444) 3031 3056 { … … 3052 3077 xConfirmPara(m_intraConstraintFlag==true, "IntraConstraintFlag must be false for non main_RExt profiles."); 3053 3078 xConfirmPara(m_lowerBitRateConstraintFlag==false, "LowerBitrateConstraintFlag must be true for non main-RExt profiles."); 3079 xConfirmPara(m_profile == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used."); 3054 3080 3055 3081 xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for non main-RExt profiles."); … … 4333 4359 if (m_profile == Profile::MAINREXT) 4334 4360 { 4335 const UInt intraIdx = m_intraConstraintFlag ? 1:0; 4336 const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 )))); 4337 const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint); 4338 const ExtendedProfileName validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx]; 4361 ExtendedProfileName validProfileName; 4362 if (m_onePictureOnlyConstraintFlag) 4363 { 4364 validProfileName = m_bitDepthConstraint == 8 ? MAIN_444_STILL_PICTURE : (m_bitDepthConstraint == 16 ? MAIN_444_16_STILL_PICTURE : NONE); 4365 } 4366 else 4367 { 4368 const UInt intraIdx = m_intraConstraintFlag ? 1:0; 4369 const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 )))); 4370 const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint); 4371 validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx]; 4372 } 4339 4373 std::string rextSubProfile; 4340 4374 if (validProfileName!=NONE) -
TabularUnified branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h ¶
r1334 r1356 144 144 Level::Tier m_levelTier; 145 145 Level::Name m_level; 146 #endif 146 147 UInt m_bitDepthConstraint; 147 148 ChromaFormat m_chromaFormatConstraint; 148 149 Bool m_intraConstraintFlag; 150 Bool m_onePictureOnlyConstraintFlag; 149 151 Bool m_lowerBitRateConstraintFlag; 152 #if !SVC_EXTENSION 150 153 Bool m_progressiveSourceFlag; 151 154 Bool m_interlacedSourceFlag; -
TabularUnified branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp ¶
r1334 r1356 229 229 m_acTEncTop[layer].setChromaFormatConstraintValue ( m_acLayerCfg[layer].m_chromaFormatConstraint ); 230 230 m_acTEncTop[layer].setIntraConstraintFlag ( m_acLayerCfg[layer].m_intraConstraintFlag ); 231 m_acTEncTop[layer].setOnePictureOnlyConstraintFlag ( m_onePictureOnlyConstraintFlag ); 231 232 m_acTEncTop[layer].setLowerBitRateConstraintFlag ( m_acLayerCfg[layer].m_lowerBitRateConstraintFlag ); 232 233 … … 809 810 m_cTEncTop.setChromaFormatConstraintValue ( m_chromaFormatConstraint ); 810 811 m_cTEncTop.setIntraConstraintFlag ( m_intraConstraintFlag ); 812 m_cTEncTop.setOnePictureOnlyConstraintFlag ( m_onePictureOnlyConstraintFlag ); 811 813 m_cTEncTop.setLowerBitRateConstraintFlag ( m_lowerBitRateConstraintFlag ); 812 814
Note: See TracChangeset for help on using the changeset viewer.