source: 3DVCSoftware/branches/HTM-15.1-dev0-Vidyo/source/Lib/TLibCommon/SEI.cpp @ 1331

Last change on this file since 1331 was 1331, checked in by vidyo, 10 years ago

LAYERS_NOT_PRESENT SEI message changes by Vidyo, Inc.
All the changes are under the #define NH_MV_LAYERS_NOT_PRESENT_SEI
Extra information passed into parseSEI - vps as MaxNumLayers is required in order to know how many flags to read.
contact:
jpadia@…, danny@…

File size: 92.6 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/** \file     #SEI.cpp
35    \brief    helper functions for SEI handling
36*/
37
38#include "CommonDef.h"
39#include "SEI.h"
40#if NH_MV_SEI
41#include "TComSlice.h"
42#endif
43
44SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
45{
46  SEIMessages result;
47
48  for (SEIMessages::iterator it=seiList.begin(); it!=seiList.end(); it++)
49  {
50    if ((*it)->payloadType() == seiType)
51    {
52      result.push_back(*it);
53    }
54  }
55  return result;
56}
57
58SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
59{
60  SEIMessages result;
61
62  SEIMessages::iterator it=seiList.begin();
63  while ( it!=seiList.end() )
64  {
65    if ((*it)->payloadType() == seiType)
66    {
67      result.push_back(*it);
68      it = seiList.erase(it);
69    }
70    else
71    {
72      it++;
73    }
74  }
75  return result;
76}
77
78
79Void deleteSEIs (SEIMessages &seiList)
80{
81  for (SEIMessages::iterator it=seiList.begin(); it!=seiList.end(); it++)
82  {
83    delete (*it);
84  }
85  seiList.clear();
86}
87
88void SEIBufferingPeriod::copyTo (SEIBufferingPeriod& target)
89{
90  target.m_bpSeqParameterSetId = m_bpSeqParameterSetId;
91  target.m_rapCpbParamsPresentFlag = m_rapCpbParamsPresentFlag;
92  target.m_cpbDelayOffset = m_cpbDelayOffset;
93  target.m_dpbDelayOffset = m_dpbDelayOffset;
94  target.m_concatenationFlag = m_concatenationFlag;
95  target.m_auCpbRemovalDelayDelta = m_auCpbRemovalDelayDelta;
96  ::memcpy(target.m_initialCpbRemovalDelay, m_initialCpbRemovalDelay, sizeof(m_initialCpbRemovalDelay));
97  ::memcpy(target.m_initialCpbRemovalDelayOffset, m_initialCpbRemovalDelayOffset, sizeof(m_initialCpbRemovalDelayOffset));
98  ::memcpy(target.m_initialAltCpbRemovalDelay, m_initialAltCpbRemovalDelay, sizeof(m_initialAltCpbRemovalDelay));
99  ::memcpy(target.m_initialAltCpbRemovalDelayOffset, m_initialAltCpbRemovalDelayOffset, sizeof(m_initialAltCpbRemovalDelayOffset));
100}
101
102void SEIPictureTiming::copyTo (SEIPictureTiming& target)
103{
104  target.m_picStruct = m_picStruct;
105  target.m_sourceScanType = m_sourceScanType;
106  target.m_duplicateFlag = m_duplicateFlag;
107
108  target.m_auCpbRemovalDelay = m_auCpbRemovalDelay;
109  target.m_picDpbOutputDelay = m_picDpbOutputDelay;
110  target.m_picDpbOutputDuDelay = m_picDpbOutputDuDelay;
111  target.m_numDecodingUnitsMinus1 = m_numDecodingUnitsMinus1;
112  target.m_duCommonCpbRemovalDelayFlag = m_duCommonCpbRemovalDelayFlag;
113  target.m_duCommonCpbRemovalDelayMinus1 = m_duCommonCpbRemovalDelayMinus1;
114
115  target.m_numNalusInDuMinus1 = m_numNalusInDuMinus1;
116  target.m_duCpbRemovalDelayMinus1 = m_duCpbRemovalDelayMinus1;
117}
118
119// Static member
120const Char *SEI::getSEIMessageString(SEI::PayloadType payloadType)
121{
122  switch (payloadType)
123  {
124    case SEI::BUFFERING_PERIOD:                     return "Buffering period";
125    case SEI::PICTURE_TIMING:                       return "Picture timing";
126    case SEI::PAN_SCAN_RECT:                        return "Pan-scan rectangle";                   // not currently decoded
127    case SEI::FILLER_PAYLOAD:                       return "Filler payload";                       // not currently decoded
128    case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return "User data registered";                 // not currently decoded
129    case SEI::USER_DATA_UNREGISTERED:               return "User data unregistered";
130    case SEI::RECOVERY_POINT:                       return "Recovery point";
131    case SEI::SCENE_INFO:                           return "Scene information";                    // not currently decoded
132    case SEI::FULL_FRAME_SNAPSHOT:                  return "Picture snapshot";                     // not currently decoded
133    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return "Progressive refinement segment start"; // not currently decoded
134    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END:   return "Progressive refinement segment end";   // not currently decoded
135    case SEI::FILM_GRAIN_CHARACTERISTICS:           return "Film grain characteristics";           // not currently decoded
136    case SEI::POST_FILTER_HINT:                     return "Post filter hint";                     // not currently decoded
137    case SEI::TONE_MAPPING_INFO:                    return "Tone mapping information";
138    case SEI::KNEE_FUNCTION_INFO:                   return "Knee function information";
139    case SEI::FRAME_PACKING:                        return "Frame packing arrangement";
140    case SEI::DISPLAY_ORIENTATION:                  return "Display orientation";
141    case SEI::SOP_DESCRIPTION:                      return "Structure of pictures information";
142    case SEI::ACTIVE_PARAMETER_SETS:                return "Active parameter sets";
143    case SEI::DECODING_UNIT_INFO:                   return "Decoding unit information";
144    case SEI::TEMPORAL_LEVEL0_INDEX:                return "Temporal sub-layer zero index";
145    case SEI::DECODED_PICTURE_HASH:                 return "Decoded picture hash";
146    case SEI::SCALABLE_NESTING:                     return "Scalable nesting";
147    case SEI::REGION_REFRESH_INFO:                  return "Region refresh information";
148    case SEI::NO_DISPLAY:                           return "No display";
149    case SEI::TIME_CODE:                            return "Time code";
150    case SEI::MASTERING_DISPLAY_COLOUR_VOLUME:      return "Mastering display colour volume";
151    case SEI::SEGM_RECT_FRAME_PACKING:              return "Segmented rectangular frame packing arrangement";
152    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return "Temporal motion constrained tile sets";
153    case SEI::CHROMA_SAMPLING_FILTER_HINT:          return "Chroma sampling filter hint";
154#if NH_MV
155    case SEI::COLOUR_REMAPPING_INFO:                     return "Colour remapping information";
156    case SEI::DEINTERLACED_FIELD_IDENTIFICATION:         return "Deinterlaced field identification";
157    case SEI::LAYERS_NOT_PRESENT:                        return "Layers not present";
158    case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:         return "Inter-layer constrained tile sets";
159    case SEI::BSP_NESTING:                               return "Bitstream partition nesting";
160    case SEI::BSP_INITIAL_ARRIVAL_TIME:                  return "Bitstream partition initial arrival time";
161    case SEI::SUB_BITSTREAM_PROPERTY:                    return "Sub-bitstream property";
162    case SEI::ALPHA_CHANNEL_INFO:                        return "Alpha channel information";
163    case SEI::OVERLAY_INFO:                              return "Overlay information"  ;
164    case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:        return "Temporal motion vector prediction constraints";
165    case SEI::FRAME_FIELD_INFO:                          return "Frame-field information";
166    case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: return "3D reference displays information";
167    case SEI::DEPTH_REPRESENTATION_INFO:                 return "Depth representation information";
168    case SEI::MULTIVIEW_SCENE_INFO:                      return "Multiview scene information";
169    case SEI::MULTIVIEW_ACQUISITION_INFO:                return "Multiview acquisition information";
170    case SEI::MULTIVIEW_VIEW_POSITION:                   return "Multiview view position";
171#if NH_3D
172    case SEI::ALTERNATIVE_DEPTH_INFO:                    return "Alternative depth information";
173#endif
174#endif
175    default:                                        return "Unknown";
176  }
177}
178
179#if NH_MV_SEI
180SEI::SEI()
181{
182  m_scalNestSeiContThisSei = NULL;
183}
184
185SEI* SEI::getNewSEIMessage(SEI::PayloadType payloadType)
186{
187  switch (payloadType)
188  {
189#if NH_MV_SEI_TBD
190    //////////////////////////////////////////////////////////////////////////
191    // TBD: Modify version 1 SEIs to use the same interfaces as Annex GFI SEI messages.
192    //////////////////////////////////////////////////////////////////////////
193
194    case SEI::BUFFERING_PERIOD:                     return new SEIBufferingPeriod; 
195    case SEI::PICTURE_TIMING:                       return new SEIPictureTiming;
196    case SEI::PAN_SCAN_RECT:                        return new SEIPanScanRectangle;                    // not currently decoded
197    case SEI::FILLER_PAYLOAD:                       return new SEIFillerPaylod;                       // not currently decoded
198    case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return new SEIUserDataRegistered;                 // not currently decoded
199    case SEI::USER_DATA_UNREGISTERED:               return new SEIuserDataUnregistered; 
200    case SEI::RECOVERY_POINT:                       return new SEIRecoveryPoint;
201    case SEI::SCENE_INFO:                           return new SEISceneInformation;                    // not currently decoded
202    case SEI::FULL_FRAME_SNAPSHOT:                  return new SEIPictureSnapshot;                     // not currently decoded
203    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return new SEIProgressiveRefinementSegmentStart;   // not currently decoded
204    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END:   return new SEIProgressiveRefinementSegmentEnd;     // not currently decoded
205    case SEI::FILM_GRAIN_CHARACTERISTICS:           return new SEIFilmGrainCharacteristics;            // not currently decoded
206    case SEI::POST_FILTER_HINT:                     return new SEIPostFilterHint;                      // not currently decoded
207    case SEI::TONE_MAPPING_INFO:                    return new SEIToneMappingInfo;
208    case SEI::KNEE_FUNCTION_INFO:                   return new SEIKneeFunctionInfo;
209    case SEI::FRAME_PACKING:                        return new SEIFramePacking;
210    case SEI::DISPLAY_ORIENTATION:                  return new SEIDisplayOrientation;
211    case SEI::SOP_DESCRIPTION:                      return new SEISOPDescription;
212    case SEI::ACTIVE_PARAMETER_SETS:                return new SEIActiveParameterSets;
213    case SEI::DECODING_UNIT_INFO:                   return new SEIDecodingUnitInfo;
214    case SEI::TEMPORAL_LEVEL0_INDEX:                return new SEITemporalLevel0Index
215    case SEI::DECODED_PICTURE_HASH:                 return new SEIDecodedPictureHash;
216    case SEI::SCALABLE_NESTING:                     return new SEIScalableNesting;
217    case SEI::REGION_REFRESH_INFO:                  return new SEIRegionRefreshInfo; 
218    case SEI::NO_DISPLAY:                           return new SEINoDisplay;
219    case SEI::TIME_CODE:                            return new SEITimeCode;
220    case SEI::MASTERING_DISPLAY_COLOUR_VOLUME:      return new SEIMasteringDisplayColourVolume;
221    case SEI::SEGM_RECT_FRAME_PACKING:              return new SEISegmentedRectFramePacking;
222    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return new SEITempMotionConstrainedTileSets; 
223    case SEI::CHROMA_SAMPLING_FILTER_HINT:          return new SEIChromaSamplingFilterHint
224#endif
225#if NH_MV_SEI
226#if NH_MV_LAYERS_NOT_PRESENT_SEI
227  case SEI::LAYERS_NOT_PRESENT                    :               return new SEILayersNotPresent;
228#endif
229  case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS     :               return new SEIInterLayerConstrainedTileSets;
230#if NH_MV_SEI_TBD
231  case SEI::BSP_NESTING                           :               return new SEIBspNesting;
232  case SEI::BSP_INITIAL_ARRIVAL_TIME              :               return new SEIBspInitialArrivalTime;
233#endif
234  case SEI::SUB_BITSTREAM_PROPERTY                :               return new SEISubBitstreamProperty;
235#if NH_MV_SEI_TBD
236  case SEI::ALPHA_CHANNEL_INFO                    :               return new SEIAlphaChannelInfo;
237  case SEI::OVERLAY_INFO                          :               return new SEIOverlayInfo;
238#endif
239  case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS    :               return new SEITemporalMvPredictionConstraints;
240#if NH_MV_SEI_TBD
241  case SEI::FRAME_FIELD_INFO                      :               return new SEIFrameFieldInfo;
242  case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:            return new SEIThreeDimensionalReferenceDisplaysInfo;
243  case SEI::DEPTH_REPRESENTATION_INFO             :               return new SEIDepthRepresentationInfo; 
244#endif
245  case SEI::MULTIVIEW_SCENE_INFO                  :               return new SEIMultiviewSceneInfo;
246  case SEI::MULTIVIEW_ACQUISITION_INFO            :               return new SEIMultiviewAcquisitionInfo;
247  case SEI::MULTIVIEW_VIEW_POSITION               :               return new SEIMultiviewViewPosition;
248#if NH_MV_SEI_TBD
249#if NH_3D
250  case SEI::ALTERNATIVE_DEPTH_INFO                :               return new SEIAlternativeDepthInfo;
251#endif
252#endif
253#endif
254  default:                                        assert( false ); return NULL;
255  }
256}
257
258Void SEI::setupFromSlice  ( const TComSlice* slice )
259{
260  xPrintCfgErrorIntro();
261  std::cout << getSEIMessageString( payloadType() ) << "Setup by the encoder is currently not possible. Using the default SEI cfg-file." << std::endl;
262}
263
264SEI* SEI::getCopy() const
265{
266  assert( 0 ); 
267  return NULL;
268}
269
270Void SEI::setupFromCfgFile( const Char* cfgFile )
271{
272  assert( false );
273}
274
275Bool SEI::insertSei( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const
276{
277  Bool insertSeiHere = true;     
278  if( !m_applicableLayerIds.empty() )
279  {
280    insertSeiHere = insertSeiHere && ( std::find( m_applicableLayerIds.begin(), m_applicableLayerIds.end(), curLayerId) != m_applicableLayerIds.end() ) ;
281  }
282  if( !m_applicablePocs     .empty() )
283  {
284    insertSeiHere = insertSeiHere && ( std::find( m_applicablePocs    .begin(), m_applicablePocs    .end(), curPoc    ) != m_applicablePocs    .end() ) ;
285  }
286  if( !m_applicableTids     .empty() )
287  {
288    insertSeiHere = insertSeiHere && ( std::find( m_applicableTids    .begin(), m_applicableTids    .end(), curTid    ) != m_applicableTids    .end() ) ;
289  }
290  if( !m_applicableVclNaluTypes.empty() )
291  {
292    insertSeiHere = insertSeiHere && ( std::find( m_applicableVclNaluTypes.begin(), m_applicableVclNaluTypes.end(), curNaluType) != m_applicableVclNaluTypes.end() ) ;
293  }
294  return insertSeiHere;
295}
296
297Bool SEI::checkCfg( const TComSlice* slice )
298{
299  assert( false ); 
300  return true;
301}
302
303Void SEI::xPrintCfgErrorIntro()
304{
305  std::cout << "Error in configuration of " << getSEIMessageString( payloadType() ) << " SEI: ";
306}
307
308Void SEI::xCheckCfgRange( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName )
309{
310  if ( val < minVal || val > maxVal  )
311  {
312    xPrintCfgErrorIntro();
313    std::cout << "The value of " << seName << "shall be in the range of " << minVal << " to " << maxVal << ", inclusive." << std::endl;       
314    wrongConfig = true;       
315  }
316}
317
318Void SEI::xAddGeneralOpts(po::Options &opts, IntAry1d defAppLayerIds, IntAry1d deftApplicablePocs, 
319                                            IntAry1d defAppTids,     IntAry1d defAppVclNaluTypes, 
320                                            Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder)
321{
322  opts.addOptions()
323    ("PayloadType"            , m_payloadType            , -1                    , "Payload Type"                                                         )
324    ("ApplicableLayerIds"     , m_applicableLayerIds     , defAppLayerIds        , "LayerIds      of layers   to which the SEI is added. (all when empty)")
325    ("ApplicablePocs"         , m_applicablePocs         , deftApplicablePocs    , "POCs          of pictures to which the SEI is added. (all when empty)")
326    ("ApplicableTids"         , m_applicableTids         , defAppTids            , "TIds          of pictures to which the SEI is added. (all when empty)")
327    ("ApplicableVclNaluTypes" , m_applicableVclNaluTypes , defAppVclNaluTypes    , "NaluUnitTypes of picture  to which the SEI is added. (all when empty)")
328    ("SeiNaluId"              , m_seiNaluId              , defSeiNaluId          , "Identifies to which NAL unit  the SEI is added." )
329    ("PositionInSeiNalu"      , m_positionInSeiNalu      , defPositionInSeiNalu  , "Identifies the position within the NAL unit.")
330    ("ModifyByEncoder"        , m_modifyByEncoder        , defModifyByEncoder    , "0: Use payload as specified in cfg file   1: Modify SEI by encoder");
331}
332
333Void SEI::xCheckCfg( Bool& wrongConfig, Bool cond, const Char* errStr )
334{
335  if ( !cond  )
336  {
337    xPrintCfgErrorIntro();
338    std::cout << errStr << std::endl;       
339    wrongConfig = true;       
340  }
341}
342
343
344#if NH_MV_LAYERS_NOT_PRESENT_SEI
345Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile)
346{ 
347  // Set default values
348  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
349
350  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
351  // This SEI message doesn't need to be added by default to any Layer / POC / NAL Unit / T Layer. Not sure if empty is right.
352  defAppLayerIds     empty( );      //push_back( TBD );
353  defAppPocs         empty( );      //push_back( TBD );
354  defAppTids         empty( );      //push_back( TBD );
355  defAppVclNaluTypes.empty( );      //push_back( TBD );
356
357  Int      defSeiNaluId                  = 0; 
358  Int      defPositionInSeiNalu          = 0; 
359  Bool     defModifyByEncoder            = false;   //0: Use payload as specified in cfg file   1: Modify SEI by encoder
360
361  // Setup config file options
362  po::Options opts;     
363  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
364
365  opts.addOptions()
366    ("LnpSeiActiveVpsId"              , m_lnpSeiActiveVpsId                , 0                              , "LnpSeiActiveVpsId"                )   //Why?
367    ("LayerNotPresentFlag"            , m_layerNotPresentFlag              , BoolAry1d(1,0)                 , "LayerNotPresentFlag"              )
368    ;
369
370  po::setDefaults(opts);
371
372  // Parse the cfg file
373  po::ErrorReporter err;
374  po::parseConfigFile( opts, cfgFile, err );
375  m_lnpSeiMaxLayers = m_layerNotPresentFlag.size();
376};
377
378  Bool SEILayersNotPresent::checkCfg( const TComSlice* slice )
379  { 
380//  // Check config values
381//  Bool wrongConfig = false;
382//
383//  // TBD: Add constraints on presence of SEI here.
384//  xCheckCfg     ( wrongConfig, TBD , "TBD" );
385//  xCheckCfg     ( wrongConfig, TBD , "TBD" );
386//
387//  // TBD: Modify constraints according to the SEI semantics.
388//  xCheckCfgRange( wrongConfig, m_lnpSeiActiveVpsId              , MINVAL , MAXVAL, "lnp_sei_active_vps_id"            );
389//  xCheckCfgRange( wrongConfig, m_layerNotPresentFlag[i]         , MINVAL , MAXVAL, "layer_not_present_flag"           );
390//
391//  return wrongConfig;
392      return false;
393  };
394//
395//Void SEILayersNotPresent::setupFromSlice  ( const TComSlice* slice )
396//{
397//  sei.m_lnpSeiActiveVpsId =  TBD ;
398//  for( Int i = 0; i  <=  MaxLayersMinus1; i++ )
399//  {
400//    sei.m_layerNotPresentFlag[i] =  TBD ;
401//  }
402//};
403#endif
404
405
406Void SEIInterLayerConstrainedTileSets::setupFromCfgFile(const Char* cfgFile)
407{ 
408  // Set default values
409  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
410
411  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
412  defAppLayerIds    .empty( ); 
413  defAppPocs        .push_back( 0 ); 
414  defAppTids        .empty( ); 
415  defAppVclNaluTypes.empty( ); 
416
417  Int      defSeiNaluId                  = 0; 
418  Int      defPositionInSeiNalu          = 0; 
419  Bool     defModifyByEncoder            = false; 
420
421  // Setup config file options
422  po::Options opts;     
423  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
424
425  const Int maxNumTileInSet = 100; 
426
427  opts.addOptions()
428    ("IlAllTilesExactSampleValueMatchFlag", m_ilAllTilesExactSampleValueMatchFlag, false                    , "IlAllTilesExactSampleValueMatchFlag")
429    ("IlOneTilePerTileSetFlag"        , m_ilOneTilePerTileSetFlag          , false                          , "IlOneTilePerTileSetFlag"          )
430    ("IlNumSetsInMessageMinus1"       , m_ilNumSetsInMessageMinus1         , 0                              , "IlNumSetsInMessageMinus1"         )
431    ("SkippedTileSetPresentFlag"      , m_skippedTileSetPresentFlag        , false                          , "SkippedTileSetPresentFlag"        )
432    ("IlctsId"                        , m_ilctsId                          , IntAry1d (256,0)               , "IlctsId"                          )
433    ("IlNumTileRectsInSetMinus1"      , m_ilNumTileRectsInSetMinus1        , IntAry1d (256,0)               , "IlNumTileRectsInSetMinus1"        )
434    ("IlTopLeftTileIndex_%d"          , m_ilTopLeftTileIndex               , IntAry1d (maxNumTileInSet,0), 256, "IlTopLeftTileIndex"               )
435    ("IlBottomRightTileIndex_%d"      , m_ilBottomRightTileIndex           , IntAry1d (maxNumTileInSet,0), 256, "IlBottomRightTileIndex"           )
436    ("IlcIdc"                         , m_ilcIdc                           , IntAry1d (256,0)               , "IlcIdc"                           )
437    ("IlExactSampleValueMatchFlag"    , m_ilExactSampleValueMatchFlag      , BoolAry1d(256,0)               , "IlExactSampleValueMatchFlag"      )
438    ("AllTilesIlcIdc"                 , m_allTilesIlcIdc                   , 0                              , "AllTilesIlcIdc"                   )
439    ;
440
441  po::setDefaults(opts);
442
443  // Parse the cfg file
444  po::ErrorReporter err;
445  po::parseConfigFile( opts, cfgFile, err );
446};
447
448Bool SEIInterLayerConstrainedTileSets::checkCfg( const TComSlice* slice )
449{ 
450  // Check config values
451  Bool wrongConfig = false; 
452  const TComPPS* pps = slice->getPPS(); 
453
454  // Currently only the active PPS checked.
455  xCheckCfg     ( wrongConfig, pps->getTilesEnabledFlag() , "The inter-layer constrained tile sets SEI message shall not be present for the layer with nuh_layer_id equal to targetLayerId when tiles_enabled_flag is equal to 0 for any PPS that is active for the pictures of the CLVS of the layer with nuh_layer_id equal to targetLayerId." );
456   
457  if ( m_ilOneTilePerTileSetFlag )
458  {
459    xCheckCfg( wrongConfig, ( pps->getNumTileColumnsMinus1() + 1 ) *  ( pps->getNumTileRowsMinus1() + 1 ) <= 256, "It is a requirement of bitstream conformance that when il_one_tile_per_tile_set_flag is equal to 1, the value of ( num_tile_columns_minus1 + 1 ) * ( num_tile_rows_minus1 + 1 ) shall be less than or equal to 256."    );
460  }
461  Int numSignificantSets = m_ilNumSetsInMessageMinus1 - m_skippedTileSetPresentFlag + 1; 
462
463  for (Int i = 0 ; i < numSignificantSets; i++)
464  {
465    xCheckCfgRange( wrongConfig, m_ilctsId[i]                         , 0 , (1 << 30) - 1, "ilcts_id"                         );
466  } 
467 
468  return wrongConfig; 
469};
470#if NH_MV_SEI_TBD
471
472Void SEIBspNesting::setupFromSlice  ( const TComSlice* slice )
473{
474  sei.m_seiOlsIdx =  TBD ;
475  sei.m_seiPartitioningSchemeIdx =  TBD ;
476  sei.m_bspIdx =  TBD ;
477  while( !ByteaLigned(() ) );
478  {
479    sei.m_bspNestingZeroBit =  TBD ;
480  }
481  sei.m_numSeisInBspMinus1 =  TBD ;
482  for( Int i = 0; i  <=  NumSeisInBspMinus1( ); i++ )
483  {
484    SeiMessage(() );
485  }
486};
487
488Void SEIBspNesting::setupFromCfgFile(const Char* cfgFile)
489{ 
490  // Set default values
491  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
492
493  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
494  defAppLayerIds    .push_back( TBD );
495  defAppPocs        .push_back( TBD );
496  defAppTids        .push_back( TBD );
497  defAppVclNaluTypes.push_back( TBD );
498
499  Int      defSeiNaluId                  = 0; 
500  Int      defPositionInSeiNalu          = 0; 
501  Bool     defModifyByEncoder            = TBD; 
502
503  // Setup config file options
504  po::Options opts;     
505  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
506
507  opts.addOptions()
508    ("SeiOlsIdx"                      , m_seiOlsIdx                        , 0                              , "SeiOlsIdx"                        )
509    ("SeiPartitioningSchemeIdx"       , m_seiPartitioningSchemeIdx         , 0                              , "SeiPartitioningSchemeIdx"         )
510    ("BspIdx"                         , m_bspIdx                           , 0                              , "BspIdx"                           )
511    ("BspNestingZeroBit"              , m_bspNestingZeroBit                , 0                              , "BspNestingZeroBit"                )
512    ("NumSeisInBspMinus1"             , m_numSeisInBspMinus1               , 0                              , "NumSeisInBspMinus1"               )
513    ;
514
515  po::setDefaults(opts);
516
517  // Parse the cfg file
518  po::ErrorReporter err;
519  po::parseConfigFile( opts, cfgFile, err );
520};
521
522Bool SEIBspNesting::checkCfg( const TComSlice* slice )
523{ 
524  // Check config values
525  Bool wrongConfig = false; 
526
527  // TBD: Add constraints on presence of SEI here.
528  xCheckCfg     ( wrongConfig, TBD , "TBD" );
529  xCheckCfg     ( wrongConfig, TBD , "TBD" );
530
531  // TBD: Modify constraints according to the SEI semantics.   
532  xCheckCfgRange( wrongConfig, m_seiOlsIdx                      , MINVAL , MAXVAL, "sei_ols_idx"          );
533  xCheckCfgRange( wrongConfig, m_seiPartitioningSchemeIdx       , MINVAL , MAXVAL, "sei_partitioning_scheme_idx"       );
534  xCheckCfgRange( wrongConfig, m_bspIdx                         , MINVAL , MAXVAL, "bsp_idx"              );
535  xCheckCfgRange( wrongConfig, m_bspNestingZeroBit              , MINVAL , MAXVAL, "bsp_nesting_zero_bit ");
536  xCheckCfgRange( wrongConfig, m_numSeisInBspMinus1             , MINVAL , MAXVAL, "num_seis_in_bsp_minus1"           );
537
538  return wrongConfig; 
539
540};
541
542Void SEIBspInitialArrivalTime::setupFromSlice  ( const TComSlice* slice )
543{
544  psIdx = SeiPartitioningSchemeIdx();
545  if( nalInitialArrivalDelayPresent )
546  {
547    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
548    {
549      sei.m_nalInitialArrivalDelay[i] =  TBD ;
550    }
551  }
552  if( vclInitialArrivalDelayPresent )
553  {
554    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
555    {
556      sei.m_vclInitialArrivalDelay[i] =  TBD ;
557    }
558  }
559};
560
561Void SEIBspInitialArrivalTime::setupFromCfgFile(const Char* cfgFile)
562{ 
563  // Set default values
564  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
565
566  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
567  defAppLayerIds    .push_back( TBD );
568  defAppPocs        .push_back( TBD );
569  defAppTids        .push_back( TBD );
570  defAppVclNaluTypes.push_back( TBD );
571
572  Int      defSeiNaluId                  = 0; 
573  Int      defPositionInSeiNalu          = 0; 
574  Bool     defModifyByEncoder            = TBD; 
575
576  // Setup config file options
577  po::Options opts;     
578  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
579
580  opts.addOptions()
581    ("NalInitialArrivalDelay"         , m_nalInitialArrivalDelay           , IntAry1d (1,0)                 , "NalInitialArrivalDelay"           )
582    ("VclInitialArrivalDelay"         , m_vclInitialArrivalDelay           , IntAry1d (1,0)                 , "VclInitialArrivalDelay"           )
583    ;
584
585  po::setDefaults(opts);
586
587  // Parse the cfg file
588  po::ErrorReporter err;
589  po::parseConfigFile( opts, cfgFile, err );
590};
591
592Bool SEIBspInitialArrivalTime::checkCfg( const TComSlice* slice )
593{ 
594  // Check config values
595  Bool wrongConfig = false; 
596
597  // TBD: Add constraints on presence of SEI here.
598  xCheckCfg     ( wrongConfig, TBD , "TBD" );
599  xCheckCfg     ( wrongConfig, TBD , "TBD" );
600
601  // TBD: Modify constraints according to the SEI semantics.   
602  xCheckCfgRange( wrongConfig, m_nalInitialArrivalDelay[i]      , MINVAL , MAXVAL, "nal_initial_arrival_delay"        );
603  xCheckCfgRange( wrongConfig, m_vclInitialArrivalDelay[i]      , MINVAL , MAXVAL, "vcl_initial_arrival_delay"        );
604
605  return wrongConfig; 
606
607};
608#endif
609
610Void SEISubBitstreamProperty::setupFromCfgFile(const Char* cfgFile)
611{ 
612  // Set default values
613  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
614
615  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
616  defAppLayerIds    .push_back( 0 );
617  defAppPocs        .push_back( 0 );
618  defAppTids        .push_back( 0 );
619  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
620
621  Int      defSeiNaluId                  = 0; 
622  Int      defPositionInSeiNalu          = 0; 
623  Bool     defModifyByEncoder            = false; 
624
625  // Setup config file options
626  po::Options opts;     
627  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
628
629  opts.addOptions()
630    ("SbPropertyActiveVpsId"          , m_sbPropertyActiveVpsId            , 0                              , "SbPropertyActiveVpsId"            )
631    ("NumAdditionalSubStreamsMinus1"  , m_numAdditionalSubStreamsMinus1    , 0                              , "NumAdditionalSubStreamsMinus1"    )
632    ("SubBitstreamMode"               , m_subBitstreamMode                 , IntAry1d (1,0)                 , "SubBitstreamMode"                 )
633    ("OlsIdxToVps"                    , m_olsIdxToVps                      , IntAry1d (1,0)                 , "OlsIdxToVps"                      )
634    ("HighestSublayerId"              , m_highestSublayerId                , IntAry1d (1,0)                 , "HighestSublayerId"                )
635    ("AvgSbPropertyBitRate"           , m_avgSbPropertyBitRate             , IntAry1d (1,0)                 , "AvgSbPropertyBitRate"             )
636    ("MaxSbPropertyBitRate"           , m_maxSbPropertyBitRate             , IntAry1d (1,0)                 , "MaxSbPropertyBitRate"             )
637    ;
638
639  po::setDefaults(opts);
640
641  // Parse the cfg file
642  po::ErrorReporter err;
643  po::parseConfigFile( opts, cfgFile, err );
644};
645
646Bool SEISubBitstreamProperty::checkCfg( const TComSlice* slice )
647{ 
648  // Check config values
649  Bool wrongConfig = false;
650
651  // For the current encoder, the initial IRAP access unit has always POC zero.   
652  xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0), "When present, the sub-bitstream property SEI message shall be associated with an initial IRAP access unit and the information provided by the SEI messages applies to the bitstream corresponding to the CVS containing the associated initial IRAP access unit.");
653
654  Bool sizeNotCorrect = 
655    (    ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_subBitstreamMode    .size() )
656    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_olsIdxToVps         .size() )
657    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_highestSublayerId   .size() )
658    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_avgSbPropertyBitRate.size() )
659    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_maxSbPropertyBitRate.size() );
660
661  xCheckCfg( wrongConfig, !sizeNotCorrect, "Some parameters of some sub-bitstream not provided." );
662  xCheckCfg( wrongConfig, slice->getVPS()->getVPSId() == m_sbPropertyActiveVpsId, "The value of sb_property_active_vps_id shall be equal to the value of vps_video_parameter_set_id of the active VPS referred to by the VCL NAL units of the associated access unit." );
663
664  xCheckCfgRange( wrongConfig, m_numAdditionalSubStreamsMinus1  , 0 , (1 << 10) - 1 , "num_additional_sub_streams_minus1");
665 
666  if ( !sizeNotCorrect )
667  {
668    for (Int i = 0; i <= m_numAdditionalSubStreamsMinus1; i++ )
669    {
670      xCheckCfgRange( wrongConfig, m_subBitstreamMode[i]    , 0 , 1                                          , "sub_bitstream_mode" );
671      xCheckCfgRange( wrongConfig, m_olsIdxToVps[i]         , 0 , slice->getVPS()->getNumOutputLayerSets()-1 , "ols_idx_to_vps"     );
672    }
673  }
674  return wrongConfig; 
675};
676
677Void SEISubBitstreamProperty::resizeArrays( )
678{
679  m_subBitstreamMode    .resize( m_numAdditionalSubStreamsMinus1 + 1); 
680  m_olsIdxToVps         .resize( m_numAdditionalSubStreamsMinus1 + 1); 
681  m_highestSublayerId   .resize( m_numAdditionalSubStreamsMinus1 + 1); 
682  m_avgSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 
683  m_maxSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 
684}
685
686#if NH_MV_SEI_TBD
687
688Void SEIAlphaChannelInfo::setupFromSlice  ( const TComSlice* slice )
689{
690  sei.m_alphaChannelCancelFlag =  TBD ;
691  if( !sei.m_alphaChannelCancelFlag )
692  {
693    sei.m_alphaChannelUseIdc =  TBD ;
694    sei.m_alphaChannelBitDepthMinus8 =  TBD ;
695    sei.m_alphaTransparentValue =  TBD ;
696    sei.m_alphaOpaqueValue =  TBD ;
697    sei.m_alphaChannelIncrFlag =  TBD ;
698    sei.m_alphaChannelClipFlag =  TBD ;
699    if( sei.m_alphaChannelClipFlag )
700    {
701      sei.m_alphaChannelClipTypeFlag =  TBD ;
702    }
703  }
704};
705
706Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile)
707{ 
708  // Set default values
709  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
710
711  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
712  defAppLayerIds    .push_back( TBD );
713  defAppPocs        .push_back( TBD );
714  defAppTids        .push_back( TBD );
715  defAppVclNaluTypes.push_back( TBD );
716
717  Int      defSeiNaluId                  = 0; 
718  Int      defPositionInSeiNalu          = 0; 
719  Bool     defModifyByEncoder            = TBD; 
720
721  // Setup config file options
722  po::Options opts;     
723  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
724
725  opts.addOptions()
726    ("AlphaChannelCancelFlag"         , m_alphaChannelCancelFlag           , false                          , "AlphaChannelCancelFlag"           )
727    ("AlphaChannelUseIdc"             , m_alphaChannelUseIdc               , 0                              , "AlphaChannelUseIdc"               )
728    ("AlphaChannelBitDepthMinus8"     , m_alphaChannelBitDepthMinus8       , 0                              , "AlphaChannelBitDepthMinus8"       )
729    ("AlphaTransparentValue"          , m_alphaTransparentValue            , 0                              , "AlphaTransparentValue"            )
730    ("AlphaOpaqueValue"               , m_alphaOpaqueValue                 , 0                              , "AlphaOpaqueValue"                 )
731    ("AlphaChannelIncrFlag"           , m_alphaChannelIncrFlag             , false                          , "AlphaChannelIncrFlag"             )
732    ("AlphaChannelClipFlag"           , m_alphaChannelClipFlag             , false                          , "AlphaChannelClipFlag"             )
733    ("AlphaChannelClipTypeFlag"       , m_alphaChannelClipTypeFlag         , false                          , "AlphaChannelClipTypeFlag"         )
734    ;
735
736  po::setDefaults(opts);
737
738  // Parse the cfg file
739  po::ErrorReporter err;
740  po::parseConfigFile( opts, cfgFile, err );
741
742};
743
744Bool SEIAlphaChannelInfo::checkCfg( const TComSlice* slice )
745{ 
746  // Check config values
747  Bool wrongConfig = false; 
748
749  // TBD: Add constraints on presence of SEI here.
750  xCheckCfg     ( wrongConfig, TBD , "TBD" );
751  xCheckCfg     ( wrongConfig, TBD , "TBD" );
752
753  // TBD: Modify constraints according to the SEI semantics.   
754  xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag         , MINVAL , MAXVAL, "alpha_channel_cancel_flag"        );
755  xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc             , MINVAL , MAXVAL, "alpha_channel_use_idc");
756  xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8     , MINVAL , MAXVAL, "alpha_channel_bit_depth_minus8"   );
757  xCheckCfgRange( wrongConfig, m_alphaTransparentValue          , MINVAL , MAXVAL, "alpha_transparent_value"          );
758  xCheckCfgRange( wrongConfig, m_alphaOpaqueValue               , MINVAL , MAXVAL, "alpha_opaque_value"   );
759  xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag           , MINVAL , MAXVAL, "alpha_channel_incr_flag"          );
760  xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag           , MINVAL , MAXVAL, "alpha_channel_clip_flag"          );
761  xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag       , MINVAL , MAXVAL, "alpha_channel_clip_type_flag"     );
762
763  return wrongConfig; 
764
765};
766
767Void SEIOverlayInfo::setupFromSlice  ( const TComSlice* slice )
768{
769  sei.m_overlayInfoCancelFlag =  TBD ;
770  if( !sei.m_overlayInfoCancelFlag )
771  {
772    sei.m_overlayContentAuxIdMinus128 =  TBD ;
773    sei.m_overlayLabelAuxIdMinus128 =  TBD ;
774    sei.m_overlayAlphaAuxIdMinus128 =  TBD ;
775    sei.m_overlayElementLabelValueLengthMinus8 =  TBD ;
776    sei.m_numOverlaysMinus1 =  TBD ;
777    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
778    {
779      sei.m_overlayIdx[i] =  TBD ;
780      sei.m_languageOverlayPresentFlag[i] =  TBD ;
781      sei.m_overlayContentLayerId[i] =  TBD ;
782      sei.m_overlayLabelPresentFlag[i] =  TBD ;
783      if( sei.m_overlayLabelPresentFlag( i ) )
784      {
785        sei.m_overlayLabelLayerId[i] =  TBD ;
786      }
787      sei.m_overlayAlphaPresentFlag[i] =  TBD ;
788      if( sei.m_overlayAlphaPresentFlag( i ) )
789      {
790        sei.m_overlayAlphaLayerId[i] =  TBD ;
791      }
792      if( sei.m_overlayLabelPresentFlag( i ) )
793      {
794        sei.m_numOverlayElementsMinus1[i] =  TBD ;
795        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
796        {
797          sei.m_overlayElementLabelMin[i][j] =  TBD ;
798          sei.m_overlayElementLabelMax[i][j] =  TBD ;
799        }
800      }
801    }
802    while( !ByteaLigned(() ) );
803    {
804      sei.m_overlayZeroBit =  TBD ;
805    }
806    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
807    {
808      if( sei.m_languageOverlayPresentFlag( i ) )
809      {
810        sei.m_overlayLanguage[i] =  TBD ;
811      }
812      sei.m_overlayName[i] =  TBD ;
813      if( sei.m_overlayLabelPresentFlag( i ) )
814      {
815        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
816        {
817          sei.m_overlayElementName[i][j] =  TBD ;
818        }
819      }
820    }
821    sei.m_overlayInfoPersistenceFlag =  TBD ;
822  }
823};
824
825Void SEIOverlayInfo::setupFromCfgFile(const Char* cfgFile)
826{ 
827  // Set default values
828  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
829
830  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
831  defAppLayerIds    .push_back( TBD );
832  defAppPocs        .push_back( TBD );
833  defAppTids        .push_back( TBD );
834  defAppVclNaluTypes.push_back( TBD );
835
836  Int      defSeiNaluId                  = 0; 
837  Int      defPositionInSeiNalu          = 0; 
838  Bool     defModifyByEncoder            = TBD; 
839
840  // Setup config file options
841  po::Options opts;     
842  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
843
844  opts.addOptions()
845    ("OverlayInfoCancelFlag"          , m_overlayInfoCancelFlag            , false                          , "OverlayInfoCancelFlag"            )
846    ("OverlayContentAuxIdMinus128"    , m_overlayContentAuxIdMinus128      , 0                              , "OverlayContentAuxIdMinus128"      )
847    ("OverlayLabelAuxIdMinus128"      , m_overlayLabelAuxIdMinus128        , 0                              , "OverlayLabelAuxIdMinus128"        )
848    ("OverlayAlphaAuxIdMinus128"      , m_overlayAlphaAuxIdMinus128        , 0                              , "OverlayAlphaAuxIdMinus128"        )
849    ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0                              , "OverlayElementLabelValueLengthMinus8")
850    ("NumOverlaysMinus1"              , m_numOverlaysMinus1                , 0                              , "NumOverlaysMinus1"                )
851    ("OverlayIdx"                     , m_overlayIdx                       , IntAry1d (1,0)                 , "OverlayIdx"                       )
852    ("LanguageOverlayPresentFlag"     , m_languageOverlayPresentFlag       , BoolAry1d(1,0)                 , "LanguageOverlayPresentFlag"       )
853    ("OverlayContentLayerId"          , m_overlayContentLayerId            , IntAry1d (1,0)                 , "OverlayContentLayerId"            )
854    ("OverlayLabelPresentFlag"        , m_overlayLabelPresentFlag          , BoolAry1d(1,0)                 , "OverlayLabelPresentFlag"          )
855    ("OverlayLabelLayerId"            , m_overlayLabelLayerId              , IntAry1d (1,0)                 , "OverlayLabelLayerId"              )
856    ("OverlayAlphaPresentFlag"        , m_overlayAlphaPresentFlag          , BoolAry1d(1,0)                 , "OverlayAlphaPresentFlag"          )
857    ("OverlayAlphaLayerId"            , m_overlayAlphaLayerId              , IntAry1d (1,0)                 , "OverlayAlphaLayerId"              )
858    ("NumOverlayElementsMinus1"       , m_numOverlayElementsMinus1         , IntAry1d (1,0)                 , "NumOverlayElementsMinus1"         )
859    ("OverlayElementLabelMin_%d"      , m_overlayElementLabelMin           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMin"           )
860    ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMax"           )
861    ("OverlayZeroBit"                 , m_overlayZeroBit                   , 0                              , "OverlayZeroBit"                   )
862    ("OverlayLanguage"                , m_overlayLanguage                  , IntAry1d (1,0)                 , "OverlayLanguage"                  )
863    ("OverlayName"                    , m_overlayName                      , IntAry1d (1,0)                 , "OverlayName"                      )
864    ("OverlayElementName_%d"          , m_overlayElementName               , IntAry1d (1,0) ,ADDNUM         , "OverlayElementName"               )
865    ("OverlayInfoPersistenceFlag"     , m_overlayInfoPersistenceFlag       , false                          , "OverlayInfoPersistenceFlag"       )
866    ;
867
868  po::setDefaults(opts);
869
870  // Parse the cfg file
871  po::ErrorReporter err;
872  po::parseConfigFile( opts, cfgFile, err );
873};
874
875Bool SEIOverlayInfo::checkCfg( const TComSlice* slice )
876{ 
877  // Check config values
878  Bool wrongConfig = false; 
879
880  // TBD: Add constraints on presence of SEI here.
881  xCheckCfg     ( wrongConfig, TBD , "TBD" );
882  xCheckCfg     ( wrongConfig, TBD , "TBD" );
883
884  // TBD: Modify constraints according to the SEI semantics.   
885  xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag          , MINVAL , MAXVAL, "overlay_info_cancel_flag"         );
886  xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128    , MINVAL , MAXVAL, "overlay_content_aux_id_minus128"  );
887  xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128      , MINVAL , MAXVAL, "overlay_label_aux_id_minus128"    );
888  xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128      , MINVAL , MAXVAL, "overlay_alpha_aux_id_minus128"    );
889  xCheckCfgRange( wrongConfig, m_overlayElementLabelValueLengthMinus8, MINVAL , MAXVAL, "overlay_element_label_value_length_minus8");
890  xCheckCfgRange( wrongConfig, m_numOverlaysMinus1              , MINVAL , MAXVAL, "num_overlays_minus1"  );
891  xCheckCfgRange( wrongConfig, m_overlayIdx[i]                  , MINVAL , MAXVAL, "overlay_idx"          );
892  xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i]  , MINVAL , MAXVAL, "language_overlay_present_flag"    );
893  xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i]       , MINVAL , MAXVAL, "overlay_content_layer_id"         );
894  xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , MINVAL , MAXVAL, "overlay_label_present_flag"       );
895  xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i]         , MINVAL , MAXVAL, "overlay_label_layer_id"           );
896  xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i]     , MINVAL , MAXVAL, "overlay_alpha_present_flag"       );
897  xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , MINVAL , MAXVAL, "overlay_alpha_layer_id"           );
898  xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , MINVAL , MAXVAL, "num_overlay_elements_minus1"       );
899  xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j]   , MINVAL , MAXVAL, "overlay_element_label_min"        );
900  xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j]   , MINVAL , MAXVAL, "overlay_element_label_max"        );
901  xCheckCfgRange( wrongConfig, m_overlayZeroBit                 , MINVAL , MAXVAL, "overlay_zero_bit"                 );
902  xCheckCfgRange( wrongConfig, m_overlayLanguage[i]             , MINVAL , MAXVAL, "overlay_language"                 );
903  xCheckCfgRange( wrongConfig, m_overlayName[i]                 , MINVAL , MAXVAL, "overlay_name"                     );
904  xCheckCfgRange( wrongConfig, m_overlayElementName[i][j]       , MINVAL , MAXVAL, "overlay_element_name"             );
905  xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag     , MINVAL , MAXVAL, "overlay_info_persistence_flag"    );
906
907  return wrongConfig; 
908
909};
910#endif
911
912Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile)
913{ 
914  // Set default values
915  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
916
917  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
918  defAppLayerIds    .clear    (   ); 
919  defAppPocs        .push_back( 0 );
920  defAppTids        .push_back( 0 );
921  defAppVclNaluTypes.clear    (   );
922
923  Int      defSeiNaluId                  = 0; 
924  Int      defPositionInSeiNalu          = 0; 
925  Bool     defModifyByEncoder            = false; 
926
927  // Setup config file options
928  po::Options opts;     
929  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
930
931  opts.addOptions()
932    ("PrevPicsNotUsedFlag"   , m_prevPicsNotUsedFlag   , false, "PrevPicsNotUsedFlag"    )
933    ("NoIntraLayerColPicFlag", m_noIntraLayerColPicFlag, false, "NoIntraLayerColPicFlag" )
934    ;
935
936  po::setDefaults(opts);
937
938  // Parse the cfg file
939  po::ErrorReporter err;
940  po::parseConfigFile( opts, cfgFile, err );
941};
942
943Bool SEITemporalMvPredictionConstraints::checkCfg( const TComSlice* slice )
944{ 
945  // Check config values
946  Bool wrongConfig = false; 
947
948  xCheckCfg     ( wrongConfig, slice->getTemporalId() == 0 , "The temporal motion vector prediction constraints SEI message may be present in an access unit with TemporalId equal to 0 and shall not be present in an access unit with TemporalId greater than 0." );
949
950  return wrongConfig; 
951};
952
953#if NH_MV_SEI_TBD
954Void SEIFrameFieldInfo::setupFromCfgFile(const Char* cfgFile)
955{ 
956  // Set default values
957  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
958
959  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
960  defAppLayerIds    .push_back( TBD );
961  defAppPocs        .push_back( TBD );
962  defAppTids        .push_back( TBD );
963  defAppVclNaluTypes.push_back( TBD );
964
965  Int      defSeiNaluId                  = 0;
966  Int      defPositionInSeiNalu          = 0;
967  Bool     defModifyByEncoder            = false;
968
969  // Setup config file options
970  po::Options opts;     
971  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
972
973  opts.addOptions()
974    ("FfinfoPicStruct"     , m_ffinfoPicStruct     , 0     , "FfinfoPicStruct"     )
975    ("FfinfoSourceScanType", m_ffinfoSourceScanType, 0     , "FfinfoSourceScanType")
976    ("FfinfoDuplicateFlag" , m_ffinfoDuplicateFlag , false , "FfinfoDuplicateFlag" )
977    ;
978
979  po::setDefaults(opts);
980
981  // Parse the cfg file
982  po::ErrorReporter err;
983  po::parseConfigFile( opts, cfgFile, err );
984};
985
986
987Bool SEIFrameFieldInfo::checkCfg( const TComSlice* slice )
988{ 
989  // Check config values
990  Bool wrongConfig = false; 
991
992  // TBD: Add constraints on presence of SEI here.
993  xCheckCfg     ( wrongConfig, TBD , "TBD" );
994  xCheckCfg     ( wrongConfig, TBD , "TBD" );
995
996  // TBD: Modify constraints according to the SEI semantics.   
997  xCheckCfgRange( wrongConfig, m_ffinfoPicStruct                , MINVAL , MAXVAL, "ffinfo_pic_struct"                );
998  xCheckCfgRange( wrongConfig, m_ffinfoSourceScanType           , MINVAL , MAXVAL, "ffinfo_source_scan_type"          );
999  xCheckCfgRange( wrongConfig, m_ffinfoDuplicateFlag            , MINVAL , MAXVAL, "ffinfo_duplicate_flag"            );
1000
1001  return wrongConfig; 
1002
1003};
1004
1005Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromSlice  ( const TComSlice* slice )
1006{
1007  sei.m_precRefDisplayWidth =  TBD ;
1008  sei.m_refViewingDistanceFlag =  TBD ;
1009  if( sei.m_refViewingDistanceFlag )
1010  {
1011    sei.m_precRefViewingDist =  TBD ;
1012  }
1013  sei.m_numRefDisplaysMinus1 =  TBD ;
1014  for( Int i = 0; i  <=  NumRefDisplaysMinus1( ); i++ )
1015  {
1016    sei.m_leftViewId[i] =  TBD ;
1017    sei.m_rightViewId[i] =  TBD ;
1018    sei.m_exponentRefDisplayWidth[i] =  TBD ;
1019    sei.m_mantissaRefDisplayWidth[i] =  TBD ;
1020    if( sei.m_refViewingDistanceFlag )
1021    {
1022      sei.m_exponentRefViewingDistance[i] =  TBD ;
1023      sei.m_mantissaRefViewingDistance[i] =  TBD ;
1024    }
1025    sei.m_additionalShiftPresentFlag[i] =  TBD ;
1026    if( sei.m_additionalShiftPresentFlag( i ) )
1027    {
1028      sei.m_numSampleShiftPlus512[i] =  TBD ;
1029    }
1030  }
1031  sei.m_threeDimensionalReferenceDisplaysExtensionFlag =  TBD ;
1032};
1033
1034Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile)
1035{ 
1036  // Set default values
1037  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1038
1039  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1040  defAppLayerIds    .push_back( TBD );
1041  defAppPocs        .push_back( TBD );
1042  defAppTids        .push_back( TBD );
1043  defAppVclNaluTypes.push_back( TBD );
1044
1045  Int      defSeiNaluId                  = 0; 
1046  Int      defPositionInSeiNalu          = 0; 
1047  Bool     defModifyByEncoder            = TBD; 
1048
1049  // Setup config file options
1050  po::Options opts;     
1051  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1052
1053  opts.addOptions()
1054    ("PrecRefDisplayWidth"            , m_precRefDisplayWidth              , 0                              , "PrecRefDisplayWidth"              )
1055    ("RefViewingDistanceFlag"         , m_refViewingDistanceFlag           , false                          , "RefViewingDistanceFlag"           )
1056    ("PrecRefViewingDist"             , m_precRefViewingDist               , 0                              , "PrecRefViewingDist"               )
1057    ("NumRefDisplaysMinus1"           , m_numRefDisplaysMinus1             , 0                              , "NumRefDisplaysMinus1"             )
1058    ("LeftViewId"                     , m_leftViewId                       , IntAry1d (1,0)                 , "LeftViewId"                       )
1059    ("RightViewId"                    , m_rightViewId                      , IntAry1d (1,0)                 , "RightViewId"                      )
1060    ("ExponentRefDisplayWidth"        , m_exponentRefDisplayWidth          , IntAry1d (1,0)                 , "ExponentRefDisplayWidth"          )
1061    ("MantissaRefDisplayWidth"        , m_mantissaRefDisplayWidth          , IntAry1d (1,0)                 , "MantissaRefDisplayWidth"          )
1062    ("ExponentRefViewingDistance"     , m_exponentRefViewingDistance       , IntAry1d (1,0)                 , "ExponentRefViewingDistance"       )
1063    ("MantissaRefViewingDistance"     , m_mantissaRefViewingDistance       , IntAry1d (1,0)                 , "MantissaRefViewingDistance"       )
1064    ("AdditionalShiftPresentFlag"     , m_additionalShiftPresentFlag       , BoolAry1d(1,0)                 , "AdditionalShiftPresentFlag"       )
1065    ("NumSampleShiftPlus512"          , m_numSampleShiftPlus512            , IntAry1d (1,0)                 , "NumSampleShiftPlus512"            )
1066    ("ThreeDimensionalReferenceDisplaysExtensionFlag", m_threeDimensionalReferenceDisplaysExtensionFlag, false                          , "ThreeDimensionalReferenceDisplaysExtensionFlag")
1067    ;
1068
1069  po::setDefaults(opts);
1070
1071  // Parse the cfg file
1072  po::ErrorReporter err;
1073  po::parseConfigFile( opts, cfgFile, err );
1074};
1075
1076Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice )
1077{ 
1078  // Check config values
1079  Bool wrongConfig = false; 
1080
1081  // TBD: Add constraints on presence of SEI here.
1082  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1083  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1084
1085  // TBD: Modify constraints according to the SEI semantics.   
1086  xCheckCfgRange( wrongConfig, m_precRefDisplayWidth            , MINVAL , MAXVAL, "prec_ref_display_width"           );
1087  xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag         , MINVAL , MAXVAL, "ref_viewing_distance_flag"        );
1088  xCheckCfgRange( wrongConfig, m_precRefViewingDist             , MINVAL , MAXVAL, "prec_ref_viewing_dist"            );
1089  xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1           , MINVAL , MAXVAL, "num_ref_displays_minus1"          );
1090  xCheckCfgRange( wrongConfig, m_leftViewId[i]                  , MINVAL , MAXVAL, "left_view_id"                     );
1091  xCheckCfgRange( wrongConfig, m_rightViewId[i]                 , MINVAL , MAXVAL, "right_view_id"                    );
1092  xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i]     , MINVAL , MAXVAL, "exponent_ref_display_width"       );
1093  xCheckCfgRange( wrongConfig, m_mantissaRefDisplayWidth[i]     , MINVAL , MAXVAL, "mantissa_ref_display_width"       );
1094  xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i]  , MINVAL , MAXVAL, "exponent_ref_viewing_distance"    );
1095  xCheckCfgRange( wrongConfig, m_mantissaRefViewingDistance[i]  , MINVAL , MAXVAL, "mantissa_ref_viewing_distance"    );
1096  xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i]  , MINVAL , MAXVAL, "additional_shift_present_flag"    );
1097  xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i]       , MINVAL , MAXVAL, "num_sample_shift_plus512"         );
1098  xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, MINVAL , MAXVAL, "three_dimensional_reference_displays_extension_flag");
1099
1100  return wrongConfig; 
1101
1102};
1103
1104Void SEIDepthRepresentationInfo::setupFromSlice  ( const TComSlice* slice )
1105{
1106  sei.m_zNearFlag =  TBD ;
1107  sei.m_zFarFlag =  TBD ;
1108  sei.m_dMinFlag =  TBD ;
1109  sei.m_dMaxFlag =  TBD ;
1110  sei.m_depthRepresentationType =  TBD ;
1111  if( sei.m_dMinFlag  | |  sei.m_dMaxFlag )
1112  {
1113    sei.m_disparityRefViewId =  TBD ;
1114  }
1115  if( sei.m_zNearFlag )
1116  {
1117    DepthRepInfoElement(() ZNearSign, ZNearExp, ZNearMantissa, ZNearManLen );
1118  }
1119  if( sei.m_zFarFlag )
1120  {
1121    DepthRepInfoElement(() ZFarSign, ZFarExp, ZFarMantissa, ZFarManLen );
1122  }
1123  if( sei.m_dMinFlag )
1124  {
1125    DepthRepInfoElement(() DMinSign, DMinExp, DMinMantissa, DMinManLen );
1126  }
1127  if( sei.m_dMaxFlag )
1128  {
1129    DepthRepInfoElement(() DMaxSign, DMaxExp, DMaxMantissa, DMaxManLen );
1130  }
1131  if( sei.m_depthRepresentationType  = =  3 )
1132  {
1133    sei.m_depthNonlinearRepresentationNumMinus1 =  TBD ;
1134    for( Int i = 1; i  <=  sei.m_depthNonlinearRepresentationNumMinus1 + 1; i++ )
1135    {
1136      DepthNonlinearRepresentationModel( i );
1137    }
1138  }
1139};
1140
1141Void SEIDepthRepresentationInfo::setupFromCfgFile(const Char* cfgFile)
1142{ 
1143  // Set default values
1144  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1145
1146  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1147  defAppLayerIds    .push_back( TBD );
1148  defAppPocs        .push_back( TBD );
1149  defAppTids        .push_back( TBD );
1150  defAppVclNaluTypes.push_back( TBD );
1151
1152  Int      defSeiNaluId                  = 0; 
1153  Int      defPositionInSeiNalu          = 0; 
1154  Bool     defModifyByEncoder            = TBD; 
1155
1156  // Setup config file options
1157  po::Options opts;     
1158  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1159
1160  opts.addOptions()
1161    ("ZNearFlag"                      , m_zNearFlag                        , false                          , "ZNearFlag"                        )
1162    ("ZFarFlag"                       , m_zFarFlag                         , false                          , "ZFarFlag"                         )
1163    ("DMinFlag"                       , m_dMinFlag                         , false                          , "DMinFlag"                         )
1164    ("DMaxFlag"                       , m_dMaxFlag                         , false                          , "DMaxFlag"                         )
1165    ("DepthRepresentationType"        , m_depthRepresentationType          , 0                              , "DepthRepresentationType"          )
1166    ("DisparityRefViewId"             , m_disparityRefViewId               , 0                              , "DisparityRefViewId"               )
1167    ("DepthNonlinearRepresentationNumMinus1", m_depthNonlinearRepresentationNumMinus1, 0                              , "DepthNonlinearRepresentationNumMinus1")
1168    ;
1169
1170  po::setDefaults(opts);
1171
1172  // Parse the cfg file
1173  po::ErrorReporter err;
1174  po::parseConfigFile( opts, cfgFile, err );
1175};
1176
1177Bool SEIDepthRepresentationInfo::checkCfg( const TComSlice* slice )
1178{ 
1179  // Check config values
1180  Bool wrongConfig = false; 
1181
1182  // TBD: Add constraints on presence of SEI here.
1183  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1184  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1185
1186  // TBD: Modify constraints according to the SEI semantics.   
1187  xCheckCfgRange( wrongConfig, m_zNearFlag                      , MINVAL , MAXVAL, "z_near_flag"                      );
1188  xCheckCfgRange( wrongConfig, m_zFarFlag                       , MINVAL , MAXVAL, "z_far_flag"                       );
1189  xCheckCfgRange( wrongConfig, m_dMinFlag                       , MINVAL , MAXVAL, "d_min_flag"                       );
1190  xCheckCfgRange( wrongConfig, m_dMaxFlag                       , MINVAL , MAXVAL, "d_max_flag"                       );
1191  xCheckCfgRange( wrongConfig, m_depthRepresentationType        , MINVAL , MAXVAL, "depth_representation_type"        );
1192  xCheckCfgRange( wrongConfig, m_disparityRefViewId             , MINVAL , MAXVAL, "disparity_ref_view_id"            );
1193  xCheckCfgRange( wrongConfig, m_depthNonlinearRepresentationNumMinus1, MINVAL , MAXVAL, "depth_nonlinear_representation_num_minus1");
1194
1195  return wrongConfig; 
1196};
1197
1198Void SEIDepthRepInfoElement::setupFromSlice  ( const TComSlice* slice )
1199{
1200  sei.m_daSignFlag =  TBD ;
1201  sei.m_daExponent =  TBD ;
1202  sei.m_daMantissaLenMinus1 =  TBD ;
1203  sei.m_daMantissa =  TBD ;
1204};
1205
1206Void SEIDepthRepInfoElement::setupFromCfgFile(const Char* cfgFile)
1207{ 
1208  // Set default values
1209  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1210
1211  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1212  defAppLayerIds    .push_back( TBD );
1213  defAppPocs        .push_back( TBD );
1214  defAppTids        .push_back( TBD );
1215  defAppVclNaluTypes.push_back( TBD );
1216
1217  Int      defSeiNaluId                  = 0; 
1218  Int      defPositionInSeiNalu          = 0; 
1219  Bool     defModifyByEncoder            = TBD; 
1220
1221  // Setup config file options
1222  po::Options opts;     
1223  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1224
1225  opts.addOptions()
1226    ("DaSignFlag"                     , m_daSignFlag                       , false                          , "DaSignFlag"                       )
1227    ("DaExponent"                     , m_daExponent                       , 0                              , "DaExponent"                       )
1228    ("DaMantissaLenMinus1"            , m_daMantissaLenMinus1              , 0                              , "DaMantissaLenMinus1"              )
1229    ("DaMantissa"                     , m_daMantissa                       , 0                              , "DaMantissa"                       )
1230    ;
1231
1232  po::setDefaults(opts);
1233
1234  // Parse the cfg file
1235  po::ErrorReporter err;
1236  po::parseConfigFile( opts, cfgFile, err );
1237};
1238
1239Bool SEIDepthRepInfoElement::checkCfg( const TComSlice* slice )
1240{ 
1241  // Check config values
1242  Bool wrongConfig = false; 
1243
1244  // TBD: Add constraints on presence of SEI here.
1245  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1246  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1247
1248  // TBD: Modify constraints according to the SEI semantics.   
1249  xCheckCfgRange( wrongConfig, m_daSignFlag                     , MINVAL , MAXVAL, "da_sign_flag"                     );
1250  xCheckCfgRange( wrongConfig, m_daExponent                     , MINVAL , MAXVAL, "da_exponent"                      );
1251  xCheckCfgRange( wrongConfig, m_daMantissaLenMinus1            , MINVAL , MAXVAL, "da_mantissa_len_minus1"           );
1252  xCheckCfgRange( wrongConfig, m_daMantissa                     , MINVAL , MAXVAL, "da_mantissa"                      );
1253
1254  return wrongConfig; 
1255};
1256#endif
1257
1258Void SEIMultiviewSceneInfo::setupFromCfgFile(const Char* cfgFile)
1259{ 
1260  // Set default values
1261  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1262
1263  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1264  defAppLayerIds      .clear(); 
1265  defAppPocs          .clear(); 
1266  defAppTids          .push_back( 0 );
1267  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
1268
1269  Int      defSeiNaluId                  = 0; 
1270  Int      defPositionInSeiNalu          = 0; 
1271  Bool     defModifyByEncoder            = false; 
1272
1273  // Setup config file options
1274  po::Options opts;     
1275  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1276
1277  opts.addOptions()
1278    ("MinDisparity"                   , m_minDisparity                     , 0                              , "MinDisparity"                     )
1279    ("MaxDisparityRange"              , m_maxDisparityRange                , 0                              , "MaxDisparityRange"                )
1280    ;
1281
1282  po::setDefaults(opts);
1283
1284  // Parse the cfg file
1285  po::ErrorReporter err;
1286  po::parseConfigFile( opts, cfgFile, err ); 
1287};
1288
1289
1290Bool SEIMultiviewSceneInfo::checkCfg( const TComSlice* slice )
1291{ 
1292  // Check config values
1293  Bool wrongConfig = false; 
1294   
1295  xCheckCfg     ( wrongConfig, slice->isIRAP(), "When present, the multiview scene information SEI message shall be associated with an IRAP access unit." );
1296     
1297  xCheckCfgRange( wrongConfig, m_minDisparity              , -1024 , 1023, "min_disparity"                    );
1298  xCheckCfgRange( wrongConfig, m_maxDisparityRange         ,     0 , 2047, "max_disparity_range"              );
1299
1300  return wrongConfig; 
1301
1302};
1303
1304Void SEIMultiviewAcquisitionInfo::setupFromCfgFile(const Char* cfgFile)
1305{ 
1306  // Set default values
1307  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1308
1309  defAppLayerIds    .clear(); 
1310  defAppPocs        .push_back( 0 );
1311  defAppTids        .push_back( 0 );
1312  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
1313 
1314
1315  Int      defSeiNaluId                  = 0; 
1316  Int      defPositionInSeiNalu          = 0; 
1317  Bool     defModifyByEncoder            = false; 
1318
1319  // Setup config file options
1320  po::Options opts;     
1321  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1322
1323  opts.addOptions()
1324    ("IntrinsicParamFlag"               , m_intrinsicParamFlag               , false                              , "IntrinsicParamFlag"               )
1325    ("ExtrinsicParamFlag"               , m_extrinsicParamFlag               , false                              , "ExtrinsicParamFlag"               )
1326    ("IntrinsicParamsEqualFlag"         , m_intrinsicParamsEqualFlag         , false                              , "IntrinsicParamsEqualFlag"         )
1327    ("PrecFocalLength"                  , m_precFocalLength                  , 0                                  , "PrecFocalLength"                  )
1328    ("PrecPrincipalPoint"               , m_precPrincipalPoint               , 0                                  , "PrecPrincipalPoint"               )
1329    ("PrecSkewFactor"                   , m_precSkewFactor                   , 0                                  , "PrecSkewFactor"                   )
1330    ("SignFocalLengthX"                 , m_signFocalLengthX                 , BoolAry1d(1,0)                     , "SignFocalLengthX"                 )
1331    ("ExponentFocalLengthX"             , m_exponentFocalLengthX             , IntAry1d (1,0)                     , "ExponentFocalLengthX"             )
1332    ("MantissaFocalLengthX"             , m_mantissaFocalLengthX             , IntAry1d (1,0)                     , "MantissaFocalLengthX"             )
1333    ("SignFocalLengthY"                 , m_signFocalLengthY                 , BoolAry1d(1,0)                     , "SignFocalLengthY"                 )
1334    ("ExponentFocalLengthY"             , m_exponentFocalLengthY             , IntAry1d (1,0)                     , "ExponentFocalLengthY"             )
1335    ("MantissaFocalLengthY"             , m_mantissaFocalLengthY             , IntAry1d (1,0)                     , "MantissaFocalLengthY"             )
1336    ("SignPrincipalPointX"              , m_signPrincipalPointX              , BoolAry1d(1,0)                     , "SignPrincipalPointX"              )
1337    ("ExponentPrincipalPointX"          , m_exponentPrincipalPointX          , IntAry1d (1,0)                     , "ExponentPrincipalPointX"          )
1338    ("MantissaPrincipalPointX"          , m_mantissaPrincipalPointX          , IntAry1d (1,0)                     , "MantissaPrincipalPointX"          )
1339    ("SignPrincipalPointY"              , m_signPrincipalPointY              , BoolAry1d(1,0)                     , "SignPrincipalPointY"              )
1340    ("ExponentPrincipalPointY"          , m_exponentPrincipalPointY          , IntAry1d (1,0)                     , "ExponentPrincipalPointY"          )
1341    ("MantissaPrincipalPointY"          , m_mantissaPrincipalPointY          , IntAry1d (1,0)                     , "MantissaPrincipalPointY"          )
1342    ("SignSkewFactor"                   , m_signSkewFactor                   , BoolAry1d(1,0)                     , "SignSkewFactor"                   )
1343    ("ExponentSkewFactor"               , m_exponentSkewFactor               , IntAry1d (1,0)                     , "ExponentSkewFactor"               )
1344    ("MantissaSkewFactor"               , m_mantissaSkewFactor               , IntAry1d (1,0)                     , "MantissaSkewFactor"               )
1345    ("PrecRotationParam"                , m_precRotationParam                , 0                                  , "PrecRotationParam"                )
1346    ("PrecTranslationParam"             , m_precTranslationParam             , 0                                  , "PrecTranslationParam"             )
1347    ("SignR_%d_%d"                      , m_signR                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS ,3  , "SignR"                            )
1348    ("ExponentR_%d_%d"                  , m_exponentR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "ExponentR"                        )
1349    ("MantissaR_%d_%d"                  , m_mantissaR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "MantissaR"                        )
1350    ("SignT_%d"                         , m_signT                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS     , "SignT"                            )
1351    ("ExponentT_%d"                     , m_exponentT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "ExponentT"                        )
1352    ("MantissaT_%d"                     , m_mantissaT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "MantissaT"                        )
1353    ;
1354
1355  po::setDefaults(opts);
1356
1357  // Parse the cfg file
1358  po::ErrorReporter err;
1359  po::parseConfigFile( opts, cfgFile, err ); 
1360};
1361
1362UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthXLen( Int i ) const
1363{
1364  return xGetSyntaxElementLen( m_exponentFocalLengthX[i], m_precFocalLength, m_mantissaFocalLengthX[ i ] );
1365}
1366
1367Bool SEIMultiviewAcquisitionInfo::checkCfg( const TComSlice* slice )
1368{ 
1369  // Check config values
1370  Bool wrongConfig = false; 
1371
1372  // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes.   
1373  xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0)  , "When present, the multiview acquisition information SEI message that applies to the current layer shall be included in an access unit that contains an IRAP picture that is the first picture of a CLVS of the current layer." ); 
1374
1375  xCheckCfgRange( wrongConfig, m_precFocalLength         , 0, 31, "prec_focal_length"         );
1376  xCheckCfgRange( wrongConfig, m_precPrincipalPoint      , 0, 31, "prec_principle_point"      );
1377  xCheckCfgRange( wrongConfig, m_precSkewFactor          , 0, 31, "prec_skew_factor"          );
1378
1379  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
1380  { 
1381    xCheckCfgRange( wrongConfig, m_exponentFocalLengthX    [ i ], 0, 62, "exponent_focal_length_x"   );
1382    xCheckCfgRange( wrongConfig, m_exponentFocalLengthY    [ i ], 0, 62, "exponent_focal_length_y"   );
1383    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointX [ i ], 0, 62, "exponent_principal_point_x");
1384    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointY [ i ], 0, 62, "exponent_principal_point_y");
1385    xCheckCfgRange( wrongConfig, m_exponentSkewFactor      [ i ], 0, 62, "exponent_skew_factor"      );
1386  }
1387
1388  xCheckCfgRange( wrongConfig, m_precRotationParam       , 0, 31, "prec_focal_length"         );
1389  xCheckCfgRange( wrongConfig, m_precTranslationParam    , 0, 31, "prec_focal_length"         );
1390
1391  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
1392  { 
1393    for (Int j = 0; j <= 2; j++)
1394    {
1395      xCheckCfgRange( wrongConfig, m_exponentT[i][j]     , 0, 62, "exponent_skew_factor"      );
1396      for (Int k = 0; k <= 2; k++ )
1397      {       
1398        xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y");         
1399      }
1400    }
1401  } 
1402
1403  return wrongConfig; 
1404
1405};
1406
1407UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthYLen( Int i ) const
1408{
1409  return xGetSyntaxElementLen( m_exponentFocalLengthY[i], m_precFocalLength, m_mantissaFocalLengthY[ i ]  );
1410}
1411
1412
1413UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointXLen( Int i ) const
1414{
1415  return xGetSyntaxElementLen( m_exponentPrincipalPointX[i], m_precPrincipalPoint, m_mantissaPrincipalPointX[ i ]  );
1416}
1417
1418UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointYLen( Int i ) const
1419{
1420  return xGetSyntaxElementLen( m_exponentPrincipalPointY[i], m_precPrincipalPoint, m_mantissaPrincipalPointY[ i ] );
1421}
1422
1423UInt SEIMultiviewAcquisitionInfo::getMantissaSkewFactorLen( Int i ) const
1424{
1425  return xGetSyntaxElementLen( m_exponentSkewFactor[ i ], m_precSkewFactor, m_mantissaSkewFactor[ i ] );
1426}
1427
1428UInt SEIMultiviewAcquisitionInfo::getMantissaRLen( Int i, Int j, Int k ) const
1429{
1430  return xGetSyntaxElementLen( m_exponentR[ i ][ j ][ k ], m_precRotationParam, m_mantissaR[ i ][ j] [ k ] );
1431}
1432
1433UInt SEIMultiviewAcquisitionInfo::getMantissaTLen( Int i, Int j ) const
1434{
1435  return xGetSyntaxElementLen( m_exponentT[ i ][ j ], m_precTranslationParam, m_mantissaT[ i ][ j ] );
1436}
1437UInt SEIMultiviewAcquisitionInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
1438{
1439  UInt len; 
1440  if( expo == 0 )
1441  {
1442    len = std::max(0, prec - 30 );
1443  }
1444  else
1445  {
1446    len = std::max( 0, expo + prec - 31 );
1447  }
1448
1449  assert( val >= 0 ); 
1450  assert( val <= ( ( 1 << len )- 1) );
1451  return len; 
1452}
1453
1454Void SEIMultiviewViewPosition::setupFromSlice  ( const TComSlice* slice )
1455{
1456  const TComVPS* vps = slice->getVPS(); 
1457  m_numViewsMinus1 = vps->getNumViews() - 1; 
1458  m_viewPosition.resize( m_numViewsMinus1 + 1 ); 
1459  for (Int i = 0; i <= m_numViewsMinus1; i++ )
1460  {
1461    // Assuming that view ids indicate the position
1462    m_viewPosition[i] = vps->getViewIdVal( i );
1463  }
1464}
1465
1466Void SEIMultiviewViewPosition::setupFromCfgFile(const Char* cfgFile)
1467{ 
1468  // Set default values
1469  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1470
1471  defAppLayerIds    .push_back( 0 );
1472  defAppPocs        .push_back( 0 );
1473  defAppTids        .push_back( 0 );
1474  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 
1475
1476  Int      defSeiNaluId                  = 0; 
1477  Int      defPositionInSeiNalu          = 0; 
1478  Bool     defModifyByEncoder            = true; 
1479
1480  // Setup config file options
1481  po::Options opts;     
1482  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1483
1484  opts.addOptions()
1485    ("NumViewsMinus1"         , m_numViewsMinus1                          , 0                       , "NumViewsMinus1")
1486    ("ViewPosition"           , m_viewPosition                            , IntAry1d (1,0)          , "ViewPosition"  ); 
1487  ;
1488
1489  po::setDefaults(opts);
1490
1491  // Parse the cfg file
1492  po::ErrorReporter err;
1493  po::parseConfigFile( opts, cfgFile, err );
1494};
1495
1496Bool SEIMultiviewViewPosition::checkCfg( const TComSlice* slice )
1497{ 
1498  // Check config values
1499  Bool wrongConfig = false; 
1500
1501  // TBD: Add constraints on presence of SEI here.
1502  xCheckCfg     ( wrongConfig, slice->isIRAP() , "When present, the multiview view position SEI message shall be associated with an IRAP access unit."  );
1503
1504  // TBD: Modify constraints according to the SEI semantics.
1505  xCheckCfgRange( wrongConfig, m_numViewsMinus1                 , 0 , 62, "num_views_minus1");
1506  for(Int i = 0; i <= m_numViewsMinus1; i++)
1507  {
1508    xCheckCfgRange( wrongConfig, m_viewPosition[i]                , 0 , 62, "view_position");
1509  }
1510
1511  return wrongConfig; 
1512
1513};
1514
1515#if NH_MV_SEI_TBD
1516Void SEIAlternativeDepthInfo::setupFromSlice  ( const TComSlice* slice )
1517{
1518  sei.m_alternativeDepthInfoCancelFlag =  TBD ;
1519  if( sei.m_alternativeDepthInfoCancelFlag  = =  0 )
1520  {
1521    sei.m_depthType =  TBD ;
1522    if( sei.m_depthType  = =  0 )
1523    {
1524      sei.m_numConstituentViewsGvdMinus1 =  TBD ;
1525      sei.m_depthPresentGvdFlag =  TBD ;
1526      sei.m_zGvdFlag =  TBD ;
1527      sei.m_intrinsicParamGvdFlag =  TBD ;
1528      sei.m_rotationGvdFlag =  TBD ;
1529      sei.m_translationGvdFlag =  TBD ;
1530      if( sei.m_zGvdFlag )
1531      {
1532        for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
1533        {
1534          sei.m_signGvdZNearFlag[i] =  TBD ;
1535          sei.m_expGvdZNear[i] =  TBD ;
1536          sei.m_manLenGvdZNearMinus1[i] =  TBD ;
1537          sei.m_manGvdZNear[i] =  TBD ;
1538          sei.m_signGvdZFarFlag[i] =  TBD ;
1539          sei.m_expGvdZFar[i] =  TBD ;
1540          sei.m_manLenGvdZFarMinus1[i] =  TBD ;
1541          sei.m_manGvdZFar[i] =  TBD ;
1542        }
1543      }
1544      if( sei.m_intrinsicParamGvdFlag )
1545      {
1546        sei.m_precGvdFocalLength =  TBD ;
1547        sei.m_precGvdPrincipalPoint =  TBD ;
1548      }
1549      if( sei.m_rotationGvdFlag )
1550      {
1551        sei.m_precGvdRotationParam =  TBD ;
1552      }
1553      if( sei.m_translationGvdFlag )
1554      {
1555        sei.m_precGvdTranslationParam =  TBD ;
1556      }
1557      for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
1558      {
1559        if( sei.m_intrinsicParamGvdFlag )
1560        {
1561          sei.m_signGvdFocalLengthX[i] =  TBD ;
1562          sei.m_expGvdFocalLengthX[i] =  TBD ;
1563          sei.m_manGvdFocalLengthX[i] =  TBD ;
1564          sei.m_signGvdFocalLengthY[i] =  TBD ;
1565          sei.m_expGvdFocalLengthY[i] =  TBD ;
1566          sei.m_manGvdFocalLengthY[i] =  TBD ;
1567          sei.m_signGvdPrincipalPointX[i] =  TBD ;
1568          sei.m_expGvdPrincipalPointX[i] =  TBD ;
1569          sei.m_manGvdPrincipalPointX[i] =  TBD ;
1570          sei.m_signGvdPrincipalPointY[i] =  TBD ;
1571          sei.m_expGvdPrincipalPointY[i] =  TBD ;
1572          sei.m_manGvdPrincipalPointY[i] =  TBD ;
1573        }
1574        if( sei.m_rotationGvdFlag )
1575        {
1576          for( Int j = 10; j  <=  3; j++ ) /* row */
1577          {
1578            for( Int k = 10; k  <=  3; k++ )  /* column */
1579            {
1580              sei.m_signGvdR[i][j][k] =  TBD ;
1581              sei.m_expGvdR[i][j][k] =  TBD ;
1582              sei.m_manGvdR[i][j][k] =  TBD ;
1583            }
1584          }
1585        }
1586        if( sei.m_translationGvdFlag )
1587        {
1588          sei.m_signGvdTX[i] =  TBD ;
1589          sei.m_expGvdTX[i] =  TBD ;
1590          sei.m_manGvdTX[i] =  TBD ;
1591        }
1592      }
1593    }
1594    if( sei.m_depthType  = =  1 )
1595    {
1596      sei.m_minOffsetXInt =  TBD ;
1597      sei.m_minOffsetXFrac =  TBD ;
1598      sei.m_maxOffsetXInt =  TBD ;
1599      sei.m_maxOffsetXFrac =  TBD ;
1600      sei.m_offsetYPresentFlag =  TBD ;
1601      if( sei.m_offsetYPresentFlag )
1602      {
1603        sei.m_minOffsetYInt =  TBD ;
1604        sei.m_minOffsetYFrac =  TBD ;
1605        sei.m_maxOffsetYInt =  TBD ;
1606        sei.m_maxOffsetYFrac =  TBD ;
1607      }
1608      sei.m_warpMapSizePresentFlag =  TBD ;
1609      if( sei.m_warpMapSizePresentFlag )
1610      {
1611        sei.m_warpMapWidthMinus2 =  TBD ;
1612        sei.m_warpMapHeightMinus2 =  TBD ;
1613      }
1614    }
1615  }
1616};
1617Void SEIAlternativeDepthInfo::setupFromCfgFile(const Char* cfgFile)
1618{ 
1619  // Set default values
1620  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1621
1622  defAppLayerIds    .push_back( TBD );
1623  defAppPocs        .push_back( TBD );
1624  defAppTids        .push_back( TBD );
1625  defAppVclNaluTypes.push_back( TBD );
1626
1627  Int      defSeiNaluId                  = 0; 
1628  Int      defPositionInSeiNalu          = 0; 
1629  Bool     defModifyByEncoder            = TBD; 
1630
1631  // Setup config file options
1632  po::Options opts;     
1633  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1634
1635  opts.addOptions()
1636    ("AlternativeDepthInfoCancelFlag"   , m_alternativeDepthInfoCancelFlag   , false                            , "AlternativeDepthInfoCancelFlag"   )
1637    ("DepthType"                        , m_depthType                        , 0                                , "DepthType"                        )
1638    ("NumConstituentViewsGvdMinus1"     , m_numConstituentViewsGvdMinus1     , 0                                , "NumConstituentViewsGvdMinus1"     )
1639    ("DepthPresentGvdFlag"              , m_depthPresentGvdFlag              , false                            , "DepthPresentGvdFlag"              )
1640    ("ZGvdFlag"                         , m_zGvdFlag                         , false                            , "ZGvdFlag"                         )
1641    ("IntrinsicParamGvdFlag"            , m_intrinsicParamGvdFlag            , false                            , "IntrinsicParamGvdFlag"            )
1642    ("RotationGvdFlag"                  , m_rotationGvdFlag                  , false                            , "RotationGvdFlag"                  )
1643    ("TranslationGvdFlag"               , m_translationGvdFlag               , false                            , "TranslationGvdFlag"               )
1644    ("SignGvdZNearFlag"                 , m_signGvdZNearFlag                 , BoolAry1d(1,0)                   , "SignGvdZNearFlag"                 )
1645    ("ExpGvdZNear"                      , m_expGvdZNear                      , IntAry1d (1,0)                   , "ExpGvdZNear"                      )
1646    ("ManLenGvdZNearMinus1"             , m_manLenGvdZNearMinus1             , IntAry1d (1,0)                   , "ManLenGvdZNearMinus1"             )
1647    ("ManGvdZNear"                      , m_manGvdZNear                      , IntAry1d (1,0)                   , "ManGvdZNear"                      )
1648    ("SignGvdZFarFlag"                  , m_signGvdZFarFlag                  , BoolAry1d(1,0)                   , "SignGvdZFarFlag"                  )
1649    ("ExpGvdZFar"                       , m_expGvdZFar                       , IntAry1d (1,0)                   , "ExpGvdZFar"                       )
1650    ("ManLenGvdZFarMinus1"              , m_manLenGvdZFarMinus1              , IntAry1d (1,0)                   , "ManLenGvdZFarMinus1"              )
1651    ("ManGvdZFar"                       , m_manGvdZFar                       , IntAry1d (1,0)                   , "ManGvdZFar"                       )
1652    ("PrecGvdFocalLength"               , m_precGvdFocalLength               , 0                                , "PrecGvdFocalLength"               )
1653    ("PrecGvdPrincipalPoint"            , m_precGvdPrincipalPoint            , 0                                , "PrecGvdPrincipalPoint"            )
1654    ("PrecGvdRotationParam"             , m_precGvdRotationParam             , 0                                , "PrecGvdRotationParam"             )
1655    ("PrecGvdTranslationParam"          , m_precGvdTranslationParam          , 0                                , "PrecGvdTranslationParam"          )
1656    ("SignGvdFocalLengthX"              , m_signGvdFocalLengthX              , BoolAry1d(1,0)                   , "SignGvdFocalLengthX"              )
1657    ("ExpGvdFocalLengthX"               , m_expGvdFocalLengthX               , IntAry1d (1,0)                   , "ExpGvdFocalLengthX"               )
1658    ("ManGvdFocalLengthX"               , m_manGvdFocalLengthX               , IntAry1d (1,0)                   , "ManGvdFocalLengthX"               )
1659    ("SignGvdFocalLengthY"              , m_signGvdFocalLengthY              , BoolAry1d(1,0)                   , "SignGvdFocalLengthY"              )
1660    ("ExpGvdFocalLengthY"               , m_expGvdFocalLengthY               , IntAry1d (1,0)                   , "ExpGvdFocalLengthY"               )
1661    ("ManGvdFocalLengthY"               , m_manGvdFocalLengthY               , IntAry1d (1,0)                   , "ManGvdFocalLengthY"               )
1662    ("SignGvdPrincipalPointX"           , m_signGvdPrincipalPointX           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointX"           )
1663    ("ExpGvdPrincipalPointX"            , m_expGvdPrincipalPointX            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointX"            )
1664    ("ManGvdPrincipalPointX"            , m_manGvdPrincipalPointX            , IntAry1d (1,0)                   , "ManGvdPrincipalPointX"            )
1665    ("SignGvdPrincipalPointY"           , m_signGvdPrincipalPointY           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointY"           )
1666    ("ExpGvdPrincipalPointY"            , m_expGvdPrincipalPointY            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointY"            )
1667    ("ManGvdPrincipalPointY"            , m_manGvdPrincipalPointY            , IntAry1d (1,0)                   , "ManGvdPrincipalPointY"            )
1668    ("SignGvdR"                         , m_signGvdR                         , BoolAry1d(1,0)   ,ADDNUM ,ADDNUM , "SignGvdR"                         )
1669    ("ExpGvdR"                          , m_expGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ExpGvdR"                          )
1670    ("ManGvdR"                          , m_manGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ManGvdR"                          )
1671    ("SignGvdTX"                        , m_signGvdTX                        , BoolAry1d(1,0)                   , "SignGvdTX"                        )
1672    ("ExpGvdTX"                         , m_expGvdTX                         , IntAry1d (1,0)                   , "ExpGvdTX"                         )
1673    ("ManGvdTX"                         , m_manGvdTX                         , IntAry1d (1,0)                   , "ManGvdTX"                         )
1674    ("MinOffsetXInt"                    , m_minOffsetXInt                    , 0                                , "MinOffsetXInt"                    )
1675    ("MinOffsetXFrac"                   , m_minOffsetXFrac                   , 0                                , "MinOffsetXFrac"                   )
1676    ("MaxOffsetXInt"                    , m_maxOffsetXInt                    , 0                                , "MaxOffsetXInt"                    )
1677    ("MaxOffsetXFrac"                   , m_maxOffsetXFrac                   , 0                                , "MaxOffsetXFrac"                   )
1678    ("OffsetYPresentFlag"               , m_offsetYPresentFlag               , false                            , "OffsetYPresentFlag"               )
1679    ("MinOffsetYInt"                    , m_minOffsetYInt                    , 0                                , "MinOffsetYInt"                    )
1680    ("MinOffsetYFrac"                   , m_minOffsetYFrac                   , 0                                , "MinOffsetYFrac"                   )
1681    ("MaxOffsetYInt"                    , m_maxOffsetYInt                    , 0                                , "MaxOffsetYInt"                    )
1682    ("MaxOffsetYFrac"                   , m_maxOffsetYFrac                   , 0                                , "MaxOffsetYFrac"                   )
1683    ("WarpMapSizePresentFlag"           , m_warpMapSizePresentFlag           , false                            , "WarpMapSizePresentFlag"           )
1684    ("WarpMapWidthMinus2"               , m_warpMapWidthMinus2               , 0                                , "WarpMapWidthMinus2"               )
1685    ("WarpMapHeightMinus2"              , m_warpMapHeightMinus2              , 0                                , "WarpMapHeightMinus2"              )
1686    ;
1687
1688  po::setDefaults(opts);
1689
1690  // Parse the cfg file
1691  po::ErrorReporter err;
1692  po::parseConfigFile( opts, cfgFile, err );
1693};
1694
1695Bool SEIAlternativeDepthInfo::checkCfg( const TComSlice* slice )
1696{ 
1697  // Check config values
1698  Bool wrongConfig = false; 
1699
1700  // TBD: Add constraints on presence of SEI here.
1701  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1702  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1703
1704  // TBD: Modify constraints according to the SEI semantics.   
1705  xCheckCfgRange( wrongConfig, m_alternativeDepthInfoCancelFlag , MINVAL , MAXVAL, "alternative_depth_info_cancel_flag");
1706  xCheckCfgRange( wrongConfig, m_depthType                      , MINVAL , MAXVAL, "depth_type"                       );
1707  xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1   , MINVAL , MAXVAL, "num_constituent_views_gvd_minus1 ");
1708  xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag            , MINVAL , MAXVAL, "depth_present_gvd_flag"           );
1709  xCheckCfgRange( wrongConfig, m_zGvdFlag                       , MINVAL , MAXVAL, "z_gvd_flag"                       );
1710  xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag          , MINVAL , MAXVAL, "intrinsic_param_gvd_flag"         );
1711  xCheckCfgRange( wrongConfig, m_rotationGvdFlag                , MINVAL , MAXVAL, "rotation_gvd_flag"                );
1712  xCheckCfgRange( wrongConfig, m_translationGvdFlag             , MINVAL , MAXVAL, "translation_gvd_flag"             );
1713  xCheckCfgRange( wrongConfig, m_signGvdZNearFlag[i]            , MINVAL , MAXVAL, "sign_gvd_z_near_flag"             );
1714  xCheckCfgRange( wrongConfig, m_expGvdZNear[i]                 , MINVAL , MAXVAL, "exp_gvd_z_near"                   );
1715  xCheckCfgRange( wrongConfig, m_manLenGvdZNearMinus1[i]        , MINVAL , MAXVAL, "man_len_gvd_z_near_minus1"        );
1716  xCheckCfgRange( wrongConfig, m_manGvdZNear[i]                 , MINVAL , MAXVAL, "man_gvd_z_near"                   );
1717  xCheckCfgRange( wrongConfig, m_signGvdZFarFlag[i]             , MINVAL , MAXVAL, "sign_gvd_z_far_flag"              );
1718  xCheckCfgRange( wrongConfig, m_expGvdZFar[i]                  , MINVAL , MAXVAL, "exp_gvd_z_far"                    );
1719  xCheckCfgRange( wrongConfig, m_manLenGvdZFarMinus1[i]         , MINVAL , MAXVAL, "man_len_gvd_z_far_minus1"         );
1720  xCheckCfgRange( wrongConfig, m_manGvdZFar[i]                  , MINVAL , MAXVAL, "man_gvd_z_far"                    );
1721  xCheckCfgRange( wrongConfig, m_precGvdFocalLength             , MINVAL , MAXVAL, "prec_gvd_focal_length"            );
1722  xCheckCfgRange( wrongConfig, m_precGvdPrincipalPoint          , MINVAL , MAXVAL, "prec_gvd_principal_point"         );
1723  xCheckCfgRange( wrongConfig, m_precGvdRotationParam           , MINVAL , MAXVAL, "prec_gvd_rotation_param"          );
1724  xCheckCfgRange( wrongConfig, m_precGvdTranslationParam        , MINVAL , MAXVAL, "prec_gvd_translation_param"       );
1725  xCheckCfgRange( wrongConfig, m_signGvdFocalLengthX[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_x"          );
1726  xCheckCfgRange( wrongConfig, m_expGvdFocalLengthX[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_x"           );
1727  xCheckCfgRange( wrongConfig, m_manGvdFocalLengthX[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_x"           );
1728  xCheckCfgRange( wrongConfig, m_signGvdFocalLengthY[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_y"          );
1729  xCheckCfgRange( wrongConfig, m_expGvdFocalLengthY[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_y"           );
1730  xCheckCfgRange( wrongConfig, m_manGvdFocalLengthY[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_y"           );
1731  xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointX[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_x"       );
1732  xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_x"        );
1733  xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_x"        );
1734  xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointY[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_y"       );
1735  xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_y"        );
1736  xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_y"        );
1737  xCheckCfgRange( wrongConfig, m_signGvdR[i][j][k]              , MINVAL , MAXVAL, "sign_gvd_r"                       );
1738  xCheckCfgRange( wrongConfig, m_expGvdR[i][j][k]               , MINVAL , MAXVAL, "exp_gvd_r"                        );
1739  xCheckCfgRange( wrongConfig, m_manGvdR[i][j][k]               , MINVAL , MAXVAL, "man_gvd_r"                        );
1740  xCheckCfgRange( wrongConfig, m_signGvdTX[i]                   , MINVAL , MAXVAL, "sign_gvd_t_x"                     );
1741  xCheckCfgRange( wrongConfig, m_expGvdTX[i]                    , MINVAL , MAXVAL, "exp_gvd_t_x"                      );
1742  xCheckCfgRange( wrongConfig, m_manGvdTX[i]                    , MINVAL , MAXVAL, "man_gvd_t_x"                      );
1743  xCheckCfgRange( wrongConfig, m_minOffsetXInt                  , MINVAL , MAXVAL, "min_offset_x_int"                 );
1744  xCheckCfgRange( wrongConfig, m_minOffsetXFrac                 , MINVAL , MAXVAL, "min_offset_x_frac"                );
1745  xCheckCfgRange( wrongConfig, m_maxOffsetXInt                  , MINVAL , MAXVAL, "max_offset_x_int"                 );
1746  xCheckCfgRange( wrongConfig, m_maxOffsetXFrac                 , MINVAL , MAXVAL, "max_offset_x_frac"                );
1747  xCheckCfgRange( wrongConfig, m_offsetYPresentFlag             , MINVAL , MAXVAL, "offset_y_present_flag"            );
1748  xCheckCfgRange( wrongConfig, m_minOffsetYInt                  , MINVAL , MAXVAL, "min_offset_y_int"                 );
1749  xCheckCfgRange( wrongConfig, m_minOffsetYFrac                 , MINVAL , MAXVAL, "min_offset_y_frac"                );
1750  xCheckCfgRange( wrongConfig, m_maxOffsetYInt                  , MINVAL , MAXVAL, "max_offset_y_int"                 );
1751  xCheckCfgRange( wrongConfig, m_maxOffsetYFrac                 , MINVAL , MAXVAL, "max_offset_y_frac"                );
1752  xCheckCfgRange( wrongConfig, m_warpMapSizePresentFlag         , MINVAL , MAXVAL, "warp_map_size_present_flag"       );
1753  xCheckCfgRange( wrongConfig, m_warpMapWidthMinus2             , MINVAL , MAXVAL, "warp_map_width_minus2"            );
1754  xCheckCfgRange( wrongConfig, m_warpMapHeightMinus2            , MINVAL , MAXVAL, "warp_map_height_minus2"           );
1755
1756  return wrongConfig; 
1757
1758};
1759#endif
1760
1761#endif
Note: See TracBrowser for help on using the repository browser.