Changeset 776 in SHVCSoftware


Ignore:
Timestamp:
21 May 2014, 02:18:44 (11 years ago)
Author:
sony
Message:

JCTVC-P0050: Knee Function Information (MACRO: P0050_KNEE_FUNCTION_SEI)
ohji.nakagami@…

Location:
branches/SHM-6-dev/source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r758 r776  
    513513  string cfg_codedPivotValue;
    514514  string cfg_targetPivotValue;
     515#if P0050_KNEE_FUNCTION_SEI
     516  string cfg_kneeSEIInputKneePointValue;
     517  string cfg_kneeSEIOutputKneePointValue;
     518#endif
    515519  po::Options opts;
    516520  opts.addOptions()
     
    943947  ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
    944948  ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
     949#if P0050_KNEE_FUNCTION_SEI
     950  ("SEIKneeFunctionInfo",                 m_kneeSEIEnabled,               false, "Control generation of Knee function SEI messages")
     951  ("SEIKneeFunctionId",                   m_kneeSEIId,                        0, "Specifies Id of Knee function SEI message for a given session")
     952  ("SEIKneeFunctionCancelFlag",           m_kneeSEICancelFlag,            false, "Indicates that Knee function SEI message cancels the persistance or follows")
     953  ("SEIKneeFunctionPersistenceFlag",      m_kneeSEIPersistenceFlag,        true, "Specifies the persistence of the Knee function SEI message")
     954  ("SEIKneeFunctionMappingFlag",          m_kneeSEIMappingFlag,           false, "Specifies the mapping mode of the Knee function SEI message")
     955  ("SEIKneeFunctionInputDrange",          m_kneeSEIInputDrange,            1000, "Specifies the peak luminance level for the input picture of Knee function SEI messages")
     956  ("SEIKneeFunctionInputDispLuminance",   m_kneeSEIInputDispLuminance,      100, "Specifies the expected display brightness for the input picture of Knee function SEI messages")
     957  ("SEIKneeFunctionOutputDrange",         m_kneeSEIOutputDrange,           4000, "Specifies the peak luminance level for the output picture of Knee function SEI messages")
     958  ("SEIKneeFunctionOutputDispLuminance",  m_kneeSEIOutputDispLuminance,     800, "Specifies the expected display brightness for the output picture of Knee function SEI messages")
     959  ("SEIKneeFunctionNumKneePointsMinus1",  m_kneeSEINumKneePointsMinus1,       2, "Specifies the number of knee points - 1")
     960  ("SEIKneeFunctionInputKneePointValue",  cfg_kneeSEIInputKneePointValue,     string("600 800 900"), "Array of input knee point")
     961  ("SEIKneeFunctionOutputKneePointValue", cfg_kneeSEIOutputKneePointValue,    string("100 250 450"), "Array of output knee point")
     962#endif
     963
    945964#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    946965  ("AdaptiveResolutionChange",     m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)")
     
    14851504    }
    14861505  }
     1506#if P0050_KNEE_FUNCTION_SEI
     1507  if( m_kneeSEIEnabled && !m_kneeSEICancelFlag )
     1508  {
     1509    Char* pcInputKneePointValue  = cfg_kneeSEIInputKneePointValue.empty()  ? NULL : strdup(cfg_kneeSEIInputKneePointValue.c_str());
     1510    Char* pcOutputKneePointValue = cfg_kneeSEIOutputKneePointValue.empty() ? NULL : strdup(cfg_kneeSEIOutputKneePointValue.c_str());
     1511    assert ( m_kneeSEINumKneePointsMinus1 >= 0 && m_kneeSEINumKneePointsMinus1 < 999 );
     1512    m_kneeSEIInputKneePoint = new Int[m_kneeSEINumKneePointsMinus1+1];
     1513    m_kneeSEIOutputKneePoint = new Int[m_kneeSEINumKneePointsMinus1+1];
     1514    char *InputVal = strtok(pcInputKneePointValue, " .,");
     1515    Int i=0;
     1516    while( InputVal && i<(m_kneeSEINumKneePointsMinus1+1) )
     1517    {
     1518      m_kneeSEIInputKneePoint[i] = (UInt) atoi( InputVal );
     1519      InputVal = strtok(NULL, " .,");
     1520      i++;
     1521    }
     1522    char *OutputVal = strtok(pcOutputKneePointValue, " .,");
     1523    i=0;
     1524    while( OutputVal && i<(m_kneeSEINumKneePointsMinus1+1) )
     1525    {
     1526      m_kneeSEIOutputKneePoint[i] = (UInt) atoi( OutputVal );
     1527      OutputVal = strtok(NULL, " .,");
     1528      i++;
     1529    }
     1530  }
     1531#endif
    14871532
    14881533#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     
    21852230    xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");
    21862231  }
     2232#if P0050_KNEE_FUNCTION_SEI
     2233  if (m_kneeSEIEnabled && !m_kneeSEICancelFlag)
     2234  {
     2235    xConfirmPara( m_kneeSEINumKneePointsMinus1 < 0 || m_kneeSEINumKneePointsMinus1 > 998, "SEIKneeFunctionNumKneePointsMinus1 must be in the range of 0 to 998");
     2236    for ( UInt i=0; i<=m_kneeSEINumKneePointsMinus1; i++ ){
     2237      xConfirmPara( m_kneeSEIInputKneePoint[i] < 1 || m_kneeSEIInputKneePoint[i] > 999, "SEIKneeFunctionInputKneePointValue must be in the range of 1 to 999");
     2238      xConfirmPara( m_kneeSEIOutputKneePoint[i] < 0 || m_kneeSEIOutputKneePoint[i] > 1000, "SEIKneeFunctionInputKneePointValue must be in the range of 0 to 1000");
     2239      if ( i > 0 )
     2240      {
     2241        xConfirmPara( m_kneeSEIInputKneePoint[i-1] >= m_kneeSEIInputKneePoint[i],  "The i-th SEIKneeFunctionInputKneePointValue must be greather than the (i-1)-th value");
     2242      }
     2243    }
     2244  }
     2245#endif
    21872246
    21882247#if RC_SHVC_HARMONIZATION
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h

    r758 r776  
    386386#endif
    387387  Bool      m_crossLayerIrapAlignFlag;
     388#if P0050_KNEE_FUNCTION_SEI
     389  Bool      m_kneeSEIEnabled;
     390  Int       m_kneeSEIId;
     391  Bool      m_kneeSEICancelFlag;
     392  Bool      m_kneeSEIPersistenceFlag;
     393  Bool      m_kneeSEIMappingFlag;
     394  Int       m_kneeSEIInputDrange;
     395  Int       m_kneeSEIInputDispLuminance;
     396  Int       m_kneeSEIOutputDrange;
     397  Int       m_kneeSEIOutputDispLuminance;
     398  Int       m_kneeSEINumKneePointsMinus1;
     399  Int*      m_kneeSEIInputKneePoint;
     400  Int*      m_kneeSEIOutputKneePoint;
     401#endif
    388402#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
    389403  Bool      m_crossLayerAlignedIdrOnlyFlag;
  • branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r766 r776  
    485485    m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue      ( m_nominalWhiteLevelLumaCodeValue );
    486486    m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue     ( m_extendedWhiteLevelLumaCodeValue );
     487#if P0050_KNEE_FUNCTION_SEI
     488    m_acTEncTop[layer].setKneeSEIEnabled                            ( m_kneeSEIEnabled );
     489    m_acTEncTop[layer].setKneeSEIId                                 ( m_kneeSEIId );
     490    m_acTEncTop[layer].setKneeSEICancelFlag                         ( m_kneeSEICancelFlag );
     491    m_acTEncTop[layer].setKneeSEIPersistenceFlag                    ( m_kneeSEIPersistenceFlag );
     492    m_acTEncTop[layer].setKneeSEIMappingFlag                        ( m_kneeSEIMappingFlag );
     493    m_acTEncTop[layer].setKneeSEIInputDrange                        ( m_kneeSEIInputDrange );
     494    m_acTEncTop[layer].setKneeSEIInputDispLuminance                 ( m_kneeSEIInputDispLuminance );
     495    m_acTEncTop[layer].setKneeSEIOutputDrange                       ( m_kneeSEIOutputDrange );
     496    m_acTEncTop[layer].setKneeSEIOutputDispLuminance                ( m_kneeSEIOutputDispLuminance );
     497    m_acTEncTop[layer].setKneeSEINumKneePointsMinus1                ( m_kneeSEINumKneePointsMinus1 );
     498    m_acTEncTop[layer].setKneeSEIInputKneePoint                     ( m_kneeSEIInputKneePoint );
     499    m_acTEncTop[layer].setKneeSEIOutputKneePoint                    ( m_kneeSEIOutputKneePoint );
     500#endif
    487501#if Q0074_SEI_COLOR_MAPPING
    488502    m_acTEncTop[layer].setColorMappingInfoSEIFile                   ( m_acLayerCfg[layer].m_cSeiColorMappingFile.empty() ? NULL : const_cast<Char *>(m_acLayerCfg[layer].m_cSeiColorMappingFile.c_str()) );
     
    804818  m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue      ( m_nominalWhiteLevelLumaCodeValue );
    805819  m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue     ( m_extendedWhiteLevelLumaCodeValue );
     820#if P0050_KNEE_FUNCTION_SEI
     821  m_cTEncTop.setKneeSEIEnabled              ( m_kneeSEIEnabled );
     822  m_cTEncTop.setKneeSEIId                   ( m_kneeSEIId );
     823  m_cTEncTop.setKneeSEICancelFlag           ( m_kneeSEICancelFlag );
     824  m_cTEncTop.setKneeSEIPersistenceFlag      ( m_kneeSEIPersistenceFlag );
     825  m_cTEncTop.setKneeSEIMappingFlag          ( m_kneeSEIMappingFlag );
     826  m_cTEncTop.setKneeSEIInputDrange          ( m_kneeSEIInputDrange );
     827  m_cTEncTop.setKneeSEIInputDispLuminance   ( m_kneeSEIInputDispLuminance );
     828  m_cTEncTop.setKneeSEIOutputDrange         ( m_kneeSEIOutputDrange );
     829  m_cTEncTop.setKneeSEIOutputDispLuminance  ( m_kneeSEIOutputDispLuminance );
     830  m_cTEncTop.setKneeSEINumKneePointsMinus1  ( m_kneeSEINumKneePointsMinus1 );
     831  m_cTEncTop.setKneeSEIInputKneePoint       ( m_kneeSEIInputKneePoint );
     832  m_cTEncTop.setKneeSEIOutputKneePoint      ( m_kneeSEIOutputKneePoint );
     833#endif
    806834#if Q0074_SEI_COLOR_MAPPING
    807835  m_cTEncTop.setColorMappingInfoSEIFile                   ( m_pchSEIColorMappingFile );
  • branches/SHM-6-dev/source/Lib/TLibCommon/SEI.h

    r698 r776  
    6666    POST_FILTER_HINT                     = 22,
    6767    TONE_MAPPING_INFO                    = 23,
     68#if P0050_KNEE_FUNCTION_SEI
     69    KNEE_FUNCTION_INFO                   = 24,
     70#endif
    6871    FRAME_PACKING                        = 45,
    6972    DISPLAY_ORIENTATION                  = 47,
     
    407410  Int    m_extendedWhiteLevelLumaCodeValue;
    408411};
    409 
     412#if P0050_KNEE_FUNCTION_SEI
     413class SEIKneeFunctionInfo : public SEI
     414{
     415public:
     416  PayloadType payloadType() const { return KNEE_FUNCTION_INFO; }
     417  SEIKneeFunctionInfo() {}
     418  virtual ~SEIKneeFunctionInfo() {}
     419
     420  Int   m_kneeId;
     421  Bool  m_kneeCancelFlag;
     422  Bool  m_kneePersistenceFlag;
     423  Bool  m_kneeMappingFlag;
     424  Int   m_kneeInputDrange;
     425  Int   m_kneeInputDispLuminance;
     426  Int   m_kneeOutputDrange;
     427  Int   m_kneeOutputDispLuminance;
     428  Int   m_kneeNumKneePointsMinus1;
     429  std::vector<Int> m_kneeInputKneePoint;
     430  std::vector<Int> m_kneeOutputKneePoint;
     431};
     432#endif
    410433#if Q0074_SEI_COLOR_MAPPING
    411434class SEIColorMappingInfo : public SEI
  • branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h

    r773 r776  
    100100#define Q0048_CGS_3D_ASYMLUT             1      ///< JCTVC-Q0048: Colour gamut scalability with look-up table
    101101#if Q0048_CGS_3D_ASYMLUT
     102
    102103#define CGS_GCC_NO_VECTORIZATION         1
    103104#define O0194_WEIGHTED_PREDICTION_CGS    0
     
    264265#define LAYER_DECPICBUFF_PARAM           1      ///< JCTVC-Q0102 Proposal 2 infer value from layer DPB param
    265266#define HRD_BPB                         1      ///< JCTVC-Q0101 Bitstream Partition Buffering Proposals
     267
     268#define P0050_KNEE_FUNCTION_SEI          1      ///< JCTVC-P0050: Knee function SEI
     269
    266270#if VIEW_ID_RELATED_SIGNALING
    267271/// scalability types
  • branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.cpp

    r775 r776  
    9393    fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n");
    9494    break;
     95#if P0050_KNEE_FUNCTION_SEI
     96  case SEI::KNEE_FUNCTION_INFO:
     97    fprintf( g_hTrace, "=========== Knee Function Information SEI message ===========\n");
     98    break;
     99#endif
    95100#if Q0074_SEI_COLOR_MAPPING
    96101  case SEI::COLOR_MAPPING_INFO:
     
    285290      xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize);
    286291      break;
     292#if P0050_KNEE_FUNCTION_SEI
     293    case SEI::KNEE_FUNCTION_INFO:
     294      sei = new SEIKneeFunctionInfo;
     295      xParseSEIKneeFunctionInfo((SEIKneeFunctionInfo&) *sei, payloadSize);
     296      break;
     297#endif
    287298#if Q0074_SEI_COLOR_MAPPING
    288299    case SEI::COLOR_MAPPING_INFO:
     
    849860}
    850861
     862#if P0050_KNEE_FUNCTION_SEI
     863Void SEIReader::xParseSEIKneeFunctionInfo(SEIKneeFunctionInfo& sei, UInt /*payloadSize*/){
     864  Int i;
     865  UInt val;
     866  READ_UVLC( val, "knee_function_id" );                   sei.m_kneeId = val;
     867  READ_FLAG( val, "knee_function_cancel_flag" );          sei.m_kneeCancelFlag = val;
     868  if ( !sei.m_kneeCancelFlag )
     869  {
     870    READ_FLAG( val, "knee_function_persistence_flag" );   sei.m_kneePersistenceFlag = val;
     871    READ_FLAG( val, "mapping_flag" );                     sei.m_kneeMappingFlag = val;
     872    READ_CODE( 32, val, "input_d_range" );                sei.m_kneeInputDrange = val;
     873    READ_CODE( 32, val, "input_disp_luminance" );         sei.m_kneeInputDispLuminance = val;
     874    READ_CODE( 32, val, "output_d_range" );               sei.m_kneeOutputDrange = val;
     875    READ_CODE( 32, val, "output_disp_luminance" );        sei.m_kneeOutputDispLuminance = val;
     876    READ_UVLC( val, "num_knee_points_minus1" );           sei.m_kneeNumKneePointsMinus1 = val;
     877    assert( sei.m_kneeNumKneePointsMinus1 > 0 );
     878    sei.m_kneeInputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1);
     879    sei.m_kneeOutputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1);
     880    for(i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ )
     881    {
     882      READ_CODE( 10, val, "input_knee_point" );           sei.m_kneeInputKneePoint[i] = val;
     883      READ_CODE( 10, val, "output_knee_point" );          sei.m_kneeOutputKneePoint[i] = val;
     884    }
     885  }
     886}
     887#endif
     888
    851889#if Q0074_SEI_COLOR_MAPPING
    852890Void SEIReader::xParseSEIColorMappingInfo(SEIColorMappingInfo& sei, UInt /*payloadSize*/)
  • branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.h

    r694 r776  
    9090  Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize);
    9191  Void xParseSEIToneMappingInfo       (SEIToneMappingInfo& sei, UInt payloadSize);
     92#if P0050_KNEE_FUNCTION_SEI
     93  Void xParseSEIKneeFunctionInfo      (SEIKneeFunctionInfo& sei, UInt payloadSize);
     94#endif
    9295#if Q0074_SEI_COLOR_MAPPING
    9396  Void xParseSEIColorMappingInfo      (SEIColorMappingInfo& sei, UInt payloadSize);
  • branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r774 r776  
    8787    fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n");
    8888    break;
     89#if P0050_KNEE_FUNCTION_SEI
     90  case SEI::KNEE_FUNCTION_INFO:
     91    fprintf( g_hTrace, "=========== Knee Function Information SEI message ===========\n");
     92    break;
     93#endif
    8994#if Q0074_SEI_COLOR_MAPPING
    9095  case SEI::COLOR_MAPPING_INFO:
     
    177182    xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei));
    178183    break;
     184#if P0050_KNEE_FUNCTION_SEI
     185  case SEI::KNEE_FUNCTION_INFO:
     186    xWriteSEIKneeFunctionInfo(*static_cast<const SEIKneeFunctionInfo*>(&sei));
     187    break;
     188#endif
    179189#if Q0074_SEI_COLOR_MAPPING
    180190  case SEI::COLOR_MAPPING_INFO:
     
    575585  xWriteByteAlign();
    576586}
    577 
     587#if P0050_KNEE_FUNCTION_SEI
     588Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei)
     589{
     590  WRITE_UVLC( sei.m_kneeId, "knee_function_id" );
     591  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" );
     592  if ( !sei.m_kneeCancelFlag )
     593  {
     594    WRITE_FLAG( sei.m_kneePersistenceFlag, "knee_function_persistence_flag" );
     595    WRITE_FLAG( sei.m_kneeMappingFlag, "mapping_flag" );
     596    WRITE_CODE( (UInt)sei.m_kneeInputDrange , 32,  "input_d_range" );
     597    WRITE_CODE( (UInt)sei.m_kneeInputDispLuminance, 32,  "input_disp_luminance" );
     598    WRITE_CODE( (UInt)sei.m_kneeOutputDrange, 32,  "output_d_range" );
     599    WRITE_CODE( (UInt)sei.m_kneeOutputDispLuminance, 32,  "output_disp_luminance" );
     600    WRITE_UVLC( sei.m_kneeNumKneePointsMinus1, "num_knee_points_minus1" );
     601    for(Int i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ )
     602    {
     603      WRITE_CODE( (UInt)sei.m_kneeInputKneePoint[i], 10,"input_knee_point" );
     604      WRITE_CODE( (UInt)sei.m_kneeOutputKneePoint[i], 10, "output_knee_point" );
     605    }
     606  }
     607  xWriteByteAlign();
     608}
     609#endif
    578610#if Q0074_SEI_COLOR_MAPPING
    579611Void SEIWriter::xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei)
  • branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.h

    r697 r776  
    7272  Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei);
    7373  Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei);
     74#if P0050_KNEE_FUNCTION_SEI
     75  Void xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei);
     76#endif
    7477#if Q0074_SEI_COLOR_MAPPING
    7578  Void xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei);
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCfg.h

    r756 r776  
    248248  Int*      m_codedPivotValue;
    249249  Int*      m_targetPivotValue;
     250#if P0050_KNEE_FUNCTION_SEI
     251  Bool      m_kneeSEIEnabled;
     252  Int       m_kneeSEIId;
     253  Bool      m_kneeSEICancelFlag;
     254  Bool      m_kneeSEIPersistenceFlag;
     255  Bool      m_kneeSEIMappingFlag;
     256  Int       m_kneeSEIInputDrange;
     257  Int       m_kneeSEIInputDispLuminance;
     258  Int       m_kneeSEIOutputDrange;
     259  Int       m_kneeSEIOutputDispLuminance;
     260  Int       m_kneeSEINumKneePointsMinus1;
     261  Int*      m_kneeSEIInputKneePoint;
     262  Int*      m_kneeSEIOutputKneePoint;
     263#endif
    250264#if Q0074_SEI_COLOR_MAPPING
    251265  Char*     m_seiColorMappingFile;
     
    668682  Void  setTMISEIExtendedWhiteLevelLumaCodeValue(Int b)      {  m_extendedWhiteLevelLumaCodeValue =b;  }
    669683  Int   getTMISEIExtendedWhiteLevelLumaCodeValue()           {  return m_extendedWhiteLevelLumaCodeValue;  }
     684#if P0050_KNEE_FUNCTION_SEI
     685  Void  setKneeSEIEnabled(Int b)                             { m_kneeSEIEnabled = b; }
     686  Bool  getKneeSEIEnabled()                                  { return m_kneeSEIEnabled; }
     687  Void  setKneeSEIId(Int b)                                  { m_kneeSEIId = b; }
     688  Int   getKneeSEIId()                                       { return m_kneeSEIId; }
     689  Void  setKneeSEICancelFlag(Bool b)                         { m_kneeSEICancelFlag=b; }
     690  Bool  getKneeSEICancelFlag()                               { return m_kneeSEICancelFlag; }
     691  Void  setKneeSEIPersistenceFlag(Bool b)                    { m_kneeSEIPersistenceFlag = b; }
     692  Bool  getKneeSEIPersistenceFlag()                          { return m_kneeSEIPersistenceFlag; }
     693  Void  setKneeSEIMappingFlag(Bool b)                        { m_kneeSEIMappingFlag = b; }
     694  Bool  getKneeSEIMappingFlag()                              { return m_kneeSEIMappingFlag; }
     695  Void  setKneeSEIInputDrange(Int b)                         { m_kneeSEIInputDrange = b; }
     696  Int   getKneeSEIInputDrange()                              { return m_kneeSEIInputDrange; }
     697  Void  setKneeSEIInputDispLuminance(Int b)                  { m_kneeSEIInputDispLuminance = b; }
     698  Int   getKneeSEIInputDispLuminance()                       { return m_kneeSEIInputDispLuminance; }
     699  Void  setKneeSEIOutputDrange(Int b)                        { m_kneeSEIOutputDrange = b; }
     700  Int   getKneeSEIOutputDrange()                             { return m_kneeSEIOutputDrange; }
     701  Void  setKneeSEIOutputDispLuminance(Int b)                 { m_kneeSEIOutputDispLuminance = b; }
     702  Int   getKneeSEIOutputDispLuminance()                      { return m_kneeSEIOutputDispLuminance; }
     703  Void  setKneeSEINumKneePointsMinus1(Int b)                 { m_kneeSEINumKneePointsMinus1 = b; }
     704  Int   getKneeSEINumKneePointsMinus1()                      { return m_kneeSEINumKneePointsMinus1; }
     705  Void  setKneeSEIInputKneePoint(Int *p)                     { m_kneeSEIInputKneePoint = p; }
     706  Int*  getKneeSEIInputKneePoint()                           { return m_kneeSEIInputKneePoint; }
     707  Void  setKneeSEIOutputKneePoint(Int *p)                    { m_kneeSEIOutputKneePoint = p; }
     708  Int*  getKneeSEIOutputKneePoint()                          { return m_kneeSEIOutputKneePoint; }
     709#endif
    670710#if Q0074_SEI_COLOR_MAPPING
    671711  Void  setColorMappingInfoSEIFile( Char* nameFile )         {  m_seiColorMappingFile = nameFile; }
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r771 r776  
    325325}
    326326
     327#if P0050_KNEE_FUNCTION_SEI
     328SEIKneeFunctionInfo* TEncGOP::xCreateSEIKneeFunctionInfo()
     329{
     330  SEIKneeFunctionInfo *seiKneeFunctionInfo = new SEIKneeFunctionInfo();
     331  seiKneeFunctionInfo->m_kneeId = m_pcCfg->getKneeSEIId();
     332  seiKneeFunctionInfo->m_kneeCancelFlag = m_pcCfg->getKneeSEICancelFlag();
     333  if ( !seiKneeFunctionInfo->m_kneeCancelFlag )
     334  {
     335    seiKneeFunctionInfo->m_kneePersistenceFlag = m_pcCfg->getKneeSEIPersistenceFlag();
     336    seiKneeFunctionInfo->m_kneeMappingFlag = m_pcCfg->getKneeSEIMappingFlag();
     337    seiKneeFunctionInfo->m_kneeInputDrange = m_pcCfg->getKneeSEIInputDrange();
     338    seiKneeFunctionInfo->m_kneeInputDispLuminance = m_pcCfg->getKneeSEIInputDispLuminance();
     339    seiKneeFunctionInfo->m_kneeOutputDrange = m_pcCfg->getKneeSEIOutputDrange();
     340    seiKneeFunctionInfo->m_kneeOutputDispLuminance = m_pcCfg->getKneeSEIOutputDispLuminance();
     341
     342    seiKneeFunctionInfo->m_kneeNumKneePointsMinus1 = m_pcCfg->getKneeSEINumKneePointsMinus1();
     343    Int* piInputKneePoint  = m_pcCfg->getKneeSEIInputKneePoint();
     344    Int* piOutputKneePoint = m_pcCfg->getKneeSEIOutputKneePoint();
     345    if(piInputKneePoint&&piOutputKneePoint)
     346    {
     347      seiKneeFunctionInfo->m_kneeInputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1);
     348      seiKneeFunctionInfo->m_kneeOutputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1);
     349      for(Int i=0; i<=seiKneeFunctionInfo->m_kneeNumKneePointsMinus1; i++)
     350      {
     351        seiKneeFunctionInfo->m_kneeInputKneePoint[i] = piInputKneePoint[i];
     352        seiKneeFunctionInfo->m_kneeOutputKneePoint[i] = piOutputKneePoint[i];
     353       }
     354    }
     355  }
     356  return seiKneeFunctionInfo;
     357}
     358#endif
     359
    327360#if Q0074_SEI_COLOR_MAPPING
    328361SEIColorMappingInfo*  TEncGOP::xCreateSEIColorMappingInfo( Char* file )
     
    475508    delete sei;
    476509  }
     510#if P0050_KNEE_FUNCTION_SEI
     511  if(m_pcCfg->getKneeSEIEnabled())
     512  {
     513    SEIKneeFunctionInfo *sei = xCreateSEIKneeFunctionInfo();
     514
     515    nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
     516    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     517#if O0164_MULTI_LAYER_HRD
     518    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
     519#else
     520    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     521#endif
     522    writeRBSPTrailingBits(nalu.m_Bitstream);
     523    accessUnit.push_back(new NALUnitEBSP(nalu));
     524    delete sei;
     525  }
     526#endif
    477527#if Q0074_SEI_COLOR_MAPPING
    478528  if(m_pcCfg->getColorMappingInfoSEIFile())
  • branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.h

    r754 r776  
    207207
    208208  SEIToneMappingInfo*     xCreateSEIToneMappingInfo();
     209#if P0050_KNEE_FUNCTION_SEI
     210  SEIKneeFunctionInfo*    xCreateSEIKneeFunctionInfo();
     211#endif
    209212#if Q0074_SEI_COLOR_MAPPING
    210213  SEIColorMappingInfo*    xCreateSEIColorMappingInfo( Char* file );
Note: See TracChangeset for help on using the changeset viewer.