Changeset 537 in 3DVCSoftware for branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 13 Jul 2013, 15:51:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.3-dev2/source/App/TAppEncoder/TAppEncCfg.cpp
r534 r537 79 79 m_aidQP = NULL; 80 80 #endif 81 #if J0149_TONE_MAPPING_SEI82 81 m_startOfCodedInterval = NULL; 83 82 m_codedPivotValue = NULL; 84 83 m_targetPivotValue = NULL; 85 #endif86 84 } 87 85 … … 108 106 } 109 107 #endif 110 #if J0149_TONE_MAPPING_SEI111 108 if ( m_startOfCodedInterval ) 112 109 { … … 124 121 m_targetPivotValue = NULL; 125 122 } 126 #endif127 123 #if !H_MV 128 124 free(m_pchInputFile); … … 316 312 } 317 313 318 #if SIGNAL_BITRATE_PICRATE_IN_VPS319 Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName);320 Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName);321 #endif322 314 // ==================================================================================================================== 323 315 // Public member functions … … 352 344 string cfg_RowHeight; 353 345 string cfg_ScalingListFile; 354 #if J0149_TONE_MAPPING_SEI355 346 string cfg_startOfCodedInterval; 356 347 string cfg_codedPivotValue; 357 348 string cfg_targetPivotValue; 358 #endif359 #if SIGNAL_BITRATE_PICRATE_IN_VPS360 string cfg_bitRateInfoPresentFlag;361 string cfg_picRateInfoPresentFlag;362 string cfg_avgBitRate;363 string cfg_maxBitRate;364 string cfg_avgPicRate;365 string cfg_constantPicRateIdc;366 #endif367 349 po::Options opts; 368 350 opts.addOptions() … … 440 422 ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level") 441 423 442 #if L0046_CONSTRAINT_FLAGS443 424 ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive") 444 425 ("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced") 445 426 ("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing") 446 427 ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") 447 #endif448 428 449 429 // Unit definition parameters … … 465 445 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 466 446 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 467 #if !L0034_COMBINED_LIST_CLEANUP468 ("ListCombination,-lc", m_bUseLComb, true, "Combined reference list for uni-prediction estimation in B-slices")469 #endif470 447 // motion options 471 448 ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") … … 507 484 ("RDOQ", m_useRDOQ, true ) 508 485 ("RDOQTS", m_useRDOQTS, true ) 509 #if L0232_RD_PENALTY510 486 ("RDpenalty", m_rdPenalty, 0, "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disbaled 1:RD-penalty 2:maximum RD-penalty") 511 #endif512 487 // Entropy coding parameters 513 488 ("SBACRD", m_bUseSBACRD, true, "SBAC based RD estimation") … … 523 498 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) 524 499 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false ) 525 #if L0386_DB_METRIC526 500 ("DeblockingFilterMetric", m_DeblockingFilterMetric, false ) 527 #endif528 501 529 502 #if H_3D_ARP … … 598 571 ( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" ) 599 572 ( "TargetBitrate", m_RCTargetBitrate, 0, "Rate control: target bitrate" ) 573 #if M0036_RC_IMPROVEMENT 574 ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, 0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" ) 575 #else 600 576 ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, false, "Rate control: keep hierarchical bit allocation in rate control algorithm" ) 577 #endif 601 578 ( "LCULevelRateControl", m_RCLCULevelRC, true, "Rate control: true: LCU level RC; false: picture level RC" ) 602 579 ( "RCLCUSeparateModel", m_RCUseLCUSeparateModel, true, "Rate control: use LCU level separate R-lambda model" ) … … 650 627 ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, 0, "Control generation of buffering period SEI messages") 651 628 ("SEIPictureTiming", m_pictureTimingSEIEnabled, 0, "Control generation of picture timing SEI messages") 652 #if J0149_TONE_MAPPING_SEI653 629 ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages") 654 630 ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session") … … 681 657 ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures") 682 658 ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures") 683 #endif684 659 ("SEIFramePacking", m_framePackingSEIEnabled, 0, "Control generation of frame packing SEI messages") 685 660 ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n" … … 702 677 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") 703 678 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") 704 #if L0208_SOP_DESCRIPTION_SEI705 679 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") 706 #endif707 #if K0180_SCALABLE_NESTING_SEI708 680 ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages") 709 #endif710 #if SIGNAL_BITRATE_PICRATE_IN_VPS711 ("BitRatePicRateMaxTLayers", m_bitRatePicRateMaxTLayers, 0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file")712 ("BitRateInfoPresent", cfg_bitRateInfoPresentFlag, string(""), "Control signalling of bit rate information of avg. bit rate and max. bit rate in VPS\n"713 "\t0: Do not sent bit rate info\n"714 "\tN (N > 0): Send bit rate info for N sub-layers. N should equal maxTempLayers.")715 ("PicRateInfoPresent", cfg_picRateInfoPresentFlag, string(""), "Control signalling of picture rate information of avg. bit rate and max. bit rate in VPS\n"716 "\t0: Do not sent picture rate info\n"717 "\tN (N > 0): Send picture rate info for N sub-layers. N should equal maxTempLayers.")718 ("AvgBitRate", cfg_avgBitRate, string(""), "List of avg. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0")719 ("MaxBitRate", cfg_maxBitRate, string(""), "List of max. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0")720 ("AvgPicRate", cfg_avgPicRate, string(""), "List of avg. picture rates for the different sub-layers; include non-negative number even if corresponding flag is 0")721 ("ConstantPicRateIdc", cfg_constantPicRateIdc, string(""), "List of constant picture rate IDCs; include non-negative number even if corresponding flag is 0")722 #endif723 681 #if H_3D 724 682 ("CameraParameterFile,cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name") … … 759 717 #endif //H_3D 760 718 ; 761 762 #if H_MV 719 #if H_MV 763 720 // parse coding structure 764 721 for( Int k = 0; k < MAX_NUM_LAYERS; k++ ) … … 898 855 free ( pRowHeight ); 899 856 #endif 900 #if SIGNAL_BITRATE_PICRATE_IN_VPS901 readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" );902 readIntString (cfg_avgBitRate, m_bitRatePicRateMaxTLayers, m_avgBitRate, "avg. bit rate" );903 readIntString (cfg_maxBitRate, m_bitRatePicRateMaxTLayers, m_maxBitRate, "max. bit rate" );904 readBoolString(cfg_picRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_picRateInfoPresentFlag, "bit rate info. present flag" );905 readIntString (cfg_avgPicRate, m_bitRatePicRateMaxTLayers, m_avgPicRate, "avg. pic rate" );906 readIntString (cfg_constantPicRateIdc, m_bitRatePicRateMaxTLayers, m_constantPicRateIdc, "constant pic rate Idc" );907 #endif908 857 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 909 858 … … 1071 1020 m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 1072 1021 1073 #if J0149_TONE_MAPPING_SEI1074 1022 if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag ) 1075 1023 { … … 1130 1078 } 1131 1079 } 1132 #endif1133 1080 #if H_3D 1134 1081 // set global varibles … … 1233 1180 return true; 1234 1181 } 1235 #if SIGNAL_BITRATE_PICRATE_IN_VPS1236 Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName)1237 {1238 Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str());1239 Int i = 0;1240 if(numEntries)1241 {1242 Char* tempArray = strtok(inpArray, " ,-");1243 memberArray = new Bool[numEntries];1244 while( tempArray != NULL )1245 {1246 if( i >= numEntries )1247 {1248 printf( "The number of %s defined is larger than the allowed number\n", elementName );1249 exit( EXIT_FAILURE );1250 }1251 assert( (atoi(tempArray) == 0) || (atoi(tempArray) == 1) );1252 *( memberArray + i ) = atoi(tempArray);1253 tempArray = strtok(NULL, " ,-");1254 i++;1255 }1256 if( i < numEntries )1257 {1258 printf( "Some %s are not defined\n", elementName );1259 exit( EXIT_FAILURE );1260 }1261 }1262 else1263 {1264 memberArray = NULL;1265 }1266 }1267 1268 Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName)1269 {1270 Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str());1271 Int i = 0;1272 if(numEntries)1273 {1274 Char* tempArray = strtok(inpArray, " ,-");1275 memberArray = new Int[numEntries];1276 while( tempArray != NULL )1277 {1278 if( i >= numEntries )1279 {1280 printf( "The number of %s defined is larger than the allowed number\n", elementName );1281 exit( EXIT_FAILURE );1282 }1283 *( memberArray + i ) = atoi(tempArray);1284 tempArray = strtok(NULL, " ,-");1285 i++;1286 }1287 if( i < numEntries )1288 {1289 printf( "Some %s are not defined\n", elementName );1290 exit( EXIT_FAILURE );1291 }1292 }1293 else1294 {1295 memberArray = NULL;1296 }1297 }1298 #endif1299 1182 // ==================================================================================================================== 1300 1183 // Private member functions … … 1312 1195 fprintf(stderr, "** decoder requires this option to be enabled. **\n"); 1313 1196 fprintf(stderr, "******************************************************************\n"); 1197 } 1198 if( m_profile==Profile::NONE ) 1199 { 1200 fprintf(stderr, "***************************************************************************\n"); 1201 fprintf(stderr, "** WARNING: For conforming bitstreams a valid Profile value must be set! **\n"); 1202 fprintf(stderr, "***************************************************************************\n"); 1203 } 1204 if( m_level==Level::NONE ) 1205 { 1206 fprintf(stderr, "***************************************************************************\n"); 1207 fprintf(stderr, "** WARNING: For conforming bitstreams a valid Level value must be set! **\n"); 1208 fprintf(stderr, "***************************************************************************\n"); 1314 1209 } 1315 1210 … … 1470 1365 xConfirmPara( m_iQP < -6 * (m_internalBitDepthY - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 1471 1366 #endif 1472 xConfirmPara( m_loopFilterBetaOffsetDiv2 < - 13 || m_loopFilterBetaOffsetDiv2 > 13, "Loop Filter Beta Offset div. 2 exceeds supported range (-13 to 13)");1473 xConfirmPara( m_loopFilterTcOffsetDiv2 < - 13 || m_loopFilterTcOffsetDiv2 > 13, "Loop Filter Tc Offset div. 2 exceeds supported range (-13 to 13)");1367 xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6, "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)"); 1368 xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6, "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)"); 1474 1369 xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2, "Fast Search Mode is not supported value (0:Full search 1:Diamond 2:PMVFAST)" ); 1475 1370 xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" ); … … 1515 1410 xConfirmPara( ( 0 != m_uiUseAdvResPred ) && ( 1 != m_uiUseAdvResPred ), "UseAdvResPred must be 0 or 1." ); 1516 1411 #endif 1517 1518 1412 #if ADAPTIVE_QP_SELECTION 1519 1413 #if H_MV … … 1999 1893 { 2000 1894 m_numReorderPics[i] = 0; 2001 #if L0323_DPB2002 1895 m_maxDecPicBuffering[i] = 1; 2003 #else2004 m_maxDecPicBuffering[i] = 0;2005 #endif2006 1896 } 2007 1897 for(Int i=0; i<m_iGOPSize; i++) 2008 1898 { 2009 #if L0323_DPB2010 1899 if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) 2011 #else 2012 if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) 2013 #endif 2014 { 2015 #if L0323_DPB 1900 { 2016 1901 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1; 2017 #else2018 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics;2019 #endif2020 1902 } 2021 1903 Int highestDecodingNumberWithLowerPOC = 0; … … 2048 1930 m_numReorderPics[i+1] = m_numReorderPics[i]; 2049 1931 } 2050 #if L0323_DPB2051 1932 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive 2052 1933 if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1) … … 2054 1935 m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1; 2055 1936 } 2056 #else2057 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive2058 if(m_numReorderPics[i] > m_maxDecPicBuffering[i])2059 {2060 m_maxDecPicBuffering[i] = m_numReorderPics[i];2061 }2062 #endif2063 1937 // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer 2064 1938 if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i]) … … 2069 1943 2070 1944 2071 #if L0323_DPB2072 1945 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive 2073 1946 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1) … … 2075 1948 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1; 2076 1949 } 2077 #else2078 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive2079 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1])2080 {2081 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1];2082 }2083 #endif2084 1950 2085 1951 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) … … 2156 2022 } 2157 2023 } 2158 #if !L0034_COMBINED_LIST_CLEANUP2159 xConfirmPara( m_bUseLComb==false && m_numReorderPics[MAX_TLAYER-1]!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" ); // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1.2160 #endif2161 2024 xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); 2162 2025 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); … … 2165 2028 xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n"); 2166 2029 2167 #if J0149_TONE_MAPPING_SEI2168 2030 if (m_toneMappingInfoSEIEnabled) 2169 2031 { … … 2176 2038 xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue"); 2177 2039 } 2178 #endif2179 2040 2180 2041 #if RATE_CONTROL_LAMBDA_DOMAIN … … 2208 2069 2209 2070 xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2"); 2210 #if L0444_FPA_TYPE2211 2071 if (m_framePackingSEIEnabled) 2212 2072 { 2213 2073 xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5"); 2214 2074 } 2215 #endif 2216 #if H_MV 2217 } 2218 } 2219 #endif 2220 2075 2076 #if H_MV 2077 } 2078 } 2079 #endif 2221 2080 #undef xConfirmPara 2222 2081 if (check_failed) … … 2356 2215 printf("RDQ:%d ", m_useRDOQ ); 2357 2216 printf("RDQTS:%d ", m_useRDOQTS ); 2358 #if L0232_RD_PENALTY2359 2217 printf("RDpenalty:%d ", m_rdPenalty ); 2360 #endif2361 2218 printf("SQP:%d ", m_uiDeltaQpRD ); 2362 2219 printf("ASR:%d ", m_bUseASR ); 2363 #if !L0034_COMBINED_LIST_CLEANUP2364 printf("LComb:%d ", m_bUseLComb );2365 #endif2366 2220 printf("FEN:%d ", m_bUseFastEnc ); 2367 2221 printf("ECU:%d ", m_bUseEarlyCU );
Note: See TracChangeset for help on using the changeset viewer.