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

Last change on this file since 1332 was 1332, checked in by tech, 11 years ago

Fixes.

File size: 92.8 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2015, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \file     #SEI.cpp
35    \brief    helper functions for SEI handling
36*/
37
38#include "CommonDef.h"
39#include "SEI.h"
40#if NH_MV_SEI
41#include "TComSlice.h"
42#endif
43
44SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
45{
46  SEIMessages result;
47
48  for (SEIMessages::iterator it=seiList.begin(); it!=seiList.end(); it++)
49  {
50    if ((*it)->payloadType() == seiType)
51    {
52      result.push_back(*it);
53    }
54  }
55  return result;
56}
57
58SEIMessages extractSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
59{
60  SEIMessages result;
61
62  SEIMessages::iterator it=seiList.begin();
63  while ( it!=seiList.end() )
64  {
65    if ((*it)->payloadType() == seiType)
66    {
67      result.push_back(*it);
68      it = seiList.erase(it);
69    }
70    else
71    {
72      it++;
73    }
74  }
75  return result;
76}
77
78
79Void deleteSEIs (SEIMessages &seiList)
80{
81  for (SEIMessages::iterator it=seiList.begin(); it!=seiList.end(); it++)
82  {
83    delete (*it);
84  }
85  seiList.clear();
86}
87
88void SEIBufferingPeriod::copyTo (SEIBufferingPeriod& target)
89{
90  target.m_bpSeqParameterSetId = m_bpSeqParameterSetId;
91  target.m_rapCpbParamsPresentFlag = m_rapCpbParamsPresentFlag;
92  target.m_cpbDelayOffset = m_cpbDelayOffset;
93  target.m_dpbDelayOffset = m_dpbDelayOffset;
94  target.m_concatenationFlag = m_concatenationFlag;
95  target.m_auCpbRemovalDelayDelta = m_auCpbRemovalDelayDelta;
96  ::memcpy(target.m_initialCpbRemovalDelay, m_initialCpbRemovalDelay, sizeof(m_initialCpbRemovalDelay));
97  ::memcpy(target.m_initialCpbRemovalDelayOffset, m_initialCpbRemovalDelayOffset, sizeof(m_initialCpbRemovalDelayOffset));
98  ::memcpy(target.m_initialAltCpbRemovalDelay, m_initialAltCpbRemovalDelay, sizeof(m_initialAltCpbRemovalDelay));
99  ::memcpy(target.m_initialAltCpbRemovalDelayOffset, m_initialAltCpbRemovalDelayOffset, sizeof(m_initialAltCpbRemovalDelayOffset));
100}
101
102void SEIPictureTiming::copyTo (SEIPictureTiming& target)
103{
104  target.m_picStruct = m_picStruct;
105  target.m_sourceScanType = m_sourceScanType;
106  target.m_duplicateFlag = m_duplicateFlag;
107
108  target.m_auCpbRemovalDelay = m_auCpbRemovalDelay;
109  target.m_picDpbOutputDelay = m_picDpbOutputDelay;
110  target.m_picDpbOutputDuDelay = m_picDpbOutputDuDelay;
111  target.m_numDecodingUnitsMinus1 = m_numDecodingUnitsMinus1;
112  target.m_duCommonCpbRemovalDelayFlag = m_duCommonCpbRemovalDelayFlag;
113  target.m_duCommonCpbRemovalDelayMinus1 = m_duCommonCpbRemovalDelayMinus1;
114
115  target.m_numNalusInDuMinus1 = m_numNalusInDuMinus1;
116  target.m_duCpbRemovalDelayMinus1 = m_duCpbRemovalDelayMinus1;
117}
118
119// Static member
120const Char *SEI::getSEIMessageString(SEI::PayloadType payloadType)
121{
122  switch (payloadType)
123  {
124    case SEI::BUFFERING_PERIOD:                     return "Buffering period";
125    case SEI::PICTURE_TIMING:                       return "Picture timing";
126    case SEI::PAN_SCAN_RECT:                        return "Pan-scan rectangle";                   // not currently decoded
127    case SEI::FILLER_PAYLOAD:                       return "Filler payload";                       // not currently decoded
128    case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return "User data registered";                 // not currently decoded
129    case SEI::USER_DATA_UNREGISTERED:               return "User data unregistered";
130    case SEI::RECOVERY_POINT:                       return "Recovery point";
131    case SEI::SCENE_INFO:                           return "Scene information";                    // not currently decoded
132    case SEI::FULL_FRAME_SNAPSHOT:                  return "Picture snapshot";                     // not currently decoded
133    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return "Progressive refinement segment start"; // not currently decoded
134    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END:   return "Progressive refinement segment end";   // not currently decoded
135    case SEI::FILM_GRAIN_CHARACTERISTICS:           return "Film grain characteristics";           // not currently decoded
136    case SEI::POST_FILTER_HINT:                     return "Post filter hint";                     // not currently decoded
137    case SEI::TONE_MAPPING_INFO:                    return "Tone mapping information";
138    case SEI::KNEE_FUNCTION_INFO:                   return "Knee function information";
139    case SEI::FRAME_PACKING:                        return "Frame packing arrangement";
140    case SEI::DISPLAY_ORIENTATION:                  return "Display orientation";
141    case SEI::SOP_DESCRIPTION:                      return "Structure of pictures information";
142    case SEI::ACTIVE_PARAMETER_SETS:                return "Active parameter sets";
143    case SEI::DECODING_UNIT_INFO:                   return "Decoding unit information";
144    case SEI::TEMPORAL_LEVEL0_INDEX:                return "Temporal sub-layer zero index";
145    case SEI::DECODED_PICTURE_HASH:                 return "Decoded picture hash";
146    case SEI::SCALABLE_NESTING:                     return "Scalable nesting";
147    case SEI::REGION_REFRESH_INFO:                  return "Region refresh information";
148    case SEI::NO_DISPLAY:                           return "No display";
149    case SEI::TIME_CODE:                            return "Time code";
150    case SEI::MASTERING_DISPLAY_COLOUR_VOLUME:      return "Mastering display colour volume";
151    case SEI::SEGM_RECT_FRAME_PACKING:              return "Segmented rectangular frame packing arrangement";
152    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return "Temporal motion constrained tile sets";
153    case SEI::CHROMA_SAMPLING_FILTER_HINT:          return "Chroma sampling filter hint";
154#if NH_MV
155    case SEI::COLOUR_REMAPPING_INFO:                     return "Colour remapping information";
156    case SEI::DEINTERLACED_FIELD_IDENTIFICATION:         return "Deinterlaced field identification";
157    case SEI::LAYERS_NOT_PRESENT:                        return "Layers not present";
158    case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:         return "Inter-layer constrained tile sets";
159    case SEI::BSP_NESTING:                               return "Bitstream partition nesting";
160    case SEI::BSP_INITIAL_ARRIVAL_TIME:                  return "Bitstream partition initial arrival time";
161    case SEI::SUB_BITSTREAM_PROPERTY:                    return "Sub-bitstream property";
162    case SEI::ALPHA_CHANNEL_INFO:                        return "Alpha channel information";
163    case SEI::OVERLAY_INFO:                              return "Overlay information"  ;
164    case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:        return "Temporal motion vector prediction constraints";
165    case SEI::FRAME_FIELD_INFO:                          return "Frame-field information";
166    case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: return "3D reference displays information";
167    case SEI::DEPTH_REPRESENTATION_INFO:                 return "Depth representation information";
168    case SEI::MULTIVIEW_SCENE_INFO:                      return "Multiview scene information";
169    case SEI::MULTIVIEW_ACQUISITION_INFO:                return "Multiview acquisition information";
170    case SEI::MULTIVIEW_VIEW_POSITION:                   return "Multiview view position";
171#if NH_3D
172    case SEI::ALTERNATIVE_DEPTH_INFO:                    return "Alternative depth information";
173#endif
174#endif
175    default:                                        return "Unknown";
176  }
177}
178
179#if NH_MV_SEI
180SEI::SEI()
181{
182  m_scalNestSeiContThisSei = NULL;
183}
184
185SEI* SEI::getNewSEIMessage(SEI::PayloadType payloadType)
186{
187  switch (payloadType)
188  {
189#if NH_MV_SEI_TBD
190    //////////////////////////////////////////////////////////////////////////
191    // TBD: Modify version 1 SEIs to use the same interfaces as Annex GFI SEI messages.
192    //////////////////////////////////////////////////////////////////////////
193
194    case SEI::BUFFERING_PERIOD:                     return new SEIBufferingPeriod; 
195    case SEI::PICTURE_TIMING:                       return new SEIPictureTiming;
196    case SEI::PAN_SCAN_RECT:                        return new SEIPanScanRectangle;                    // not currently decoded
197    case SEI::FILLER_PAYLOAD:                       return new SEIFillerPaylod;                       // not currently decoded
198    case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return new SEIUserDataRegistered;                 // not currently decoded
199    case SEI::USER_DATA_UNREGISTERED:               return new SEIuserDataUnregistered; 
200    case SEI::RECOVERY_POINT:                       return new SEIRecoveryPoint;
201    case SEI::SCENE_INFO:                           return new SEISceneInformation;                    // not currently decoded
202    case SEI::FULL_FRAME_SNAPSHOT:                  return new SEIPictureSnapshot;                     // not currently decoded
203    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return new SEIProgressiveRefinementSegmentStart;   // not currently decoded
204    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END:   return new SEIProgressiveRefinementSegmentEnd;     // not currently decoded
205    case SEI::FILM_GRAIN_CHARACTERISTICS:           return new SEIFilmGrainCharacteristics;            // not currently decoded
206    case SEI::POST_FILTER_HINT:                     return new SEIPostFilterHint;                      // not currently decoded
207    case SEI::TONE_MAPPING_INFO:                    return new SEIToneMappingInfo;
208    case SEI::KNEE_FUNCTION_INFO:                   return new SEIKneeFunctionInfo;
209    case SEI::FRAME_PACKING:                        return new SEIFramePacking;
210    case SEI::DISPLAY_ORIENTATION:                  return new SEIDisplayOrientation;
211    case SEI::SOP_DESCRIPTION:                      return new SEISOPDescription;
212    case SEI::ACTIVE_PARAMETER_SETS:                return new SEIActiveParameterSets;
213    case SEI::DECODING_UNIT_INFO:                   return new SEIDecodingUnitInfo;
214    case SEI::TEMPORAL_LEVEL0_INDEX:                return new SEITemporalLevel0Index
215    case SEI::DECODED_PICTURE_HASH:                 return new SEIDecodedPictureHash;
216    case SEI::SCALABLE_NESTING:                     return new SEIScalableNesting;
217    case SEI::REGION_REFRESH_INFO:                  return new SEIRegionRefreshInfo; 
218    case SEI::NO_DISPLAY:                           return new SEINoDisplay;
219    case SEI::TIME_CODE:                            return new SEITimeCode;
220    case SEI::MASTERING_DISPLAY_COLOUR_VOLUME:      return new SEIMasteringDisplayColourVolume;
221    case SEI::SEGM_RECT_FRAME_PACKING:              return new SEISegmentedRectFramePacking;
222    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return new SEITempMotionConstrainedTileSets; 
223    case SEI::CHROMA_SAMPLING_FILTER_HINT:          return new SEIChromaSamplingFilterHint
224#endif
225#if NH_MV_SEI
226#if NH_MV_LAYERS_NOT_PRESENT_SEI
227  case SEI::LAYERS_NOT_PRESENT                    :               return new SEILayersNotPresent;
228#endif
229  case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS     :               return new SEIInterLayerConstrainedTileSets;
230#if NH_MV_SEI_TBD
231  case SEI::BSP_NESTING                           :               return new SEIBspNesting;
232  case SEI::BSP_INITIAL_ARRIVAL_TIME              :               return new SEIBspInitialArrivalTime;
233#endif
234  case SEI::SUB_BITSTREAM_PROPERTY                :               return new SEISubBitstreamProperty;
235#if NH_MV_SEI_TBD
236  case SEI::ALPHA_CHANNEL_INFO                    :               return new SEIAlphaChannelInfo;
237  case SEI::OVERLAY_INFO                          :               return new SEIOverlayInfo;
238#endif
239  case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS    :               return new SEITemporalMvPredictionConstraints;
240#if NH_MV_SEI_TBD
241  case SEI::FRAME_FIELD_INFO                      :               return new SEIFrameFieldInfo;
242  case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:            return new SEIThreeDimensionalReferenceDisplaysInfo;
243  case SEI::DEPTH_REPRESENTATION_INFO             :               return new SEIDepthRepresentationInfo; 
244#endif
245  case SEI::MULTIVIEW_SCENE_INFO                  :               return new SEIMultiviewSceneInfo;
246  case SEI::MULTIVIEW_ACQUISITION_INFO            :               return new SEIMultiviewAcquisitionInfo;
247  case SEI::MULTIVIEW_VIEW_POSITION               :               return new SEIMultiviewViewPosition;
248#if NH_MV_SEI_TBD
249#if NH_3D
250  case SEI::ALTERNATIVE_DEPTH_INFO                :               return new SEIAlternativeDepthInfo;
251#endif
252#endif
253#endif
254  default:                                        assert( false ); return NULL;
255  }
256}
257
258Void SEI::setupFromSlice  ( const TComSlice* slice )
259{
260  xPrintCfgErrorIntro();
261  std::cout << getSEIMessageString( payloadType() ) << "Setup by the encoder is currently not possible. Using the default SEI cfg-file." << std::endl;
262}
263
264SEI* SEI::getCopy() const
265{
266  assert( 0 ); 
267  return NULL;
268}
269
270Void SEI::setupFromCfgFile( const Char* cfgFile )
271{
272  assert( false );
273}
274
275Bool SEI::insertSei( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const
276{
277  Bool insertSeiHere = true;     
278  if( !m_applicableLayerIds.empty() )
279  {
280    insertSeiHere = insertSeiHere && ( std::find( m_applicableLayerIds.begin(), m_applicableLayerIds.end(), curLayerId) != m_applicableLayerIds.end() ) ;
281  }
282  if( !m_applicablePocs     .empty() )
283  {
284    insertSeiHere = insertSeiHere && ( std::find( m_applicablePocs    .begin(), m_applicablePocs    .end(), curPoc    ) != m_applicablePocs    .end() ) ;
285  }
286  if( !m_applicableTids     .empty() )
287  {
288    insertSeiHere = insertSeiHere && ( std::find( m_applicableTids    .begin(), m_applicableTids    .end(), curTid    ) != m_applicableTids    .end() ) ;
289  }
290  if( !m_applicableVclNaluTypes.empty() )
291  {
292    insertSeiHere = insertSeiHere && ( std::find( m_applicableVclNaluTypes.begin(), m_applicableVclNaluTypes.end(), curNaluType) != m_applicableVclNaluTypes.end() ) ;
293  }
294  return insertSeiHere;
295}
296
297Bool SEI::checkCfg( const TComSlice* slice )
298{
299  assert( false ); 
300  return true;
301}
302
303Void SEI::xPrintCfgErrorIntro()
304{
305  std::cout << "Error in configuration of " << getSEIMessageString( payloadType() ) << " SEI: ";
306}
307
308Void SEI::xCheckCfgRange( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName )
309{
310  if ( val < minVal || val > maxVal  )
311  {
312    xPrintCfgErrorIntro();
313    std::cout << "The value of " << seName << "shall be in the range of " << minVal << " to " << maxVal << ", inclusive." << std::endl;       
314    wrongConfig = true;       
315  }
316}
317
318Void SEI::xAddGeneralOpts(po::Options &opts, IntAry1d defAppLayerIds, IntAry1d deftApplicablePocs, 
319                                            IntAry1d defAppTids,     IntAry1d defAppVclNaluTypes, 
320                                            Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder)
321{
322  opts.addOptions()
323    ("PayloadType"            , m_payloadType            , -1                    , "Payload Type"                                                         )
324    ("ApplicableLayerIds"     , m_applicableLayerIds     , defAppLayerIds        , "LayerIds      of layers   to which the SEI is added. (all when empty)")
325    ("ApplicablePocs"         , m_applicablePocs         , deftApplicablePocs    , "POCs          of pictures to which the SEI is added. (all when empty)")
326    ("ApplicableTids"         , m_applicableTids         , defAppTids            , "TIds          of pictures to which the SEI is added. (all when empty)")
327    ("ApplicableVclNaluTypes" , m_applicableVclNaluTypes , defAppVclNaluTypes    , "NaluUnitTypes of picture  to which the SEI is added. (all when empty)")
328    ("SeiNaluId"              , m_seiNaluId              , defSeiNaluId          , "Identifies to which NAL unit  the SEI is added." )
329    ("PositionInSeiNalu"      , m_positionInSeiNalu      , defPositionInSeiNalu  , "Identifies the position within the NAL unit.")
330    ("ModifyByEncoder"        , m_modifyByEncoder        , defModifyByEncoder    , "0: Use payload as specified in cfg file   1: Modify SEI by encoder");
331}
332
333Void SEI::xCheckCfg( Bool& wrongConfig, Bool cond, const Char* errStr )
334{
335  if ( !cond  )
336  {
337    xPrintCfgErrorIntro();
338    std::cout << errStr << std::endl;       
339    wrongConfig = true;       
340  }
341}
342
343
344#if NH_MV_LAYERS_NOT_PRESENT_SEI
345Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile)
346{ 
347  // Set default values
348  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
349
350  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
351  // This SEI message doesn't need to be added by default to any Layer / POC / NAL Unit / T Layer. Not sure if empty is right.
352  defAppLayerIds    .empty( );
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
684#if NH_MV_SEI_TBD
685
686Void SEIAlphaChannelInfo::setupFromSlice  ( const TComSlice* slice )
687{
688  sei.m_alphaChannelCancelFlag =  TBD ;
689  if( !sei.m_alphaChannelCancelFlag )
690  {
691    sei.m_alphaChannelUseIdc =  TBD ;
692    sei.m_alphaChannelBitDepthMinus8 =  TBD ;
693    sei.m_alphaTransparentValue =  TBD ;
694    sei.m_alphaOpaqueValue =  TBD ;
695    sei.m_alphaChannelIncrFlag =  TBD ;
696    sei.m_alphaChannelClipFlag =  TBD ;
697    if( sei.m_alphaChannelClipFlag )
698    {
699      sei.m_alphaChannelClipTypeFlag =  TBD ;
700    }
701  }
702};
703
704Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile)
705{ 
706  // Set default values
707  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
708
709  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
710  defAppLayerIds    .push_back( TBD );
711  defAppPocs        .push_back( TBD );
712  defAppTids        .push_back( TBD );
713  defAppVclNaluTypes.push_back( TBD );
714
715  Int      defSeiNaluId                  = 0; 
716  Int      defPositionInSeiNalu          = 0; 
717  Bool     defModifyByEncoder            = TBD; 
718
719  // Setup config file options
720  po::Options opts;     
721  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
722
723  opts.addOptions()
724    ("AlphaChannelCancelFlag"         , m_alphaChannelCancelFlag           , false                          , "AlphaChannelCancelFlag"           )
725    ("AlphaChannelUseIdc"             , m_alphaChannelUseIdc               , 0                              , "AlphaChannelUseIdc"               )
726    ("AlphaChannelBitDepthMinus8"     , m_alphaChannelBitDepthMinus8       , 0                              , "AlphaChannelBitDepthMinus8"       )
727    ("AlphaTransparentValue"          , m_alphaTransparentValue            , 0                              , "AlphaTransparentValue"            )
728    ("AlphaOpaqueValue"               , m_alphaOpaqueValue                 , 0                              , "AlphaOpaqueValue"                 )
729    ("AlphaChannelIncrFlag"           , m_alphaChannelIncrFlag             , false                          , "AlphaChannelIncrFlag"             )
730    ("AlphaChannelClipFlag"           , m_alphaChannelClipFlag             , false                          , "AlphaChannelClipFlag"             )
731    ("AlphaChannelClipTypeFlag"       , m_alphaChannelClipTypeFlag         , false                          , "AlphaChannelClipTypeFlag"         )
732    ;
733
734  po::setDefaults(opts);
735
736  // Parse the cfg file
737  po::ErrorReporter err;
738  po::parseConfigFile( opts, cfgFile, err );
739
740};
741
742Bool SEIAlphaChannelInfo::checkCfg( const TComSlice* slice )
743{ 
744  // Check config values
745  Bool wrongConfig = false; 
746
747  // TBD: Add constraints on presence of SEI here.
748  xCheckCfg     ( wrongConfig, TBD , "TBD" );
749  xCheckCfg     ( wrongConfig, TBD , "TBD" );
750
751  // TBD: Modify constraints according to the SEI semantics.   
752  xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag         , MINVAL , MAXVAL, "alpha_channel_cancel_flag"        );
753  xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc             , MINVAL , MAXVAL, "alpha_channel_use_idc");
754  xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8     , MINVAL , MAXVAL, "alpha_channel_bit_depth_minus8"   );
755  xCheckCfgRange( wrongConfig, m_alphaTransparentValue          , MINVAL , MAXVAL, "alpha_transparent_value"          );
756  xCheckCfgRange( wrongConfig, m_alphaOpaqueValue               , MINVAL , MAXVAL, "alpha_opaque_value"   );
757  xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag           , MINVAL , MAXVAL, "alpha_channel_incr_flag"          );
758  xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag           , MINVAL , MAXVAL, "alpha_channel_clip_flag"          );
759  xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag       , MINVAL , MAXVAL, "alpha_channel_clip_type_flag"     );
760
761  return wrongConfig; 
762
763};
764
765Void SEIOverlayInfo::setupFromSlice  ( const TComSlice* slice )
766{
767  sei.m_overlayInfoCancelFlag =  TBD ;
768  if( !sei.m_overlayInfoCancelFlag )
769  {
770    sei.m_overlayContentAuxIdMinus128 =  TBD ;
771    sei.m_overlayLabelAuxIdMinus128 =  TBD ;
772    sei.m_overlayAlphaAuxIdMinus128 =  TBD ;
773    sei.m_overlayElementLabelValueLengthMinus8 =  TBD ;
774    sei.m_numOverlaysMinus1 =  TBD ;
775    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
776    {
777      sei.m_overlayIdx[i] =  TBD ;
778      sei.m_languageOverlayPresentFlag[i] =  TBD ;
779      sei.m_overlayContentLayerId[i] =  TBD ;
780      sei.m_overlayLabelPresentFlag[i] =  TBD ;
781      if( sei.m_overlayLabelPresentFlag( i ) )
782      {
783        sei.m_overlayLabelLayerId[i] =  TBD ;
784      }
785      sei.m_overlayAlphaPresentFlag[i] =  TBD ;
786      if( sei.m_overlayAlphaPresentFlag( i ) )
787      {
788        sei.m_overlayAlphaLayerId[i] =  TBD ;
789      }
790      if( sei.m_overlayLabelPresentFlag( i ) )
791      {
792        sei.m_numOverlayElementsMinus1[i] =  TBD ;
793        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
794        {
795          sei.m_overlayElementLabelMin[i][j] =  TBD ;
796          sei.m_overlayElementLabelMax[i][j] =  TBD ;
797        }
798      }
799    }
800    while( !ByteaLigned(() ) );
801    {
802      sei.m_overlayZeroBit =  TBD ;
803    }
804    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
805    {
806      if( sei.m_languageOverlayPresentFlag( i ) )
807      {
808        sei.m_overlayLanguage[i] =  TBD ;
809      }
810      sei.m_overlayName[i] =  TBD ;
811      if( sei.m_overlayLabelPresentFlag( i ) )
812      {
813        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
814        {
815          sei.m_overlayElementName[i][j] =  TBD ;
816        }
817      }
818    }
819    sei.m_overlayInfoPersistenceFlag =  TBD ;
820  }
821};
822
823Void SEIOverlayInfo::setupFromCfgFile(const Char* cfgFile)
824{ 
825  // Set default values
826  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
827
828  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
829  defAppLayerIds    .push_back( TBD );
830  defAppPocs        .push_back( TBD );
831  defAppTids        .push_back( TBD );
832  defAppVclNaluTypes.push_back( TBD );
833
834  Int      defSeiNaluId                  = 0; 
835  Int      defPositionInSeiNalu          = 0; 
836  Bool     defModifyByEncoder            = TBD; 
837
838  // Setup config file options
839  po::Options opts;     
840  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
841
842  opts.addOptions()
843    ("OverlayInfoCancelFlag"          , m_overlayInfoCancelFlag            , false                          , "OverlayInfoCancelFlag"            )
844    ("OverlayContentAuxIdMinus128"    , m_overlayContentAuxIdMinus128      , 0                              , "OverlayContentAuxIdMinus128"      )
845    ("OverlayLabelAuxIdMinus128"      , m_overlayLabelAuxIdMinus128        , 0                              , "OverlayLabelAuxIdMinus128"        )
846    ("OverlayAlphaAuxIdMinus128"      , m_overlayAlphaAuxIdMinus128        , 0                              , "OverlayAlphaAuxIdMinus128"        )
847    ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0                              , "OverlayElementLabelValueLengthMinus8")
848    ("NumOverlaysMinus1"              , m_numOverlaysMinus1                , 0                              , "NumOverlaysMinus1"                )
849    ("OverlayIdx"                     , m_overlayIdx                       , IntAry1d (1,0)                 , "OverlayIdx"                       )
850    ("LanguageOverlayPresentFlag"     , m_languageOverlayPresentFlag       , BoolAry1d(1,0)                 , "LanguageOverlayPresentFlag"       )
851    ("OverlayContentLayerId"          , m_overlayContentLayerId            , IntAry1d (1,0)                 , "OverlayContentLayerId"            )
852    ("OverlayLabelPresentFlag"        , m_overlayLabelPresentFlag          , BoolAry1d(1,0)                 , "OverlayLabelPresentFlag"          )
853    ("OverlayLabelLayerId"            , m_overlayLabelLayerId              , IntAry1d (1,0)                 , "OverlayLabelLayerId"              )
854    ("OverlayAlphaPresentFlag"        , m_overlayAlphaPresentFlag          , BoolAry1d(1,0)                 , "OverlayAlphaPresentFlag"          )
855    ("OverlayAlphaLayerId"            , m_overlayAlphaLayerId              , IntAry1d (1,0)                 , "OverlayAlphaLayerId"              )
856    ("NumOverlayElementsMinus1"       , m_numOverlayElementsMinus1         , IntAry1d (1,0)                 , "NumOverlayElementsMinus1"         )
857    ("OverlayElementLabelMin_%d"      , m_overlayElementLabelMin           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMin"           )
858    ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMax"           )
859    ("OverlayZeroBit"                 , m_overlayZeroBit                   , 0                              , "OverlayZeroBit"                   )
860    ("OverlayLanguage"                , m_overlayLanguage                  , IntAry1d (1,0)                 , "OverlayLanguage"                  )
861    ("OverlayName"                    , m_overlayName                      , IntAry1d (1,0)                 , "OverlayName"                      )
862    ("OverlayElementName_%d"          , m_overlayElementName               , IntAry1d (1,0) ,ADDNUM         , "OverlayElementName"               )
863    ("OverlayInfoPersistenceFlag"     , m_overlayInfoPersistenceFlag       , false                          , "OverlayInfoPersistenceFlag"       )
864    ;
865
866  po::setDefaults(opts);
867
868  // Parse the cfg file
869  po::ErrorReporter err;
870  po::parseConfigFile( opts, cfgFile, err );
871};
872
873Bool SEIOverlayInfo::checkCfg( const TComSlice* slice )
874{ 
875  // Check config values
876  Bool wrongConfig = false; 
877
878  // TBD: Add constraints on presence of SEI here.
879  xCheckCfg     ( wrongConfig, TBD , "TBD" );
880  xCheckCfg     ( wrongConfig, TBD , "TBD" );
881
882  // TBD: Modify constraints according to the SEI semantics.   
883  xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag          , MINVAL , MAXVAL, "overlay_info_cancel_flag"         );
884  xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128    , MINVAL , MAXVAL, "overlay_content_aux_id_minus128"  );
885  xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128      , MINVAL , MAXVAL, "overlay_label_aux_id_minus128"    );
886  xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128      , MINVAL , MAXVAL, "overlay_alpha_aux_id_minus128"    );
887  xCheckCfgRange( wrongConfig, m_overlayElementLabelValueLengthMinus8, MINVAL , MAXVAL, "overlay_element_label_value_length_minus8");
888  xCheckCfgRange( wrongConfig, m_numOverlaysMinus1              , MINVAL , MAXVAL, "num_overlays_minus1"  );
889  xCheckCfgRange( wrongConfig, m_overlayIdx[i]                  , MINVAL , MAXVAL, "overlay_idx"          );
890  xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i]  , MINVAL , MAXVAL, "language_overlay_present_flag"    );
891  xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i]       , MINVAL , MAXVAL, "overlay_content_layer_id"         );
892  xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , MINVAL , MAXVAL, "overlay_label_present_flag"       );
893  xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i]         , MINVAL , MAXVAL, "overlay_label_layer_id"           );
894  xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i]     , MINVAL , MAXVAL, "overlay_alpha_present_flag"       );
895  xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , MINVAL , MAXVAL, "overlay_alpha_layer_id"           );
896  xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , MINVAL , MAXVAL, "num_overlay_elements_minus1"       );
897  xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j]   , MINVAL , MAXVAL, "overlay_element_label_min"        );
898  xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j]   , MINVAL , MAXVAL, "overlay_element_label_max"        );
899  xCheckCfgRange( wrongConfig, m_overlayZeroBit                 , MINVAL , MAXVAL, "overlay_zero_bit"                 );
900  xCheckCfgRange( wrongConfig, m_overlayLanguage[i]             , MINVAL , MAXVAL, "overlay_language"                 );
901  xCheckCfgRange( wrongConfig, m_overlayName[i]                 , MINVAL , MAXVAL, "overlay_name"                     );
902  xCheckCfgRange( wrongConfig, m_overlayElementName[i][j]       , MINVAL , MAXVAL, "overlay_element_name"             );
903  xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag     , MINVAL , MAXVAL, "overlay_info_persistence_flag"    );
904
905  return wrongConfig; 
906
907};
908#endif
909
910Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile)
911{ 
912  // Set default values
913  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
914
915  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
916  defAppLayerIds    .clear    (   ); 
917  defAppPocs        .push_back( 0 );
918  defAppTids        .push_back( 0 );
919  defAppVclNaluTypes.clear    (   );
920
921  Int      defSeiNaluId                  = 0; 
922  Int      defPositionInSeiNalu          = 0; 
923  Bool     defModifyByEncoder            = false; 
924
925  // Setup config file options
926  po::Options opts;     
927  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
928
929  opts.addOptions()
930    ("PrevPicsNotUsedFlag"   , m_prevPicsNotUsedFlag   , false, "PrevPicsNotUsedFlag"    )
931    ("NoIntraLayerColPicFlag", m_noIntraLayerColPicFlag, false, "NoIntraLayerColPicFlag" )
932    ;
933
934  po::setDefaults(opts);
935
936  // Parse the cfg file
937  po::ErrorReporter err;
938  po::parseConfigFile( opts, cfgFile, err );
939};
940
941Bool SEITemporalMvPredictionConstraints::checkCfg( const TComSlice* slice )
942{ 
943  // Check config values
944  Bool wrongConfig = false; 
945
946  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." );
947
948  return wrongConfig; 
949};
950
951#if NH_MV_SEI_TBD
952Void SEIFrameFieldInfo::setupFromCfgFile(const Char* cfgFile)
953{ 
954  // Set default values
955  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
956
957  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
958  defAppLayerIds    .push_back( TBD );
959  defAppPocs        .push_back( TBD );
960  defAppTids        .push_back( TBD );
961  defAppVclNaluTypes.push_back( TBD );
962
963  Int      defSeiNaluId                  = 0;
964  Int      defPositionInSeiNalu          = 0;
965  Bool     defModifyByEncoder            = false;
966
967  // Setup config file options
968  po::Options opts;     
969  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
970
971  opts.addOptions()
972    ("FfinfoPicStruct"     , m_ffinfoPicStruct     , 0     , "FfinfoPicStruct"     )
973    ("FfinfoSourceScanType", m_ffinfoSourceScanType, 0     , "FfinfoSourceScanType")
974    ("FfinfoDuplicateFlag" , m_ffinfoDuplicateFlag , false , "FfinfoDuplicateFlag" )
975    ;
976
977  po::setDefaults(opts);
978
979  // Parse the cfg file
980  po::ErrorReporter err;
981  po::parseConfigFile( opts, cfgFile, err );
982};
983
984
985Bool SEIFrameFieldInfo::checkCfg( const TComSlice* slice )
986{ 
987  // Check config values
988  Bool wrongConfig = false; 
989
990  // TBD: Add constraints on presence of SEI here.
991  xCheckCfg     ( wrongConfig, TBD , "TBD" );
992  xCheckCfg     ( wrongConfig, TBD , "TBD" );
993
994  // TBD: Modify constraints according to the SEI semantics.   
995  xCheckCfgRange( wrongConfig, m_ffinfoPicStruct                , MINVAL , MAXVAL, "ffinfo_pic_struct"                );
996  xCheckCfgRange( wrongConfig, m_ffinfoSourceScanType           , MINVAL , MAXVAL, "ffinfo_source_scan_type"          );
997  xCheckCfgRange( wrongConfig, m_ffinfoDuplicateFlag            , MINVAL , MAXVAL, "ffinfo_duplicate_flag"            );
998
999  return wrongConfig; 
1000
1001};
1002
1003Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromSlice  ( const TComSlice* slice )
1004{
1005  sei.m_precRefDisplayWidth =  TBD ;
1006  sei.m_refViewingDistanceFlag =  TBD ;
1007  if( sei.m_refViewingDistanceFlag )
1008  {
1009    sei.m_precRefViewingDist =  TBD ;
1010  }
1011  sei.m_numRefDisplaysMinus1 =  TBD ;
1012  for( Int i = 0; i  <=  NumRefDisplaysMinus1( ); i++ )
1013  {
1014    sei.m_leftViewId[i] =  TBD ;
1015    sei.m_rightViewId[i] =  TBD ;
1016    sei.m_exponentRefDisplayWidth[i] =  TBD ;
1017    sei.m_mantissaRefDisplayWidth[i] =  TBD ;
1018    if( sei.m_refViewingDistanceFlag )
1019    {
1020      sei.m_exponentRefViewingDistance[i] =  TBD ;
1021      sei.m_mantissaRefViewingDistance[i] =  TBD ;
1022    }
1023    sei.m_additionalShiftPresentFlag[i] =  TBD ;
1024    if( sei.m_additionalShiftPresentFlag( i ) )
1025    {
1026      sei.m_numSampleShiftPlus512[i] =  TBD ;
1027    }
1028  }
1029  sei.m_threeDimensionalReferenceDisplaysExtensionFlag =  TBD ;
1030};
1031
1032Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile)
1033{ 
1034  // Set default values
1035  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1036
1037  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1038  defAppLayerIds    .push_back( TBD );
1039  defAppPocs        .push_back( TBD );
1040  defAppTids        .push_back( TBD );
1041  defAppVclNaluTypes.push_back( TBD );
1042
1043  Int      defSeiNaluId                  = 0; 
1044  Int      defPositionInSeiNalu          = 0; 
1045  Bool     defModifyByEncoder            = TBD; 
1046
1047  // Setup config file options
1048  po::Options opts;     
1049  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1050
1051  opts.addOptions()
1052    ("PrecRefDisplayWidth"            , m_precRefDisplayWidth              , 0                              , "PrecRefDisplayWidth"              )
1053    ("RefViewingDistanceFlag"         , m_refViewingDistanceFlag           , false                          , "RefViewingDistanceFlag"           )
1054    ("PrecRefViewingDist"             , m_precRefViewingDist               , 0                              , "PrecRefViewingDist"               )
1055    ("NumRefDisplaysMinus1"           , m_numRefDisplaysMinus1             , 0                              , "NumRefDisplaysMinus1"             )
1056    ("LeftViewId"                     , m_leftViewId                       , IntAry1d (1,0)                 , "LeftViewId"                       )
1057    ("RightViewId"                    , m_rightViewId                      , IntAry1d (1,0)                 , "RightViewId"                      )
1058    ("ExponentRefDisplayWidth"        , m_exponentRefDisplayWidth          , IntAry1d (1,0)                 , "ExponentRefDisplayWidth"          )
1059    ("MantissaRefDisplayWidth"        , m_mantissaRefDisplayWidth          , IntAry1d (1,0)                 , "MantissaRefDisplayWidth"          )
1060    ("ExponentRefViewingDistance"     , m_exponentRefViewingDistance       , IntAry1d (1,0)                 , "ExponentRefViewingDistance"       )
1061    ("MantissaRefViewingDistance"     , m_mantissaRefViewingDistance       , IntAry1d (1,0)                 , "MantissaRefViewingDistance"       )
1062    ("AdditionalShiftPresentFlag"     , m_additionalShiftPresentFlag       , BoolAry1d(1,0)                 , "AdditionalShiftPresentFlag"       )
1063    ("NumSampleShiftPlus512"          , m_numSampleShiftPlus512            , IntAry1d (1,0)                 , "NumSampleShiftPlus512"            )
1064    ("ThreeDimensionalReferenceDisplaysExtensionFlag", m_threeDimensionalReferenceDisplaysExtensionFlag, false                          , "ThreeDimensionalReferenceDisplaysExtensionFlag")
1065    ;
1066
1067  po::setDefaults(opts);
1068
1069  // Parse the cfg file
1070  po::ErrorReporter err;
1071  po::parseConfigFile( opts, cfgFile, err );
1072};
1073
1074Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice )
1075{ 
1076  // Check config values
1077  Bool wrongConfig = false; 
1078
1079  // TBD: Add constraints on presence of SEI here.
1080  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1081  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1082
1083  // TBD: Modify constraints according to the SEI semantics.   
1084  xCheckCfgRange( wrongConfig, m_precRefDisplayWidth            , MINVAL , MAXVAL, "prec_ref_display_width"           );
1085  xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag         , MINVAL , MAXVAL, "ref_viewing_distance_flag"        );
1086  xCheckCfgRange( wrongConfig, m_precRefViewingDist             , MINVAL , MAXVAL, "prec_ref_viewing_dist"            );
1087  xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1           , MINVAL , MAXVAL, "num_ref_displays_minus1"          );
1088  xCheckCfgRange( wrongConfig, m_leftViewId[i]                  , MINVAL , MAXVAL, "left_view_id"                     );
1089  xCheckCfgRange( wrongConfig, m_rightViewId[i]                 , MINVAL , MAXVAL, "right_view_id"                    );
1090  xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i]     , MINVAL , MAXVAL, "exponent_ref_display_width"       );
1091  xCheckCfgRange( wrongConfig, m_mantissaRefDisplayWidth[i]     , MINVAL , MAXVAL, "mantissa_ref_display_width"       );
1092  xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i]  , MINVAL , MAXVAL, "exponent_ref_viewing_distance"    );
1093  xCheckCfgRange( wrongConfig, m_mantissaRefViewingDistance[i]  , MINVAL , MAXVAL, "mantissa_ref_viewing_distance"    );
1094  xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i]  , MINVAL , MAXVAL, "additional_shift_present_flag"    );
1095  xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i]       , MINVAL , MAXVAL, "num_sample_shift_plus512"         );
1096  xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, MINVAL , MAXVAL, "three_dimensional_reference_displays_extension_flag");
1097
1098  return wrongConfig; 
1099
1100};
1101
1102Void SEIDepthRepresentationInfo::setupFromSlice  ( const TComSlice* slice )
1103{
1104  sei.m_zNearFlag =  TBD ;
1105  sei.m_zFarFlag =  TBD ;
1106  sei.m_dMinFlag =  TBD ;
1107  sei.m_dMaxFlag =  TBD ;
1108  sei.m_depthRepresentationType =  TBD ;
1109  if( sei.m_dMinFlag  | |  sei.m_dMaxFlag )
1110  {
1111    sei.m_disparityRefViewId =  TBD ;
1112  }
1113  if( sei.m_zNearFlag )
1114  {
1115    DepthRepInfoElement(() ZNearSign, ZNearExp, ZNearMantissa, ZNearManLen );
1116  }
1117  if( sei.m_zFarFlag )
1118  {
1119    DepthRepInfoElement(() ZFarSign, ZFarExp, ZFarMantissa, ZFarManLen );
1120  }
1121  if( sei.m_dMinFlag )
1122  {
1123    DepthRepInfoElement(() DMinSign, DMinExp, DMinMantissa, DMinManLen );
1124  }
1125  if( sei.m_dMaxFlag )
1126  {
1127    DepthRepInfoElement(() DMaxSign, DMaxExp, DMaxMantissa, DMaxManLen );
1128  }
1129  if( sei.m_depthRepresentationType  = =  3 )
1130  {
1131    sei.m_depthNonlinearRepresentationNumMinus1 =  TBD ;
1132    for( Int i = 1; i  <=  sei.m_depthNonlinearRepresentationNumMinus1 + 1; i++ )
1133    {
1134      DepthNonlinearRepresentationModel( i );
1135    }
1136  }
1137};
1138
1139Void SEIDepthRepresentationInfo::setupFromCfgFile(const Char* cfgFile)
1140{ 
1141  // Set default values
1142  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1143
1144  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1145  defAppLayerIds    .push_back( TBD );
1146  defAppPocs        .push_back( TBD );
1147  defAppTids        .push_back( TBD );
1148  defAppVclNaluTypes.push_back( TBD );
1149
1150  Int      defSeiNaluId                  = 0; 
1151  Int      defPositionInSeiNalu          = 0; 
1152  Bool     defModifyByEncoder            = TBD; 
1153
1154  // Setup config file options
1155  po::Options opts;     
1156  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1157
1158  opts.addOptions()
1159    ("ZNearFlag"                      , m_zNearFlag                        , false                          , "ZNearFlag"                        )
1160    ("ZFarFlag"                       , m_zFarFlag                         , false                          , "ZFarFlag"                         )
1161    ("DMinFlag"                       , m_dMinFlag                         , false                          , "DMinFlag"                         )
1162    ("DMaxFlag"                       , m_dMaxFlag                         , false                          , "DMaxFlag"                         )
1163    ("DepthRepresentationType"        , m_depthRepresentationType          , 0                              , "DepthRepresentationType"          )
1164    ("DisparityRefViewId"             , m_disparityRefViewId               , 0                              , "DisparityRefViewId"               )
1165    ("DepthNonlinearRepresentationNumMinus1", m_depthNonlinearRepresentationNumMinus1, 0                              , "DepthNonlinearRepresentationNumMinus1")
1166    ;
1167
1168  po::setDefaults(opts);
1169
1170  // Parse the cfg file
1171  po::ErrorReporter err;
1172  po::parseConfigFile( opts, cfgFile, err );
1173};
1174
1175Bool SEIDepthRepresentationInfo::checkCfg( const TComSlice* slice )
1176{ 
1177  // Check config values
1178  Bool wrongConfig = false; 
1179
1180  // TBD: Add constraints on presence of SEI here.
1181  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1182  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1183
1184  // TBD: Modify constraints according to the SEI semantics.   
1185  xCheckCfgRange( wrongConfig, m_zNearFlag                      , MINVAL , MAXVAL, "z_near_flag"                      );
1186  xCheckCfgRange( wrongConfig, m_zFarFlag                       , MINVAL , MAXVAL, "z_far_flag"                       );
1187  xCheckCfgRange( wrongConfig, m_dMinFlag                       , MINVAL , MAXVAL, "d_min_flag"                       );
1188  xCheckCfgRange( wrongConfig, m_dMaxFlag                       , MINVAL , MAXVAL, "d_max_flag"                       );
1189  xCheckCfgRange( wrongConfig, m_depthRepresentationType        , MINVAL , MAXVAL, "depth_representation_type"        );
1190  xCheckCfgRange( wrongConfig, m_disparityRefViewId             , MINVAL , MAXVAL, "disparity_ref_view_id"            );
1191  xCheckCfgRange( wrongConfig, m_depthNonlinearRepresentationNumMinus1, MINVAL , MAXVAL, "depth_nonlinear_representation_num_minus1");
1192
1193  return wrongConfig; 
1194};
1195
1196Void SEIDepthRepInfoElement::setupFromSlice  ( const TComSlice* slice )
1197{
1198  sei.m_daSignFlag =  TBD ;
1199  sei.m_daExponent =  TBD ;
1200  sei.m_daMantissaLenMinus1 =  TBD ;
1201  sei.m_daMantissa =  TBD ;
1202};
1203
1204Void SEIDepthRepInfoElement::setupFromCfgFile(const Char* cfgFile)
1205{ 
1206  // Set default values
1207  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1208
1209  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1210  defAppLayerIds    .push_back( TBD );
1211  defAppPocs        .push_back( TBD );
1212  defAppTids        .push_back( TBD );
1213  defAppVclNaluTypes.push_back( TBD );
1214
1215  Int      defSeiNaluId                  = 0; 
1216  Int      defPositionInSeiNalu          = 0; 
1217  Bool     defModifyByEncoder            = TBD; 
1218
1219  // Setup config file options
1220  po::Options opts;     
1221  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1222
1223  opts.addOptions()
1224    ("DaSignFlag"                     , m_daSignFlag                       , false                          , "DaSignFlag"                       )
1225    ("DaExponent"                     , m_daExponent                       , 0                              , "DaExponent"                       )
1226    ("DaMantissaLenMinus1"            , m_daMantissaLenMinus1              , 0                              , "DaMantissaLenMinus1"              )
1227    ("DaMantissa"                     , m_daMantissa                       , 0                              , "DaMantissa"                       )
1228    ;
1229
1230  po::setDefaults(opts);
1231
1232  // Parse the cfg file
1233  po::ErrorReporter err;
1234  po::parseConfigFile( opts, cfgFile, err );
1235};
1236
1237Bool SEIDepthRepInfoElement::checkCfg( const TComSlice* slice )
1238{ 
1239  // Check config values
1240  Bool wrongConfig = false; 
1241
1242  // TBD: Add constraints on presence of SEI here.
1243  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1244  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1245
1246  // TBD: Modify constraints according to the SEI semantics.   
1247  xCheckCfgRange( wrongConfig, m_daSignFlag                     , MINVAL , MAXVAL, "da_sign_flag"                     );
1248  xCheckCfgRange( wrongConfig, m_daExponent                     , MINVAL , MAXVAL, "da_exponent"                      );
1249  xCheckCfgRange( wrongConfig, m_daMantissaLenMinus1            , MINVAL , MAXVAL, "da_mantissa_len_minus1"           );
1250  xCheckCfgRange( wrongConfig, m_daMantissa                     , MINVAL , MAXVAL, "da_mantissa"                      );
1251
1252  return wrongConfig; 
1253};
1254#endif
1255
1256Void SEIMultiviewSceneInfo::setupFromCfgFile(const Char* cfgFile)
1257{ 
1258  // Set default values
1259  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1260
1261  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
1262  defAppLayerIds      .clear(); 
1263  defAppPocs          .clear(); 
1264  defAppTids          .push_back( 0 );
1265  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
1266
1267  Int      defSeiNaluId                  = 0; 
1268  Int      defPositionInSeiNalu          = 0; 
1269  Bool     defModifyByEncoder            = false; 
1270
1271  // Setup config file options
1272  po::Options opts;     
1273  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1274
1275  opts.addOptions()
1276    ("MinDisparity"                   , m_minDisparity                     , 0                              , "MinDisparity"                     )
1277    ("MaxDisparityRange"              , m_maxDisparityRange                , 0                              , "MaxDisparityRange"                )
1278    ;
1279
1280  po::setDefaults(opts);
1281
1282  // Parse the cfg file
1283  po::ErrorReporter err;
1284  po::parseConfigFile( opts, cfgFile, err ); 
1285};
1286
1287
1288Bool SEIMultiviewSceneInfo::checkCfg( const TComSlice* slice )
1289{ 
1290  // Check config values
1291  Bool wrongConfig = false; 
1292   
1293  xCheckCfg     ( wrongConfig, slice->isIRAP(), "When present, the multiview scene information SEI message shall be associated with an IRAP access unit." );
1294     
1295  xCheckCfgRange( wrongConfig, m_minDisparity              , -1024 , 1023, "min_disparity"                    );
1296  xCheckCfgRange( wrongConfig, m_maxDisparityRange         ,     0 , 2047, "max_disparity_range"              );
1297
1298  return wrongConfig; 
1299
1300};
1301
1302Void SEIMultiviewAcquisitionInfo::setupFromCfgFile(const Char* cfgFile)
1303{ 
1304  // Set default values
1305  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1306
1307  defAppLayerIds    .clear(); 
1308  defAppPocs        .push_back( 0 );
1309  defAppTids        .push_back( 0 );
1310  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
1311 
1312
1313  Int      defSeiNaluId                  = 0; 
1314  Int      defPositionInSeiNalu          = 0; 
1315  Bool     defModifyByEncoder            = false; 
1316
1317  // Setup config file options
1318  po::Options opts;     
1319  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1320
1321  opts.addOptions()
1322    ("IntrinsicParamFlag"               , m_intrinsicParamFlag               , false                              , "IntrinsicParamFlag"               )
1323    ("ExtrinsicParamFlag"               , m_extrinsicParamFlag               , false                              , "ExtrinsicParamFlag"               )
1324    ("IntrinsicParamsEqualFlag"         , m_intrinsicParamsEqualFlag         , false                              , "IntrinsicParamsEqualFlag"         )
1325    ("PrecFocalLength"                  , m_precFocalLength                  , 0                                  , "PrecFocalLength"                  )
1326    ("PrecPrincipalPoint"               , m_precPrincipalPoint               , 0                                  , "PrecPrincipalPoint"               )
1327    ("PrecSkewFactor"                   , m_precSkewFactor                   , 0                                  , "PrecSkewFactor"                   )
1328    ("SignFocalLengthX"                 , m_signFocalLengthX                 , BoolAry1d(1,0)                     , "SignFocalLengthX"                 )
1329    ("ExponentFocalLengthX"             , m_exponentFocalLengthX             , IntAry1d (1,0)                     , "ExponentFocalLengthX"             )
1330    ("MantissaFocalLengthX"             , m_mantissaFocalLengthX             , IntAry1d (1,0)                     , "MantissaFocalLengthX"             )
1331    ("SignFocalLengthY"                 , m_signFocalLengthY                 , BoolAry1d(1,0)                     , "SignFocalLengthY"                 )
1332    ("ExponentFocalLengthY"             , m_exponentFocalLengthY             , IntAry1d (1,0)                     , "ExponentFocalLengthY"             )
1333    ("MantissaFocalLengthY"             , m_mantissaFocalLengthY             , IntAry1d (1,0)                     , "MantissaFocalLengthY"             )
1334    ("SignPrincipalPointX"              , m_signPrincipalPointX              , BoolAry1d(1,0)                     , "SignPrincipalPointX"              )
1335    ("ExponentPrincipalPointX"          , m_exponentPrincipalPointX          , IntAry1d (1,0)                     , "ExponentPrincipalPointX"          )
1336    ("MantissaPrincipalPointX"          , m_mantissaPrincipalPointX          , IntAry1d (1,0)                     , "MantissaPrincipalPointX"          )
1337    ("SignPrincipalPointY"              , m_signPrincipalPointY              , BoolAry1d(1,0)                     , "SignPrincipalPointY"              )
1338    ("ExponentPrincipalPointY"          , m_exponentPrincipalPointY          , IntAry1d (1,0)                     , "ExponentPrincipalPointY"          )
1339    ("MantissaPrincipalPointY"          , m_mantissaPrincipalPointY          , IntAry1d (1,0)                     , "MantissaPrincipalPointY"          )
1340    ("SignSkewFactor"                   , m_signSkewFactor                   , BoolAry1d(1,0)                     , "SignSkewFactor"                   )
1341    ("ExponentSkewFactor"               , m_exponentSkewFactor               , IntAry1d (1,0)                     , "ExponentSkewFactor"               )
1342    ("MantissaSkewFactor"               , m_mantissaSkewFactor               , IntAry1d (1,0)                     , "MantissaSkewFactor"               )
1343    ("PrecRotationParam"                , m_precRotationParam                , 0                                  , "PrecRotationParam"                )
1344    ("PrecTranslationParam"             , m_precTranslationParam             , 0                                  , "PrecTranslationParam"             )
1345    ("SignR_%d_%d"                      , m_signR                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS ,3  , "SignR"                            )
1346    ("ExponentR_%d_%d"                  , m_exponentR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "ExponentR"                        )
1347    ("MantissaR_%d_%d"                  , m_mantissaR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "MantissaR"                        )
1348    ("SignT_%d"                         , m_signT                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS     , "SignT"                            )
1349    ("ExponentT_%d"                     , m_exponentT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "ExponentT"                        )
1350    ("MantissaT_%d"                     , m_mantissaT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "MantissaT"                        )
1351    ;
1352
1353  po::setDefaults(opts);
1354
1355  // Parse the cfg file
1356  po::ErrorReporter err;
1357  po::parseConfigFile( opts, cfgFile, err ); 
1358};
1359
1360UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthXLen( Int i ) const
1361{
1362  return xGetSyntaxElementLen( m_exponentFocalLengthX[i], m_precFocalLength, m_mantissaFocalLengthX[ i ] );
1363}
1364
1365Bool SEIMultiviewAcquisitionInfo::checkCfg( const TComSlice* slice )
1366{ 
1367  // Check config values
1368  Bool wrongConfig = false; 
1369
1370  // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes.   
1371  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." ); 
1372
1373  xCheckCfgRange( wrongConfig, m_precFocalLength         , 0, 31, "prec_focal_length"         );
1374  xCheckCfgRange( wrongConfig, m_precPrincipalPoint      , 0, 31, "prec_principle_point"      );
1375  xCheckCfgRange( wrongConfig, m_precSkewFactor          , 0, 31, "prec_skew_factor"          );
1376
1377  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
1378  { 
1379    xCheckCfgRange( wrongConfig, m_exponentFocalLengthX    [ i ], 0, 62, "exponent_focal_length_x"   );
1380    xCheckCfgRange( wrongConfig, m_exponentFocalLengthY    [ i ], 0, 62, "exponent_focal_length_y"   );
1381    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointX [ i ], 0, 62, "exponent_principal_point_x");
1382    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointY [ i ], 0, 62, "exponent_principal_point_y");
1383    xCheckCfgRange( wrongConfig, m_exponentSkewFactor      [ i ], 0, 62, "exponent_skew_factor"      );
1384  }
1385
1386  xCheckCfgRange( wrongConfig, m_precRotationParam       , 0, 31, "prec_focal_length"         );
1387  xCheckCfgRange( wrongConfig, m_precTranslationParam    , 0, 31, "prec_focal_length"         );
1388
1389  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
1390  { 
1391    for (Int j = 0; j <= 2; j++)
1392    {
1393      xCheckCfgRange( wrongConfig, m_exponentT[i][j]     , 0, 62, "exponent_skew_factor"      );
1394      for (Int k = 0; k <= 2; k++ )
1395      {       
1396        xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y");         
1397      }
1398    }
1399  } 
1400
1401  return wrongConfig; 
1402
1403};
1404
1405UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthYLen( Int i ) const
1406{
1407  return xGetSyntaxElementLen( m_exponentFocalLengthY[i], m_precFocalLength, m_mantissaFocalLengthY[ i ]  );
1408}
1409
1410
1411UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointXLen( Int i ) const
1412{
1413  return xGetSyntaxElementLen( m_exponentPrincipalPointX[i], m_precPrincipalPoint, m_mantissaPrincipalPointX[ i ]  );
1414}
1415
1416UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointYLen( Int i ) const
1417{
1418  return xGetSyntaxElementLen( m_exponentPrincipalPointY[i], m_precPrincipalPoint, m_mantissaPrincipalPointY[ i ] );
1419}
1420
1421UInt SEIMultiviewAcquisitionInfo::getMantissaSkewFactorLen( Int i ) const
1422{
1423  return xGetSyntaxElementLen( m_exponentSkewFactor[ i ], m_precSkewFactor, m_mantissaSkewFactor[ i ] );
1424}
1425
1426UInt SEIMultiviewAcquisitionInfo::getMantissaRLen( Int i, Int j, Int k ) const
1427{
1428  return xGetSyntaxElementLen( m_exponentR[ i ][ j ][ k ], m_precRotationParam, m_mantissaR[ i ][ j] [ k ] );
1429}
1430
1431UInt SEIMultiviewAcquisitionInfo::getMantissaTLen( Int i, Int j ) const
1432{
1433  return xGetSyntaxElementLen( m_exponentT[ i ][ j ], m_precTranslationParam, m_mantissaT[ i ][ j ] );
1434}
1435UInt SEIMultiviewAcquisitionInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
1436{
1437  UInt len; 
1438  if( expo == 0 )
1439  {
1440    len = std::max(0, prec - 30 );
1441  }
1442  else
1443  {
1444    len = std::max( 0, expo + prec - 31 );
1445  }
1446
1447  assert( val >= 0 ); 
1448  assert( val <= ( ( 1 << len )- 1) );
1449  return len; 
1450}
1451
1452Void SEIMultiviewViewPosition::setupFromSlice  ( const TComSlice* slice )
1453{
1454  const TComVPS* vps = slice->getVPS(); 
1455  m_numViewsMinus1 = vps->getNumViews() - 1; 
1456  m_viewPosition.resize( m_numViewsMinus1 + 1 ); 
1457  for (Int i = 0; i <= m_numViewsMinus1; i++ )
1458  {
1459    // Assuming that view ids indicate the position
1460    m_viewPosition[i] = vps->getViewIdVal( i );
1461  }
1462}
1463
1464Void SEIMultiviewViewPosition::setupFromCfgFile(const Char* cfgFile)
1465{ 
1466  // Set default values
1467  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1468
1469  defAppLayerIds    .push_back( 0 );
1470  defAppPocs        .push_back( 0 );
1471  defAppTids        .push_back( 0 );
1472  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES; 
1473
1474  Int      defSeiNaluId                  = 0; 
1475  Int      defPositionInSeiNalu          = 0; 
1476  Bool     defModifyByEncoder            = true; 
1477
1478  // Setup config file options
1479  po::Options opts;     
1480  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1481
1482  opts.addOptions()
1483    ("NumViewsMinus1"         , m_numViewsMinus1                          , 0                       , "NumViewsMinus1")
1484    ("ViewPosition"           , m_viewPosition                            , IntAry1d (1,0)          , "ViewPosition"  ); 
1485  ;
1486
1487  po::setDefaults(opts);
1488
1489  // Parse the cfg file
1490  po::ErrorReporter err;
1491  po::parseConfigFile( opts, cfgFile, err );
1492};
1493
1494Bool SEIMultiviewViewPosition::checkCfg( const TComSlice* slice )
1495{ 
1496  // Check config values
1497  Bool wrongConfig = false; 
1498
1499  // TBD: Add constraints on presence of SEI here.
1500  xCheckCfg     ( wrongConfig, slice->isIRAP() , "When present, the multiview view position SEI message shall be associated with an IRAP access unit."  );
1501
1502  // TBD: Modify constraints according to the SEI semantics.
1503  xCheckCfgRange( wrongConfig, m_numViewsMinus1                 , 0 , 62, "num_views_minus1");
1504  for(Int i = 0; i <= m_numViewsMinus1; i++)
1505  {
1506    xCheckCfgRange( wrongConfig, m_viewPosition[i]                , 0 , 62, "view_position");
1507  }
1508
1509  return wrongConfig; 
1510
1511};
1512
1513#if NH_MV_SEI_TBD
1514Void SEIAlternativeDepthInfo::setupFromSlice  ( const TComSlice* slice )
1515{
1516  sei.m_alternativeDepthInfoCancelFlag =  TBD ;
1517  if( sei.m_alternativeDepthInfoCancelFlag  = =  0 )
1518  {
1519    sei.m_depthType =  TBD ;
1520    if( sei.m_depthType  = =  0 )
1521    {
1522      sei.m_numConstituentViewsGvdMinus1 =  TBD ;
1523      sei.m_depthPresentGvdFlag =  TBD ;
1524      sei.m_zGvdFlag =  TBD ;
1525      sei.m_intrinsicParamGvdFlag =  TBD ;
1526      sei.m_rotationGvdFlag =  TBD ;
1527      sei.m_translationGvdFlag =  TBD ;
1528      if( sei.m_zGvdFlag )
1529      {
1530        for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
1531        {
1532          sei.m_signGvdZNearFlag[i] =  TBD ;
1533          sei.m_expGvdZNear[i] =  TBD ;
1534          sei.m_manLenGvdZNearMinus1[i] =  TBD ;
1535          sei.m_manGvdZNear[i] =  TBD ;
1536          sei.m_signGvdZFarFlag[i] =  TBD ;
1537          sei.m_expGvdZFar[i] =  TBD ;
1538          sei.m_manLenGvdZFarMinus1[i] =  TBD ;
1539          sei.m_manGvdZFar[i] =  TBD ;
1540        }
1541      }
1542      if( sei.m_intrinsicParamGvdFlag )
1543      {
1544        sei.m_precGvdFocalLength =  TBD ;
1545        sei.m_precGvdPrincipalPoint =  TBD ;
1546      }
1547      if( sei.m_rotationGvdFlag )
1548      {
1549        sei.m_precGvdRotationParam =  TBD ;
1550      }
1551      if( sei.m_translationGvdFlag )
1552      {
1553        sei.m_precGvdTranslationParam =  TBD ;
1554      }
1555      for( Int i = 0; i  <=  sei.m_numConstituentViewsGvdMinus1 + 1; i++ )
1556      {
1557        if( sei.m_intrinsicParamGvdFlag )
1558        {
1559          sei.m_signGvdFocalLengthX[i] =  TBD ;
1560          sei.m_expGvdFocalLengthX[i] =  TBD ;
1561          sei.m_manGvdFocalLengthX[i] =  TBD ;
1562          sei.m_signGvdFocalLengthY[i] =  TBD ;
1563          sei.m_expGvdFocalLengthY[i] =  TBD ;
1564          sei.m_manGvdFocalLengthY[i] =  TBD ;
1565          sei.m_signGvdPrincipalPointX[i] =  TBD ;
1566          sei.m_expGvdPrincipalPointX[i] =  TBD ;
1567          sei.m_manGvdPrincipalPointX[i] =  TBD ;
1568          sei.m_signGvdPrincipalPointY[i] =  TBD ;
1569          sei.m_expGvdPrincipalPointY[i] =  TBD ;
1570          sei.m_manGvdPrincipalPointY[i] =  TBD ;
1571        }
1572        if( sei.m_rotationGvdFlag )
1573        {
1574          for( Int j = 10; j  <=  3; j++ ) /* row */
1575          {
1576            for( Int k = 10; k  <=  3; k++ )  /* column */
1577            {
1578              sei.m_signGvdR[i][j][k] =  TBD ;
1579              sei.m_expGvdR[i][j][k] =  TBD ;
1580              sei.m_manGvdR[i][j][k] =  TBD ;
1581            }
1582          }
1583        }
1584        if( sei.m_translationGvdFlag )
1585        {
1586          sei.m_signGvdTX[i] =  TBD ;
1587          sei.m_expGvdTX[i] =  TBD ;
1588          sei.m_manGvdTX[i] =  TBD ;
1589        }
1590      }
1591    }
1592    if( sei.m_depthType  = =  1 )
1593    {
1594      sei.m_minOffsetXInt =  TBD ;
1595      sei.m_minOffsetXFrac =  TBD ;
1596      sei.m_maxOffsetXInt =  TBD ;
1597      sei.m_maxOffsetXFrac =  TBD ;
1598      sei.m_offsetYPresentFlag =  TBD ;
1599      if( sei.m_offsetYPresentFlag )
1600      {
1601        sei.m_minOffsetYInt =  TBD ;
1602        sei.m_minOffsetYFrac =  TBD ;
1603        sei.m_maxOffsetYInt =  TBD ;
1604        sei.m_maxOffsetYFrac =  TBD ;
1605      }
1606      sei.m_warpMapSizePresentFlag =  TBD ;
1607      if( sei.m_warpMapSizePresentFlag )
1608      {
1609        sei.m_warpMapWidthMinus2 =  TBD ;
1610        sei.m_warpMapHeightMinus2 =  TBD ;
1611      }
1612    }
1613  }
1614};
1615Void SEIAlternativeDepthInfo::setupFromCfgFile(const Char* cfgFile)
1616{ 
1617  // Set default values
1618  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
1619
1620  defAppLayerIds    .push_back( TBD );
1621  defAppPocs        .push_back( TBD );
1622  defAppTids        .push_back( TBD );
1623  defAppVclNaluTypes.push_back( TBD );
1624
1625  Int      defSeiNaluId                  = 0; 
1626  Int      defPositionInSeiNalu          = 0; 
1627  Bool     defModifyByEncoder            = TBD; 
1628
1629  // Setup config file options
1630  po::Options opts;     
1631  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder ); 
1632
1633  opts.addOptions()
1634    ("AlternativeDepthInfoCancelFlag"   , m_alternativeDepthInfoCancelFlag   , false                            , "AlternativeDepthInfoCancelFlag"   )
1635    ("DepthType"                        , m_depthType                        , 0                                , "DepthType"                        )
1636    ("NumConstituentViewsGvdMinus1"     , m_numConstituentViewsGvdMinus1     , 0                                , "NumConstituentViewsGvdMinus1"     )
1637    ("DepthPresentGvdFlag"              , m_depthPresentGvdFlag              , false                            , "DepthPresentGvdFlag"              )
1638    ("ZGvdFlag"                         , m_zGvdFlag                         , false                            , "ZGvdFlag"                         )
1639    ("IntrinsicParamGvdFlag"            , m_intrinsicParamGvdFlag            , false                            , "IntrinsicParamGvdFlag"            )
1640    ("RotationGvdFlag"                  , m_rotationGvdFlag                  , false                            , "RotationGvdFlag"                  )
1641    ("TranslationGvdFlag"               , m_translationGvdFlag               , false                            , "TranslationGvdFlag"               )
1642    ("SignGvdZNearFlag"                 , m_signGvdZNearFlag                 , BoolAry1d(1,0)                   , "SignGvdZNearFlag"                 )
1643    ("ExpGvdZNear"                      , m_expGvdZNear                      , IntAry1d (1,0)                   , "ExpGvdZNear"                      )
1644    ("ManLenGvdZNearMinus1"             , m_manLenGvdZNearMinus1             , IntAry1d (1,0)                   , "ManLenGvdZNearMinus1"             )
1645    ("ManGvdZNear"                      , m_manGvdZNear                      , IntAry1d (1,0)                   , "ManGvdZNear"                      )
1646    ("SignGvdZFarFlag"                  , m_signGvdZFarFlag                  , BoolAry1d(1,0)                   , "SignGvdZFarFlag"                  )
1647    ("ExpGvdZFar"                       , m_expGvdZFar                       , IntAry1d (1,0)                   , "ExpGvdZFar"                       )
1648    ("ManLenGvdZFarMinus1"              , m_manLenGvdZFarMinus1              , IntAry1d (1,0)                   , "ManLenGvdZFarMinus1"              )
1649    ("ManGvdZFar"                       , m_manGvdZFar                       , IntAry1d (1,0)                   , "ManGvdZFar"                       )
1650    ("PrecGvdFocalLength"               , m_precGvdFocalLength               , 0                                , "PrecGvdFocalLength"               )
1651    ("PrecGvdPrincipalPoint"            , m_precGvdPrincipalPoint            , 0                                , "PrecGvdPrincipalPoint"            )
1652    ("PrecGvdRotationParam"             , m_precGvdRotationParam             , 0                                , "PrecGvdRotationParam"             )
1653    ("PrecGvdTranslationParam"          , m_precGvdTranslationParam          , 0                                , "PrecGvdTranslationParam"          )
1654    ("SignGvdFocalLengthX"              , m_signGvdFocalLengthX              , BoolAry1d(1,0)                   , "SignGvdFocalLengthX"              )
1655    ("ExpGvdFocalLengthX"               , m_expGvdFocalLengthX               , IntAry1d (1,0)                   , "ExpGvdFocalLengthX"               )
1656    ("ManGvdFocalLengthX"               , m_manGvdFocalLengthX               , IntAry1d (1,0)                   , "ManGvdFocalLengthX"               )
1657    ("SignGvdFocalLengthY"              , m_signGvdFocalLengthY              , BoolAry1d(1,0)                   , "SignGvdFocalLengthY"              )
1658    ("ExpGvdFocalLengthY"               , m_expGvdFocalLengthY               , IntAry1d (1,0)                   , "ExpGvdFocalLengthY"               )
1659    ("ManGvdFocalLengthY"               , m_manGvdFocalLengthY               , IntAry1d (1,0)                   , "ManGvdFocalLengthY"               )
1660    ("SignGvdPrincipalPointX"           , m_signGvdPrincipalPointX           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointX"           )
1661    ("ExpGvdPrincipalPointX"            , m_expGvdPrincipalPointX            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointX"            )
1662    ("ManGvdPrincipalPointX"            , m_manGvdPrincipalPointX            , IntAry1d (1,0)                   , "ManGvdPrincipalPointX"            )
1663    ("SignGvdPrincipalPointY"           , m_signGvdPrincipalPointY           , BoolAry1d(1,0)                   , "SignGvdPrincipalPointY"           )
1664    ("ExpGvdPrincipalPointY"            , m_expGvdPrincipalPointY            , IntAry1d (1,0)                   , "ExpGvdPrincipalPointY"            )
1665    ("ManGvdPrincipalPointY"            , m_manGvdPrincipalPointY            , IntAry1d (1,0)                   , "ManGvdPrincipalPointY"            )
1666    ("SignGvdR"                         , m_signGvdR                         , BoolAry1d(1,0)   ,ADDNUM ,ADDNUM , "SignGvdR"                         )
1667    ("ExpGvdR"                          , m_expGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ExpGvdR"                          )
1668    ("ManGvdR"                          , m_manGvdR                          , IntAry1d (1,0)   ,ADDNUM ,ADDNUM , "ManGvdR"                          )
1669    ("SignGvdTX"                        , m_signGvdTX                        , BoolAry1d(1,0)                   , "SignGvdTX"                        )
1670    ("ExpGvdTX"                         , m_expGvdTX                         , IntAry1d (1,0)                   , "ExpGvdTX"                         )
1671    ("ManGvdTX"                         , m_manGvdTX                         , IntAry1d (1,0)                   , "ManGvdTX"                         )
1672    ("MinOffsetXInt"                    , m_minOffsetXInt                    , 0                                , "MinOffsetXInt"                    )
1673    ("MinOffsetXFrac"                   , m_minOffsetXFrac                   , 0                                , "MinOffsetXFrac"                   )
1674    ("MaxOffsetXInt"                    , m_maxOffsetXInt                    , 0                                , "MaxOffsetXInt"                    )
1675    ("MaxOffsetXFrac"                   , m_maxOffsetXFrac                   , 0                                , "MaxOffsetXFrac"                   )
1676    ("OffsetYPresentFlag"               , m_offsetYPresentFlag               , false                            , "OffsetYPresentFlag"               )
1677    ("MinOffsetYInt"                    , m_minOffsetYInt                    , 0                                , "MinOffsetYInt"                    )
1678    ("MinOffsetYFrac"                   , m_minOffsetYFrac                   , 0                                , "MinOffsetYFrac"                   )
1679    ("MaxOffsetYInt"                    , m_maxOffsetYInt                    , 0                                , "MaxOffsetYInt"                    )
1680    ("MaxOffsetYFrac"                   , m_maxOffsetYFrac                   , 0                                , "MaxOffsetYFrac"                   )
1681    ("WarpMapSizePresentFlag"           , m_warpMapSizePresentFlag           , false                            , "WarpMapSizePresentFlag"           )
1682    ("WarpMapWidthMinus2"               , m_warpMapWidthMinus2               , 0                                , "WarpMapWidthMinus2"               )
1683    ("WarpMapHeightMinus2"              , m_warpMapHeightMinus2              , 0                                , "WarpMapHeightMinus2"              )
1684    ;
1685
1686  po::setDefaults(opts);
1687
1688  // Parse the cfg file
1689  po::ErrorReporter err;
1690  po::parseConfigFile( opts, cfgFile, err );
1691};
1692
1693Bool SEIAlternativeDepthInfo::checkCfg( const TComSlice* slice )
1694{ 
1695  // Check config values
1696  Bool wrongConfig = false; 
1697
1698  // TBD: Add constraints on presence of SEI here.
1699  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1700  xCheckCfg     ( wrongConfig, TBD , "TBD" );
1701
1702  // TBD: Modify constraints according to the SEI semantics.   
1703  xCheckCfgRange( wrongConfig, m_alternativeDepthInfoCancelFlag , MINVAL , MAXVAL, "alternative_depth_info_cancel_flag");
1704  xCheckCfgRange( wrongConfig, m_depthType                      , MINVAL , MAXVAL, "depth_type"                       );
1705  xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1   , MINVAL , MAXVAL, "num_constituent_views_gvd_minus1 ");
1706  xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag            , MINVAL , MAXVAL, "depth_present_gvd_flag"           );
1707  xCheckCfgRange( wrongConfig, m_zGvdFlag                       , MINVAL , MAXVAL, "z_gvd_flag"                       );
1708  xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag          , MINVAL , MAXVAL, "intrinsic_param_gvd_flag"         );
1709  xCheckCfgRange( wrongConfig, m_rotationGvdFlag                , MINVAL , MAXVAL, "rotation_gvd_flag"                );
1710  xCheckCfgRange( wrongConfig, m_translationGvdFlag             , MINVAL , MAXVAL, "translation_gvd_flag"             );
1711  xCheckCfgRange( wrongConfig, m_signGvdZNearFlag[i]            , MINVAL , MAXVAL, "sign_gvd_z_near_flag"             );
1712  xCheckCfgRange( wrongConfig, m_expGvdZNear[i]                 , MINVAL , MAXVAL, "exp_gvd_z_near"                   );
1713  xCheckCfgRange( wrongConfig, m_manLenGvdZNearMinus1[i]        , MINVAL , MAXVAL, "man_len_gvd_z_near_minus1"        );
1714  xCheckCfgRange( wrongConfig, m_manGvdZNear[i]                 , MINVAL , MAXVAL, "man_gvd_z_near"                   );
1715  xCheckCfgRange( wrongConfig, m_signGvdZFarFlag[i]             , MINVAL , MAXVAL, "sign_gvd_z_far_flag"              );
1716  xCheckCfgRange( wrongConfig, m_expGvdZFar[i]                  , MINVAL , MAXVAL, "exp_gvd_z_far"                    );
1717  xCheckCfgRange( wrongConfig, m_manLenGvdZFarMinus1[i]         , MINVAL , MAXVAL, "man_len_gvd_z_far_minus1"         );
1718  xCheckCfgRange( wrongConfig, m_manGvdZFar[i]                  , MINVAL , MAXVAL, "man_gvd_z_far"                    );
1719  xCheckCfgRange( wrongConfig, m_precGvdFocalLength             , MINVAL , MAXVAL, "prec_gvd_focal_length"            );
1720  xCheckCfgRange( wrongConfig, m_precGvdPrincipalPoint          , MINVAL , MAXVAL, "prec_gvd_principal_point"         );
1721  xCheckCfgRange( wrongConfig, m_precGvdRotationParam           , MINVAL , MAXVAL, "prec_gvd_rotation_param"          );
1722  xCheckCfgRange( wrongConfig, m_precGvdTranslationParam        , MINVAL , MAXVAL, "prec_gvd_translation_param"       );
1723  xCheckCfgRange( wrongConfig, m_signGvdFocalLengthX[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_x"          );
1724  xCheckCfgRange( wrongConfig, m_expGvdFocalLengthX[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_x"           );
1725  xCheckCfgRange( wrongConfig, m_manGvdFocalLengthX[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_x"           );
1726  xCheckCfgRange( wrongConfig, m_signGvdFocalLengthY[i]         , MINVAL , MAXVAL, "sign_gvd_focal_length_y"          );
1727  xCheckCfgRange( wrongConfig, m_expGvdFocalLengthY[i]          , MINVAL , MAXVAL, "exp_gvd_focal_length_y"           );
1728  xCheckCfgRange( wrongConfig, m_manGvdFocalLengthY[i]          , MINVAL , MAXVAL, "man_gvd_focal_length_y"           );
1729  xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointX[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_x"       );
1730  xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_x"        );
1731  xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointX[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_x"        );
1732  xCheckCfgRange( wrongConfig, m_signGvdPrincipalPointY[i]      , MINVAL , MAXVAL, "sign_gvd_principal_point_y"       );
1733  xCheckCfgRange( wrongConfig, m_expGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "exp_gvd_principal_point_y"        );
1734  xCheckCfgRange( wrongConfig, m_manGvdPrincipalPointY[i]       , MINVAL , MAXVAL, "man_gvd_principal_point_y"        );
1735  xCheckCfgRange( wrongConfig, m_signGvdR[i][j][k]              , MINVAL , MAXVAL, "sign_gvd_r"                       );
1736  xCheckCfgRange( wrongConfig, m_expGvdR[i][j][k]               , MINVAL , MAXVAL, "exp_gvd_r"                        );
1737  xCheckCfgRange( wrongConfig, m_manGvdR[i][j][k]               , MINVAL , MAXVAL, "man_gvd_r"                        );
1738  xCheckCfgRange( wrongConfig, m_signGvdTX[i]                   , MINVAL , MAXVAL, "sign_gvd_t_x"                     );
1739  xCheckCfgRange( wrongConfig, m_expGvdTX[i]                    , MINVAL , MAXVAL, "exp_gvd_t_x"                      );
1740  xCheckCfgRange( wrongConfig, m_manGvdTX[i]                    , MINVAL , MAXVAL, "man_gvd_t_x"                      );
1741  xCheckCfgRange( wrongConfig, m_minOffsetXInt                  , MINVAL , MAXVAL, "min_offset_x_int"                 );
1742  xCheckCfgRange( wrongConfig, m_minOffsetXFrac                 , MINVAL , MAXVAL, "min_offset_x_frac"                );
1743  xCheckCfgRange( wrongConfig, m_maxOffsetXInt                  , MINVAL , MAXVAL, "max_offset_x_int"                 );
1744  xCheckCfgRange( wrongConfig, m_maxOffsetXFrac                 , MINVAL , MAXVAL, "max_offset_x_frac"                );
1745  xCheckCfgRange( wrongConfig, m_offsetYPresentFlag             , MINVAL , MAXVAL, "offset_y_present_flag"            );
1746  xCheckCfgRange( wrongConfig, m_minOffsetYInt                  , MINVAL , MAXVAL, "min_offset_y_int"                 );
1747  xCheckCfgRange( wrongConfig, m_minOffsetYFrac                 , MINVAL , MAXVAL, "min_offset_y_frac"                );
1748  xCheckCfgRange( wrongConfig, m_maxOffsetYInt                  , MINVAL , MAXVAL, "max_offset_y_int"                 );
1749  xCheckCfgRange( wrongConfig, m_maxOffsetYFrac                 , MINVAL , MAXVAL, "max_offset_y_frac"                );
1750  xCheckCfgRange( wrongConfig, m_warpMapSizePresentFlag         , MINVAL , MAXVAL, "warp_map_size_present_flag"       );
1751  xCheckCfgRange( wrongConfig, m_warpMapWidthMinus2             , MINVAL , MAXVAL, "warp_map_width_minus2"            );
1752  xCheckCfgRange( wrongConfig, m_warpMapHeightMinus2            , MINVAL , MAXVAL, "warp_map_height_minus2"           );
1753
1754  return wrongConfig; 
1755
1756};
1757#endif
1758
1759#endif
Note: See TracBrowser for help on using the repository browser.