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

Last change on this file since 1338 was 1335, checked in by tech, 10 years ago

Fixes to

  • alphaChannelInfoSei.cfg
  • default presence.
File size: 92.1 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2015, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \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  case SEI::ALPHA_CHANNEL_INFO                    :               return new SEIAlphaChannelInfo;
236#if NH_MV_SEI_TBD
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( );
353  defAppPocs        .empty( );
354  defAppTids        .empty( );
355  defAppVclNaluTypes.empty( );
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    const TComVPS* vps = slice->getVPS(); 
384//  // TBD: Add constraints on presence of SEI here.
385    xCheckCfg     ( wrongConfig, m_lnpSeiActiveVpsId == vps->getVPSId(), "The value of lnp_sei_active_vps_id shall be equal to the value of vps_video_parameter_set_id of the active VPS for the VCL NAL units of the access unit containing the SEI message." );
386
387
388    for (Int i = 0; i < vps->getMaxLayersMinus1(); i++)
389    {
390      if ( m_layerNotPresentFlag[ i ] && i < vps->getMaxLayersMinus1() )
391      {
392        for (Int j = 0; j < vps->getNumPredictedLayers( vps->getLayerIdInNuh( j ) - 1 ); j++ )
393        {
394          xCheckCfg     ( wrongConfig, m_layerNotPresentFlag[ vps->getLayerIdInVps( vps->getIdPredictedLayer( vps->getLayerIdInNuh(i),j) )], "When layer_not_present_flag[ i ] is equal to 1 and i is less than MaxLayersMinus1, layer_not_present_flag[ LayerIdxInVps[ IdPredictedLayer[ layer_id_in_nuh[ i ] ][ j ] ] ] shall be equal to 1 for all values of j in the range of 0 to NumPredictedLayers[ layer_id_in_nuh[ i ] ] - 1, inclusive." );
395        }
396      }
397    }
398
399      return wrongConfig; 
400  };
401#endif
402
403
404Void SEIInterLayerConstrainedTileSets::setupFromCfgFile(const Char* cfgFile)
405{ 
406  // Set default values
407  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
408
409  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
410  defAppLayerIds    .empty( ); 
411  defAppPocs        .push_back( 0 ); 
412  defAppTids        .empty( ); 
413  defAppVclNaluTypes.empty( ); 
414
415  Int      defSeiNaluId                  = 0; 
416  Int      defPositionInSeiNalu          = 0; 
417  Bool     defModifyByEncoder            = false; 
418
419  // Setup config file options
420  po::Options opts;     
421  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
422
423  const Int maxNumTileInSet = 100; 
424
425  opts.addOptions()
426    ("IlAllTilesExactSampleValueMatchFlag", m_ilAllTilesExactSampleValueMatchFlag, false                    , "IlAllTilesExactSampleValueMatchFlag")
427    ("IlOneTilePerTileSetFlag"        , m_ilOneTilePerTileSetFlag          , false                          , "IlOneTilePerTileSetFlag"          )
428    ("IlNumSetsInMessageMinus1"       , m_ilNumSetsInMessageMinus1         , 0                              , "IlNumSetsInMessageMinus1"         )
429    ("SkippedTileSetPresentFlag"      , m_skippedTileSetPresentFlag        , false                          , "SkippedTileSetPresentFlag"        )
430    ("IlctsId"                        , m_ilctsId                          , IntAry1d (256,0)               , "IlctsId"                          )
431    ("IlNumTileRectsInSetMinus1"      , m_ilNumTileRectsInSetMinus1        , IntAry1d (256,0)               , "IlNumTileRectsInSetMinus1"        )
432    ("IlTopLeftTileIndex_%d"          , m_ilTopLeftTileIndex               , IntAry1d (maxNumTileInSet,0), 256, "IlTopLeftTileIndex"               )
433    ("IlBottomRightTileIndex_%d"      , m_ilBottomRightTileIndex           , IntAry1d (maxNumTileInSet,0), 256, "IlBottomRightTileIndex"           )
434    ("IlcIdc"                         , m_ilcIdc                           , IntAry1d (256,0)               , "IlcIdc"                           )
435    ("IlExactSampleValueMatchFlag"    , m_ilExactSampleValueMatchFlag      , BoolAry1d(256,0)               , "IlExactSampleValueMatchFlag"      )
436    ("AllTilesIlcIdc"                 , m_allTilesIlcIdc                   , 0                              , "AllTilesIlcIdc"                   )
437    ;
438
439  po::setDefaults(opts);
440
441  // Parse the cfg file
442  po::ErrorReporter err;
443  po::parseConfigFile( opts, cfgFile, err );
444};
445
446Bool SEIInterLayerConstrainedTileSets::checkCfg( const TComSlice* slice )
447{ 
448  // Check config values
449  Bool wrongConfig = false; 
450  const TComPPS* pps = slice->getPPS(); 
451
452  // Currently only the active PPS checked.
453  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." );
454   
455  if ( m_ilOneTilePerTileSetFlag )
456  {
457    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."    );
458  }
459  Int numSignificantSets = m_ilNumSetsInMessageMinus1 - m_skippedTileSetPresentFlag + 1; 
460
461  for (Int i = 0 ; i < numSignificantSets; i++)
462  {
463    xCheckCfgRange( wrongConfig, m_ilctsId[i]                         , 0 , (1 << 30) - 1, "ilcts_id"                         );
464  } 
465 
466  return wrongConfig; 
467};
468#if NH_MV_SEI_TBD
469
470Void SEIBspNesting::setupFromSlice  ( const TComSlice* slice )
471{
472  sei.m_seiOlsIdx =  TBD ;
473  sei.m_seiPartitioningSchemeIdx =  TBD ;
474  sei.m_bspIdx =  TBD ;
475  while( !ByteaLigned(() ) );
476  {
477    sei.m_bspNestingZeroBit =  TBD ;
478  }
479  sei.m_numSeisInBspMinus1 =  TBD ;
480  for( Int i = 0; i  <=  NumSeisInBspMinus1( ); i++ )
481  {
482    SeiMessage(() );
483  }
484};
485
486Void SEIBspNesting::setupFromCfgFile(const Char* cfgFile)
487{ 
488  // Set default values
489  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
490
491  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
492  defAppLayerIds    .push_back( TBD );
493  defAppPocs        .push_back( TBD );
494  defAppTids        .push_back( TBD );
495  defAppVclNaluTypes.push_back( TBD );
496
497  Int      defSeiNaluId                  = 0; 
498  Int      defPositionInSeiNalu          = 0; 
499  Bool     defModifyByEncoder            = TBD; 
500
501  // Setup config file options
502  po::Options opts;     
503  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
504
505  opts.addOptions()
506    ("SeiOlsIdx"                      , m_seiOlsIdx                        , 0                              , "SeiOlsIdx"                        )
507    ("SeiPartitioningSchemeIdx"       , m_seiPartitioningSchemeIdx         , 0                              , "SeiPartitioningSchemeIdx"         )
508    ("BspIdx"                         , m_bspIdx                           , 0                              , "BspIdx"                           )
509    ("BspNestingZeroBit"              , m_bspNestingZeroBit                , 0                              , "BspNestingZeroBit"                )
510    ("NumSeisInBspMinus1"             , m_numSeisInBspMinus1               , 0                              , "NumSeisInBspMinus1"               )
511    ;
512
513  po::setDefaults(opts);
514
515  // Parse the cfg file
516  po::ErrorReporter err;
517  po::parseConfigFile( opts, cfgFile, err );
518};
519
520Bool SEIBspNesting::checkCfg( const TComSlice* slice )
521{ 
522  // Check config values
523  Bool wrongConfig = false; 
524
525  // TBD: Add constraints on presence of SEI here.
526  xCheckCfg     ( wrongConfig, TBD , "TBD" );
527  xCheckCfg     ( wrongConfig, TBD , "TBD" );
528
529  // TBD: Modify constraints according to the SEI semantics.   
530  xCheckCfgRange( wrongConfig, m_seiOlsIdx                      , MINVAL , MAXVAL, "sei_ols_idx"          );
531  xCheckCfgRange( wrongConfig, m_seiPartitioningSchemeIdx       , MINVAL , MAXVAL, "sei_partitioning_scheme_idx"       );
532  xCheckCfgRange( wrongConfig, m_bspIdx                         , MINVAL , MAXVAL, "bsp_idx"              );
533  xCheckCfgRange( wrongConfig, m_bspNestingZeroBit              , MINVAL , MAXVAL, "bsp_nesting_zero_bit ");
534  xCheckCfgRange( wrongConfig, m_numSeisInBspMinus1             , MINVAL , MAXVAL, "num_seis_in_bsp_minus1"           );
535
536  return wrongConfig; 
537
538};
539
540Void SEIBspInitialArrivalTime::setupFromSlice  ( const TComSlice* slice )
541{
542  psIdx = SeiPartitioningSchemeIdx();
543  if( nalInitialArrivalDelayPresent )
544  {
545    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
546    {
547      sei.m_nalInitialArrivalDelay[i] =  TBD ;
548    }
549  }
550  if( vclInitialArrivalDelayPresent )
551  {
552    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
553    {
554      sei.m_vclInitialArrivalDelay[i] =  TBD ;
555    }
556  }
557};
558
559Void SEIBspInitialArrivalTime::setupFromCfgFile(const Char* cfgFile)
560{ 
561  // Set default values
562  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
563
564  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
565  defAppLayerIds    .push_back( TBD );
566  defAppPocs        .push_back( TBD );
567  defAppTids        .push_back( TBD );
568  defAppVclNaluTypes.push_back( TBD );
569
570  Int      defSeiNaluId                  = 0; 
571  Int      defPositionInSeiNalu          = 0; 
572  Bool     defModifyByEncoder            = TBD; 
573
574  // Setup config file options
575  po::Options opts;     
576  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
577
578  opts.addOptions()
579    ("NalInitialArrivalDelay"         , m_nalInitialArrivalDelay           , IntAry1d (1,0)                 , "NalInitialArrivalDelay"           )
580    ("VclInitialArrivalDelay"         , m_vclInitialArrivalDelay           , IntAry1d (1,0)                 , "VclInitialArrivalDelay"           )
581    ;
582
583  po::setDefaults(opts);
584
585  // Parse the cfg file
586  po::ErrorReporter err;
587  po::parseConfigFile( opts, cfgFile, err );
588};
589
590Bool SEIBspInitialArrivalTime::checkCfg( const TComSlice* slice )
591{ 
592  // Check config values
593  Bool wrongConfig = false; 
594
595  // TBD: Add constraints on presence of SEI here.
596  xCheckCfg     ( wrongConfig, TBD , "TBD" );
597  xCheckCfg     ( wrongConfig, TBD , "TBD" );
598
599  // TBD: Modify constraints according to the SEI semantics.   
600  xCheckCfgRange( wrongConfig, m_nalInitialArrivalDelay[i]      , MINVAL , MAXVAL, "nal_initial_arrival_delay"        );
601  xCheckCfgRange( wrongConfig, m_vclInitialArrivalDelay[i]      , MINVAL , MAXVAL, "vcl_initial_arrival_delay"        );
602
603  return wrongConfig; 
604
605};
606#endif
607
608Void SEISubBitstreamProperty::setupFromCfgFile(const Char* cfgFile)
609{ 
610  // Set default values
611  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
612
613  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
614  defAppLayerIds    .push_back( 0 );
615  defAppPocs        .push_back( 0 );
616  defAppTids        .push_back( 0 );
617  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
618
619  Int      defSeiNaluId                  = 0; 
620  Int      defPositionInSeiNalu          = 0; 
621  Bool     defModifyByEncoder            = false; 
622
623  // Setup config file options
624  po::Options opts;     
625  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
626
627  opts.addOptions()
628    ("SbPropertyActiveVpsId"          , m_sbPropertyActiveVpsId            , 0                              , "SbPropertyActiveVpsId"            )
629    ("NumAdditionalSubStreamsMinus1"  , m_numAdditionalSubStreamsMinus1    , 0                              , "NumAdditionalSubStreamsMinus1"    )
630    ("SubBitstreamMode"               , m_subBitstreamMode                 , IntAry1d (1,0)                 , "SubBitstreamMode"                 )
631    ("OlsIdxToVps"                    , m_olsIdxToVps                      , IntAry1d (1,0)                 , "OlsIdxToVps"                      )
632    ("HighestSublayerId"              , m_highestSublayerId                , IntAry1d (1,0)                 , "HighestSublayerId"                )
633    ("AvgSbPropertyBitRate"           , m_avgSbPropertyBitRate             , IntAry1d (1,0)                 , "AvgSbPropertyBitRate"             )
634    ("MaxSbPropertyBitRate"           , m_maxSbPropertyBitRate             , IntAry1d (1,0)                 , "MaxSbPropertyBitRate"             )
635    ;
636
637  po::setDefaults(opts);
638
639  // Parse the cfg file
640  po::ErrorReporter err;
641  po::parseConfigFile( opts, cfgFile, err );
642};
643
644Bool SEISubBitstreamProperty::checkCfg( const TComSlice* slice )
645{ 
646  // Check config values
647  Bool wrongConfig = false;
648
649  // For the current encoder, the initial IRAP access unit has always POC zero.   
650  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.");
651
652  Bool sizeNotCorrect = 
653    (    ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_subBitstreamMode    .size() )
654    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_olsIdxToVps         .size() )
655    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_highestSublayerId   .size() )
656    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_avgSbPropertyBitRate.size() )
657    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_maxSbPropertyBitRate.size() );
658
659  xCheckCfg( wrongConfig, !sizeNotCorrect, "Some parameters of some sub-bitstream not provided." );
660  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." );
661
662  xCheckCfgRange( wrongConfig, m_numAdditionalSubStreamsMinus1  , 0 , (1 << 10) - 1 , "num_additional_sub_streams_minus1");
663 
664  if ( !sizeNotCorrect )
665  {
666    for (Int i = 0; i <= m_numAdditionalSubStreamsMinus1; i++ )
667    {
668      xCheckCfgRange( wrongConfig, m_subBitstreamMode[i]    , 0 , 1                                          , "sub_bitstream_mode" );
669      xCheckCfgRange( wrongConfig, m_olsIdxToVps[i]         , 0 , slice->getVPS()->getNumOutputLayerSets()-1 , "ols_idx_to_vps"     );
670    }
671  }
672  return wrongConfig; 
673};
674
675Void SEISubBitstreamProperty::resizeArrays( )
676{
677  m_subBitstreamMode    .resize( m_numAdditionalSubStreamsMinus1 + 1); 
678  m_olsIdxToVps         .resize( m_numAdditionalSubStreamsMinus1 + 1); 
679  m_highestSublayerId   .resize( m_numAdditionalSubStreamsMinus1 + 1); 
680  m_avgSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 
681  m_maxSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1); 
682}
683
684Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile)
685{ 
686  // Set default values
687  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
688
689  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
690  defAppLayerIds    .clear();
691  defAppPocs        .push_back( 0 );
692  defAppTids        .push_back( 0 );
693  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
694
695  Int      defSeiNaluId                  = 0; 
696  Int      defPositionInSeiNalu          = 0; 
697  Bool     defModifyByEncoder            = false;
698
699  // Setup config file options
700  po::Options opts;     
701  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
702
703  opts.addOptions()
704    ("AlphaChannelCancelFlag"         , m_alphaChannelCancelFlag           , false                          , "AlphaChannelCancelFlag"           )
705    ("AlphaChannelUseIdc"             , m_alphaChannelUseIdc               , 0                              , "AlphaChannelUseIdc"               )
706    ("AlphaChannelBitDepthMinus8"     , m_alphaChannelBitDepthMinus8       , 0                              , "AlphaChannelBitDepthMinus8"       )
707    ("AlphaTransparentValue"          , m_alphaTransparentValue            , 0                              , "AlphaTransparentValue"            )
708    ("AlphaOpaqueValue"               , m_alphaOpaqueValue                 , 255                            , "AlphaOpaqueValue"                 )
709    ("AlphaChannelIncrFlag"           , m_alphaChannelIncrFlag             , false                          , "AlphaChannelIncrFlag"             )
710    ("AlphaChannelClipFlag"           , m_alphaChannelClipFlag             , false                          , "AlphaChannelClipFlag"             )
711    ("AlphaChannelClipTypeFlag"       , m_alphaChannelClipTypeFlag         , false                          , "AlphaChannelClipTypeFlag"         )
712    ;
713
714  po::setDefaults(opts);
715
716  // Parse the cfg file
717  po::ErrorReporter err;
718  po::parseConfigFile( opts, cfgFile, err );
719
720};
721
722Bool SEIAlphaChannelInfo::checkCfg( const TComSlice* slice )
723{ 
724  // Check config values
725  Bool wrongConfig = false; 
726
727  int maxInterpretationValue = (1 << (m_alphaChannelBitDepthMinus8+9)) - 1;
728  xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag         , 0 , 1, "alpha_channel_cancel_flag"        );
729  xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc             , 0 , 7, "alpha_channel_use_idc");
730  xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8     , 0 , 7, "alpha_channel_bit_depth_minus8"   );
731  xCheckCfgRange( wrongConfig, m_alphaTransparentValue          , 0 , maxInterpretationValue, "alpha_transparent_value"          );
732  xCheckCfgRange( wrongConfig, m_alphaOpaqueValue               , 0 , maxInterpretationValue, "alpha_opaque_value"   );
733  xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag           , 0 , 1, "alpha_channel_incr_flag"          );
734  xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag           , 0 , 1, "alpha_channel_clip_flag"          );
735  xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag       , 0 , 1, "alpha_channel_clip_type_flag"     );
736
737  return wrongConfig; 
738
739};
740#if NH_MV_SEI_TBD
741Void SEIOverlayInfo::setupFromSlice  ( const TComSlice* slice )
742{
743  sei.m_overlayInfoCancelFlag =  TBD ;
744  if( !sei.m_overlayInfoCancelFlag )
745  {
746    sei.m_overlayContentAuxIdMinus128 =  TBD ;
747    sei.m_overlayLabelAuxIdMinus128 =  TBD ;
748    sei.m_overlayAlphaAuxIdMinus128 =  TBD ;
749    sei.m_overlayElementLabelValueLengthMinus8 =  TBD ;
750    sei.m_numOverlaysMinus1 =  TBD ;
751    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
752    {
753      sei.m_overlayIdx[i] =  TBD ;
754      sei.m_languageOverlayPresentFlag[i] =  TBD ;
755      sei.m_overlayContentLayerId[i] =  TBD ;
756      sei.m_overlayLabelPresentFlag[i] =  TBD ;
757      if( sei.m_overlayLabelPresentFlag( i ) )
758      {
759        sei.m_overlayLabelLayerId[i] =  TBD ;
760      }
761      sei.m_overlayAlphaPresentFlag[i] =  TBD ;
762      if( sei.m_overlayAlphaPresentFlag( i ) )
763      {
764        sei.m_overlayAlphaLayerId[i] =  TBD ;
765      }
766      if( sei.m_overlayLabelPresentFlag( i ) )
767      {
768        sei.m_numOverlayElementsMinus1[i] =  TBD ;
769        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
770        {
771          sei.m_overlayElementLabelMin[i][j] =  TBD ;
772          sei.m_overlayElementLabelMax[i][j] =  TBD ;
773        }
774      }
775    }
776    while( !ByteaLigned(() ) );
777    {
778      sei.m_overlayZeroBit =  TBD ;
779    }
780    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
781    {
782      if( sei.m_languageOverlayPresentFlag( i ) )
783      {
784        sei.m_overlayLanguage[i] =  TBD ;
785      }
786      sei.m_overlayName[i] =  TBD ;
787      if( sei.m_overlayLabelPresentFlag( i ) )
788      {
789        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
790        {
791          sei.m_overlayElementName[i][j] =  TBD ;
792        }
793      }
794    }
795    sei.m_overlayInfoPersistenceFlag =  TBD ;
796  }
797};
798
799Void SEIOverlayInfo::setupFromCfgFile(const Char* cfgFile)
800{ 
801  // Set default values
802  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
803
804  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
805  defAppLayerIds    .push_back( TBD );
806  defAppPocs        .push_back( TBD );
807  defAppTids        .push_back( TBD );
808  defAppVclNaluTypes.push_back( TBD );
809
810  Int      defSeiNaluId                  = 0; 
811  Int      defPositionInSeiNalu          = 0; 
812  Bool     defModifyByEncoder            = TBD; 
813
814  // Setup config file options
815  po::Options opts;     
816  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
817
818  opts.addOptions()
819    ("OverlayInfoCancelFlag"          , m_overlayInfoCancelFlag            , false                          , "OverlayInfoCancelFlag"            )
820    ("OverlayContentAuxIdMinus128"    , m_overlayContentAuxIdMinus128      , 0                              , "OverlayContentAuxIdMinus128"      )
821    ("OverlayLabelAuxIdMinus128"      , m_overlayLabelAuxIdMinus128        , 0                              , "OverlayLabelAuxIdMinus128"        )
822    ("OverlayAlphaAuxIdMinus128"      , m_overlayAlphaAuxIdMinus128        , 0                              , "OverlayAlphaAuxIdMinus128"        )
823    ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0                              , "OverlayElementLabelValueLengthMinus8")
824    ("NumOverlaysMinus1"              , m_numOverlaysMinus1                , 0                              , "NumOverlaysMinus1"                )
825    ("OverlayIdx"                     , m_overlayIdx                       , IntAry1d (1,0)                 , "OverlayIdx"                       )
826    ("LanguageOverlayPresentFlag"     , m_languageOverlayPresentFlag       , BoolAry1d(1,0)                 , "LanguageOverlayPresentFlag"       )
827    ("OverlayContentLayerId"          , m_overlayContentLayerId            , IntAry1d (1,0)                 , "OverlayContentLayerId"            )
828    ("OverlayLabelPresentFlag"        , m_overlayLabelPresentFlag          , BoolAry1d(1,0)                 , "OverlayLabelPresentFlag"          )
829    ("OverlayLabelLayerId"            , m_overlayLabelLayerId              , IntAry1d (1,0)                 , "OverlayLabelLayerId"              )
830    ("OverlayAlphaPresentFlag"        , m_overlayAlphaPresentFlag          , BoolAry1d(1,0)                 , "OverlayAlphaPresentFlag"          )
831    ("OverlayAlphaLayerId"            , m_overlayAlphaLayerId              , IntAry1d (1,0)                 , "OverlayAlphaLayerId"              )
832    ("NumOverlayElementsMinus1"       , m_numOverlayElementsMinus1         , IntAry1d (1,0)                 , "NumOverlayElementsMinus1"         )
833    ("OverlayElementLabelMin_%d"      , m_overlayElementLabelMin           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMin"           )
834    ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMax"           )
835    ("OverlayZeroBit"                 , m_overlayZeroBit                   , 0                              , "OverlayZeroBit"                   )
836    ("OverlayLanguage"                , m_overlayLanguage                  , IntAry1d (1,0)                 , "OverlayLanguage"                  )
837    ("OverlayName"                    , m_overlayName                      , IntAry1d (1,0)                 , "OverlayName"                      )
838    ("OverlayElementName_%d"          , m_overlayElementName               , IntAry1d (1,0) ,ADDNUM         , "OverlayElementName"               )
839    ("OverlayInfoPersistenceFlag"     , m_overlayInfoPersistenceFlag       , false                          , "OverlayInfoPersistenceFlag"       )
840    ;
841
842  po::setDefaults(opts);
843
844  // Parse the cfg file
845  po::ErrorReporter err;
846  po::parseConfigFile( opts, cfgFile, err );
847};
848
849Bool SEIOverlayInfo::checkCfg( const TComSlice* slice )
850{ 
851  // Check config values
852  Bool wrongConfig = false; 
853
854  // TBD: Add constraints on presence of SEI here.
855  xCheckCfg     ( wrongConfig, TBD , "TBD" );
856  xCheckCfg     ( wrongConfig, TBD , "TBD" );
857
858  // TBD: Modify constraints according to the SEI semantics.   
859  xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag          , MINVAL , MAXVAL, "overlay_info_cancel_flag"         );
860  xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128    , MINVAL , MAXVAL, "overlay_content_aux_id_minus128"  );
861  xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128      , MINVAL , MAXVAL, "overlay_label_aux_id_minus128"    );
862  xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128      , MINVAL , MAXVAL, "overlay_alpha_aux_id_minus128"    );
863  xCheckCfgRange( wrongConfig, m_overlayElementLabelValueLengthMinus8, MINVAL , MAXVAL, "overlay_element_label_value_length_minus8");
864  xCheckCfgRange( wrongConfig, m_numOverlaysMinus1              , MINVAL , MAXVAL, "num_overlays_minus1"  );
865  xCheckCfgRange( wrongConfig, m_overlayIdx[i]                  , MINVAL , MAXVAL, "overlay_idx"          );
866  xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i]  , MINVAL , MAXVAL, "language_overlay_present_flag"    );
867  xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i]       , MINVAL , MAXVAL, "overlay_content_layer_id"         );
868  xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , MINVAL , MAXVAL, "overlay_label_present_flag"       );
869  xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i]         , MINVAL , MAXVAL, "overlay_label_layer_id"           );
870  xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i]     , MINVAL , MAXVAL, "overlay_alpha_present_flag"       );
871  xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , MINVAL , MAXVAL, "overlay_alpha_layer_id"           );
872  xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , MINVAL , MAXVAL, "num_overlay_elements_minus1"       );
873  xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j]   , MINVAL , MAXVAL, "overlay_element_label_min"        );
874  xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j]   , MINVAL , MAXVAL, "overlay_element_label_max"        );
875  xCheckCfgRange( wrongConfig, m_overlayZeroBit                 , MINVAL , MAXVAL, "overlay_zero_bit"                 );
876  xCheckCfgRange( wrongConfig, m_overlayLanguage[i]             , MINVAL , MAXVAL, "overlay_language"                 );
877  xCheckCfgRange( wrongConfig, m_overlayName[i]                 , MINVAL , MAXVAL, "overlay_name"                     );
878  xCheckCfgRange( wrongConfig, m_overlayElementName[i][j]       , MINVAL , MAXVAL, "overlay_element_name"             );
879  xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag     , MINVAL , MAXVAL, "overlay_info_persistence_flag"    );
880
881  return wrongConfig; 
882
883};
884#endif
885
886Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile)
887{ 
888  // Set default values
889  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
890
891  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
892  defAppLayerIds    .clear    (   ); 
893  defAppPocs        .push_back( 0 );
894  defAppTids        .push_back( 0 );
895  defAppVclNaluTypes.clear    (   );
896
897  Int      defSeiNaluId                  = 0; 
898  Int      defPositionInSeiNalu          = 0; 
899  Bool     defModifyByEncoder            = false; 
900
901  // Setup config file options
902  po::Options opts;     
903  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
904
905  opts.addOptions()
906    ("PrevPicsNotUsedFlag"   , m_prevPicsNotUsedFlag   , false, "PrevPicsNotUsedFlag"    )
907    ("NoIntraLayerColPicFlag", m_noIntraLayerColPicFlag, false, "NoIntraLayerColPicFlag" )
908    ;
909
910  po::setDefaults(opts);
911
912  // Parse the cfg file
913  po::ErrorReporter err;
914  po::parseConfigFile( opts, cfgFile, err );
915};
916
917Bool SEITemporalMvPredictionConstraints::checkCfg( const TComSlice* slice )
918{ 
919  // Check config values
920  Bool wrongConfig = false; 
921
922  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." );
923
924  return wrongConfig; 
925};
926
927#if NH_MV_SEI_TBD
928Void SEIFrameFieldInfo::setupFromCfgFile(const Char* cfgFile)
929{ 
930  // Set default values
931  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
932
933  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
934  defAppLayerIds    .push_back( TBD );
935  defAppPocs        .push_back( TBD );
936  defAppTids        .push_back( TBD );
937  defAppVclNaluTypes.push_back( TBD );
938
939  Int      defSeiNaluId                  = 0;
940  Int      defPositionInSeiNalu          = 0;
941  Bool     defModifyByEncoder            = false;
942
943  // Setup config file options
944  po::Options opts;     
945  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
946
947  opts.addOptions()
948    ("FfinfoPicStruct"     , m_ffinfoPicStruct     , 0     , "FfinfoPicStruct"     )
949    ("FfinfoSourceScanType", m_ffinfoSourceScanType, 0     , "FfinfoSourceScanType")
950    ("FfinfoDuplicateFlag" , m_ffinfoDuplicateFlag , false , "FfinfoDuplicateFlag" )
951    ;
952
953  po::setDefaults(opts);
954
955  // Parse the cfg file
956  po::ErrorReporter err;
957  po::parseConfigFile( opts, cfgFile, err );
958};
959
960
961Bool SEIFrameFieldInfo::checkCfg( const TComSlice* slice )
962{ 
963  // Check config values
964  Bool wrongConfig = false; 
965
966  // TBD: Add constraints on presence of SEI here.
967  xCheckCfg     ( wrongConfig, TBD , "TBD" );
968  xCheckCfg     ( wrongConfig, TBD , "TBD" );
969
970  // TBD: Modify constraints according to the SEI semantics.   
971  xCheckCfgRange( wrongConfig, m_ffinfoPicStruct                , MINVAL , MAXVAL, "ffinfo_pic_struct"                );
972  xCheckCfgRange( wrongConfig, m_ffinfoSourceScanType           , MINVAL , MAXVAL, "ffinfo_source_scan_type"          );
973  xCheckCfgRange( wrongConfig, m_ffinfoDuplicateFlag            , MINVAL , MAXVAL, "ffinfo_duplicate_flag"            );
974
975  return wrongConfig; 
976
977};
978
979Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromSlice  ( const TComSlice* slice )
980{
981  sei.m_precRefDisplayWidth =  TBD ;
982  sei.m_refViewingDistanceFlag =  TBD ;
983  if( sei.m_refViewingDistanceFlag )
984  {
985    sei.m_precRefViewingDist =  TBD ;
986  }
987  sei.m_numRefDisplaysMinus1 =  TBD ;
988  for( Int i = 0; i  <=  NumRefDisplaysMinus1( ); i++ )
989  {
990    sei.m_leftViewId[i] =  TBD ;
991    sei.m_rightViewId[i] =  TBD ;
992    sei.m_exponentRefDisplayWidth[i] =  TBD ;
993    sei.m_mantissaRefDisplayWidth[i] =  TBD ;
994    if( sei.m_refViewingDistanceFlag )
995    {
996      sei.m_exponentRefViewingDistance[i] =  TBD ;
997      sei.m_mantissaRefViewingDistance[i] =  TBD ;
998    }
999    sei.m_additionalShiftPresentFlag[i] =  TBD ;
1000    if( sei.m_additionalShiftPresentFlag( i ) )
1001    {
1002      sei.m_numSampleShiftPlus512[i] =  TBD ;
1003    }
1004  }
1005  sei.m_threeDimensionalReferenceDisplaysExtensionFlag =  TBD ;
1006};
1007
1008Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile)
1009{ 
1010  // Set default values
1011  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1012
1013  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1014  defAppLayerIds    .push_back( TBD );
1015  defAppPocs        .push_back( TBD );
1016  defAppTids        .push_back( TBD );
1017  defAppVclNaluTypes.push_back( TBD );
1018
1019  Int      defSeiNaluId                  = 0; 
1020  Int      defPositionInSeiNalu          = 0; 
1021  Bool     defModifyByEncoder            = TBD; 
1022
1023  // Setup config file options
1024  po::Options opts;     
1025  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1026
1027  opts.addOptions()
1028    ("PrecRefDisplayWidth"            , m_precRefDisplayWidth              , 0                              , "PrecRefDisplayWidth"              )
1029    ("RefViewingDistanceFlag"         , m_refViewingDistanceFlag           , false                          , "RefViewingDistanceFlag"           )
1030    ("PrecRefViewingDist"             , m_precRefViewingDist               , 0                              , "PrecRefViewingDist"               )
1031    ("NumRefDisplaysMinus1"           , m_numRefDisplaysMinus1             , 0                              , "NumRefDisplaysMinus1"             )
1032    ("LeftViewId"                     , m_leftViewId                       , IntAry1d (1,0)                 , "LeftViewId"                       )
1033    ("RightViewId"                    , m_rightViewId                      , IntAry1d (1,0)                 , "RightViewId"                      )
1034    ("ExponentRefDisplayWidth"        , m_exponentRefDisplayWidth          , IntAry1d (1,0)                 , "ExponentRefDisplayWidth"          )
1035    ("MantissaRefDisplayWidth"        , m_mantissaRefDisplayWidth          , IntAry1d (1,0)                 , "MantissaRefDisplayWidth"          )
1036    ("ExponentRefViewingDistance"     , m_exponentRefViewingDistance       , IntAry1d (1,0)                 , "ExponentRefViewingDistance"       )
1037    ("MantissaRefViewingDistance"     , m_mantissaRefViewingDistance       , IntAry1d (1,0)                 , "MantissaRefViewingDistance"       )
1038    ("AdditionalShiftPresentFlag"     , m_additionalShiftPresentFlag       , BoolAry1d(1,0)                 , "AdditionalShiftPresentFlag"       )
1039    ("NumSampleShiftPlus512"          , m_numSampleShiftPlus512            , IntAry1d (1,0)                 , "NumSampleShiftPlus512"            )
1040    ("ThreeDimensionalReferenceDisplaysExtensionFlag", m_threeDimensionalReferenceDisplaysExtensionFlag, false                          , "ThreeDimensionalReferenceDisplaysExtensionFlag")
1041    ;
1042
1043  po::setDefaults(opts);
1044
1045  // Parse the cfg file
1046  po::ErrorReporter err;
1047  po::parseConfigFile( opts, cfgFile, err );
1048};
1049
1050Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice )
1051{ 
1052  // Check config values
1053  Bool wrongConfig = false; 
1054
1055  // TBD: Add constraints on presence of SEI here.
1056  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1057  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1058
1059  // TBD: Modify constraints according to the SEI semantics.   
1060  xCheckCfgRange( wrongConfig, m_precRefDisplayWidth            , MINVAL , MAXVAL, "prec_ref_display_width"           );
1061  xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag         , MINVAL , MAXVAL, "ref_viewing_distance_flag"        );
1062  xCheckCfgRange( wrongConfig, m_precRefViewingDist             , MINVAL , MAXVAL, "prec_ref_viewing_dist"            );
1063  xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1           , MINVAL , MAXVAL, "num_ref_displays_minus1"          );
1064  xCheckCfgRange( wrongConfig, m_leftViewId[i]                  , MINVAL , MAXVAL, "left_view_id"                     );
1065  xCheckCfgRange( wrongConfig, m_rightViewId[i]                 , MINVAL , MAXVAL, "right_view_id"                    );
1066  xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i]     , MINVAL , MAXVAL, "exponent_ref_display_width"       );
1067  xCheckCfgRange( wrongConfig, m_mantissaRefDisplayWidth[i]     , MINVAL , MAXVAL, "mantissa_ref_display_width"       );
1068  xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i]  , MINVAL , MAXVAL, "exponent_ref_viewing_distance"    );
1069  xCheckCfgRange( wrongConfig, m_mantissaRefViewingDistance[i]  , MINVAL , MAXVAL, "mantissa_ref_viewing_distance"    );
1070  xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i]  , MINVAL , MAXVAL, "additional_shift_present_flag"    );
1071  xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i]       , MINVAL , MAXVAL, "num_sample_shift_plus512"         );
1072  xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, MINVAL , MAXVAL, "three_dimensional_reference_displays_extension_flag");
1073
1074  return wrongConfig; 
1075
1076};
1077
1078Void SEIDepthRepresentationInfo::setupFromSlice  ( const TComSlice* slice )
1079{
1080  sei.m_zNearFlag =  TBD ;
1081  sei.m_zFarFlag =  TBD ;
1082  sei.m_dMinFlag =  TBD ;
1083  sei.m_dMaxFlag =  TBD ;
1084  sei.m_depthRepresentationType =  TBD ;
1085  if( sei.m_dMinFlag  | |  sei.m_dMaxFlag )
1086  {
1087    sei.m_disparityRefViewId =  TBD ;
1088  }
1089  if( sei.m_zNearFlag )
1090  {
1091    DepthRepInfoElement(() ZNearSign, ZNearExp, ZNearMantissa, ZNearManLen );
1092  }
1093  if( sei.m_zFarFlag )
1094  {
1095    DepthRepInfoElement(() ZFarSign, ZFarExp, ZFarMantissa, ZFarManLen );
1096  }
1097  if( sei.m_dMinFlag )
1098  {
1099    DepthRepInfoElement(() DMinSign, DMinExp, DMinMantissa, DMinManLen );
1100  }
1101  if( sei.m_dMaxFlag )
1102  {
1103    DepthRepInfoElement(() DMaxSign, DMaxExp, DMaxMantissa, DMaxManLen );
1104  }
1105  if( sei.m_depthRepresentationType  = =  3 )
1106  {
1107    sei.m_depthNonlinearRepresentationNumMinus1 =  TBD ;
1108    for( Int i = 1; i  <=  sei.m_depthNonlinearRepresentationNumMinus1 + 1; i++ )
1109    {
1110      DepthNonlinearRepresentationModel( i );
1111    }
1112  }
1113};
1114
1115Void SEIDepthRepresentationInfo::setupFromCfgFile(const Char* cfgFile)
1116{ 
1117  // Set default values
1118  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1119
1120  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1121  defAppLayerIds    .push_back( TBD );
1122  defAppPocs        .push_back( TBD );
1123  defAppTids        .push_back( TBD );
1124  defAppVclNaluTypes.push_back( TBD );
1125
1126  Int      defSeiNaluId                  = 0; 
1127  Int      defPositionInSeiNalu          = 0; 
1128  Bool     defModifyByEncoder            = TBD; 
1129
1130  // Setup config file options
1131  po::Options opts;     
1132  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1133
1134  opts.addOptions()
1135    ("ZNearFlag"                      , m_zNearFlag                        , false                          , "ZNearFlag"                        )
1136    ("ZFarFlag"                       , m_zFarFlag                         , false                          , "ZFarFlag"                         )
1137    ("DMinFlag"                       , m_dMinFlag                         , false                          , "DMinFlag"                         )
1138    ("DMaxFlag"                       , m_dMaxFlag                         , false                          , "DMaxFlag"                         )
1139    ("DepthRepresentationType"        , m_depthRepresentationType          , 0                              , "DepthRepresentationType"          )
1140    ("DisparityRefViewId"             , m_disparityRefViewId               , 0                              , "DisparityRefViewId"               )
1141    ("DepthNonlinearRepresentationNumMinus1", m_depthNonlinearRepresentationNumMinus1, 0                              , "DepthNonlinearRepresentationNumMinus1")
1142    ;
1143
1144  po::setDefaults(opts);
1145
1146  // Parse the cfg file
1147  po::ErrorReporter err;
1148  po::parseConfigFile( opts, cfgFile, err );
1149};
1150
1151Bool SEIDepthRepresentationInfo::checkCfg( const TComSlice* slice )
1152{ 
1153  // Check config values
1154  Bool wrongConfig = false; 
1155
1156  // TBD: Add constraints on presence of SEI here.
1157  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1158  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1159
1160  // TBD: Modify constraints according to the SEI semantics.   
1161  xCheckCfgRange( wrongConfig, m_zNearFlag                      , MINVAL , MAXVAL, "z_near_flag"                      );
1162  xCheckCfgRange( wrongConfig, m_zFarFlag                       , MINVAL , MAXVAL, "z_far_flag"                       );
1163  xCheckCfgRange( wrongConfig, m_dMinFlag                       , MINVAL , MAXVAL, "d_min_flag"                       );
1164  xCheckCfgRange( wrongConfig, m_dMaxFlag                       , MINVAL , MAXVAL, "d_max_flag"                       );
1165  xCheckCfgRange( wrongConfig, m_depthRepresentationType        , MINVAL , MAXVAL, "depth_representation_type"        );
1166  xCheckCfgRange( wrongConfig, m_disparityRefViewId             , MINVAL , MAXVAL, "disparity_ref_view_id"            );
1167  xCheckCfgRange( wrongConfig, m_depthNonlinearRepresentationNumMinus1, MINVAL , MAXVAL, "depth_nonlinear_representation_num_minus1");
1168
1169  return wrongConfig; 
1170};
1171
1172Void SEIDepthRepInfoElement::setupFromSlice  ( const TComSlice* slice )
1173{
1174  sei.m_daSignFlag =  TBD ;
1175  sei.m_daExponent =  TBD ;
1176  sei.m_daMantissaLenMinus1 =  TBD ;
1177  sei.m_daMantissa =  TBD ;
1178};
1179
1180Void SEIDepthRepInfoElement::setupFromCfgFile(const Char* cfgFile)
1181{ 
1182  // Set default values
1183  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1184
1185  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1186  defAppLayerIds    .push_back( TBD );
1187  defAppPocs        .push_back( TBD );
1188  defAppTids        .push_back( TBD );
1189  defAppVclNaluTypes.push_back( TBD );
1190
1191  Int      defSeiNaluId                  = 0; 
1192  Int      defPositionInSeiNalu          = 0; 
1193  Bool     defModifyByEncoder            = TBD; 
1194
1195  // Setup config file options
1196  po::Options opts;     
1197  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1198
1199  opts.addOptions()
1200    ("DaSignFlag"                     , m_daSignFlag                       , false                          , "DaSignFlag"                       )
1201    ("DaExponent"                     , m_daExponent                       , 0                              , "DaExponent"                       )
1202    ("DaMantissaLenMinus1"            , m_daMantissaLenMinus1              , 0                              , "DaMantissaLenMinus1"              )
1203    ("DaMantissa"                     , m_daMantissa                       , 0                              , "DaMantissa"                       )
1204    ;
1205
1206  po::setDefaults(opts);
1207
1208  // Parse the cfg file
1209  po::ErrorReporter err;
1210  po::parseConfigFile( opts, cfgFile, err );
1211};
1212
1213Bool SEIDepthRepInfoElement::checkCfg( const TComSlice* slice )
1214{ 
1215  // Check config values
1216  Bool wrongConfig = false; 
1217
1218  // TBD: Add constraints on presence of SEI here.
1219  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1220  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1221
1222  // TBD: Modify constraints according to the SEI semantics.   
1223  xCheckCfgRange( wrongConfig, m_daSignFlag                     , MINVAL , MAXVAL, "da_sign_flag"                     );
1224  xCheckCfgRange( wrongConfig, m_daExponent                     , MINVAL , MAXVAL, "da_exponent"                      );
1225  xCheckCfgRange( wrongConfig, m_daMantissaLenMinus1            , MINVAL , MAXVAL, "da_mantissa_len_minus1"           );
1226  xCheckCfgRange( wrongConfig, m_daMantissa                     , MINVAL , MAXVAL, "da_mantissa"                      );
1227
1228  return wrongConfig; 
1229};
1230#endif
1231
1232Void SEIMultiviewSceneInfo::setupFromCfgFile(const Char* cfgFile)
1233{ 
1234  // Set default values
1235  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1236
1237  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1238  defAppLayerIds      .clear(); 
1239  defAppPocs          .clear(); 
1240  defAppTids          .push_back( 0 );
1241  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
1242
1243  Int      defSeiNaluId                  = 0; 
1244  Int      defPositionInSeiNalu          = 0; 
1245  Bool     defModifyByEncoder            = false; 
1246
1247  // Setup config file options
1248  po::Options opts;     
1249  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1250
1251  opts.addOptions()
1252    ("MinDisparity"                   , m_minDisparity                     , 0                              , "MinDisparity"                     )
1253    ("MaxDisparityRange"              , m_maxDisparityRange                , 0                              , "MaxDisparityRange"                )
1254    ;
1255
1256  po::setDefaults(opts);
1257
1258  // Parse the cfg file
1259  po::ErrorReporter err;
1260  po::parseConfigFile( opts, cfgFile, err ); 
1261};
1262
1263
1264Bool SEIMultiviewSceneInfo::checkCfg( const TComSlice* slice )
1265{ 
1266  // Check config values
1267  Bool wrongConfig = false; 
1268   
1269  xCheckCfg     ( wrongConfig, slice->isIRAP(), "When present, the multiview scene information SEI message shall be associated with an IRAP access unit." );
1270     
1271  xCheckCfgRange( wrongConfig, m_minDisparity              , -1024 , 1023, "min_disparity"                    );
1272  xCheckCfgRange( wrongConfig, m_maxDisparityRange         ,     0 , 2047, "max_disparity_range"              );
1273
1274  return wrongConfig; 
1275
1276};
1277
1278Void SEIMultiviewAcquisitionInfo::setupFromCfgFile(const Char* cfgFile)
1279{ 
1280  // Set default values
1281  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1282
1283  defAppLayerIds    .clear(); 
1284  defAppPocs        .push_back( 0 );
1285  defAppTids        .push_back( 0 );
1286  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
1287 
1288
1289  Int      defSeiNaluId                  = 0; 
1290  Int      defPositionInSeiNalu          = 0; 
1291  Bool     defModifyByEncoder            = false; 
1292
1293  // Setup config file options
1294  po::Options opts;     
1295  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1296
1297  opts.addOptions()
1298    ("IntrinsicParamFlag"               , m_intrinsicParamFlag               , false                              , "IntrinsicParamFlag"               )
1299    ("ExtrinsicParamFlag"               , m_extrinsicParamFlag               , false                              , "ExtrinsicParamFlag"               )
1300    ("IntrinsicParamsEqualFlag"         , m_intrinsicParamsEqualFlag         , false                              , "IntrinsicParamsEqualFlag"         )
1301    ("PrecFocalLength"                  , m_precFocalLength                  , 0                                  , "PrecFocalLength"                  )
1302    ("PrecPrincipalPoint"               , m_precPrincipalPoint               , 0                                  , "PrecPrincipalPoint"               )
1303    ("PrecSkewFactor"                   , m_precSkewFactor                   , 0                                  , "PrecSkewFactor"                   )
1304    ("SignFocalLengthX"                 , m_signFocalLengthX                 , BoolAry1d(1,0)                     , "SignFocalLengthX"                 )
1305    ("ExponentFocalLengthX"             , m_exponentFocalLengthX             , IntAry1d (1,0)                     , "ExponentFocalLengthX"             )
1306    ("MantissaFocalLengthX"             , m_mantissaFocalLengthX             , IntAry1d (1,0)                     , "MantissaFocalLengthX"             )
1307    ("SignFocalLengthY"                 , m_signFocalLengthY                 , BoolAry1d(1,0)                     , "SignFocalLengthY"                 )
1308    ("ExponentFocalLengthY"             , m_exponentFocalLengthY             , IntAry1d (1,0)                     , "ExponentFocalLengthY"             )
1309    ("MantissaFocalLengthY"             , m_mantissaFocalLengthY             , IntAry1d (1,0)                     , "MantissaFocalLengthY"             )
1310    ("SignPrincipalPointX"              , m_signPrincipalPointX              , BoolAry1d(1,0)                     , "SignPrincipalPointX"              )
1311    ("ExponentPrincipalPointX"          , m_exponentPrincipalPointX          , IntAry1d (1,0)                     , "ExponentPrincipalPointX"          )
1312    ("MantissaPrincipalPointX"          , m_mantissaPrincipalPointX          , IntAry1d (1,0)                     , "MantissaPrincipalPointX"          )
1313    ("SignPrincipalPointY"              , m_signPrincipalPointY              , BoolAry1d(1,0)                     , "SignPrincipalPointY"              )
1314    ("ExponentPrincipalPointY"          , m_exponentPrincipalPointY          , IntAry1d (1,0)                     , "ExponentPrincipalPointY"          )
1315    ("MantissaPrincipalPointY"          , m_mantissaPrincipalPointY          , IntAry1d (1,0)                     , "MantissaPrincipalPointY"          )
1316    ("SignSkewFactor"                   , m_signSkewFactor                   , BoolAry1d(1,0)                     , "SignSkewFactor"                   )
1317    ("ExponentSkewFactor"               , m_exponentSkewFactor               , IntAry1d (1,0)                     , "ExponentSkewFactor"               )
1318    ("MantissaSkewFactor"               , m_mantissaSkewFactor               , IntAry1d (1,0)                     , "MantissaSkewFactor"               )
1319    ("PrecRotationParam"                , m_precRotationParam                , 0                                  , "PrecRotationParam"                )
1320    ("PrecTranslationParam"             , m_precTranslationParam             , 0                                  , "PrecTranslationParam"             )
1321    ("SignR_%d_%d"                      , m_signR                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS ,3  , "SignR"                            )
1322    ("ExponentR_%d_%d"                  , m_exponentR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "ExponentR"                        )
1323    ("MantissaR_%d_%d"                  , m_mantissaR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "MantissaR"                        )
1324    ("SignT_%d"                         , m_signT                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS     , "SignT"                            )
1325    ("ExponentT_%d"                     , m_exponentT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "ExponentT"                        )
1326    ("MantissaT_%d"                     , m_mantissaT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "MantissaT"                        )
1327    ;
1328
1329  po::setDefaults(opts);
1330
1331  // Parse the cfg file
1332  po::ErrorReporter err;
1333  po::parseConfigFile( opts, cfgFile, err ); 
1334};
1335
1336UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthXLen( Int i ) const
1337{
1338  return xGetSyntaxElementLen( m_exponentFocalLengthX[i], m_precFocalLength, m_mantissaFocalLengthX[ i ] );
1339}
1340
1341Bool SEIMultiviewAcquisitionInfo::checkCfg( const TComSlice* slice )
1342{ 
1343  // Check config values
1344  Bool wrongConfig = false; 
1345
1346  // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes.   
1347  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." ); 
1348
1349  xCheckCfgRange( wrongConfig, m_precFocalLength         , 0, 31, "prec_focal_length"         );
1350  xCheckCfgRange( wrongConfig, m_precPrincipalPoint      , 0, 31, "prec_principle_point"      );
1351  xCheckCfgRange( wrongConfig, m_precSkewFactor          , 0, 31, "prec_skew_factor"          );
1352
1353  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
1354  { 
1355    xCheckCfgRange( wrongConfig, m_exponentFocalLengthX    [ i ], 0, 62, "exponent_focal_length_x"   );
1356    xCheckCfgRange( wrongConfig, m_exponentFocalLengthY    [ i ], 0, 62, "exponent_focal_length_y"   );
1357    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointX [ i ], 0, 62, "exponent_principal_point_x");
1358    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointY [ i ], 0, 62, "exponent_principal_point_y");
1359    xCheckCfgRange( wrongConfig, m_exponentSkewFactor      [ i ], 0, 62, "exponent_skew_factor"      );
1360  }
1361
1362  xCheckCfgRange( wrongConfig, m_precRotationParam       , 0, 31, "prec_focal_length"         );
1363  xCheckCfgRange( wrongConfig, m_precTranslationParam    , 0, 31, "prec_focal_length"         );
1364
1365  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
1366  { 
1367    for (Int j = 0; j <= 2; j++)
1368    {
1369      xCheckCfgRange( wrongConfig, m_exponentT[i][j]     , 0, 62, "exponent_skew_factor"      );
1370      for (Int k = 0; k <= 2; k++ )
1371      {       
1372        xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y");         
1373      }
1374    }
1375  } 
1376
1377  return wrongConfig; 
1378
1379};
1380
1381UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthYLen( Int i ) const
1382{
1383  return xGetSyntaxElementLen( m_exponentFocalLengthY[i], m_precFocalLength, m_mantissaFocalLengthY[ i ]  );
1384}
1385
1386
1387UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointXLen( Int i ) const
1388{
1389  return xGetSyntaxElementLen( m_exponentPrincipalPointX[i], m_precPrincipalPoint, m_mantissaPrincipalPointX[ i ]  );
1390}
1391
1392UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointYLen( Int i ) const
1393{
1394  return xGetSyntaxElementLen( m_exponentPrincipalPointY[i], m_precPrincipalPoint, m_mantissaPrincipalPointY[ i ] );
1395}
1396
1397UInt SEIMultiviewAcquisitionInfo::getMantissaSkewFactorLen( Int i ) const
1398{
1399  return xGetSyntaxElementLen( m_exponentSkewFactor[ i ], m_precSkewFactor, m_mantissaSkewFactor[ i ] );
1400}
1401
1402UInt SEIMultiviewAcquisitionInfo::getMantissaRLen( Int i, Int j, Int k ) const
1403{
1404  return xGetSyntaxElementLen( m_exponentR[ i ][ j ][ k ], m_precRotationParam, m_mantissaR[ i ][ j] [ k ] );
1405}
1406
1407UInt SEIMultiviewAcquisitionInfo::getMantissaTLen( Int i, Int j ) const
1408{
1409  return xGetSyntaxElementLen( m_exponentT[ i ][ j ], m_precTranslationParam, m_mantissaT[ i ][ j ] );
1410}
1411UInt SEIMultiviewAcquisitionInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
1412{
1413  UInt len; 
1414  if( expo == 0 )
1415  {
1416    len = std::max(0, prec - 30 );
1417  }
1418  else
1419  {
1420    len = std::max( 0, expo + prec - 31 );
1421  }
1422
1423  assert( val >= 0 ); 
1424  assert( val <= ( ( 1 << len )- 1) );
1425  return len; 
1426}
1427
1428Void SEIMultiviewViewPosition::setupFromSlice  ( const TComSlice* slice )
1429{
1430  const TComVPS* vps = slice->getVPS(); 
1431  m_numViewsMinus1 = vps->getNumViews() - 1; 
1432  m_viewPosition.resize( m_numViewsMinus1 + 1 ); 
1433  for (Int i = 0; i <= m_numViewsMinus1; i++ )
1434  {
1435    // Assuming that view ids indicate the position
1436    m_viewPosition[i] = vps->getViewIdVal( i );
1437  }
1438}
1439
1440Void SEIMultiviewViewPosition::setupFromCfgFile(const Char* cfgFile)
1441{ 
1442  // Set default values
1443  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1444
1445  defAppLayerIds    .push_back( 0 );
1446  defAppPocs        .push_back( 0 );
1447  defAppTids        .push_back( 0 );
1448  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 
1449
1450  Int      defSeiNaluId                  = 0; 
1451  Int      defPositionInSeiNalu          = 0; 
1452  Bool     defModifyByEncoder            = true; 
1453
1454  // Setup config file options
1455  po::Options opts;     
1456  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1457
1458  opts.addOptions()
1459    ("NumViewsMinus1"         , m_numViewsMinus1                          , 0                       , "NumViewsMinus1")
1460    ("ViewPosition"           , m_viewPosition                            , IntAry1d (1,0)          , "ViewPosition"  ); 
1461  ;
1462
1463  po::setDefaults(opts);
1464
1465  // Parse the cfg file
1466  po::ErrorReporter err;
1467  po::parseConfigFile( opts, cfgFile, err );
1468};
1469
1470Bool SEIMultiviewViewPosition::checkCfg( const TComSlice* slice )
1471{ 
1472  // Check config values
1473  Bool wrongConfig = false; 
1474
1475  // TBD: Add constraints on presence of SEI here.
1476  xCheckCfg     ( wrongConfig, slice->isIRAP() , "When present, the multiview view position SEI message shall be associated with an IRAP access unit."  );
1477
1478  // TBD: Modify constraints according to the SEI semantics.
1479  xCheckCfgRange( wrongConfig, m_numViewsMinus1                 , 0 , 62, "num_views_minus1");
1480  for(Int i = 0; i <= m_numViewsMinus1; i++)
1481  {
1482    xCheckCfgRange( wrongConfig, m_viewPosition[i]                , 0 , 62, "view_position");
1483  }
1484
1485  return wrongConfig; 
1486
1487};
1488
1489#if NH_MV_SEI_TBD
1490Void SEIAlternativeDepthInfo::setupFromSlice  ( const TComSlice* slice )
1491{
1492  sei.m_alternativeDepthInfoCancelFlag =  TBD ;
1493  if( sei.m_alternativeDepthInfoCancelFlag  = =  0 )
1494  {
1495    sei.m_depthType =  TBD ;
1496    if( sei.m_depthType  = =  0 )
1497    {
1498      sei.m_numConstituentViewsGvdMinus1 =  TBD ;
1499      sei.m_depthPresentGvdFlag =  TBD ;
1500      sei.m_zGvdFlag =  TBD ;
1501      sei.m_intrinsicParamGvdFlag =  TBD ;
1502      sei.m_rotationGvdFlag =  TBD ;
1503      sei.m_translationGvdFlag =  TBD ;
1504      if( sei.m_zGvdFlag )
1505      {
1506        for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
1507        {
1508          sei.m_signGvdZNearFlag[i] =  TBD ;
1509          sei.m_expGvdZNear[i] =  TBD ;
1510          sei.m_manLenGvdZNearMinus1[i] =  TBD ;
1511          sei.m_manGvdZNear[i] =  TBD ;
1512          sei.m_signGvdZFarFlag[i] =  TBD ;
1513          sei.m_expGvdZFar[i] =  TBD ;
1514          sei.m_manLenGvdZFarMinus1[i] =  TBD ;
1515          sei.m_manGvdZFar[i] =  TBD ;
1516        }
1517      }
1518      if( sei.m_intrinsicParamGvdFlag )
1519      {
1520        sei.m_precGvdFocalLength =  TBD ;
1521        sei.m_precGvdPrincipalPoint =  TBD ;
1522      }
1523      if( sei.m_rotationGvdFlag )
1524      {
1525        sei.m_precGvdRotationParam =  TBD ;
1526      }
1527      if( sei.m_translationGvdFlag )
1528      {
1529        sei.m_precGvdTranslationParam =  TBD ;
1530      }
1531      for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
1532      {
1533        if( sei.m_intrinsicParamGvdFlag )
1534        {
1535          sei.m_signGvdFocalLengthX[i] =  TBD ;
1536          sei.m_expGvdFocalLengthX[i] =  TBD ;
1537          sei.m_manGvdFocalLengthX[i] =  TBD ;
1538          sei.m_signGvdFocalLengthY[i] =  TBD ;
1539          sei.m_expGvdFocalLengthY[i] =  TBD ;
1540          sei.m_manGvdFocalLengthY[i] =  TBD ;
1541          sei.m_signGvdPrincipalPointX[i] =  TBD ;
1542          sei.m_expGvdPrincipalPointX[i] =  TBD ;
1543          sei.m_manGvdPrincipalPointX[i] =  TBD ;
1544          sei.m_signGvdPrincipalPointY[i] =  TBD ;
1545          sei.m_expGvdPrincipalPointY[i] =  TBD ;
1546          sei.m_manGvdPrincipalPointY[i] =  TBD ;
1547        }
1548        if( sei.m_rotationGvdFlag )
1549        {
1550          for( Int j = 10; j  <=  3; j++ ) /* row */
1551          {
1552            for( Int k = 10; k  <=  3; k++ )  /* column */
1553            {
1554              sei.m_signGvdR[i][j][k] =  TBD ;
1555              sei.m_expGvdR[i][j][k] =  TBD ;
1556              sei.m_manGvdR[i][j][k] =  TBD ;
1557            }
1558          }
1559        }
1560        if( sei.m_translationGvdFlag )
1561        {
1562          sei.m_signGvdTX[i] =  TBD ;
1563          sei.m_expGvdTX[i] =  TBD ;
1564          sei.m_manGvdTX[i] =  TBD ;
1565        }
1566      }
1567    }
1568    if( sei.m_depthType  = =  1 )
1569    {
1570      sei.m_minOffsetXInt =  TBD ;
1571      sei.m_minOffsetXFrac =  TBD ;
1572      sei.m_maxOffsetXInt =  TBD ;
1573      sei.m_maxOffsetXFrac =  TBD ;
1574      sei.m_offsetYPresentFlag =  TBD ;
1575      if( sei.m_offsetYPresentFlag )
1576      {
1577        sei.m_minOffsetYInt =  TBD ;
1578        sei.m_minOffsetYFrac =  TBD ;
1579        sei.m_maxOffsetYInt =  TBD ;
1580        sei.m_maxOffsetYFrac =  TBD ;
1581      }
1582      sei.m_warpMapSizePresentFlag =  TBD ;
1583      if( sei.m_warpMapSizePresentFlag )
1584      {
1585        sei.m_warpMapWidthMinus2 =  TBD ;
1586        sei.m_warpMapHeightMinus2 =  TBD ;
1587      }
1588    }
1589  }
1590};
1591Void SEIAlternativeDepthInfo::setupFromCfgFile(const Char* cfgFile)
1592{ 
1593  // Set default values
1594  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1595
1596  defAppLayerIds    .push_back( TBD );
1597  defAppPocs        .push_back( TBD );
1598  defAppTids        .push_back( TBD );
1599  defAppVclNaluTypes.push_back( TBD );
1600
1601  Int      defSeiNaluId                  = 0; 
1602  Int      defPositionInSeiNalu          = 0; 
1603  Bool     defModifyByEncoder            = TBD; 
1604
1605  // Setup config file options
1606  po::Options opts;     
1607  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1608
1609  opts.addOptions()
1610    ("AlternativeDepthInfoCancelFlag"   , m_alternativeDepthInfoCancelFlag   , false                            , "AlternativeDepthInfoCancelFlag"   )
1611    ("DepthType"                        , m_depthType                        , 0                                , "DepthType"                        )
1612    ("NumConstituentViewsGvdMinus1"     , m_numConstituentViewsGvdMinus1     , 0                                , "NumConstituentViewsGvdMinus1"     )
1613    ("DepthPresentGvdFlag"              , m_depthPresentGvdFlag              , false                            , "DepthPresentGvdFlag"              )
1614    ("ZGvdFlag"                         , m_zGvdFlag                         , false                            , "ZGvdFlag"                         )
1615    ("IntrinsicParamGvdFlag"            , m_intrinsicParamGvdFlag            , false                            , "IntrinsicParamGvdFlag"            )
1616    ("RotationGvdFlag"                  , m_rotationGvdFlag                  , false                            , "RotationGvdFlag"                  )
1617    ("TranslationGvdFlag"               , m_translationGvdFlag               , false                            , "TranslationGvdFlag"               )
1618    ("SignGvdZNearFlag"                 , m_signGvdZNearFlag                 , BoolAry1d(1,0)                   , "SignGvdZNearFlag"                 )
1619    ("ExpGvdZNear"                      , m_expGvdZNear                      , IntAry1d (1,0)                   , "ExpGvdZNear"                      )
1620    ("ManLenGvdZNearMinus1"             , m_manLenGvdZNearMinus1             , IntAry1d (1,0)                   , "ManLenGvdZNearMinus1"             )
1621    ("ManGvdZNear"                      , m_manGvdZNear                      , IntAry1d (1,0)                   , "ManGvdZNear"                      )
1622    ("SignGvdZFarFlag"                  , m_signGvdZFarFlag                  , BoolAry1d(1,0)                   , "SignGvdZFarFlag"                  )
1623    ("ExpGvdZFar"                       , m_expGvdZFar                       , IntAry1d (1,0)                   , "ExpGvdZFar"                       )
1624    ("ManLenGvdZFarMinus1"              , m_manLenGvdZFarMinus1              , IntAry1d (1,0)                   , "ManLenGvdZFarMinus1"              )
1625    ("ManGvdZFar"                       , m_manGvdZFar                       , IntAry1d (1,0)                   , "ManGvdZFar"                       )
1626    ("PrecGvdFocalLength"               , m_precGvdFocalLength               , 0                                , "PrecGvdFocalLength"               )
1627    ("PrecGvdPrincipalPoint"            , m_precGvdPrincipalPoint            , 0                                , "PrecGvdPrincipalPoint"            )
1628    ("PrecGvdRotationParam"             , m_precGvdRotationParam             , 0                                , "PrecGvdRotationParam"             )
1629    ("PrecGvdTranslationParam"          , m_precGvdTranslationParam          , 0                                , "PrecGvdTranslationParam"          )
1630    ("SignGvdFocalLengthX"              , m_signGvdFocalLengthX              , BoolAry1d(1,0)                   , "SignGvdFocalLengthX"              )
1631    ("ExpGvdFocalLengthX"               , m_expGvdFocalLengthX               , IntAry1d (1,0)                   , "ExpGvdFocalLengthX"               )
1632    ("ManGvdFocalLengthX"               , m_manGvdFocalLengthX               , IntAry1d (1,0)                   , "ManGvdFocalLengthX"               )
1633    ("SignGvdFocalLengthY"              , m_signGvdFocalLengthY              , BoolAry1d(1,0)                   , "SignGvdFocalLengthY"              )
1634    ("ExpGvdFocalLengthY"               , m_expGvdFocalLengthY               , IntAry1d (1,0)                   , "ExpGvdFocalLengthY"               )
1635    ("ManGvdFocalLengthY"               , m_manGvdFocalLengthY               , IntAry1d (1,0)                   , "ManGvdFocalLengthY"               )
1636    ("SignGvdPrincipalPointX"           , m_signGvdPrincipalPointX           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointX"           )
1637    ("ExpGvdPrincipalPointX"            , m_expGvdPrincipalPointX            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointX"            )
1638    ("ManGvdPrincipalPointX"            , m_manGvdPrincipalPointX            , IntAry1d (1,0)                   , "ManGvdPrincipalPointX"            )
1639    ("SignGvdPrincipalPointY"           , m_signGvdPrincipalPointY           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointY"           )
1640    ("ExpGvdPrincipalPointY"            , m_expGvdPrincipalPointY            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointY"            )
1641    ("ManGvdPrincipalPointY"            , m_manGvdPrincipalPointY            , IntAry1d (1,0)                   , "ManGvdPrincipalPointY"            )
1642    ("SignGvdR"                         , m_signGvdR                         , BoolAry1d(1,0)   ,ADDNUM ,ADDNUM , "SignGvdR"                         )
1643    ("ExpGvdR"                          , m_expGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ExpGvdR"                          )
1644    ("ManGvdR"                          , m_manGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ManGvdR"                          )
1645    ("SignGvdTX"                        , m_signGvdTX                        , BoolAry1d(1,0)                   , "SignGvdTX"                        )
1646    ("ExpGvdTX"                         , m_expGvdTX                         , IntAry1d (1,0)                   , "ExpGvdTX"                         )
1647    ("ManGvdTX"                         , m_manGvdTX                         , IntAry1d (1,0)                   , "ManGvdTX"                         )
1648    ("MinOffsetXInt"                    , m_minOffsetXInt                    , 0                                , "MinOffsetXInt"                    )
1649    ("MinOffsetXFrac"                   , m_minOffsetXFrac                   , 0                                , "MinOffsetXFrac"                   )
1650    ("MaxOffsetXInt"                    , m_maxOffsetXInt                    , 0                                , "MaxOffsetXInt"                    )
1651    ("MaxOffsetXFrac"                   , m_maxOffsetXFrac                   , 0                                , "MaxOffsetXFrac"                   )
1652    ("OffsetYPresentFlag"               , m_offsetYPresentFlag               , false                            , "OffsetYPresentFlag"               )
1653    ("MinOffsetYInt"                    , m_minOffsetYInt                    , 0                                , "MinOffsetYInt"                    )
1654    ("MinOffsetYFrac"                   , m_minOffsetYFrac                   , 0                                , "MinOffsetYFrac"                   )
1655    ("MaxOffsetYInt"                    , m_maxOffsetYInt                    , 0                                , "MaxOffsetYInt"                    )
1656    ("MaxOffsetYFrac"                   , m_maxOffsetYFrac                   , 0                                , "MaxOffsetYFrac"                   )
1657    ("WarpMapSizePresentFlag"           , m_warpMapSizePresentFlag           , false                            , "WarpMapSizePresentFlag"           )
1658    ("WarpMapWidthMinus2"               , m_warpMapWidthMinus2               , 0                                , "WarpMapWidthMinus2"               )
1659    ("WarpMapHeightMinus2"              , m_warpMapHeightMinus2              , 0                                , "WarpMapHeightMinus2"              )
1660    ;
1661
1662  po::setDefaults(opts);
1663
1664  // Parse the cfg file
1665  po::ErrorReporter err;
1666  po::parseConfigFile( opts, cfgFile, err );
1667};
1668
1669Bool SEIAlternativeDepthInfo::checkCfg( const TComSlice* slice )
1670{ 
1671  // Check config values
1672  Bool wrongConfig = false; 
1673
1674  // TBD: Add constraints on presence of SEI here.
1675  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1676  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1677
1678  // TBD: Modify constraints according to the SEI semantics.   
1679  xCheckCfgRange( wrongConfig, m_alternativeDepthInfoCancelFlag , MINVAL , MAXVAL, "alternative_depth_info_cancel_flag");
1680  xCheckCfgRange( wrongConfig, m_depthType                      , MINVAL , MAXVAL, "depth_type"                       );
1681  xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1   , MINVAL , MAXVAL, "num_constituent_views_gvd_minus1 ");
1682  xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag            , MINVAL , MAXVAL, "depth_present_gvd_flag"           );
1683  xCheckCfgRange( wrongConfig, m_zGvdFlag                       , MINVAL , MAXVAL, "z_gvd_flag"                       );
1684  xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag          , MINVAL , MAXVAL, "intrinsic_param_gvd_flag"         );
1685  xCheckCfgRange( wrongConfig, m_rotationGvdFlag                , MINVAL , MAXVAL, "rotation_gvd_flag"                );
1686  xCheckCfgRange( wrongConfig, m_translationGvdFlag             , MINVAL , MAXVAL, "translation_gvd_flag"             );
1687  xCheckCfgRange( wrongConfig, m_signGvdZNearFlag[i]            , MINVAL , MAXVAL, "sign_gvd_z_near_flag"             );
1688  xCheckCfgRange( wrongConfig, m_expGvdZNear[i]                 , MINVAL , MAXVAL, "exp_gvd_z_near"                   );
1689  xCheckCfgRange( wrongConfig, m_manLenGvdZNearMinus1[i]        , MINVAL , MAXVAL, "man_len_gvd_z_near_minus1"        );
1690  xCheckCfgRange( wrongConfig, m_manGvdZNear[i]                 , MINVAL , MAXVAL, "man_gvd_z_near"                   );
1691  xCheckCfgRange( wrongConfig, m_signGvdZFarFlag[i]             , MINVAL , MAXVAL, "sign_gvd_z_far_flag"              );
1692  xCheckCfgRange( wrongConfig, m_expGvdZFar[i]                  , MINVAL , MAXVAL, "exp_gvd_z_far"                    );
1693  xCheckCfgRange( wrongConfig, m_manLenGvdZFarMinus1[i]         , MINVAL , MAXVAL, "man_len_gvd_z_far_minus1"         );
1694  xCheckCfgRange( wrongConfig, m_manGvdZFar[i]                  , MINVAL , MAXVAL, "man_gvd_z_far"                    );
1695  xCheckCfgRange( wrongConfig, m_precGvdFocalLength             , MINVAL , MAXVAL, "prec_gvd_focal_length"            );
1696  xCheckCfgRange( wrongConfig, m_precGvdPrincipalPoint          , MINVAL , MAXVAL, "prec_gvd_principal_point"         );
1697  xCheckCfgRange( wrongConfig, m_precGvdRotationParam           , MINVAL , MAXVAL, "prec_gvd_rotation_param"          );
1698  xCheckCfgRange( wrongConfig, m_precGvdTranslationParam        , MINVAL , MAXVAL, "prec_gvd_translation_param"       );
1699  xCheckCfgRange( wrongConfig, m_signGvdFocalLengthX[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_x"          );
1700  xCheckCfgRange( wrongConfig, m_expGvdFocalLengthX[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_x"           );
1701  xCheckCfgRange( wrongConfig, m_manGvdFocalLengthX[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_x"           );
1702  xCheckCfgRange( wrongConfig, m_signGvdFocalLengthY[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_y"          );
1703  xCheckCfgRange( wrongConfig, m_expGvdFocalLengthY[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_y"           );
1704  xCheckCfgRange( wrongConfig, m_manGvdFocalLengthY[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_y"           );
1705  xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointX[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_x"       );
1706  xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_x"        );
1707  xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_x"        );
1708  xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointY[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_y"       );
1709  xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_y"        );
1710  xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_y"        );
1711  xCheckCfgRange( wrongConfig, m_signGvdR[i][j][k]              , MINVAL , MAXVAL, "sign_gvd_r"                       );
1712  xCheckCfgRange( wrongConfig, m_expGvdR[i][j][k]               , MINVAL , MAXVAL, "exp_gvd_r"                        );
1713  xCheckCfgRange( wrongConfig, m_manGvdR[i][j][k]               , MINVAL , MAXVAL, "man_gvd_r"                        );
1714  xCheckCfgRange( wrongConfig, m_signGvdTX[i]                   , MINVAL , MAXVAL, "sign_gvd_t_x"                     );
1715  xCheckCfgRange( wrongConfig, m_expGvdTX[i]                    , MINVAL , MAXVAL, "exp_gvd_t_x"                      );
1716  xCheckCfgRange( wrongConfig, m_manGvdTX[i]                    , MINVAL , MAXVAL, "man_gvd_t_x"                      );
1717  xCheckCfgRange( wrongConfig, m_minOffsetXInt                  , MINVAL , MAXVAL, "min_offset_x_int"                 );
1718  xCheckCfgRange( wrongConfig, m_minOffsetXFrac                 , MINVAL , MAXVAL, "min_offset_x_frac"                );
1719  xCheckCfgRange( wrongConfig, m_maxOffsetXInt                  , MINVAL , MAXVAL, "max_offset_x_int"                 );
1720  xCheckCfgRange( wrongConfig, m_maxOffsetXFrac                 , MINVAL , MAXVAL, "max_offset_x_frac"                );
1721  xCheckCfgRange( wrongConfig, m_offsetYPresentFlag             , MINVAL , MAXVAL, "offset_y_present_flag"            );
1722  xCheckCfgRange( wrongConfig, m_minOffsetYInt                  , MINVAL , MAXVAL, "min_offset_y_int"                 );
1723  xCheckCfgRange( wrongConfig, m_minOffsetYFrac                 , MINVAL , MAXVAL, "min_offset_y_frac"                );
1724  xCheckCfgRange( wrongConfig, m_maxOffsetYInt                  , MINVAL , MAXVAL, "max_offset_y_int"                 );
1725  xCheckCfgRange( wrongConfig, m_maxOffsetYFrac                 , MINVAL , MAXVAL, "max_offset_y_frac"                );
1726  xCheckCfgRange( wrongConfig, m_warpMapSizePresentFlag         , MINVAL , MAXVAL, "warp_map_size_present_flag"       );
1727  xCheckCfgRange( wrongConfig, m_warpMapWidthMinus2             , MINVAL , MAXVAL, "warp_map_width_minus2"            );
1728  xCheckCfgRange( wrongConfig, m_warpMapHeightMinus2            , MINVAL , MAXVAL, "warp_map_height_minus2"           );
1729
1730  return wrongConfig; 
1731
1732};
1733#endif
1734
1735#endif
Note: See TracBrowser for help on using the repository browser.