Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibCommon/SEI.h


Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/SEI.h

    r1179 r1313  
    44 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    3232 */
    3333
     34#ifndef __SEI__
     35#define __SEI__
     36
    3437#pragma once
    3538#include <list>
     
    3740#include <cstring>
    3841
     42#include "CommonDef.h"
     43#include "libmd5/MD5.h"
    3944//! \ingroup TLibCommon
    4045//! \{
     
    7277    SCALABLE_NESTING                     = 133,
    7378    REGION_REFRESH_INFO                  = 134,
    74 #if H_MV
    75     SUB_BITSTREAM_PROPERTY               = 139,    // Final PayloadType to be defined after finalization
     79    NO_DISPLAY                           = 135,
     80    TIME_CODE                            = 136,
     81    MASTERING_DISPLAY_COLOUR_VOLUME      = 137,
     82    SEGM_RECT_FRAME_PACKING              = 138,
     83    TEMP_MOTION_CONSTRAINED_TILE_SETS    = 139,
     84    CHROMA_SAMPLING_FILTER_HINT          = 140,
     85    KNEE_FUNCTION_INFO                   = 141
     86#if NH_MV
     87    ,SUB_BITSTREAM_PROPERTY              = 164
    7688#endif
     89
    7790  };
    78  
     91
    7992  SEI() {}
    8093  virtual ~SEI() {}
    81  
     94
     95  static const Char *getSEIMessageString(SEI::PayloadType payloadType);
     96
    8297  virtual PayloadType payloadType() const = 0;
    8398};
     99
     100static const UInt ISO_IEC_11578_LEN=16;
    84101
    85102class SEIuserDataUnregistered : public SEI
     
    97114  }
    98115
    99   UChar uuid_iso_iec_11578[16];
    100   UInt userDataLength;
     116  UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN];
     117  UInt  userDataLength;
    101118  UChar *userData;
    102119};
     
    109126  SEIDecodedPictureHash() {}
    110127  virtual ~SEIDecodedPictureHash() {}
    111  
     128
    112129  enum Method
    113130  {
     
    118135  } method;
    119136
    120   UChar digest[3][16];
    121 };
    122 
    123 class SEIActiveParameterSets : public SEI 
     137  TComPictureHash m_pictureHash;
     138};
     139
     140class SEIActiveParameterSets : public SEI
    124141{
    125142public:
    126143  PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
    127144
    128   SEIActiveParameterSets() 
     145  SEIActiveParameterSets()
    129146    : activeVPSId            (0)
    130147    , m_selfContainedCvsFlag (false)
     
    134151  virtual ~SEIActiveParameterSets() {}
    135152
    136   Int activeVPSId; 
     153  Int activeVPSId;
    137154  Bool m_selfContainedCvsFlag;
    138155  Bool m_noParameterSetUpdateFlag;
     
    145162public:
    146163  PayloadType payloadType() const { return BUFFERING_PERIOD; }
     164  void copyTo (SEIBufferingPeriod& target);
    147165
    148166  SEIBufferingPeriod()
     
    174192public:
    175193  PayloadType payloadType() const { return PICTURE_TIMING; }
     194  void copyTo (SEIPictureTiming& target);
    176195
    177196  SEIPictureTiming()
     
    180199  , m_duplicateFlag           (false)
    181200  , m_picDpbOutputDuDelay     (0)
    182   , m_numNalusInDuMinus1      (NULL)
    183   , m_duCpbRemovalDelayMinus1 (NULL)
    184201  {}
    185202  virtual ~SEIPictureTiming()
    186203  {
    187     if( m_numNalusInDuMinus1 != NULL )
    188     {
    189       delete m_numNalusInDuMinus1;
    190     }
    191     if( m_duCpbRemovalDelayMinus1  != NULL )
    192     {
    193       delete m_duCpbRemovalDelayMinus1;
    194     }
    195204  }
    196205
     
    205214  Bool  m_duCommonCpbRemovalDelayFlag;
    206215  UInt  m_duCommonCpbRemovalDelayMinus1;
    207   UInt* m_numNalusInDuMinus1;
    208   UInt* m_duCpbRemovalDelayMinus1;
     216  std::vector<UInt> m_numNalusInDuMinus1;
     217  std::vector<UInt> m_duCpbRemovalDelayMinus1;
    209218};
    210219
     
    239248  Bool m_brokenLinkFlag;
    240249};
     250
    241251class SEIFramePacking : public SEI
    242252{
     
    267277};
    268278
     279class SEISegmentedRectFramePacking : public SEI
     280{
     281public:
     282  PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; }
     283
     284  SEISegmentedRectFramePacking() {}
     285  virtual ~SEISegmentedRectFramePacking() {}
     286
     287  Bool m_arrangementCancelFlag;
     288  Int  m_contentInterpretationType;
     289  Bool m_arrangementPersistenceFlag;
     290};
     291
    269292class SEIDisplayOrientation : public SEI
    270293{
     
    314337
    315338  Bool m_gdrForegroundFlag;
     339};
     340
     341class SEINoDisplay : public SEI
     342{
     343public:
     344  PayloadType payloadType() const { return NO_DISPLAY; }
     345
     346  SEINoDisplay()
     347    : m_noDisplay(false)
     348  {}
     349  virtual ~SEINoDisplay() {}
     350
     351  Bool m_noDisplay;
    316352};
    317353
     
    358394  Int    m_exposureIndexIdc;
    359395  Int    m_exposureIndexValue;
    360   Int    m_exposureCompensationValueSignFlag;
     396  Bool   m_exposureCompensationValueSignFlag;
    361397  Int    m_exposureCompensationValueNumerator;
    362398  Int    m_exposureCompensationValueDenomIdc;
     
    368404};
    369405
    370 #if H_MV
     406class SEIKneeFunctionInfo : public SEI
     407{
     408public:
     409  PayloadType payloadType() const { return KNEE_FUNCTION_INFO; }
     410  SEIKneeFunctionInfo() {}
     411  virtual ~SEIKneeFunctionInfo() {}
     412
     413  Int   m_kneeId;
     414  Bool  m_kneeCancelFlag;
     415  Bool  m_kneePersistenceFlag;
     416  Int   m_kneeInputDrange;
     417  Int   m_kneeInputDispLuminance;
     418  Int   m_kneeOutputDrange;
     419  Int   m_kneeOutputDispLuminance;
     420  Int   m_kneeNumKneePointsMinus1;
     421  std::vector<Int> m_kneeInputKneePoint;
     422  std::vector<Int> m_kneeOutputKneePoint;
     423};
     424
     425class SEIChromaSamplingFilterHint : public SEI
     426{
     427public:
     428  PayloadType payloadType() const {return CHROMA_SAMPLING_FILTER_HINT;}
     429  SEIChromaSamplingFilterHint() {}
     430  virtual ~SEIChromaSamplingFilterHint() {
     431    if(m_verChromaFilterIdc == 1)
     432    {
     433      for(Int i = 0; i < m_numVerticalFilters; i ++)
     434      {
     435        free(m_verFilterCoeff[i]);
     436      }
     437      free(m_verFilterCoeff);
     438      free(m_verTapLengthMinus1);
     439    }
     440    if(m_horChromaFilterIdc == 1)
     441    {
     442      for(Int i = 0; i < m_numHorizontalFilters; i ++)
     443      {
     444        free(m_horFilterCoeff[i]);
     445      }
     446      free(m_horFilterCoeff);
     447      free(m_horTapLengthMinus1);
     448    }
     449  }
     450
     451  Int   m_verChromaFilterIdc;
     452  Int   m_horChromaFilterIdc;
     453  Bool  m_verFilteringProcessFlag;
     454  Int   m_targetFormatIdc;
     455  Bool  m_perfectReconstructionFlag;
     456  Int   m_numVerticalFilters;
     457  Int*  m_verTapLengthMinus1;
     458  Int** m_verFilterCoeff;
     459  Int   m_numHorizontalFilters;
     460  Int*  m_horTapLengthMinus1;
     461  Int** m_horFilterCoeff;
     462};
     463
     464class SEIMasteringDisplayColourVolume : public SEI
     465{
     466public:
     467    PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; }
     468    SEIMasteringDisplayColourVolume() {}
     469    virtual ~SEIMasteringDisplayColourVolume(){}
     470   
     471    TComSEIMasteringDisplay values;
     472};
     473
     474#if NH_MV
    371475class SEISubBitstreamProperty : public SEI
    372476{
     
    392496SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
    393497
    394 /// remove a selection of SEI messages by payload type from the original list and return them in a new list. 
     498/// remove a selection of SEI messages by payload type from the original list and return them in a new list.
    395499SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
    396500
     
    404508
    405509  SEIScalableNesting() {}
     510
    406511  virtual ~SEIScalableNesting()
    407512  {
    408     if (!m_callerOwnsSEIs)
    409     {
    410       deleteSEIs(m_nestedSEIs);
    411     }
     513    deleteSEIs(m_nestedSEIs);
    412514  }
    413515
     
    422524  UInt  m_nestingNoOpMaxTemporalIdPlus1;             //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
    423525  UInt  m_nestingNumLayersMinus1;                    //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
    424   UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER];     //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 unsigned char values
    425 
    426   Bool  m_callerOwnsSEIs;
     526  UChar m_nestingLayerId[MAX_NESTING_NUM_LAYER];     //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0. This can e.g. be a static array of 64 UChar values
     527
    427528  SEIMessages m_nestedSEIs;
    428529};
    429530
     531class SEITimeCode : public SEI
     532{
     533public:
     534  PayloadType payloadType() const { return TIME_CODE; }
     535  SEITimeCode() {}
     536  virtual ~SEITimeCode(){}
     537
     538  UInt numClockTs;
     539  TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS];
     540};
     541
     542//definition according to P1005_v1;
     543class SEITempMotionConstrainedTileSets: public SEI
     544{
     545  struct TileSetData
     546  {
     547    protected:
     548      std::vector<Int> m_top_left_tile_index;  //[tileSetIdx][tileIdx];
     549      std::vector<Int> m_bottom_right_tile_index;
     550
     551    public:
     552      Int     m_mcts_id; 
     553      Bool    m_display_tile_set_flag;
     554      Int     m_num_tile_rects_in_set; //_minus1;
     555      Bool    m_exact_sample_value_match_flag;
     556      Bool    m_mcts_tier_level_idc_present_flag;
     557      Bool    m_mcts_tier_flag;
     558      Int     m_mcts_level_idc;
     559
     560      Void setNumberOfTileRects(const Int number)
     561      {
     562        m_top_left_tile_index    .resize(number);
     563        m_bottom_right_tile_index.resize(number);
     564      }
     565
     566      Int  getNumberOfTileRects() const
     567      {
     568        assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size());
     569        return Int(m_top_left_tile_index.size());
     570      }
     571
     572            Int &topLeftTileIndex    (const Int tileRectIndex)       { return m_top_left_tile_index    [tileRectIndex]; }
     573            Int &bottomRightTileIndex(const Int tileRectIndex)       { return m_bottom_right_tile_index[tileRectIndex]; }
     574      const Int &topLeftTileIndex    (const Int tileRectIndex) const { return m_top_left_tile_index    [tileRectIndex]; }
     575      const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; }
     576  };
     577
     578protected:
     579  std::vector<TileSetData> m_tile_set_data;
     580
     581public:
     582
     583  Bool    m_mc_all_tiles_exact_sample_value_match_flag;
     584  Bool    m_each_tile_one_tile_set_flag;
     585  Bool    m_limited_tile_set_display_flag;
     586  Bool    m_max_mcs_tier_level_idc_present_flag;
     587  Bool    m_max_mcts_tier_flag;
     588  Int     m_max_mcts_level_idc;
     589
     590  PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; }
     591
     592  Void setNumberOfTileSets(const Int number)       { m_tile_set_data.resize(number);     }
     593  Int  getNumberOfTileSets()                 const { return Int(m_tile_set_data.size()); }
     594
     595        TileSetData &tileSetData (const Int index)       { return m_tile_set_data[index]; }
     596  const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; }
     597
     598};
     599
     600#endif
     601
    430602//! \}
Note: See TracChangeset for help on using the changeset viewer.