Changeset 133 in SHVCSoftware for branches/SHM-2.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 28 Apr 2013, 08:49:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r125 r133 89 89 { 90 90 m_aidQP = NULL; 91 #if J0149_TONE_MAPPING_SEI 92 m_startOfCodedInterval = NULL; 93 m_codedPivotValue = NULL; 94 m_targetPivotValue = NULL; 95 #endif 91 96 } 92 97 #endif … … 102 107 delete[] m_aidQP; 103 108 } 109 #if J0149_TONE_MAPPING_SEI 110 if ( m_startOfCodedInterval ) 111 { 112 delete[] m_startOfCodedInterval; 113 m_startOfCodedInterval = NULL; 114 } 115 if ( m_codedPivotValue ) 116 { 117 delete[] m_codedPivotValue; 118 m_codedPivotValue = NULL; 119 } 120 if ( m_targetPivotValue ) 121 { 122 delete[] m_targetPivotValue; 123 m_targetPivotValue = NULL; 124 } 125 #endif 104 126 free(m_pchInputFile); 105 127 #endif … … 324 346 string cfg_RowHeight; 325 347 string cfg_ScalingListFile; 348 #if J0149_TONE_MAPPING_SEI 349 string cfg_startOfCodedInterval; 350 string cfg_codedPivotValue; 351 string cfg_targetPivotValue; 352 #endif 326 353 #if SIGNAL_BITRATE_PICRATE_IN_VPS 327 354 string cfg_bitRateInfoPresentFlag; … … 430 457 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 431 458 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 459 #if !L0034_COMBINED_LIST_CLEANUP 432 460 ("ListCombination,-lc", m_bUseLComb, true, "Combined reference list for uni-prediction estimation in B-slices") 461 #endif 433 462 // motion options 434 463 ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") … … 488 517 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) 489 518 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false ) 519 #if L0386_DB_METRIC 520 ("DeblockingFilterMetric", m_DeblockingFilterMetric, false ) 521 #endif 490 522 491 523 // Coding tools … … 602 634 ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, 0, "Control generation of buffering period SEI messages") 603 635 ("SEIPictureTiming", m_pictureTimingSEIEnabled, 0, "Control generation of picture timing SEI messages") 636 #if J0149_TONE_MAPPING_SEI 637 ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages") 638 ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session") 639 ("SEIToneMapCancelFlag", m_toneMapCancelFlag, false, "Indicates that Tone Mapping SEI message cancels the persistance or follows") 640 ("SEIToneMapPersistenceFlag", m_toneMapPersistenceFlag, true, "Specifies the persistence of the Tone Mapping SEI message") 641 ("SEIToneMapCodedDataBitDepth", m_toneMapCodedDataBitDepth, 8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages") 642 ("SEIToneMapTargetBitDepth", m_toneMapTargetBitDepth, 8, "Specifies Output BitDepth of Tome mapping function") 643 ("SEIToneMapModelId", m_toneMapModelId, 0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n" 644 "\t0: linear mapping with clipping\n" 645 "\t1: sigmoidal mapping\n" 646 "\t2: user-defined table mapping\n" 647 "\t3: piece-wise linear mapping\n" 648 "\t4: luminance dynamic range information ") 649 ("SEIToneMapMinValue", m_toneMapMinValue, 0, "Specifies the minimum value in mode 0") 650 ("SEIToneMapMaxValue", m_toneMapMaxValue, 1023, "Specifies the maxmum value in mode 0") 651 ("SEIToneMapSigmoidMidpoint", m_sigmoidMidpoint, 512, "Specifies the centre point in mode 1") 652 ("SEIToneMapSigmoidWidth", m_sigmoidWidth, 960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1") 653 ("SEIToneMapStartOfCodedInterval", cfg_startOfCodedInterval, string(""), "Array of user-defined mapping table") 654 ("SEIToneMapNumPivots", m_numPivots, 0, "Specifies the number of pivot points in mode 3") 655 ("SEIToneMapCodedPivotValue", cfg_codedPivotValue, string(""), "Array of pivot point") 656 ("SEIToneMapTargetPivotValue", cfg_targetPivotValue, string(""), "Array of pivot point") 657 ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination") 658 ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO") 659 ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue") 660 ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue") 661 ("SEIToneMapExposureCompensationValueDenomIdc", m_exposureCompensationValueDenomIdc, 2, "Specifies the denominator of ExposureCompensationValue") 662 ("SEIToneMapRefScreenLuminanceWhite", m_refScreenLuminanceWhite, 350, "Specifies reference screen brightness setting in units of candela per square metre") 663 ("SEIToneMapExtendedRangeWhiteLevel", m_extendedRangeWhiteLevel, 800, "Indicates the luminance dynamic range") 664 ("SEIToneMapNominalBlackLevelLumaCodeValue", m_nominalBlackLevelLumaCodeValue, 16, "Specifies luma sample value of the nominal black level assigned decoded pictures") 665 ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures") 666 ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures") 667 #endif 604 668 ("SEIFramePacking", m_framePackingSEIEnabled, 0, "Control generation of frame packing SEI messages") 605 669 ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n" … … 622 686 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") 623 687 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") 688 #if L0208_SOP_DESCRIPTION_SEI 689 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") 690 #endif 691 #if K0180_SCALABLE_NESTING_SEI 692 ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages") 693 #endif 624 694 #if SIGNAL_BITRATE_PICRATE_IN_VPS 625 695 ("BitRatePicRateMaxTLayers", m_bitRatePicRateMaxTLayers, 0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file") … … 878 948 } 879 949 m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; 950 #endif 951 #if J0149_TONE_MAPPING_SEI 952 if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag ) 953 { 954 Char* pcStartOfCodedInterval = cfg_startOfCodedInterval.empty() ? NULL: strdup(cfg_startOfCodedInterval.c_str()); 955 Char* pcCodedPivotValue = cfg_codedPivotValue.empty() ? NULL: strdup(cfg_codedPivotValue.c_str()); 956 Char* pcTargetPivotValue = cfg_targetPivotValue.empty() ? NULL: strdup(cfg_targetPivotValue.c_str()); 957 if( m_toneMapModelId == 2 && pcStartOfCodedInterval ) 958 { 959 char *startOfCodedInterval; 960 UInt num = 1u<< m_toneMapTargetBitDepth; 961 m_startOfCodedInterval = new Int[num]; 962 ::memset( m_startOfCodedInterval, 0, sizeof(Int)*num ); 963 startOfCodedInterval = strtok(pcStartOfCodedInterval, " ."); 964 int i = 0; 965 while( startOfCodedInterval && ( i < num ) ) 966 { 967 m_startOfCodedInterval[i] = atoi( startOfCodedInterval ); 968 startOfCodedInterval = strtok(NULL, " ."); 969 i++; 970 } 971 } 972 else 973 { 974 m_startOfCodedInterval = NULL; 975 } 976 if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) ) 977 { 978 if( pcCodedPivotValue && pcTargetPivotValue ) 979 { 980 char *codedPivotValue; 981 char *targetPivotValue; 982 m_codedPivotValue = new Int[m_numPivots]; 983 m_targetPivotValue = new Int[m_numPivots]; 984 ::memset( m_codedPivotValue, 0, sizeof(Int)*( m_numPivots ) ); 985 ::memset( m_targetPivotValue, 0, sizeof(Int)*( m_numPivots ) ); 986 codedPivotValue = strtok(pcCodedPivotValue, " ."); 987 int i=0; 988 while(codedPivotValue&&i<m_numPivots) 989 { 990 m_codedPivotValue[i] = atoi( codedPivotValue ); 991 codedPivotValue = strtok(NULL, " ."); 992 i++; 993 } 994 i=0; 995 targetPivotValue = strtok(pcTargetPivotValue, " ."); 996 while(targetPivotValue&&i<m_numPivots) 997 { 998 m_targetPivotValue[i]= atoi( targetPivotValue ); 999 targetPivotValue = strtok(NULL, " ."); 1000 i++; 1001 } 1002 } 1003 } 1004 else 1005 { 1006 m_codedPivotValue = NULL; 1007 m_targetPivotValue = NULL; 1008 } 1009 } 880 1010 #endif 881 1011 // check validity of input parameters … … 1375 1505 { 1376 1506 m_numReorderPics[i] = 0; 1507 #if L0323_DPB 1508 m_maxDecPicBuffering[i] = 1; 1509 #else 1377 1510 m_maxDecPicBuffering[i] = 0; 1511 #endif 1378 1512 } 1379 1513 for(Int i=0; i<m_iGOPSize; i++) 1380 1514 { 1515 #if L0323_DPB 1516 if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) 1517 #else 1381 1518 if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) 1382 { 1519 #endif 1520 { 1521 #if L0323_DPB 1522 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1; 1523 #else 1383 1524 m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics; 1525 #endif 1384 1526 } 1385 1527 Int highestDecodingNumberWithLowerPOC = 0; … … 1412 1554 m_numReorderPics[i+1] = m_numReorderPics[i]; 1413 1555 } 1556 #if L0323_DPB 1557 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive 1558 if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1) 1559 { 1560 m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1; 1561 } 1562 #else 1414 1563 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive 1415 1564 if(m_numReorderPics[i] > m_maxDecPicBuffering[i]) … … 1417 1566 m_maxDecPicBuffering[i] = m_numReorderPics[i]; 1418 1567 } 1568 #endif 1419 1569 // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer 1420 1570 if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i]) … … 1423 1573 } 1424 1574 } 1575 1576 1577 #if L0323_DPB 1578 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive 1579 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1) 1580 { 1581 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1; 1582 } 1583 #else 1425 1584 // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive 1426 1585 if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1]) … … 1428 1587 m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1]; 1429 1588 } 1589 #endif 1430 1590 1431 1591 #if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers … … 1511 1671 } 1512 1672 #endif 1513 1673 #if !L0034_COMBINED_LIST_CLEANUP 1514 1674 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. 1675 #endif 1515 1676 xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); 1516 1677 #if !SVC_EXTENSION … … 1520 1681 1521 1682 xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n"); 1683 1684 #if J0149_TONE_MAPPING_SEI 1685 if (m_toneMappingInfoSEIEnabled) 1686 { 1687 xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14"); 1688 xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255"); 1689 xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4"); 1690 xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0"); 1691 xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100"); 1692 xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue"); 1693 xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue"); 1694 } 1695 #endif 1522 1696 1523 1697 #if RATE_CONTROL_LAMBDA_DOMAIN … … 1677 1851 printf("SQP:%d ", m_uiDeltaQpRD ); 1678 1852 printf("ASR:%d ", m_bUseASR ); 1853 #if !L0034_COMBINED_LIST_CLEANUP 1679 1854 printf("LComb:%d ", m_bUseLComb ); 1855 #endif 1680 1856 printf("FEN:%d ", m_bUseFastEnc ); 1681 1857 printf("ECU:%d ", m_bUseEarlyCU );
Note: See TracChangeset for help on using the changeset viewer.