Changeset 1487 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 24 Nov 2015, 03:13:36 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1475 r1487 57 57 58 58 59 59 #if !SCALABLE_REXT 60 60 enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations 61 61 { … … 70 70 SCALABLEMAIN = 7, 71 71 SCALABLEMAIN10 = 8, 72 #if SCALABLE_REXT 73 SCALABLEREXT = 10, 74 #endif 72 75 #endif 73 76 // The following are RExt profiles, which would map to the MAINREXT profile idc. … … 75 78 // the chroma format in the next digit 76 79 // the intra constraint in the next digit 77 // If it is a RExt still picture, there is a '1' for the top digit. 80 // If it is a RExt still picture, there is a '1' for the next digit, 81 // If it is a Scalable Rext profile, there is a '1' for the top digit. 78 82 MONOCHROME_8 = 1008, 79 83 MONOCHROME_12 = 1012, … … 97 101 MAIN_444_STILL_PICTURE = 11308, 98 102 MAIN_444_16_STILL_PICTURE = 12316 103 #if SCALABLE_REXT 104 , 105 SCALABLE_MONOCHROME_8 = 101008, 106 SCALABLE_MONOCHROME_12 = 101012, 107 SCALABLE_MONOCHROME_16 = 101016, 108 SCALABLE_MAIN_444 = 101308 109 #endif 99 110 }; 111 #endif 100 112 101 113 … … 257 269 {"scalable-main", Profile::SCALABLEMAIN }, 258 270 {"scalable-main10", Profile::SCALABLEMAIN10 }, 271 #if SCALABLE_REXT 272 {"scalable-Rext", Profile::SCALABLEREXT }, 273 #endif 259 274 #endif 260 275 }; … … 305 320 {"scalable-main", SCALABLEMAIN }, 306 321 {"scalable-main10", SCALABLEMAIN10 }, 322 #if SCALABLE_REXT 323 {"scalable-monochrome", SCALABLE_MONOCHROME_8 }, 324 {"scalable-monochrome12", SCALABLE_MONOCHROME_12 }, 325 {"scalable-monochrome16", SCALABLE_MONOCHROME_16 }, 326 {"scalable-main_444", SCALABLE_MAIN_444 }, 327 #endif 307 328 #endif 308 329 }; … … 1074 1095 ("OutputBitDepth%d", cfg_OutputBitDepth[CHANNEL_TYPE_LUMA], 0, m_numLayers, "Bit-depth of output file (default:InternalBitDepth)") 1075 1096 ("InputBitDepthC%d", cfg_InputBitDepth[CHANNEL_TYPE_CHROMA], 0, m_numLayers, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d") 1076 ("InternalBitDepthC%d", cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA],0, m_numLayers, "As per InternalBitDepth but for chroma component. (default:Int renalBitDepth) for layer %d")1097 ("InternalBitDepthC%d", cfg_InternalBitDepth[CHANNEL_TYPE_CHROMA],0, m_numLayers, "As per InternalBitDepth but for chroma component. (default:InternalBitDepth) for layer %d") 1077 1098 ("OutputBitDepthC%d", cfg_OutputBitDepth[CHANNEL_TYPE_CHROMA], 0, m_numLayers, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 1078 1099 … … 1791 1812 1792 1813 #if SVC_EXTENSION 1814 #if SCALABLE_REXT 1815 Int cfgTmpConstraintChromaFormat = tmpConstraintChromaFormat; 1816 #endif 1793 1817 for( Int layer = 0; layer < m_numLayers; layer++ ) 1794 1818 { … … 1854 1878 m_profileList[layerPTLIdx] = Profile::MAINREXT; 1855 1879 1880 #if SCALABLE_REXT 1881 if(m_numLayers > 1 && layer == 0 ) 1882 { 1883 m_profileList[0] = extendedToShortProfileName(extendedProfile[0]); 1884 } 1885 1886 if( m_apcLayerCfg[layer]->m_bitDepthConstraint != 0 || cfgTmpConstraintChromaFormat != 0) 1887 #else 1856 1888 if( m_apcLayerCfg[layer]->m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0) 1889 #endif 1857 1890 { 1858 1891 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n"); … … 1869 1902 } 1870 1903 } 1904 #if SCALABLE_REXT 1905 else if(extendedProfile[layerPTLIdx] >= 101008 && extendedProfile[layerPTLIdx] <= 101308) 1906 { 1907 m_profileList[layerPTLIdx] = Profile::SCALABLEREXT; 1908 1909 if( m_apcLayerCfg[layer]->m_bitDepthConstraint != 0 || cfgTmpConstraintChromaFormat != 0) 1910 { 1911 fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit Scalabe-RExt profile is specified\n"); 1912 exit(EXIT_FAILURE); 1913 } 1914 m_apcLayerCfg[layer]->m_bitDepthConstraint = (extendedProfile[layerPTLIdx]%100); 1915 m_apcLayerCfg[layer]->m_intraConstraintFlag = 0; // no all-intra constraint for scalable-Rext profiles 1916 switch ((extendedProfile[layerPTLIdx]/100)%10) 1917 { 1918 case 0: tmpConstraintChromaFormat=400; break; 1919 case 1: tmpConstraintChromaFormat=420; break; 1920 case 2: tmpConstraintChromaFormat=422; break; 1921 default: tmpConstraintChromaFormat=444; break; 1922 } 1923 } 1924 #endif 1871 1925 else 1872 1926 { 1873 1927 if( layer == 0 ) 1874 1928 { 1929 #if SCALABLE_REXT 1930 m_profileList[0] = extendedToShortProfileName(extendedProfile[0]); 1931 #else 1875 1932 m_profileList[0] = Profile::Name(extendedProfile[0]); 1933 #endif 1876 1934 } 1877 1935 … … 1884 1942 m_apcLayerCfg[layer]->m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? CHROMA_444 : numberToChromaFormat(tmpConstraintChromaFormat); 1885 1943 } 1944 #if SCALABLE_REXT 1945 else if( m_profileList[layerPTLIdx] == Profile::MAINREXT || m_profileList[layerPTLIdx] == Profile::SCALABLEREXT ) 1946 #else 1886 1947 else if( m_profileList[layerPTLIdx] == Profile::MAINREXT ) 1948 #endif 1887 1949 { 1888 1950 if( m_apcLayerCfg[layer]->m_bitDepthConstraint == 0 && tmpConstraintChromaFormat == 0 ) … … 1923 1985 m_apcLayerCfg[layer]->m_bitDepthConstraint = (m_profileList[layerPTLIdx] == Profile::MAIN10 || m_profileList[layerPTLIdx] == Profile::SCALABLEMAIN10) ? 10 : 8; 1924 1986 } 1987 #if FORMATIDX_CHECK 1988 for(Int compareLayer = layer+1; compareLayer < m_numLayers; compareLayer++ ) 1989 { 1990 if(m_apcLayerCfg[layer]->m_repFormatIdx == m_apcLayerCfg[compareLayer]->m_repFormatIdx && ( 1991 m_apcLayerCfg[layer]->m_chromaFormatIDC != m_apcLayerCfg[compareLayer]->m_chromaFormatIDC 1992 // separate_colour_plane_flag not supported yet but if supported insert check here 1993 || m_apcLayerCfg[layer]->m_iSourceWidth != m_apcLayerCfg[compareLayer]->m_iSourceWidth 1994 || m_apcLayerCfg[layer]->m_iSourceHeight != m_apcLayerCfg[compareLayer]->m_iSourceHeight 1995 || m_apcLayerCfg[layer]->m_internalBitDepth != m_apcLayerCfg[compareLayer]->m_internalBitDepth 1996 || m_apcLayerCfg[layer]->m_confWinLeft != m_apcLayerCfg[compareLayer]->m_confWinLeft 1997 || m_apcLayerCfg[layer]->m_confWinRight != m_apcLayerCfg[compareLayer]->m_confWinRight 1998 || m_apcLayerCfg[layer]->m_confWinTop != m_apcLayerCfg[compareLayer]->m_confWinTop 1999 || m_apcLayerCfg[layer]->m_confWinBottom != m_apcLayerCfg[compareLayer]->m_confWinBottom 2000 )) 2001 { 2002 fprintf(stderr, "Error: Two layers using the same FormatIdx value must share the same values of the related parameters\n"); 2003 exit(EXIT_FAILURE); 2004 } 2005 } 2006 #endif 1925 2007 } 1926 2008 #else … … 2558 2640 ChromaFormat& m_chromaFormatIDC = m_apcLayerCfg[layer]->m_chromaFormatIDC; 2559 2641 2642 #if SCALABLE_REXT 2643 Int& m_confWinLeft = m_apcLayerCfg[layer]->m_confWinLeft; 2644 Int& m_confWinRight = m_apcLayerCfg[layer]->m_confWinRight; 2645 Int& m_confWinTop = m_apcLayerCfg[layer]->m_confWinTop; 2646 Int& m_confWinBottom = m_apcLayerCfg[layer]->m_confWinBottom; 2647 #else 2560 2648 Int& m_confWinLeft = m_apcLayerCfg[layer]->m_confWinLeft; 2561 2649 Int& m_confWinRight = m_apcLayerCfg[layer]->m_confWinLeft; 2562 2650 Int& m_confWinTop = m_apcLayerCfg[layer]->m_confWinLeft; 2563 2651 Int& m_confWinBottom = m_apcLayerCfg[layer]->m_confWinLeft; 2652 #endif 2564 2653 Int* m_aiPad = m_apcLayerCfg[layer]->m_aiPad; 2565 2654 Int* m_aidQP = m_apcLayerCfg[layer]->m_aidQP; … … 3110 3199 xConfirmPara(m_chromaFormatConstraint<m_chromaFormatIDC, "The chroma format used must not be greater than the chromaFormatConstraint value"); 3111 3200 3201 #if SCALABLE_REXT 3202 if (m_profile==Profile::MAINREXT || m_profile==Profile::HIGHTHROUGHPUTREXT || m_profile==Profile::SCALABLEREXT) 3203 #else 3112 3204 if (m_profile==Profile::MAINREXT || m_profile==Profile::HIGHTHROUGHPUTREXT) 3205 #endif 3113 3206 { 3114 3207 xConfirmPara(m_lowerBitRateConstraintFlag==false && m_intraConstraintFlag==false, "The lowerBitRateConstraint flag cannot be false when intraConstraintFlag is false"); 3115 3208 xConfirmPara(m_cabacBypassAlignmentEnabledFlag && m_profile!=Profile::HIGHTHROUGHPUTREXT, "AlignCABACBeforeBypass must not be enabled unless the high throughput profile is being used."); 3209 #if SCALABLE_REXT 3210 if (m_profile == Profile::MAINREXT || m_profile==Profile::SCALABLEREXT) 3211 #else 3116 3212 if (m_profile == Profile::MAINREXT) 3213 #endif 3117 3214 { 3118 3215 const UInt intraIdx = m_intraConstraintFlag ? 1:0; … … 3162 3259 xConfirmPara(m_bitDepthConstraint!=((m_profile==Profile::MAIN10)?10:8), "BitDepthConstraint must be 8 for MAIN profile and 10 for MAIN10 profile."); 3163 3260 #endif 3261 #if SCALABLE_REXT // changes below are only about displayed text 3262 xConfirmPara(m_chromaFormatConstraint!=CHROMA_420, "ChromaFormatConstraint must be 420 for non main-RExt and non scalable-Rext profiles."); 3263 xConfirmPara(m_intraConstraintFlag==true, "IntraConstraintFlag must be false for non main_RExt and non scalable-Rext profiles."); 3264 xConfirmPara(m_lowerBitRateConstraintFlag==false, "LowerBitrateConstraintFlag must be true for non main-RExt and non scalable-Rext profiles."); 3265 xConfirmPara(m_profile == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used."); 3266 3267 xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for non main-RExt and non scalable-Rext profiles."); 3268 xConfirmPara(m_log2MaxTransformSkipBlockSize!=2, "Transform Skip Log2 Max Size must be 2 for V1 profiles."); 3269 xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for non main-RExt and non scalable-Rext profiles."); 3270 xConfirmPara(m_transformSkipContextEnabledFlag==true, "UseSingleSignificanceMapContext must not be enabled for non main-RExt nand on scalable-Rext profiles."); 3271 xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT]==true, "ImplicitResidualDPCM must not be enabled for non main-RExt and non scalable-Rext profiles."); 3272 xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT]==true, "ExplicitResidualDPCM must not be enabled for non main-RExt and non scalable-Rext profiles."); 3273 xConfirmPara(m_persistentRiceAdaptationEnabledFlag==true, "GolombRiceParameterAdaption must not be enabled for non main-RExt and non scalable-Rext profiles."); 3274 xConfirmPara(m_extendedPrecisionProcessingFlag==true, "UseExtendedPrecision must not be enabled for non main-RExt and non scalable-Rext profiles."); 3275 xConfirmPara(m_highPrecisionOffsetsEnabledFlag==true, "UseHighPrecisionPredictionWeighting must not be enabled for non main-RExt and non scalable-Rext profiles."); 3276 xConfirmPara(m_enableIntraReferenceSmoothing==false, "EnableIntraReferenceSmoothing must be enabled for non main-RExt and non scalable-Rext profiles."); 3277 xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for non main-RExt and non scalable-Rext profiles."); 3278 #else 3164 3279 xConfirmPara(m_chromaFormatConstraint!=CHROMA_420, "ChromaFormatConstraint must be 420 for non main-RExt profiles."); 3165 3280 xConfirmPara(m_intraConstraintFlag==true, "IntraConstraintFlag must be false for non main_RExt profiles."); … … 3178 3293 xConfirmPara(m_enableIntraReferenceSmoothing==false, "EnableIntraReferenceSmoothing must be enabled for non main-RExt profiles."); 3179 3294 xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for non main-RExt profiles."); 3295 #endif 3180 3296 } 3181 3297 … … 4029 4145 UInt& m_uiMaxCUDepth = m_apcLayerCfg[layerIdx]->m_uiMaxCUDepth; 4030 4146 4147 #if SCALABLE_REXT 4148 Int& m_confWinLeft = m_apcLayerCfg[layerIdx]->m_confWinLeft; 4149 Int& m_confWinRight = m_apcLayerCfg[layerIdx]->m_confWinRight; 4150 Int& m_confWinTop = m_apcLayerCfg[layerIdx]->m_confWinTop; 4151 Int& m_confWinBottom = m_apcLayerCfg[layerIdx]->m_confWinBottom; 4152 #else 4031 4153 Int& m_confWinLeft = m_apcLayerCfg[layerIdx]->m_confWinLeft; 4032 4154 Int& m_confWinRight = m_apcLayerCfg[layerIdx]->m_confWinLeft; 4033 4155 Int& m_confWinTop = m_apcLayerCfg[layerIdx]->m_confWinLeft; 4034 4156 Int& m_confWinBottom = m_apcLayerCfg[layerIdx]->m_confWinLeft; 4157 #endif 4035 4158 4036 4159 Int& m_iSourceWidth = m_apcLayerCfg[layerIdx]->m_iSourceWidth;
Note: See TracChangeset for help on using the changeset viewer.