Ticket #1247: TM_SEI_fix.patch

File TM_SEI_fix.patch, 10.2 KB (added by o.nakagami, 11 years ago)
  • doc/software-manual.tex

     
    17621762\\
    17631763\Option{SEIToneMapCameraIsoSpeedValue} &
    17641764\ShortOption{\None} &
    1765 \Default{420} &
     1765\Default{400} &
    17661766Specifies the camera ISO speed for daylight illumination of Extended_ISO.
    17671767\\
     1768\Option{SEIToneMapExposureIndexIdc} &
     1769\ShortOption{\None} &
     1770\Default{0} &
     1771Indicates the exposure index setting of the camera.
     1772\\
     1773\Option{SEIToneMapExposureIndexValue} &
     1774\ShortOption{\None} &
     1775\Default{400} &
     1776Specifies the exposure index setting of the cameran of Extended_ISO.
     1777\\
    17681778\Option{SEIToneMapExposureCompensationValueSignFlag} &
    17691779\ShortOption{\None} &
    17701780\Default{0} &
  • source/App/TAppEncoder/TAppEncCfg.cpp

     
    486486  ("SEIToneMapTargetPivotValue",                      cfg_targetPivotValue,              string(""), "Array of pivot point")
    487487  ("SEIToneMapCameraIsoSpeedIdc",                     m_cameraIsoSpeedIdc,                        0, "Indicates the camera ISO speed for daylight illumination")
    488488  ("SEIToneMapCameraIsoSpeedValue",                   m_cameraIsoSpeedValue,                    400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO")
     489  ("SEIToneMapExposureIndexIdc",                      m_exposureIndexIdc,                         0, "Indicates the exposure index setting of the camera")
     490  ("SEIToneMapExposureIndexValue",                    m_exposureIndexValue,                     400, "Specifies the exposure index setting of the cameran of Extended_ISO")
    489491  ("SEIToneMapExposureCompensationValueSignFlag",     m_exposureCompensationValueSignFlag,        0, "Specifies the sign of ExposureCompensationValue")
    490492  ("SEIToneMapExposureCompensationValueNumerator",    m_exposureCompensationValueNumerator,       0, "Specifies the numerator of ExposureCompensationValue")
    491493  ("SEIToneMapExposureCompensationValueDenomIdc",     m_exposureCompensationValueDenomIdc,        2, "Specifies the denominator of ExposureCompensationValue")
     
    13261328    xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255");
    13271329    xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4");
    13281330    xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0");
     1331    xConfirmPara( m_exposureIndexValue  == 0, "SEIToneMapExposureIndexValue shall not be equal to 0");
    13291332    xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100");
    13301333    xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue");
    13311334    xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");
  • source/App/TAppEncoder/TAppEncCfg.h

     
    212212  Int       m_numPivots;
    213213  Int       m_cameraIsoSpeedIdc;
    214214  Int       m_cameraIsoSpeedValue;
     215  Int       m_exposureIndexIdc;
     216  Int       m_exposureIndexValue;
    215217  Int       m_exposureCompensationValueSignFlag;
    216218  Int       m_exposureCompensationValueNumerator;
    217219  Int       m_exposureCompensationValueDenomIdc;
  • source/App/TAppEncoder/TAppEncTop.cpp

     
    234234  m_cTEncTop.setTMISEITargetPivotValue                    ( m_targetPivotValue );
    235235  m_cTEncTop.setTMISEICameraIsoSpeedIdc                   ( m_cameraIsoSpeedIdc );
    236236  m_cTEncTop.setTMISEICameraIsoSpeedValue                 ( m_cameraIsoSpeedValue );
     237  m_cTEncTop.setTMISEIExposureIndexIdc                    ( m_exposureIndexIdc );
     238  m_cTEncTop.setTMISEIExposureIndexValue                  ( m_exposureIndexValue );
    237239  m_cTEncTop.setTMISEIExposureCompensationValueSignFlag   ( m_exposureCompensationValueSignFlag );
    238240  m_cTEncTop.setTMISEIExposureCompensationValueNumerator  ( m_exposureCompensationValueNumerator );
    239241  m_cTEncTop.setTMISEIExposureCompensationValueDenomIdc   ( m_exposureCompensationValueDenomIdc );
  • source/Lib/TLibCommon/SEI.h

     
    352352  std::vector<Int> m_targetPivotValue;
    353353  Int    m_cameraIsoSpeedIdc;
    354354  Int    m_cameraIsoSpeedValue;
     355  Int    m_exposureIndexIdc;
     356  Int    m_exposureIndexValue;
    355357  Int    m_exposureCompensationValueSignFlag;
    356358  Int    m_exposureCompensationValueNumerator;
    357359  Int    m_exposureCompensationValueDenomIdc;
  • source/Lib/TLibDecoder/SEIread.cpp

     
    669669      }
    670670    case 4:
    671671      {
    672         READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedValue = val;
    673         if( sei.m_cameraIsoSpeedValue == 255) //Extended_ISO
     672        READ_CODE( 8, val, "camera_iso_speed_idc" );                     sei.m_cameraIsoSpeedIdc = val;
     673        if( sei.m_cameraIsoSpeedIdc == 255) //Extended_ISO
    674674        {
    675675          READ_CODE( 32,   val,   "camera_iso_speed_value" );            sei.m_cameraIsoSpeedValue = val;
    676676        }
     677        READ_CODE( 8, val, "exposure_index_idc" );                       sei.m_exposureIndexIdc = val;
     678        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
     679        {
     680          READ_CODE( 32,   val,   "exposure_index_value" );              sei.m_exposureIndexValue = val;
     681        }
    677682        READ_FLAG( val, "exposure_compensation_value_sign_flag" );       sei.m_exposureCompensationValueSignFlag = val;
    678683        READ_CODE( 16, val, "exposure_compensation_value_numerator" );   sei.m_exposureCompensationValueNumerator = val;
    679684        READ_CODE( 16, val, "exposure_compensation_value_denom_idc" );   sei.m_exposureCompensationValueDenomIdc = val;
  • source/Lib/TLibEncoder/SEIwrite.cpp

     
    468468        {
    469469          WRITE_CODE( sei.m_cameraIsoSpeedValue,    32,    "camera_iso_speed_value" );
    470470        }
     471        WRITE_CODE( sei.m_exposureIndexIdc,     8,    "exposure_index_idc" );
     472        if( sei.m_exposureIndexIdc == 255) //Extended_ISO
     473        {
     474          WRITE_CODE( sei.m_exposureIndexValue,     32,    "exposure_index_value" );
     475        }
    471476        WRITE_FLAG( sei.m_exposureCompensationValueSignFlag,           "exposure_compensation_value_sign_flag" );
    472477        WRITE_CODE( sei.m_exposureCompensationValueNumerator,     16,  "exposure_compensation_value_numerator" );
    473478        WRITE_CODE( sei.m_exposureCompensationValueDenomIdc,      16,  "exposure_compensation_value_denom_idc" );
  • source/Lib/TLibEncoder/TEncCfg.h

     
    234234  Int       m_numPivots;
    235235  Int       m_cameraIsoSpeedIdc;
    236236  Int       m_cameraIsoSpeedValue;
     237  Int       m_exposureIndexIdc;
     238  Int       m_exposureIndexValue;
    237239  Int       m_exposureCompensationValueSignFlag;
    238240  Int       m_exposureCompensationValueNumerator;
    239241  Int       m_exposureCompensationValueDenomIdc;
     
    580582  Int   getTMISEICameraIsoSpeedIdc()                         {  return m_cameraIsoSpeedIdc;  }
    581583  Void  setTMISEICameraIsoSpeedValue(Int b)                  {  m_cameraIsoSpeedValue = b;  }
    582584  Int   getTMISEICameraIsoSpeedValue()                       {  return m_cameraIsoSpeedValue;  }
     585  Void  setTMISEIExposureIndexIdc(Int b)                     {  m_exposureIndexIdc = b;  }
     586  Int   getTMISEIExposurIndexIdc()                           {  return m_exposureIndexIdc;  }
     587  Void  setTMISEIExposureIndexValue(Int b)                   {  m_exposureIndexValue = b;  }
     588  Int   getTMISEIExposurIndexValue()                         {  return m_exposureIndexValue;  }
    583589  Void  setTMISEIExposureCompensationValueSignFlag(Int b)    {  m_exposureCompensationValueSignFlag = b;  }
    584590  Int   getTMISEIExposureCompensationValueSignFlag()         {  return m_exposureCompensationValueSignFlag;  }
    585591  Void  setTMISEIExposureCompensationValueNumerator(Int b)   {  m_exposureCompensationValueNumerator = b;  }
  • source/Lib/TLibEncoder/TEncGOP.cpp

     
    251251       seiToneMappingInfo->m_cameraIsoSpeedIdc = m_pcCfg->getTMISEICameraIsoSpeedIdc();
    252252       seiToneMappingInfo->m_cameraIsoSpeedValue = m_pcCfg->getTMISEICameraIsoSpeedValue();
    253253       assert( seiToneMappingInfo->m_cameraIsoSpeedValue !=0 );
     254       seiToneMappingInfo->m_exposureIndexIdc = m_pcCfg->getTMISEIExposurIndexIdc();
     255       seiToneMappingInfo->m_exposureIndexValue = m_pcCfg->getTMISEIExposurIndexValue();
     256       assert( seiToneMappingInfo->m_exposureIndexValue !=0 );
    254257       seiToneMappingInfo->m_exposureCompensationValueSignFlag = m_pcCfg->getTMISEIExposureCompensationValueSignFlag();
    255258       seiToneMappingInfo->m_exposureCompensationValueNumerator = m_pcCfg->getTMISEIExposureCompensationValueNumerator();
    256259       seiToneMappingInfo->m_exposureCompensationValueDenomIdc = m_pcCfg->getTMISEIExposureCompensationValueDenomIdc();