source: 3DVCSoftware/branches/HTM-15.1-dev0/source/Lib/TLibCommon/SEI.h @ 1328

Last change on this file since 1328 was 1328, checked in by tech, 9 years ago

Integrated general SEI changes and following SEIs:

  • Multiview view position SEI
  • Multiview acquisition information SEI
  • Multiview scene information SEI
  • Inter-layer constrained tile sets SEI
  • Property svn:eol-style set to native
File size: 35.1 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2015, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#ifndef __SEI__
35#define __SEI__
36
37#pragma once
38#include <list>
39#include <vector>
40#include <cstring>
41
42#include "CommonDef.h"
43#include "libmd5/MD5.h"
44 
45
46#if NH_MV_SEI
47#include "TAppCommon/program_options_lite.h"
48using namespace std;
49namespace po = df::program_options_lite;
50#endif
51
52//! \ingroup TLibCommon
53//! \{
54class TComSPS;
55#if NH_MV_SEI
56class TComSlice; 
57class SEIScalableNesting; 
58#endif
59
60/**
61 * Abstract class representing an SEI message with lightweight RTTI.
62 */
63class SEI
64{
65public:
66  enum PayloadType
67  {
68    BUFFERING_PERIOD                     = 0,
69    PICTURE_TIMING                       = 1,
70    PAN_SCAN_RECT                        = 2,
71    FILLER_PAYLOAD                       = 3,
72    USER_DATA_REGISTERED_ITU_T_T35       = 4,
73    USER_DATA_UNREGISTERED               = 5,
74    RECOVERY_POINT                       = 6,
75    SCENE_INFO                           = 9,
76    FULL_FRAME_SNAPSHOT                  = 15,
77    PROGRESSIVE_REFINEMENT_SEGMENT_START = 16,
78    PROGRESSIVE_REFINEMENT_SEGMENT_END   = 17,
79    FILM_GRAIN_CHARACTERISTICS           = 19,
80    POST_FILTER_HINT                     = 22,
81    TONE_MAPPING_INFO                    = 23,
82    FRAME_PACKING                        = 45,
83    DISPLAY_ORIENTATION                  = 47,
84    SOP_DESCRIPTION                      = 128,
85    ACTIVE_PARAMETER_SETS                = 129,
86    DECODING_UNIT_INFO                   = 130,
87    TEMPORAL_LEVEL0_INDEX                = 131,
88    DECODED_PICTURE_HASH                 = 132,
89    SCALABLE_NESTING                     = 133,
90    REGION_REFRESH_INFO                  = 134,
91    NO_DISPLAY                           = 135,
92    TIME_CODE                            = 136,
93    MASTERING_DISPLAY_COLOUR_VOLUME      = 137,
94    SEGM_RECT_FRAME_PACKING              = 138,
95    TEMP_MOTION_CONSTRAINED_TILE_SETS    = 139,
96    CHROMA_SAMPLING_FILTER_HINT          = 140,
97    KNEE_FUNCTION_INFO                   = 141
98#if NH_MV_SEI
99    ,COLOUR_REMAPPING_INFO                    = 142,
100    DEINTERLACED_FIELD_IDENTIFICATION         = 143,
101    LAYERS_NOT_PRESENT                        = 160,
102    INTER_LAYER_CONSTRAINED_TILE_SETS         = 161,
103    BSP_NESTING                               = 162,
104    BSP_INITIAL_ARRIVAL_TIME                  = 163,
105    SUB_BITSTREAM_PROPERTY                    = 164,
106    ALPHA_CHANNEL_INFO                        = 165,
107    OVERLAY_INFO                              = 166,
108    TEMPORAL_MV_PREDICTION_CONSTRAINTS        = 167,
109    FRAME_FIELD_INFO                          = 168,
110    THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO = 176,
111    DEPTH_REPRESENTATION_INFO                 = 177,
112    MULTIVIEW_SCENE_INFO                      = 178,
113    MULTIVIEW_ACQUISITION_INFO                = 179,
114    MULTIVIEW_VIEW_POSITION                   = 180
115#if NH_3D
116    ,    ALTERNATIVE_DEPTH_INFO                    = 181
117#endif
118#endif
119
120  };
121
122  SEI();
123
124  virtual ~SEI() {}
125  virtual SEI*       getCopy( ) const;
126  static const Char *getSEIMessageString(SEI::PayloadType payloadType );
127  virtual PayloadType payloadType() const = 0;
128
129#if NH_MV_SEI
130  static SEI*        getNewSEIMessage         ( SEI::PayloadType payloadType ); 
131  Bool               insertSei                ( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const; 
132
133
134  virtual Void       setupFromSlice           ( const TComSlice* slice );
135  virtual Void       setupFromCfgFile         ( const Char* cfgFile );
136  virtual Bool       checkCfg                 ( const TComSlice* slice   );
137
138  Void               xPrintCfgErrorIntro();
139  Void               xCheckCfgRange           ( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName );
140  Void               xCheckCfg                ( Bool& wrongConfig, Bool cond, const Char* errStr );
141  Void               xAddGeneralOpts          ( po::Options &opts, IntAry1d defAppLayerIds, IntAry1d defAppPocs, IntAry1d defAppTids, IntAry1d defAppVclNaluTypes, 
142                                                Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder );
143    // Filters where to insert SEI in the bitstream.
144  // When the respected vector is empty, all layersIds, POCs, Tids, and Nalu types are used.
145  IntAry1d                       m_applicableLayerIds; 
146  IntAry1d                       m_applicablePocs; 
147  IntAry1d                       m_applicableTids; 
148  IntAry1d                       m_applicableVclNaluTypes;     
149
150  Int                            m_payloadType;              // Payload type
151  Int                            m_seiNaluId;                // Identifies to which NAL unit  the SEI is added.
152  Int                            m_positionInSeiNalu;        // Identifies the order within the NAL unit
153  Bool                           m_modifyByEncoder;          // Don't use the SEI cfg-file, but let let the encoder setup the NALU.   
154
155  SEIScalableNesting*            m_scalNestSeiContThisSei;   // Pointer to scalable nesting SEI containing the SEI. When NULL, the SEI is not nested.
156#endif
157};
158
159static const UInt ISO_IEC_11578_LEN=16;
160
161class SEIuserDataUnregistered : public SEI
162{
163public:
164  PayloadType payloadType() const { return USER_DATA_UNREGISTERED; }
165
166  SEIuserDataUnregistered()
167    : userData(0)
168    {}
169
170  virtual ~SEIuserDataUnregistered()
171  {
172    delete userData;
173  }
174
175  UChar uuid_iso_iec_11578[ISO_IEC_11578_LEN];
176  UInt  userDataLength;
177  UChar *userData;
178};
179
180class SEIDecodedPictureHash : public SEI
181{
182public:
183  PayloadType payloadType() const { return DECODED_PICTURE_HASH; }
184
185  SEIDecodedPictureHash() {}
186  virtual ~SEIDecodedPictureHash() {}
187
188  enum Method
189  {
190    MD5,
191    CRC,
192    CHECKSUM,
193    RESERVED,
194  } method;
195
196  TComPictureHash m_pictureHash;
197};
198
199class SEIActiveParameterSets : public SEI
200{
201public:
202  PayloadType payloadType() const { return ACTIVE_PARAMETER_SETS; }
203
204  SEIActiveParameterSets()
205    : activeVPSId            (0)
206    , m_selfContainedCvsFlag (false)
207    , m_noParameterSetUpdateFlag (false)
208    , numSpsIdsMinus1        (0)
209  {}
210  virtual ~SEIActiveParameterSets() {}
211
212  Int activeVPSId;
213  Bool m_selfContainedCvsFlag;
214  Bool m_noParameterSetUpdateFlag;
215  Int numSpsIdsMinus1;
216  std::vector<Int> activeSeqParameterSetId; 
217};
218
219class SEIBufferingPeriod : public SEI
220{
221public:
222  PayloadType payloadType() const { return BUFFERING_PERIOD; }
223  void copyTo (SEIBufferingPeriod& target);
224
225  SEIBufferingPeriod()
226  : m_bpSeqParameterSetId (0)
227  , m_rapCpbParamsPresentFlag (false)
228  , m_cpbDelayOffset      (0)
229  , m_dpbDelayOffset      (0)
230  {
231    ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay));
232    ::memset(m_initialCpbRemovalDelayOffset, 0, sizeof(m_initialCpbRemovalDelayOffset));
233    ::memset(m_initialAltCpbRemovalDelay, 0, sizeof(m_initialAltCpbRemovalDelay));
234    ::memset(m_initialAltCpbRemovalDelayOffset, 0, sizeof(m_initialAltCpbRemovalDelayOffset));
235  }
236  virtual ~SEIBufferingPeriod() {}
237
238  UInt m_bpSeqParameterSetId;
239  Bool m_rapCpbParamsPresentFlag;
240  UInt m_cpbDelayOffset;
241  UInt m_dpbDelayOffset;
242  UInt m_initialCpbRemovalDelay         [MAX_CPB_CNT][2];
243  UInt m_initialCpbRemovalDelayOffset   [MAX_CPB_CNT][2];
244  UInt m_initialAltCpbRemovalDelay      [MAX_CPB_CNT][2];
245  UInt m_initialAltCpbRemovalDelayOffset[MAX_CPB_CNT][2];
246  Bool m_concatenationFlag;
247  UInt m_auCpbRemovalDelayDelta;
248};
249class SEIPictureTiming : public SEI
250{
251public:
252  PayloadType payloadType() const { return PICTURE_TIMING; }
253  void copyTo (SEIPictureTiming& target);
254
255  SEIPictureTiming()
256  : m_picStruct               (0)
257  , m_sourceScanType          (0)
258  , m_duplicateFlag           (false)
259  , m_picDpbOutputDuDelay     (0)
260  {}
261  virtual ~SEIPictureTiming()
262  {
263  }
264
265  UInt  m_picStruct;
266  UInt  m_sourceScanType;
267  Bool  m_duplicateFlag;
268
269  UInt  m_auCpbRemovalDelay;
270  UInt  m_picDpbOutputDelay;
271  UInt  m_picDpbOutputDuDelay;
272  UInt  m_numDecodingUnitsMinus1;
273  Bool  m_duCommonCpbRemovalDelayFlag;
274  UInt  m_duCommonCpbRemovalDelayMinus1;
275  std::vector<UInt> m_numNalusInDuMinus1;
276  std::vector<UInt> m_duCpbRemovalDelayMinus1;
277};
278
279class SEIDecodingUnitInfo : public SEI
280{
281public:
282  PayloadType payloadType() const { return DECODING_UNIT_INFO; }
283
284  SEIDecodingUnitInfo()
285    : m_decodingUnitIdx(0)
286    , m_duSptCpbRemovalDelay(0)
287    , m_dpbOutputDuDelayPresentFlag(false)
288    , m_picSptDpbOutputDuDelay(0)
289  {}
290  virtual ~SEIDecodingUnitInfo() {}
291  Int m_decodingUnitIdx;
292  Int m_duSptCpbRemovalDelay;
293  Bool m_dpbOutputDuDelayPresentFlag;
294  Int m_picSptDpbOutputDuDelay;
295};
296
297class SEIRecoveryPoint : public SEI
298{
299public:
300  PayloadType payloadType() const { return RECOVERY_POINT; }
301
302  SEIRecoveryPoint() {}
303  virtual ~SEIRecoveryPoint() {}
304
305  Int  m_recoveryPocCnt;
306  Bool m_exactMatchingFlag;
307  Bool m_brokenLinkFlag;
308};
309
310class SEIFramePacking : public SEI
311{
312public:
313  PayloadType payloadType() const { return FRAME_PACKING; }
314
315  SEIFramePacking() {}
316  virtual ~SEIFramePacking() {}
317
318  Int  m_arrangementId;
319  Bool m_arrangementCancelFlag;
320  Int  m_arrangementType;
321  Bool m_quincunxSamplingFlag;
322  Int  m_contentInterpretationType;
323  Bool m_spatialFlippingFlag;
324  Bool m_frame0FlippedFlag;
325  Bool m_fieldViewsFlag;
326  Bool m_currentFrameIsFrame0Flag;
327  Bool m_frame0SelfContainedFlag;
328  Bool m_frame1SelfContainedFlag;
329  Int  m_frame0GridPositionX;
330  Int  m_frame0GridPositionY;
331  Int  m_frame1GridPositionX;
332  Int  m_frame1GridPositionY;
333  Int  m_arrangementReservedByte;
334  Bool m_arrangementPersistenceFlag;
335  Bool m_upsampledAspectRatio;
336};
337
338class SEISegmentedRectFramePacking : public SEI
339{
340public:
341  PayloadType payloadType() const { return SEGM_RECT_FRAME_PACKING; }
342
343  SEISegmentedRectFramePacking() {}
344  virtual ~SEISegmentedRectFramePacking() {}
345
346  Bool m_arrangementCancelFlag;
347  Int  m_contentInterpretationType;
348  Bool m_arrangementPersistenceFlag;
349};
350
351class SEIDisplayOrientation : public SEI
352{
353public:
354  PayloadType payloadType() const { return DISPLAY_ORIENTATION; }
355
356  SEIDisplayOrientation()
357    : cancelFlag(true)
358    , persistenceFlag(0)
359    , extensionFlag(false)
360    {}
361  virtual ~SEIDisplayOrientation() {}
362
363  Bool cancelFlag;
364  Bool horFlip;
365  Bool verFlip;
366
367  UInt anticlockwiseRotation;
368  Bool persistenceFlag;
369  Bool extensionFlag;
370};
371
372class SEITemporalLevel0Index : public SEI
373{
374public:
375  PayloadType payloadType() const { return TEMPORAL_LEVEL0_INDEX; }
376
377  SEITemporalLevel0Index()
378    : tl0Idx(0)
379    , rapIdx(0)
380    {}
381  virtual ~SEITemporalLevel0Index() {}
382
383  UInt tl0Idx;
384  UInt rapIdx;
385};
386
387class SEIGradualDecodingRefreshInfo : public SEI
388{
389public:
390  PayloadType payloadType() const { return REGION_REFRESH_INFO; }
391
392  SEIGradualDecodingRefreshInfo()
393    : m_gdrForegroundFlag(0)
394  {}
395  virtual ~SEIGradualDecodingRefreshInfo() {}
396
397  Bool m_gdrForegroundFlag;
398};
399
400class SEINoDisplay : public SEI
401{
402public:
403  PayloadType payloadType() const { return NO_DISPLAY; }
404
405  SEINoDisplay()
406    : m_noDisplay(false)
407  {}
408  virtual ~SEINoDisplay() {}
409
410  Bool m_noDisplay;
411};
412
413class SEISOPDescription : public SEI
414{
415public:
416  PayloadType payloadType() const { return SOP_DESCRIPTION; }
417
418  SEISOPDescription() {}
419  virtual ~SEISOPDescription() {}
420
421  UInt m_sopSeqParameterSetId;
422  UInt m_numPicsInSopMinus1;
423
424  UInt m_sopDescVclNaluType[MAX_NUM_PICS_IN_SOP];
425  UInt m_sopDescTemporalId[MAX_NUM_PICS_IN_SOP];
426  UInt m_sopDescStRpsIdx[MAX_NUM_PICS_IN_SOP];
427  Int m_sopDescPocDelta[MAX_NUM_PICS_IN_SOP];
428};
429
430class SEIToneMappingInfo : public SEI
431{
432public:
433  PayloadType payloadType() const { return TONE_MAPPING_INFO; }
434  SEIToneMappingInfo() {}
435  virtual ~SEIToneMappingInfo() {}
436
437  Int    m_toneMapId;
438  Bool   m_toneMapCancelFlag;
439  Bool   m_toneMapPersistenceFlag;
440  Int    m_codedDataBitDepth;
441  Int    m_targetBitDepth;
442  Int    m_modelId;
443  Int    m_minValue;
444  Int    m_maxValue;
445  Int    m_sigmoidMidpoint;
446  Int    m_sigmoidWidth;
447  std::vector<Int> m_startOfCodedInterval;
448  Int    m_numPivots;
449  std::vector<Int> m_codedPivotValue;
450  std::vector<Int> m_targetPivotValue;
451  Int    m_cameraIsoSpeedIdc;
452  Int    m_cameraIsoSpeedValue;
453  Int    m_exposureIndexIdc;
454  Int    m_exposureIndexValue;
455  Bool   m_exposureCompensationValueSignFlag;
456  Int    m_exposureCompensationValueNumerator;
457  Int    m_exposureCompensationValueDenomIdc;
458  Int    m_refScreenLuminanceWhite;
459  Int    m_extendedRangeWhiteLevel;
460  Int    m_nominalBlackLevelLumaCodeValue;
461  Int    m_nominalWhiteLevelLumaCodeValue;
462  Int    m_extendedWhiteLevelLumaCodeValue;
463};
464
465class SEIKneeFunctionInfo : public SEI
466{
467public:
468  PayloadType payloadType() const { return KNEE_FUNCTION_INFO; }
469  SEIKneeFunctionInfo() {}
470  virtual ~SEIKneeFunctionInfo() {}
471
472  Int   m_kneeId;
473  Bool  m_kneeCancelFlag;
474  Bool  m_kneePersistenceFlag;
475  Int   m_kneeInputDrange;
476  Int   m_kneeInputDispLuminance;
477  Int   m_kneeOutputDrange;
478  Int   m_kneeOutputDispLuminance;
479  Int   m_kneeNumKneePointsMinus1;
480  std::vector<Int> m_kneeInputKneePoint;
481  std::vector<Int> m_kneeOutputKneePoint;
482};
483
484class SEIChromaSamplingFilterHint : public SEI
485{
486public:
487  PayloadType payloadType() const {return CHROMA_SAMPLING_FILTER_HINT;}
488  SEIChromaSamplingFilterHint() {}
489  virtual ~SEIChromaSamplingFilterHint() {
490    if(m_verChromaFilterIdc == 1)
491    {
492      for(Int i = 0; i < m_numVerticalFilters; i ++)
493      {
494        free(m_verFilterCoeff[i]);
495      }
496      free(m_verFilterCoeff);
497      free(m_verTapLengthMinus1);
498    }
499    if(m_horChromaFilterIdc == 1)
500    {
501      for(Int i = 0; i < m_numHorizontalFilters; i ++)
502      {
503        free(m_horFilterCoeff[i]);
504      }
505      free(m_horFilterCoeff);
506      free(m_horTapLengthMinus1);
507    }
508  }
509
510  Int   m_verChromaFilterIdc;
511  Int   m_horChromaFilterIdc;
512  Bool  m_verFilteringProcessFlag;
513  Int   m_targetFormatIdc;
514  Bool  m_perfectReconstructionFlag;
515  Int   m_numVerticalFilters;
516  Int*  m_verTapLengthMinus1;
517  Int** m_verFilterCoeff;
518  Int   m_numHorizontalFilters;
519  Int*  m_horTapLengthMinus1;
520  Int** m_horFilterCoeff;
521};
522
523class SEIMasteringDisplayColourVolume : public SEI
524{
525public:
526    PayloadType payloadType() const { return MASTERING_DISPLAY_COLOUR_VOLUME; }
527    SEIMasteringDisplayColourVolume() {}
528    virtual ~SEIMasteringDisplayColourVolume(){}
529   
530    TComSEIMasteringDisplay values;
531};
532
533#if NH_MV
534#if !NH_MV_SEI
535class SEISubBitstreamProperty : public SEI
536{
537public:
538  PayloadType payloadType() const { return SUB_BITSTREAM_PROPERTY; }
539
540  SEISubBitstreamProperty():   m_activeVpsId(-1), m_numAdditionalSubStreams(0) {}
541  virtual ~SEISubBitstreamProperty() {}
542
543  Int  m_activeVpsId;
544  Int  m_numAdditionalSubStreams;
545  std::vector<Int>  m_subBitstreamMode;
546  std::vector<Int>  m_outputLayerSetIdxToVps;
547  std::vector<Int>  m_highestSublayerId;
548  std::vector<Int>  m_avgBitRate;
549  std::vector<Int>  m_maxBitRate;
550};
551#endif
552#endif
553
554typedef std::list<SEI*> SEIMessages;
555
556/// output a selection of SEI messages by payload type. Ownership stays in original message list.
557SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
558
559/// remove a selection of SEI messages by payload type from the original list and return them in a new list.
560SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType);
561
562/// delete list of SEI messages (freeing the referenced objects)
563Void deleteSEIs (SEIMessages &seiList);
564
565class SEIScalableNesting : public SEI
566{
567public:
568  PayloadType payloadType() const { return SCALABLE_NESTING; }
569
570  SEIScalableNesting() {}
571
572  virtual ~SEIScalableNesting()
573  {
574    deleteSEIs(m_nestedSEIs);
575  }
576
577  Bool  m_bitStreamSubsetFlag;
578  Bool  m_nestingOpFlag;
579  Bool  m_defaultOpFlag;                             //value valid if m_nestingOpFlag != 0
580  UInt  m_nestingNumOpsMinus1;                       // -"-
581  UInt  m_nestingMaxTemporalIdPlus1[MAX_TLAYER];     // -"-
582  UInt  m_nestingOpIdx[MAX_NESTING_NUM_OPS];         // -"-
583
584  Bool  m_allLayersFlag;                             //value valid if m_nestingOpFlag == 0
585  UInt  m_nestingNoOpMaxTemporalIdPlus1;             //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
586  UInt  m_nestingNumLayersMinus1;                    //value valid if m_nestingOpFlag == 0 and m_allLayersFlag == 0
587  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
588
589  SEIMessages m_nestedSEIs;
590};
591
592class SEITimeCode : public SEI
593{
594public:
595  PayloadType payloadType() const { return TIME_CODE; }
596  SEITimeCode() {}
597  virtual ~SEITimeCode(){}
598
599  UInt numClockTs;
600  TComSEITimeSet timeSetArray[MAX_TIMECODE_SEI_SETS];
601};
602
603//definition according to P1005_v1;
604class SEITempMotionConstrainedTileSets: public SEI
605{
606  struct TileSetData
607  {
608    protected:
609      std::vector<Int> m_top_left_tile_index;  //[tileSetIdx][tileIdx];
610      std::vector<Int> m_bottom_right_tile_index;
611
612    public:
613      Int     m_mcts_id; 
614      Bool    m_display_tile_set_flag;
615      Int     m_num_tile_rects_in_set; //_minus1;
616      Bool    m_exact_sample_value_match_flag;
617      Bool    m_mcts_tier_level_idc_present_flag;
618      Bool    m_mcts_tier_flag;
619      Int     m_mcts_level_idc;
620
621      Void setNumberOfTileRects(const Int number)
622      {
623        m_top_left_tile_index    .resize(number);
624        m_bottom_right_tile_index.resize(number);
625      }
626
627      Int  getNumberOfTileRects() const
628      {
629        assert(m_top_left_tile_index.size() == m_bottom_right_tile_index.size());
630        return Int(m_top_left_tile_index.size());
631      }
632
633            Int &topLeftTileIndex    (const Int tileRectIndex)       { return m_top_left_tile_index    [tileRectIndex]; }
634            Int &bottomRightTileIndex(const Int tileRectIndex)       { return m_bottom_right_tile_index[tileRectIndex]; }
635      const Int &topLeftTileIndex    (const Int tileRectIndex) const { return m_top_left_tile_index    [tileRectIndex]; }
636      const Int &bottomRightTileIndex(const Int tileRectIndex) const { return m_bottom_right_tile_index[tileRectIndex]; }
637  };
638
639protected:
640  std::vector<TileSetData> m_tile_set_data;
641
642public:
643
644  Bool    m_mc_all_tiles_exact_sample_value_match_flag;
645  Bool    m_each_tile_one_tile_set_flag;
646  Bool    m_limited_tile_set_display_flag;
647  Bool    m_max_mcs_tier_level_idc_present_flag;
648  Bool    m_max_mcts_tier_flag;
649  Int     m_max_mcts_level_idc;
650
651  PayloadType payloadType() const { return TEMP_MOTION_CONSTRAINED_TILE_SETS; }
652
653  Void setNumberOfTileSets(const Int number)       { m_tile_set_data.resize(number);     }
654  Int  getNumberOfTileSets()                 const { return Int(m_tile_set_data.size()); }
655
656        TileSetData &tileSetData (const Int index)       { return m_tile_set_data[index]; }
657  const TileSetData &tileSetData (const Int index) const { return m_tile_set_data[index]; }
658
659};
660
661#if NH_MV_SEI
662#if NH_MV_SEI_TBD
663class SEILayersNotPresent : public SEI
664{
665public:
666  PayloadType payloadType( ) const { return LAYERS_NOT_PRESENT; }
667  SEILayersNotPresent ( ) { };
668  ~SEILayersNotPresent( ) { };
669  SEI* getCopy( ) const { return new SEILayersNotPresent(*this); }; 
670
671  Void setupFromCfgFile( const Char*      cfgFile );
672  Void setupFromSlice  ( const TComSlice* slice   );
673  Bool checkCfg        ( const TComSlice* slice   );
674
675  Int       m_lnpSeiActiveVpsId;
676  BoolAry1d m_layerNotPresentFlag;
677};
678#endif
679
680class SEIInterLayerConstrainedTileSets : public SEI
681{
682public:
683  PayloadType payloadType( ) const { return INTER_LAYER_CONSTRAINED_TILE_SETS; }
684  SEIInterLayerConstrainedTileSets ( ) { };
685  ~SEIInterLayerConstrainedTileSets( ) { };
686  SEI* getCopy( ) const { return new SEIInterLayerConstrainedTileSets(*this); }; 
687
688  Void setupFromCfgFile( const Char*      cfgFile );
689  Bool checkCfg        ( const TComSlice* slice   );
690
691  Bool      m_ilAllTilesExactSampleValueMatchFlag;
692  Bool      m_ilOneTilePerTileSetFlag;
693  Int       m_ilNumSetsInMessageMinus1;
694  Bool      m_skippedTileSetPresentFlag;
695  IntAry1d  m_ilctsId;
696  IntAry1d  m_ilNumTileRectsInSetMinus1;
697  IntAry2d  m_ilTopLeftTileIndex;
698  IntAry2d  m_ilBottomRightTileIndex;
699  IntAry1d  m_ilcIdc;
700  BoolAry1d m_ilExactSampleValueMatchFlag;
701  Int       m_allTilesIlcIdc;
702
703  Void      resizeDimI( Int sizeDimI )
704  {
705    m_ilctsId                    .resize( sizeDimI );
706    m_ilNumTileRectsInSetMinus1  .resize( sizeDimI );
707    m_ilTopLeftTileIndex         .resize( sizeDimI );
708    m_ilBottomRightTileIndex     .resize( sizeDimI );
709    m_ilcIdc                     .resize( sizeDimI );
710    m_ilExactSampleValueMatchFlag.resize( sizeDimI );
711  }
712
713  Void      resizeDimJ( Int i, Int sizeDimJ )
714  {
715    m_ilTopLeftTileIndex    [i].resize( sizeDimJ );
716    m_ilBottomRightTileIndex[i].resize( sizeDimJ );
717  }
718
719};
720
721#if NH_MV_TBD
722class SEIBspNesting : public SEI
723{
724public:
725  PayloadType payloadType( ) const { return BSP_NESTING; }
726  SEIBspNesting ( ) { };
727  ~SEIBspNesting( ) { };
728  SEI* getCopy( ) const { return new SEIBspNesting(*this); }; 
729
730  Void setupFromCfgFile( const Char*      cfgFile );
731  Void setupFromSlice  ( const TComSlice* slice   );
732  Bool checkCfg        ( const TComSlice* slice   );
733
734  Int       m_seiOlsIdx;
735  Int       m_seiPartitioningSchemeIdx;
736  Int       m_bspIdx;
737  Int       m_bspNestingZeroBit;
738  Int       m_numSeisInBspMinus1;
739};
740
741class SEIBspInitialArrivalTime : public SEI
742{
743public:
744  PayloadType payloadType( ) const { return BSP_INITIAL_ARRIVAL_TIME; }
745  SEIBspInitialArrivalTime ( ) { };
746  ~SEIBspInitialArrivalTime( ) { };
747  SEI* getCopy( ) const { return new SEIBspInitialArrivalTime(*this); }; 
748
749  Void setupFromCfgFile( const Char*      cfgFile );
750  Void setupFromSlice  ( const TComSlice* slice   );
751  Bool checkCfg        ( const TComSlice* slice   );
752
753  IntAry1d  m_nalInitialArrivalDelay;
754  IntAry1d  m_vclInitialArrivalDelay;
755};
756#endif
757
758class SEISubBitstreamProperty : public SEI
759{
760public:
761  PayloadType payloadType( ) const { return SUB_BITSTREAM_PROPERTY; }
762  SEISubBitstreamProperty ( ) { };
763  ~SEISubBitstreamProperty( ) { };
764  SEI* getCopy( ) const { return new SEISubBitstreamProperty(*this); }; 
765
766  Void setupFromCfgFile( const Char*      cfgFile );
767  Bool checkCfg        ( const TComSlice* slice   );
768  Void resizeArrays    ( ); 
769
770  Int       m_sbPropertyActiveVpsId;
771  Int       m_numAdditionalSubStreamsMinus1;
772  IntAry1d  m_subBitstreamMode;
773  IntAry1d  m_olsIdxToVps;
774  IntAry1d  m_highestSublayerId;
775  IntAry1d  m_avgSbPropertyBitRate;
776  IntAry1d  m_maxSbPropertyBitRate;
777};
778
779#if NH_MV_SEI_TBD
780class SEIAlphaChannelInfo : public SEI
781{
782public:
783  PayloadType payloadType( ) const { return ALPHA_CHANNEL_INFO; }
784  SEIAlphaChannelInfo ( ) { };
785  ~SEIAlphaChannelInfo( ) { };
786  SEI* getCopy( ) const { return new SEIAlphaChannelInfo(*this); }; 
787
788  Void setupFromCfgFile( const Char*      cfgFile );
789  Void setupFromSlice  ( const TComSlice* slice   );
790  Bool checkCfg        ( const TComSlice* slice   );
791
792  Bool      m_alphaChannelCancelFlag;
793  Int       m_alphaChannelUseIdc;
794  Int       m_alphaChannelBitDepthMinus8;
795  Int       m_alphaTransparentValue;
796  Int       m_alphaOpaqueValue;
797  Bool      m_alphaChannelIncrFlag;
798  Bool      m_alphaChannelClipFlag;
799  Bool      m_alphaChannelClipTypeFlag;
800};
801
802class SEIOverlayInfo : public SEI
803{
804public:
805  PayloadType payloadType( ) const { return OVERLAY_INFO; }
806  SEIOverlayInfo ( ) { };
807  ~SEIOverlayInfo( ) { };
808  SEI* getCopy( ) const { return new SEIOverlayInfo(*this); }; 
809
810  Void setupFromCfgFile( const Char*      cfgFile );
811  Void setupFromSlice  ( const TComSlice* slice   );
812  Bool checkCfg        ( const TComSlice* slice   );
813
814  Bool      m_overlayInfoCancelFlag;
815  Int       m_overlayContentAuxIdMinus128;
816  Int       m_overlayLabelAuxIdMinus128;
817  Int       m_overlayAlphaAuxIdMinus128;
818  Int       m_overlayElementLabelValueLengthMinus8;
819  Int       m_numOverlaysMinus1;
820  IntAry1d  m_overlayIdx;
821  BoolAry1d m_languageOverlayPresentFlag;
822  IntAry1d  m_overlayContentLayerId;
823  BoolAry1d m_overlayLabelPresentFlag;
824  IntAry1d  m_overlayLabelLayerId;
825  BoolAry1d m_overlayAlphaPresentFlag;
826  IntAry1d  m_overlayAlphaLayerId;
827  IntAry1d  m_numOverlayElementsMinus1;
828  IntAry2d  m_overlayElementLabelMin;
829  IntAry2d  m_overlayElementLabelMax;
830  Int       m_overlayZeroBit;
831  IntAry1d  m_overlayLanguage;
832  IntAry1d  m_overlayName;
833  IntAry2d  m_overlayElementName;
834  Bool      m_overlayInfoPersistenceFlag;
835};
836
837#endif
838
839class SEITemporalMvPredictionConstraints : public SEI
840{
841public:
842  PayloadType payloadType( ) const { return TEMPORAL_MV_PREDICTION_CONSTRAINTS; }
843  SEITemporalMvPredictionConstraints ( ) { };
844  ~SEITemporalMvPredictionConstraints( ) { };
845  SEI* getCopy( ) const { return new SEITemporalMvPredictionConstraints(*this); }; 
846
847  Void setupFromCfgFile( const Char*      cfgFile );
848  Bool checkCfg        ( const TComSlice* slice   );
849
850  Bool      m_prevPicsNotUsedFlag;
851  Bool      m_noIntraLayerColPicFlag;
852};
853
854#if NH_MV_SEI_TBD
855class SEIFrameFieldInfo : public SEI
856{
857public:
858  PayloadType payloadType( ) const { return FRAME_FIELD_INFO; }
859  SEIFrameFieldInfo ( ) { };
860  ~SEIFrameFieldInfo( ) { };
861  SEI* getCopy( ) const { return new SEIFrameFieldInfo(*this); }; 
862
863  Void setupFromCfgFile( const Char*      cfgFile );
864  Void setupFromSlice  ( const TComSlice* slice   );
865  Bool checkCfg        ( const TComSlice* slice   );
866
867  Int       m_ffinfoPicStruct;
868  Int       m_ffinfoSourceScanType;
869  Bool      m_ffinfoDuplicateFlag;
870};
871
872class SEIThreeDimensionalReferenceDisplaysInfo : public SEI
873{
874public:
875  PayloadType payloadType( ) const { return THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO; }
876  SEIThreeDimensionalReferenceDisplaysInfo ( ) { };
877  ~SEIThreeDimensionalReferenceDisplaysInfo( ) { };
878  SEI* getCopy( ) const { return new SEIThreeDimensionalReferenceDisplaysInfo(*this); }; 
879
880  Void setupFromCfgFile( const Char*      cfgFile );
881  Void setupFromSlice  ( const TComSlice* slice   );
882  Bool checkCfg        ( const TComSlice* slice   );
883
884  Int       m_precRefDisplayWidth;
885  Bool      m_refViewingDistanceFlag;
886  Int       m_precRefViewingDist;
887  Int       m_numRefDisplaysMinus1;
888  IntAry1d  m_leftViewId;
889  IntAry1d  m_rightViewId;
890  IntAry1d  m_exponentRefDisplayWidth;
891  IntAry1d  m_mantissaRefDisplayWidth;
892  IntAry1d  m_exponentRefViewingDistance;
893  IntAry1d  m_mantissaRefViewingDistance;
894  BoolAry1d m_additionalShiftPresentFlag;
895  IntAry1d  m_numSampleShiftPlus512;
896  Bool      m_threeDimensionalReferenceDisplaysExtensionFlag;
897};
898
899class SEIDepthRepresentationInfo : public SEI
900{
901public:
902  PayloadType payloadType( ) const { return DEPTH_REPRESENTATION_INFO; }
903  SEIDepthRepresentationInfo ( ) { };
904  ~SEIDepthRepresentationInfo( ) { };
905  SEI* getCopy( ) const { return new SEIDepthRepresentationInfo(*this); }; 
906
907  Void setupFromCfgFile( const Char*      cfgFile );
908  Void setupFromSlice  ( const TComSlice* slice   );
909  Bool checkCfg        ( const TComSlice* slice   );
910
911  Bool      m_zNearFlag;
912  Bool      m_zFarFlag;
913  Bool      m_dMinFlag;
914  Bool      m_dMaxFlag;
915  Int       m_depthRepresentationType;
916  Int       m_disparityRefViewId;
917  Int       m_depthNonlinearRepresentationNumMinus1;
918};
919
920class SEIDepthRepInfoElement : public SEI
921{
922public:
923  PayloadType payloadType( ) const { return DEPTH_REP_INFO_ELEMENT; }
924  SEIDepthRepInfoElement ( ) { };
925  ~SEIDepthRepInfoElement( ) { };
926  SEI* getCopy( ) const { return new SEIDepthRepInfoElement(*this); }; 
927
928  Void setupFromCfgFile( const Char*      cfgFile );
929  Void setupFromSlice  ( const TComSlice* slice   );
930  Bool checkCfg        ( const TComSlice* slice   );
931
932  Bool      m_daSignFlag;
933  Int       m_daExponent;
934  Int       m_daMantissaLenMinus1;
935  Int       m_daMantissa;
936};
937#endif
938
939class SEIMultiviewSceneInfo : public SEI
940{
941public:
942  PayloadType payloadType( ) const { return MULTIVIEW_SCENE_INFO; }
943  SEIMultiviewSceneInfo ( ) { };
944  ~SEIMultiviewSceneInfo( ) { };
945  SEI* getCopy( ) const { return new SEIMultiviewSceneInfo(*this); }; 
946
947  Void setupFromCfgFile( const Char*      cfgFile );
948  Bool checkCfg        ( const TComSlice* slice   );
949
950  Int       m_minDisparity;
951  Int       m_maxDisparityRange;
952};
953
954
955class SEIMultiviewAcquisitionInfo : public SEI
956{
957public:
958  PayloadType payloadType( ) const { return MULTIVIEW_ACQUISITION_INFO; }
959  SEIMultiviewAcquisitionInfo ( ) { };
960  ~SEIMultiviewAcquisitionInfo( ) { };
961  SEI* getCopy( ) const { return new SEIMultiviewAcquisitionInfo(*this); }; 
962
963  Void setupFromCfgFile( const Char*      cfgFile );
964  Bool checkCfg        ( const TComSlice* slice   );
965
966  Int getNumViewsMinus1( ) const
967  {
968    Int numViewsMinus1; 
969    if( m_scalNestSeiContThisSei != NULL )
970    {
971      numViewsMinus1 = m_scalNestSeiContThisSei->m_nestingNumLayersMinus1;
972    } 
973    else
974    {
975      numViewsMinus1 = 0; 
976    }
977    return numViewsMinus1; 
978  }
979 
980  Void resizeArrays( )
981  {
982    Int numViews = getNumViewsMinus1() + 1;     
983    m_signFocalLengthX       .resize( numViews );
984    m_exponentFocalLengthX   .resize( numViews );
985    m_mantissaFocalLengthX   .resize( numViews );
986    m_signFocalLengthY       .resize( numViews );
987    m_exponentFocalLengthY   .resize( numViews );
988    m_mantissaFocalLengthY   .resize( numViews );
989    m_signPrincipalPointX    .resize( numViews );
990    m_exponentPrincipalPointX.resize( numViews );
991    m_mantissaPrincipalPointX.resize( numViews );
992    m_signPrincipalPointY    .resize( numViews );
993    m_exponentPrincipalPointY.resize( numViews );
994    m_mantissaPrincipalPointY.resize( numViews );
995    m_signSkewFactor         .resize( numViews );
996    m_exponentSkewFactor     .resize( numViews );
997    m_mantissaSkewFactor     .resize( numViews );
998
999    m_signR                  .resize( numViews );   
1000    m_exponentR              .resize( numViews );
1001    m_mantissaR              .resize( numViews ); 
1002    m_signT                  .resize( numViews );
1003    m_exponentT              .resize( numViews );
1004    m_mantissaT              .resize( numViews );
1005
1006    for( Int i = 0; i  < numViews ; i++ )
1007    {
1008      m_signR    [i].resize( 3 );   
1009      m_exponentR[i].resize( 3 );
1010      m_mantissaR[i].resize( 3 ); 
1011      m_signT    [i].resize( 3 );
1012      m_exponentT[i].resize( 3 );
1013      m_mantissaT[i].resize( 3 );
1014
1015      for (Int j = 0; j < 3; j++)
1016      {
1017        m_signR    [i][j].resize( 3 );   
1018        m_exponentR[i][j].resize( 3 );
1019        m_mantissaR[i][j].resize( 3 ); 
1020      }
1021    }
1022  }
1023 
1024  UInt getMantissaFocalLengthXLen   ( Int i ) const ;
1025  UInt getMantissaFocalLengthYLen   ( Int i ) const ;
1026  UInt getMantissaPrincipalPointXLen( Int i ) const ;
1027  UInt getMantissaPrincipalPointYLen( Int i ) const ;
1028  UInt getMantissaSkewFactorLen     ( Int i ) const ;
1029  UInt getMantissaRLen              ( Int i, Int j, Int k ) const ;
1030  UInt getMantissaTLen              ( Int i, Int j )        const ;
1031
1032  Bool      m_intrinsicParamFlag;
1033  Bool      m_extrinsicParamFlag;
1034  Bool      m_intrinsicParamsEqualFlag;
1035  Int       m_precFocalLength;
1036  Int       m_precPrincipalPoint;
1037  Int       m_precSkewFactor;
1038  BoolAry1d m_signFocalLengthX;
1039  IntAry1d  m_exponentFocalLengthX;
1040  IntAry1d  m_mantissaFocalLengthX;
1041  BoolAry1d m_signFocalLengthY;
1042  IntAry1d  m_exponentFocalLengthY;
1043  IntAry1d  m_mantissaFocalLengthY;
1044  BoolAry1d m_signPrincipalPointX;
1045  IntAry1d  m_exponentPrincipalPointX;
1046  IntAry1d  m_mantissaPrincipalPointX;
1047  BoolAry1d m_signPrincipalPointY;
1048  IntAry1d  m_exponentPrincipalPointY;
1049  IntAry1d  m_mantissaPrincipalPointY;
1050  BoolAry1d m_signSkewFactor;
1051  IntAry1d  m_exponentSkewFactor;
1052  IntAry1d  m_mantissaSkewFactor;
1053  Int       m_precRotationParam;
1054  Int       m_precTranslationParam;
1055  BoolAry3d m_signR;
1056  IntAry3d  m_exponentR;
1057  IntAry3d  m_mantissaR;
1058  BoolAry2d m_signT;
1059  IntAry2d  m_exponentT;
1060  IntAry2d  m_mantissaT;
1061private: 
1062  UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const; 
1063};
1064
1065
1066
1067class SEIMultiviewViewPosition : public SEI
1068{
1069public:
1070  PayloadType payloadType( ) const { return MULTIVIEW_VIEW_POSITION; }
1071  SEIMultiviewViewPosition ( ) { };
1072  ~SEIMultiviewViewPosition( ) { };
1073  SEI* getCopy( ) const { return new SEIMultiviewViewPosition(*this); }; 
1074
1075  Void setupFromCfgFile( const Char*      cfgFile );
1076  Void setupFromSlice  ( const TComSlice* slice   );
1077  Bool checkCfg        ( const TComSlice* slice   );
1078 
1079  Int       m_numViewsMinus1;
1080  IntAry1d  m_viewPosition;
1081};
1082
1083#if NH_MV_SEI_TBD
1084class SEIAlternativeDepthInfo : public SEI
1085{
1086public:
1087  PayloadType payloadType( ) const { return ALTERNATIVE_DEPTH_INFO; }
1088  SEIAlternativeDepthInfo ( ) { };
1089  ~SEIAlternativeDepthInfo( ) { };
1090  SEI* getCopy( ) const { return new SEIAlternativeDepthInfo(*this); }; 
1091
1092  Void setupFromCfgFile( const Char*      cfgFile );
1093  Void setupFromSlice  ( const TComSlice* slice   );
1094  Bool checkCfg        ( const TComSlice* slice   );
1095
1096  Bool      m_alternativeDepthInfoCancelFlag;
1097  Int       m_depthType;
1098  Int       m_numConstituentViewsGvdMinus1;
1099  Bool      m_depthPresentGvdFlag;
1100  Bool      m_zGvdFlag;
1101  Bool      m_intrinsicParamGvdFlag;
1102  Bool      m_rotationGvdFlag;
1103  Bool      m_translationGvdFlag;
1104  BoolAry1d m_signGvdZNearFlag;
1105  IntAry1d  m_expGvdZNear;
1106  IntAry1d  m_manLenGvdZNearMinus1;
1107  IntAry1d  m_manGvdZNear;
1108  BoolAry1d m_signGvdZFarFlag;
1109  IntAry1d  m_expGvdZFar;
1110  IntAry1d  m_manLenGvdZFarMinus1;
1111  IntAry1d  m_manGvdZFar;
1112  Int       m_precGvdFocalLength;
1113  Int       m_precGvdPrincipalPoint;
1114  Int       m_precGvdRotationParam;
1115  Int       m_precGvdTranslationParam;
1116  BoolAry1d m_signGvdFocalLengthX;
1117  IntAry1d  m_expGvdFocalLengthX;
1118  IntAry1d  m_manGvdFocalLengthX;
1119  BoolAry1d m_signGvdFocalLengthY;
1120  IntAry1d  m_expGvdFocalLengthY;
1121  IntAry1d  m_manGvdFocalLengthY;
1122  BoolAry1d m_signGvdPrincipalPointX;
1123  IntAry1d  m_expGvdPrincipalPointX;
1124  IntAry1d  m_manGvdPrincipalPointX;
1125  BoolAry1d m_signGvdPrincipalPointY;
1126  IntAry1d  m_expGvdPrincipalPointY;
1127  IntAry1d  m_manGvdPrincipalPointY;
1128  BoolAry3d m_signGvdR;
1129  IntAry3d  m_expGvdR;
1130  IntAry3d  m_manGvdR;
1131  BoolAry1d m_signGvdTX;
1132  IntAry1d  m_expGvdTX;
1133  IntAry1d  m_manGvdTX;
1134  Int       m_minOffsetXInt;
1135  Int       m_minOffsetXFrac;
1136  Int       m_maxOffsetXInt;
1137  Int       m_maxOffsetXFrac;
1138  Bool      m_offsetYPresentFlag;
1139  Int       m_minOffsetYInt;
1140  Int       m_minOffsetYFrac;
1141  Int       m_maxOffsetYInt;
1142  Int       m_maxOffsetYFrac;
1143  Bool      m_warpMapSizePresentFlag;
1144  Int       m_warpMapWidthMinus2;
1145  Int       m_warpMapHeightMinus2;
1146};
1147#endif
1148
1149#endif
1150
1151#endif
1152//! \}
Note: See TracBrowser for help on using the repository browser.