Changeset 438 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 23 May 2013, 15:40:36 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r368 r438 79 79 m_aidQP = NULL; 80 80 #endif 81 #if J0149_TONE_MAPPING_SEI82 m_startOfCodedInterval = NULL;83 m_codedPivotValue = NULL;84 m_targetPivotValue = NULL;85 #endif86 81 } 87 82 … … 107 102 delete[] m_aidQP; 108 103 } 109 #endif110 #if J0149_TONE_MAPPING_SEI111 if ( m_startOfCodedInterval )112 {113 delete[] m_startOfCodedInterval;114 m_startOfCodedInterval = NULL;115 }116 if ( m_codedPivotValue )117 {118 delete[] m_codedPivotValue;119 m_codedPivotValue = NULL;120 }121 if ( m_targetPivotValue )122 {123 delete[] m_targetPivotValue;124 m_targetPivotValue = NULL;125 }126 #endif127 #if !H_MV128 104 free(m_pchInputFile); 129 105 #endif 106 130 107 free(m_pchBitstreamFile); 108 131 109 #if H_MV 132 110 for(Int i = 0; i< m_pchReconFileList.size(); i++ ) … … 138 116 free(m_pchReconFile); 139 117 #endif 118 140 119 free(m_pchdQPFile); 141 120 free(m_pColumnWidth); 142 121 free(m_pRowHeight); 143 122 free(m_scalingListFile); 123 144 124 #if H_MV 145 125 for( Int i = 0; i < m_GOPListMvc.size(); i++ ) … … 320 300 string cfg_InputFile; 321 301 #endif 302 322 303 string cfg_BitstreamFile; 304 323 305 #if !H_MV 324 306 string cfg_ReconFile; 325 307 #endif 308 326 309 #if H_MV 327 310 vector<Int> cfg_dimensionLength; … … 333 316 #endif 334 317 #endif 318 335 319 string cfg_dQPFile; 336 320 string cfg_ColumnWidth; 337 321 string cfg_RowHeight; 338 322 string cfg_ScalingListFile; 339 #if J0149_TONE_MAPPING_SEI340 string cfg_startOfCodedInterval;341 string cfg_codedPivotValue;342 string cfg_targetPivotValue;343 #endif344 323 #if SIGNAL_BITRATE_PICRATE_IN_VPS 345 324 string cfg_bitRateInfoPresentFlag; … … 356 335 357 336 // File, I/O and source parameters 337 358 338 #if H_MV 359 339 ("InputFile_%d,i_%d", m_pchInputFileList, (char *) 0 , MAX_NUM_LAYER_IDS , "original Yuv input file name %d") … … 361 341 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") 362 342 #endif 343 363 344 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") 345 364 346 #if H_MV 365 347 ("ReconFile_%d,o_%d", m_pchReconFileList, (char *) 0 , MAX_NUM_LAYER_IDS , "reconstructed Yuv output file name %d") … … 367 349 ("ReconFile,o", cfg_ReconFile, string(""), "Reconstructed YUV output file name") 368 350 #endif 351 369 352 #if H_MV 370 353 ("NumberOfLayers", m_numberOfLayers , 1, "Number of layers") … … 382 365 ("SplittingFlag", m_splittingFlag , false , "Splitting Flag") 383 366 #endif 367 384 368 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") 385 369 ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") … … 403 387 404 388 // Profile and level 389 405 390 ("Profile", m_profile, Profile::NONE, "Profile to be used when encoding (Incomplete)") 406 391 ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1 (Incomplete)") … … 432 417 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 433 418 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 434 #if !L0034_COMBINED_LIST_CLEANUP435 419 ("ListCombination,-lc", m_bUseLComb, true, "Combined reference list for uni-prediction estimation in B-slices") 436 #endif437 420 // motion options 438 421 ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") … … 490 473 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) 491 474 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false ) 492 #if L0386_DB_METRIC493 ("DeblockingFilterMetric", m_DeblockingFilterMetric, false )494 #endif495 475 496 476 // Coding tools … … 611 591 ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, 0, "Control generation of buffering period SEI messages") 612 592 ("SEIPictureTiming", m_pictureTimingSEIEnabled, 0, "Control generation of picture timing SEI messages") 613 #if J0149_TONE_MAPPING_SEI614 ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages")615 ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session")616 ("SEIToneMapCancelFlag", m_toneMapCancelFlag, false, "Indicates that Tone Mapping SEI message cancels the persistance or follows")617 ("SEIToneMapPersistenceFlag", m_toneMapPersistenceFlag, true, "Specifies the persistence of the Tone Mapping SEI message")618 ("SEIToneMapCodedDataBitDepth", m_toneMapCodedDataBitDepth, 8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages")619 ("SEIToneMapTargetBitDepth", m_toneMapTargetBitDepth, 8, "Specifies Output BitDepth of Tome mapping function")620 ("SEIToneMapModelId", m_toneMapModelId, 0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n"621 "\t0: linear mapping with clipping\n"622 "\t1: sigmoidal mapping\n"623 "\t2: user-defined table mapping\n"624 "\t3: piece-wise linear mapping\n"625 "\t4: luminance dynamic range information ")626 ("SEIToneMapMinValue", m_toneMapMinValue, 0, "Specifies the minimum value in mode 0")627 ("SEIToneMapMaxValue", m_toneMapMaxValue, 1023, "Specifies the maxmum value in mode 0")628 ("SEIToneMapSigmoidMidpoint", m_sigmoidMidpoint, 512, "Specifies the centre point in mode 1")629 ("SEIToneMapSigmoidWidth", m_sigmoidWidth, 960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1")630 ("SEIToneMapStartOfCodedInterval", cfg_startOfCodedInterval, string(""), "Array of user-defined mapping table")631 ("SEIToneMapNumPivots", m_numPivots, 0, "Specifies the number of pivot points in mode 3")632 ("SEIToneMapCodedPivotValue", cfg_codedPivotValue, string(""), "Array of pivot point")633 ("SEIToneMapTargetPivotValue", cfg_targetPivotValue, string(""), "Array of pivot point")634 ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination")635 ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO")636 ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue")637 ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue")638 ("SEIToneMapExposureCompensationValueDenomIdc", m_exposureCompensationValueDenomIdc, 2, "Specifies the denominator of ExposureCompensationValue")639 ("SEIToneMapRefScreenLuminanceWhite", m_refScreenLuminanceWhite, 350, "Specifies reference screen brightness setting in units of candela per square metre")640 ("SEIToneMapExtendedRangeWhiteLevel", m_extendedRangeWhiteLevel, 800, "Indicates the luminance dynamic range")641 ("SEIToneMapNominalBlackLevelLumaCodeValue", m_nominalBlackLevelLumaCodeValue, 16, "Specifies luma sample value of the nominal black level assigned decoded pictures")642 ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures")643 ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")644 #endif645 593 ("SEIFramePacking", m_framePackingSEIEnabled, 0, "Control generation of frame packing SEI messages") 646 594 ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n" … … 663 611 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") 664 612 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") 665 #if L0208_SOP_DESCRIPTION_SEI666 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages")667 #endif668 #if K0180_SCALABLE_NESTING_SEI669 ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages")670 #endif671 613 #if SIGNAL_BITRATE_PICRATE_IN_VPS 672 614 ("BitRatePicRateMaxTLayers", m_bitRatePicRateMaxTLayers, 0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file") … … 719 661 } 720 662 #endif 663 721 664 po::setDefaults(opts); 722 665 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); … … 738 681 */ 739 682 /* convert std::string to c string for compatability */ 683 740 684 #if !H_MV 741 685 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); 742 686 #endif 687 743 688 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 689 744 690 #if !H_MV 745 691 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 746 692 #endif 693 747 694 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 748 695 … … 808 755 free ( pRowHeight ); 809 756 #endif 757 810 758 #if SIGNAL_BITRATE_PICRATE_IN_VPS 811 759 readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" ); … … 966 914 m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 967 915 968 #if J0149_TONE_MAPPING_SEI969 if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag )970 {971 Char* pcStartOfCodedInterval = cfg_startOfCodedInterval.empty() ? NULL: strdup(cfg_startOfCodedInterval.c_str());972 Char* pcCodedPivotValue = cfg_codedPivotValue.empty() ? NULL: strdup(cfg_codedPivotValue.c_str());973 Char* pcTargetPivotValue = cfg_targetPivotValue.empty() ? NULL: strdup(cfg_targetPivotValue.c_str());974 if( m_toneMapModelId == 2 && pcStartOfCodedInterval )975 {976 char *startOfCodedInterval;977 UInt num = 1u<< m_toneMapTargetBitDepth;978 m_startOfCodedInterval = new Int[num];979 ::memset( m_startOfCodedInterval, 0, sizeof(Int)*num );980 startOfCodedInterval = strtok(pcStartOfCodedInterval, " .");981 int i = 0;982 while( startOfCodedInterval && ( i < num ) )983 {984 m_startOfCodedInterval[i] = atoi( startOfCodedInterval );985 startOfCodedInterval = strtok(NULL, " .");986 i++;987 }988 }989 else990 {991 m_startOfCodedInterval = NULL;992 }993 if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) )994 {995 if( pcCodedPivotValue && pcTargetPivotValue )996 {997 char *codedPivotValue;998 char *targetPivotValue;999 m_codedPivotValue = new Int[m_numPivots];1000 m_targetPivotValue = new Int[m_numPivots];1001 ::memset( m_codedPivotValue, 0, sizeof(Int)*( m_numPivots ) );1002 ::memset( m_targetPivotValue, 0, sizeof(Int)*( m_numPivots ) );1003 codedPivotValue = strtok(pcCodedPivotValue, " .");1004 int i=0;1005 while(codedPivotValue&&i<m_numPivots)1006 {1007 m_codedPivotValue[i] = atoi( codedPivotValue );1008 codedPivotValue = strtok(NULL, " .");1009 i++;1010 }1011 i=0;1012 targetPivotValue = strtok(pcTargetPivotValue, " .");1013 while(targetPivotValue&&i<m_numPivots)1014 {1015 m_targetPivotValue[i]= atoi( targetPivotValue );1016 targetPivotValue = strtok(NULL, " .");1017 i++;1018 }1019 }1020 }1021 else1022 {1023 m_codedPivotValue = NULL;1024 m_targetPivotValue = NULL;1025 }1026 }1027 #endif1028 916 // check validity of input parameters 1029 917 xCheckParameter(); … … 1125 1013 xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); 1126 1014 xConfirmPara( m_framesToBeEncoded <= 0, "Total Number Of Frames encoded must be more than 0" ); 1015 1127 1016 #if H_MV 1128 1017 xConfirmPara( m_numberOfLayers > MAX_NUM_LAYER_IDS , "NumberOfLayers must be less than or equal to MAX_NUM_LAYER_IDS"); … … 1137 1026 xConfirmPara( m_scalabilityMask != 1 , "Scalability Mask must be equal to 1. "); 1138 1027 #endif 1139 1028 1140 1029 m_dimIds.push_back( m_viewId ); 1141 1030 #if H_3D … … 1194 1083 1195 1084 #endif 1085 1086 1196 1087 xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); 1197 1088 xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" ); … … 1457 1348 Int* m_numReorderPics = m_numReorderPicsMvc [layer]; // It is not a member, but this name helps avoiding code duplication !!! 1458 1349 #endif 1350 1459 1351 /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure 1460 1352 * This permits the ability to omit a GOP structure specification */ … … 1717 1609 { 1718 1610 m_numReorderPics[i] = 0; 1719 #if L0323_DPB1720 m_maxDecPicBuffering[i] = 1;1721 #else1722 1611 m_maxDecPicBuffering[i] = 0; 1723 #endif1724 1612 } 1725 1613 for(Int i=0; i<m_iGOPSize; i++) 1726 1614 { 1727 #if L0323_DPB1728 if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])1729 #else1730 1615 if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) 1731 #endif 1732 { 1733 #if L0323_DPB 1734 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1; 1735 #else 1616 { 1736 1617 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics; 1737 #endif1738 1618 } 1739 1619 Int highestDecodingNumberWithLowerPOC = 0; … … 1766 1646 m_numReorderPics[i+1] = m_numReorderPics[i]; 1767 1647 } 1768 #if L0323_DPB1769 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive1770 if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)1771 {1772 m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1;1773 }1774 #else1775 1648 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive 1776 1649 if(m_numReorderPics[i] > m_maxDecPicBuffering[i]) … … 1778 1651 m_maxDecPicBuffering[i] = m_numReorderPics[i]; 1779 1652 } 1780 #endif1781 1653 // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer 1782 1654 if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i]) … … 1785 1657 } 1786 1658 } 1787 1788 1789 #if L0323_DPB1790 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive1791 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)1792 {1793 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;1794 }1795 #else1796 1659 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive 1797 1660 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1]) … … 1799 1662 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1]; 1800 1663 } 1801 #endif1802 1664 1803 1665 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) … … 1874 1736 } 1875 1737 } 1876 #if !L0034_COMBINED_LIST_CLEANUP1877 1738 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. 1878 #endif1879 1739 xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); 1880 1740 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); … … 1883 1743 xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n"); 1884 1744 1885 #if J0149_TONE_MAPPING_SEI1886 if (m_toneMappingInfoSEIEnabled)1887 {1888 xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14");1889 xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255");1890 xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4");1891 xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0");1892 xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100");1893 xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue");1894 xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");1895 }1896 #endif1897 1898 1745 #if RATE_CONTROL_LAMBDA_DOMAIN 1899 1746 if ( m_RCEnableRateControl ) … … 1932 1779 } 1933 1780 #endif 1781 1934 1782 #if H_MV 1935 1783 } … … 1979 1827 printf("Input File : %s\n", m_pchInputFile ); 1980 1828 #endif 1829 1981 1830 printf("Bitstream File : %s\n", m_pchBitstreamFile ); 1831 1982 1832 #if H_MV 1983 1833 for( Int layer = 0; layer < m_numberOfLayers; layer++) … … 1988 1838 printf("Reconstruction File : %s\n", m_pchReconFile ); 1989 1839 #endif 1840 1990 1841 #if H_MV 1991 1842 xPrintParaVector( "ViewId", m_viewId ); 1992 1843 #endif 1844 1993 1845 #if H_3D 1994 1846 xPrintParaVector( "DepthFlag", m_depthFlag ); 1995 1847 #endif 1848 1996 1849 #if H_MV 1997 1850 xPrintParaVector( "QP" , m_fQP ); … … 2055 1908 printf("SQP:%d ", m_uiDeltaQpRD ); 2056 1909 printf("ASR:%d ", m_bUseASR ); 2057 #if !L0034_COMBINED_LIST_CLEANUP2058 1910 printf("LComb:%d ", m_bUseLComb ); 2059 #endif2060 1911 printf("FEN:%d ", m_bUseFastEnc ); 2061 1912 printf("ECU:%d ", m_bUseEarlyCU );
Note: See TracChangeset for help on using the changeset viewer.