Index: /trunk/cfg/3D-HEVC/fullCfg.cfg
===================================================================
--- /trunk/cfg/3D-HEVC/fullCfg.cfg	(revision 1355)
+++ /trunk/cfg/3D-HEVC/fullCfg.cfg	(revision 1356)
@@ -350,4 +350,21 @@
 
 WarnUnknowParameter       : 1
+#========== Supplemental enhancement information ==========
+SeiCfgFileName_0                    :                  
+SeiCfgFileName_1                    :                 
+SeiCfgFileName_2                    :                 
+SeiCfgFileName_3                    :                 
+SeiCfgFileName_4                    :                 
+SeiCfgFileName_5                    :                 
+SeiCfgFileName_6                    :                 
+SeiCfgFileName_7                    :                 
+SeiCfgFileName_8                    :                 
+SeiCfgFileName_9                    :                 
+SeiCfgFileName_10                   :                 
+SeiCfgFileName_11                   :                 
+SeiCfgFileName_12                   :                 
+SeiCfgFileName_13                   :                 
+SeiCfgFileName_14                   :                 
+
 
 ### DO NOT ADD ANYTHING BELOW THIS LINE ###
Index: /trunk/cfg/MV-HEVC/NonCTC/deltaCfg_sei.cfg
===================================================================
--- /trunk/cfg/MV-HEVC/NonCTC/deltaCfg_sei.cfg	(revision 1356)
+++ /trunk/cfg/MV-HEVC/NonCTC/deltaCfg_sei.cfg	(revision 1356)
@@ -0,0 +1,12 @@
+#============== SEI ================================
+SeiCfgFileName_0                    : 
+SeiCfgFileName_1                    :
+SeiCfgFileName_2                    :
+SeiCfgFileName_3                    :
+SeiCfgFileName_4                    :
+SeiCfgFileName_5                    :
+SeiCfgFileName_6                    :
+SeiCfgFileName_7                    :
+SeiCfgFileName_8                    :
+SeiCfgFileName_9                    :
+SeiCfgFileName_10                   :
Index: /trunk/cfg/MV-HEVC/fullCfg.cfg
===================================================================
--- /trunk/cfg/MV-HEVC/fullCfg.cfg	(revision 1355)
+++ /trunk/cfg/MV-HEVC/fullCfg.cfg	(revision 1356)
@@ -307,4 +307,22 @@
 RCForceIntraQP                      : 0                # Rate control: force intra QP to be equal to initial QP
 
+
+#============== SEI ================================
+SeiCfgFileName_0                    :                  
+SeiCfgFileName_1                    :                 
+SeiCfgFileName_2                    :                 
+SeiCfgFileName_3                    :                 
+SeiCfgFileName_4                    :                 
+SeiCfgFileName_5                    :                 
+SeiCfgFileName_6                    :                 
+SeiCfgFileName_7                    :                 
+SeiCfgFileName_8                    :                 
+SeiCfgFileName_9                    :                 
+SeiCfgFileName_10                   :                 
+SeiCfgFileName_11                   :                 
+SeiCfgFileName_12                   :                 
+SeiCfgFileName_13                   :                 
+SeiCfgFileName_14                   :                 
+
 ### DO NOT ADD ANYTHING BELOW THIS LINE ###
 ### DO NOT DELETE THE EMPTY LINE BELOW ###
Index: /trunk/cfg/SEI/alphaChannelInfoSei.cfg
===================================================================
--- /trunk/cfg/SEI/alphaChannelInfoSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/alphaChannelInfoSei.cfg	(revision 1356)
@@ -0,0 +1,25 @@
+
+PayloadType                     : 165
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              :                                # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                              # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : 0                              # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : 19 20                          # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                              #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+AlphaChannelCancelFlag          : 0
+AlphaChannelUseIdc              : 0
+AlphaChannelBitDepthMinus8      : 0
+AlphaTransparentValue           : 0
+AlphaOpaqueValue                : 255
+AlphaChannelIncrFlag            : 0
+AlphaChannelClipFlag            : 0
+AlphaChannelClipTypeFlag        : 0
Index: /trunk/cfg/SEI/alternativeDepthInfoSei_gvd.cfg
===================================================================
--- /trunk/cfg/SEI/alternativeDepthInfoSei_gvd.cfg	(revision 1356)
+++ /trunk/cfg/SEI/alternativeDepthInfoSei_gvd.cfg	(revision 1356)
@@ -0,0 +1,66 @@
+
+PayloadType                     : 181
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : 0                     # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0 24 48 72 96 120 144 168 192 216 240   # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                       # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          :                       # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                               # Identifies to which NAL unit  the SEI is added
+PositionInSeiNalu               : 0                               # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                               # 0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============                     # FP Value by ATM 13.3 SEI dump
+                                                                  # Poznan Street
+#======== Part 0 ============================
+AlternativeDepthInfoCancelFlag  : 0
+DepthType                       : 0                               # 0: NICT-GVD, 1: Nagoya-Warpmap
+NumConstituentViewsGvdMinus1    : 1                               # 1: 3View
+DepthPresentGvdFlag             : 0
+ZGvdFlag                        : 1
+IntrinsicParamGvdFlag           : 1
+RotationGvdFlag                 : 1
+TranslationGvdFlag              : 1
+#======== Part 1 ============================
+SignGvdZNearFlag_0              : 1         1         1           # -34.506386 # -34.506386 # -34.506386
+ExpGvdZNear_0                   : 36        36        36
+ManLenGvdZNearMinus1_0          : 24        24        24
+ManGvdZNear_0                   : 2628136   2628136   2628136
+SignGvdZFarFlag_0               : 1         1         1           # -2760.510889 # -2760.510889 # -2760.510889
+ExpGvdZFar_0                    : 42        42        42
+ManLenGvdZFarMinus1_0           : 24        24        24
+ManGvdZFar_0                    : 11673778  11673778  11673778
+#======== Part 2 ============================
+PrecGvdFocalLength              : 18                              # ATM code embeded value.
+PrecGvdPrincipalPoint           : 18
+PrecGvdRotationParam            : 18
+PrecGvdTranslationParam         : 18
+#======== Part 3 ============================
+SignGvdFocalLengthX_0           : 0         0         0           # 1732.875727 # 1732.875727 # 1732.875727
+ExpGvdFocalLengthX_0            : 41        41        41
+ManGvdFocalLengthX_0            : 185827518 185827518 185827518
+SignGvdFocalLengthY_0           : 0         0         0           # 1729.908923 # 1729.908923 # 1729.908923
+ExpGvdFocalLengthY_0            : 41        41        41
+ManGvdFocalLengthY_0            : 185049788 185049788 185049788
+SignGvdPrincipalPointX_0        : 0         0         0           # 943.231169 # 943.231169 # 943.231169
+ExpGvdPrincipalPointX_0         : 40        40        40
+ManGvdPrincipalPointX_0         : 113044663 113044663 113044663
+SignGvdPrincipalPointY_0        : 0         0         0           # 548.845040 # 548.845040 # 548.845040
+ExpGvdPrincipalPointY_0         : 40        40        40
+ManGvdPrincipalPointY_0         : 9658706   9658706   9658706
+SignGvdR_0_0                    : 0         0         0           # 1.000000 # 0.000000 # 0.000000
+SignGvdR_0_1                    : 0         0         0           # 0.000000 # 1.000000 # 0.000000
+SignGvdR_0_2                    : 0         0         0           # 0.000000 # 0.000000 # 1.000000
+ExpGvdR_0_0                     : 31        0         0
+ExpGvdR_0_1                     : 0         31        0
+ExpGvdR_0_2                     : 0         0         31
+ManGvdR_0_0                     : 0         0         0
+ManGvdR_0_1                     : 0         0         0
+ManGvdR_0_2                     : 0         0         0
+SignGvdTX_0                     : 0         0         0           # 6.372093 # 7.965116 # 4.779070
+ExpGvdTX_0                      : 33        33        33
+ManGvdTX_0                      : 621829    1039431   204228
Index: /trunk/cfg/SEI/alternativeDepthInfoSei_gvd_dancer.cfg
===================================================================
--- /trunk/cfg/SEI/alternativeDepthInfoSei_gvd_dancer.cfg	(revision 1356)
+++ /trunk/cfg/SEI/alternativeDepthInfoSei_gvd_dancer.cfg	(revision 1356)
@@ -0,0 +1,85 @@
+
+PayloadType                     : 181
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : 0                               # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0 24 48 72 96 120 144 168 192 216 240   # 250
+                                                                  # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                                 # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          :                                 # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                               # Identifies to which NAL unit  the SEI is added
+PositionInSeiNalu               : 0                               # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                               # 0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============                     # FP Value by ATM 13.3 SEI dump
+                                                                  # Undo Dancer
+#======== Part 0 ============================
+AlternativeDepthInfoCancelFlag  : 0
+DepthType                       : 0                               # 0: NICT-GVD, 1: Nagoya-Warpmap
+NumConstituentViewsGvdMinus1    : 1                               # 1: 3View
+DepthPresentGvdFlag             : 0
+ZGvdFlag                        : 1
+IntrinsicParamGvdFlag           : 1
+RotationGvdFlag                 : 1
+TranslationGvdFlag              : 1
+#======== Part 1 ============================
+SignGvdZNearFlag_0              : 0         0         0           # 2289.000000 # 2289.000000 # 2289.000000
+ExpGvdZNear_0                   : 42        42        42
+ManLenGvdZNearMinus1_0          : 24        24        24
+ManGvdZNear_0                   : 3948544   3948544   3948544
+SignGvdZFarFlag_0               : 0         0         0           # 213500.000000 # 213500.000000 # 213500.000000
+ExpGvdZFar_0                    : 48        48        48
+ManLenGvdZFarMinus1_0           : 24        24        24
+ManGvdZFar_0                    : 21101568  21101568  21101568
+#======== Part 2 ============================
+PrecGvdFocalLength              : 18                              # ATM code embeded value.
+PrecGvdPrincipalPoint           : 18
+PrecGvdRotationParam            : 18
+PrecGvdTranslationParam         : 18
+#======== Part 3 ============================
+SignGvdFocalLengthX_0           : 0         0         0           # 2302.852542 # 2302.852542 # 2302.852542
+ExpGvdFocalLengthX_0            : 42        42        42
+ManGvdFocalLengthX_0            : 66808064  66808064  66808064
+SignGvdFocalLengthY_0           : 0         0         0           # 2302.852542 # 2302.852542 # 2302.852542
+ExpGvdFocalLengthY_0            : 42        42        42
+ManGvdFocalLengthY_0            : 66808064  66808064  66808064
+SignGvdPrincipalPointX_0        : 0         0         0           # 960.000000 # 960.000000 # 960.000000
+ExpGvdPrincipalPointX_0         : 40        40        40
+ManGvdPrincipalPointX_0         : 117440512 117440512 117440512
+SignGvdPrincipalPointY_0        : 0         0         0           # 540.000000 # 540.000000 # 540.000000
+ExpGvdPrincipalPointY_0         : 40        40        40
+ManGvdPrincipalPointY_0         : 7340032   7340032   7340032
+SignGvdR00_0                    : 0         0         0           # 1.000000 # 1.000000 # 1.000000
+ExpGvdR00_0                     : 31        31        31
+ManGvdR00_0                     : 0         0         0
+SignGvdR01_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR01_0                     : 0         0         0
+ManGvdR01_0                     : 0         0         0
+SignGvdR02_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR02_0                     : 0         0         0
+ManGvdR02_0                     : 0         0         0
+SignGvdR10_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR10_0                     : 0         0         0
+ManGvdR10_0                     : 0         0         0
+SignGvdR11_0                    : 0         0         0           # 1.000000 # 1.000000 # 1.000000
+ExpGvdR11_0                     : 31        31        31
+ManGvdR11_0                     : 0         0         0
+SignGvdR12_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR12_0                     : 0         0         0
+ManGvdR12_0                     : 0         0         0
+SignGvdR20_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR20_0                     : 0         0         0
+ManGvdR20_0                     : 0         0         0
+SignGvdR21_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR21_0                     : 0         0         0
+ManGvdR21_0                     : 0         0         0
+SignGvdR22_0                    : 0         0         0           # 1.000000 # 1.000000 # 1.000000
+ExpGvdR22_0                     : 31        31        31
+ManGvdR22_0                     : 0         0         0
+SignGvdTX_0                     : 0         1         0           # 0.000000 # -80.000000 # 80.000000
+ExpGvdTX_0                      : 0         37        37
+ManGvdTX_0                      : 0         4194303   4194303
Index: /trunk/cfg/SEI/alternativeDepthInfoSei_gvd_street.cfg
===================================================================
--- /trunk/cfg/SEI/alternativeDepthInfoSei_gvd_street.cfg	(revision 1356)
+++ /trunk/cfg/SEI/alternativeDepthInfoSei_gvd_street.cfg	(revision 1356)
@@ -0,0 +1,85 @@
+
+PayloadType                     : 181
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : 0                               # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0 24 48 72 96 120 144 168 192 216 240   # 250
+                                                                  # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                                 # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          :                                 # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                               # Identifies to which NAL unit  the SEI is added
+PositionInSeiNalu               : 0                               # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                               # 0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============                     # FP Value by ATM 13.3 SEI dump
+                                                                  # Poznan Street
+#======== Part 0 ============================
+AlternativeDepthInfoCancelFlag  : 0
+DepthType                       : 0                               # 0: NICT-GVD, 1: Nagoya-Warpmap
+NumConstituentViewsGvdMinus1    : 1                               # 1: 3View
+DepthPresentGvdFlag             : 0
+ZGvdFlag                        : 1
+IntrinsicParamGvdFlag           : 1
+RotationGvdFlag                 : 1
+TranslationGvdFlag              : 1
+#======== Part 1 ============================
+SignGvdZNearFlag_0              : 1         1         1           # -34.506386 # -34.506386 # -34.506386
+ExpGvdZNear_0                   : 36        36        36
+ManLenGvdZNearMinus1_0          : 24        24        24
+ManGvdZNear_0                   : 2628136   2628136   2628136
+SignGvdZFarFlag_0               : 1         1         1           # -2760.510889 # -2760.510889 # -2760.510889
+ExpGvdZFar_0                    : 42        42        42
+ManLenGvdZFarMinus1_0           : 24        24        24
+ManGvdZFar_0                    : 11673778  11673778  11673778
+#======== Part 2 ============================
+PrecGvdFocalLength              : 18                              # ATM code embeded value.
+PrecGvdPrincipalPoint           : 18
+PrecGvdRotationParam            : 18
+PrecGvdTranslationParam         : 18
+#======== Part 3 ============================
+SignGvdFocalLengthX_0           : 0         0         0           # 1732.875727 # 1732.875727 # 1732.875727
+ExpGvdFocalLengthX_0            : 41        41        41
+ManGvdFocalLengthX_0            : 185827518 185827518 185827518
+SignGvdFocalLengthY_0           : 0         0         0           # 1729.908923 # 1729.908923 # 1729.908923
+ExpGvdFocalLengthY_0            : 41        41        41
+ManGvdFocalLengthY_0            : 185049788 185049788 185049788
+SignGvdPrincipalPointX_0        : 0         0         0           # 943.231169 # 943.231169 # 943.231169
+ExpGvdPrincipalPointX_0         : 40        40        40
+ManGvdPrincipalPointX_0         : 113044663 113044663 113044663
+SignGvdPrincipalPointY_0        : 0         0         0           # 548.845040 # 548.845040 # 548.845040
+ExpGvdPrincipalPointY_0         : 40        40        40
+ManGvdPrincipalPointY_0         : 9658706   9658706   9658706
+SignGvdR00_0                    : 0         0         0           # 1.000000 # 1.000000 # 1.000000
+ExpGvdR00_0                     : 31        31        31
+ManGvdR00_0                     : 0         0         0
+SignGvdR01_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR01_0                     : 0         0         0
+ManGvdR01_0                     : 0         0         0
+SignGvdR02_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR02_0                     : 0         0         0
+ManGvdR02_0                     : 0         0         0
+SignGvdR10_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR10_0                     : 0         0         0
+ManGvdR10_0                     : 0         0         0
+SignGvdR11_0                    : 0         0         0           # 1.000000 # 1.000000 # 1.000000
+ExpGvdR11_0                     : 31        31        31
+ManGvdR11_0                     : 0         0         0
+SignGvdR12_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR12_0                     : 0         0         0
+ManGvdR12_0                     : 0         0         0
+SignGvdR20_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR20_0                     : 0         0         0
+ManGvdR20_0                     : 0         0         0
+SignGvdR21_0                    : 0         0         0           # 0.000000 # 0.000000 # 0.000000
+ExpGvdR21_0                     : 0         0         0
+ManGvdR21_0                     : 0         0         0
+SignGvdR22_0                    : 0         0         0           # 1.000000 # 1.000000 # 1.000000
+ExpGvdR22_0                     : 31        31        31
+ManGvdR22_0                     : 0         0         0
+SignGvdTX_0                     : 0         0         0           # 6.372093 # 7.965116 # 4.779070
+ExpGvdTX_0                      : 33        33        33
+ManGvdTX_0                      : 621829    1039431   204228
Index: /trunk/cfg/SEI/alternativeDepthInfoSei_warpmap.cfg
===================================================================
--- /trunk/cfg/SEI/alternativeDepthInfoSei_warpmap.cfg	(revision 1356)
+++ /trunk/cfg/SEI/alternativeDepthInfoSei_warpmap.cfg	(revision 1356)
@@ -0,0 +1,31 @@
+
+PayloadType                     : 181
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              :                             # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  :                             # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                             # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          :                             # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+AlternativeDepthInfoCancelFlag  : 0
+DepthType                       : 1
+MinOffsetXInt                   : -10
+MinOffsetXFrac                  : 50
+MaxOffsetXInt                   : 70
+MaxOffsetXFrac                  : 30
+OffsetYPresentFlag              : 1
+MinOffsetYInt                   : -20
+MinOffsetYFrac                  : 70
+MaxOffsetYInt                   : 30
+MaxOffsetYFrac                  : 154
+WarpMapSizePresentFlag          : 1
+WarpMapWidthMinus2              : 700
+WarpMapHeightMinus2             : 300
Index: /trunk/cfg/SEI/bspInitialArrivalTimeSei.cfg
===================================================================
--- /trunk/cfg/SEI/bspInitialArrivalTimeSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/bspInitialArrivalTimeSei.cfg	(revision 1356)
@@ -0,0 +1,19 @@
+
+PayloadType                     : TBD
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : TBD                            # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : TBD                            # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : TBD                            # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : TBD                            # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : TBD                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+NalInitialArrivalDelay          : 0
+VclInitialArrivalDelay          : 0
Index: /trunk/cfg/SEI/bspNestingSei.cfg
===================================================================
--- /trunk/cfg/SEI/bspNestingSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/bspNestingSei.cfg	(revision 1356)
@@ -0,0 +1,22 @@
+
+PayloadType                     : TBD
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : TBD                            # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : TBD                            # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : TBD                            # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : TBD                            # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : TBD                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+SeiOlsIdx                       : 0
+SeiPartitioningSchemeIdx        : 0
+BspIdx                          : 0
+BspNestingZeroBit               : 0
+NumSeisInBspMinus1              : 0
Index: /trunk/cfg/SEI/depthRepresentationInfoSei.cfg
===================================================================
--- /trunk/cfg/SEI/depthRepresentationInfoSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/depthRepresentationInfoSei.cfg	(revision 1356)
@@ -0,0 +1,39 @@
+PayloadType                     : 177
+
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              :  1 3                           # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                            # POCs          of pictures to which the SEI is added. (all when empty)
+#ApplicableTids                  : 0                            # Tids          of pictures to which the SEI is added. (all when empty)
+#ApplicableVclNaluTypes          : 0                            # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+#======== Payload modification =============
+ModifyByEncoder                 : 1                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+#======== Payload specification =============
+
+#DepthRepresentationInfoSeiPresentFlag_x equal to 1 indicates that the DepthRepresentationInfoSei parameters for layer_x are given below 
+#Each parameter should be named link parametername_xxx , where xxx represents the layerId
+DepthRepresentationInfoSeiPresentFlag_1 : 1
+
+ZNear_1 : 2289.2
+ZFar_1 : 213500
+DepthRepresentationType_1         : 2
+
+
+DepthRepresentationInfoSeiPresentFlag_3 : 1
+
+ZNear_3 : 448.251214
+ZFar_3 : 11206.280350
+DMin_3 : 1.891
+DMax_3 : 16.28
+
+DepthRepresentationType_3         : 3
+DisparityRefViewId_3 :  0
+
+DepthNonlinearRepresentationNumMinus1_3 : 4
+DepthNonlinearRepresentationModel_3 : 1  3 4 12 5
+
+
+
Index: /trunk/cfg/SEI/frameFieldInfoSei.cfg
===================================================================
--- /trunk/cfg/SEI/frameFieldInfoSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/frameFieldInfoSei.cfg	(revision 1356)
@@ -0,0 +1,20 @@
+
+PayloadType                     : TBD
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : TBD                            # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : TBD                            # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : TBD                            # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : TBD                            # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : TBD                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+FfinfoPicStruct                 : 0
+FfinfoSourceScanType            : 0
+FfinfoDuplicateFlag             : 0
Index: /trunk/cfg/SEI/interLayerConstrainedTileSetsSei.cfg
===================================================================
--- /trunk/cfg/SEI/interLayerConstrainedTileSetsSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/interLayerConstrainedTileSetsSei.cfg	(revision 1356)
@@ -0,0 +1,34 @@
+
+PayloadType                     : 161
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              :                                # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                              # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                                # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          :                                # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                              #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+IlAllTilesExactSampleValueMatchFlag: 0
+IlOneTilePerTileSetFlag         : 0
+IlNumSetsInMessageMinus1        : 3
+SkippedTileSetPresentFlag       : 0
+IlctsId                         : 0 1 2 2
+IlNumTileRectsInSetMinus1       : 1 2 3 3
+IlTopLeftTileIndex_0            : 0 0
+IlTopLeftTileIndex_1            : 0 0 0
+IlTopLeftTileIndex_2            : 0 1 2 0
+IlTopLeftTileIndex_3            : 0 2 2 0
+IlBottomRightTileIndex_0        : 5 1
+IlBottomRightTileIndex_1        : 0 1 1 
+IlBottomRightTileIndex_2        : 5 6 8 1
+IlBottomRightTileIndex_3        : 0 4 3 1
+IlcIdc                          : 0 0 0 0
+IlExactSampleValueMatchFlag     : 0 0 0 0 
+AllTilesIlcIdc                  : 0
Index: /trunk/cfg/SEI/layersNotPresentSei.cfg
===================================================================
--- /trunk/cfg/SEI/layersNotPresentSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/layersNotPresentSei.cfg	(revision 1356)
@@ -0,0 +1,19 @@
+
+PayloadType                     : 160
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : 0                              # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                              # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : 0                              # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : 19 20                          # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                               #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+LnpSeiActiveVpsId               : 0
+LayerNotPresentFlag             : 0 0 0                           # All layers present
Index: /trunk/cfg/SEI/multiviewAcquisitionInfoSei.cfg
===================================================================
--- /trunk/cfg/SEI/multiviewAcquisitionInfoSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/multiviewAcquisitionInfoSei.cfg	(revision 1356)
@@ -0,0 +1,55 @@
+PayloadType                     : 179
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              :                                # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                              # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : 0                              # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : 19 20                          # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+IntrinsicParamFlag              : 1
+ExtrinsicParamFlag              : 1
+IntrinsicParamsEqualFlag        : 1
+PrecFocalLength                 : 31
+PrecPrincipalPoint              : 31
+PrecSkewFactor                  : 31
+SignFocalLengthX                : 0
+ExponentFocalLengthX            : 0
+MantissaFocalLengthX            : 0
+SignFocalLengthY                : 0
+ExponentFocalLengthY            : 0
+MantissaFocalLengthY            : 0
+SignPrincipalPointX             : 0
+ExponentPrincipalPointX         : 0
+MantissaPrincipalPointX         : 0
+SignPrincipalPointY             : 0
+ExponentPrincipalPointY         : 0
+MantissaPrincipalPointY         : 0
+SignSkewFactor                  : 0
+ExponentSkewFactor              : 0
+MantissaSkewFactor              : 0
+PrecRotationParam               : 31
+PrecTranslationParam            : 31
+
+SignR_0_0                       : 0 1 0
+SignR_0_1                       : 1 0 0
+SignR_0_2                       : 0 1 1
+
+ExponentR_0_0                   : 10 20 11
+ExponentR_0_1                   : 10 5 11
+ExponentR_0_2                   :  2 20 11
+
+MantissaR_0_0                   : 4  9  1
+MantissaR_0_1                   : 0  3  4
+MantissaR_0_2                   : 3  3  7
+
+SignT_0                         : 0  1  0
+ExponentT_0                     : 0 10  5
+MantissaT_0                     : 1  8  9
Index: /trunk/cfg/SEI/multiviewSceneInfoSei.cfg
===================================================================
--- /trunk/cfg/SEI/multiviewSceneInfoSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/multiviewSceneInfoSei.cfg	(revision 1356)
@@ -0,0 +1,19 @@
+
+PayloadType                     : 178
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              :                                # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  :                                # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                                # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : 16 17 18 19 20 21              # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                              #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+MinDisparity                    : -333
+MaxDisparityRange               : 2047
Index: /trunk/cfg/SEI/multiviewViewPositionSei.cfg
===================================================================
--- /trunk/cfg/SEI/multiviewViewPositionSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/multiviewViewPositionSei.cfg	(revision 1356)
@@ -0,0 +1,19 @@
+
+PayloadType                     : 180
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : 0                              # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                              # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : 0                              # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : 19 20                          # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 1                              #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+NumViewsMinus1                  : 2            
+ViewPosition                    : 2 0 1        
Index: /trunk/cfg/SEI/overlayInfoSei.cfg
===================================================================
--- /trunk/cfg/SEI/overlayInfoSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/overlayInfoSei.cfg	(revision 1356)
@@ -0,0 +1,45 @@
+PayloadType                     : 166
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              :                             # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  :                             # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                             # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          :                             # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added.
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+OverlayInfoCancelFlag           : 0
+OverlayContentAuxIdMinus128     : 1
+OverlayLabelAuxIdMinus128       : 2
+OverlayAlphaAuxIdMinus128       : 3
+OverlayElementLabelValueLengthMinus8: 0
+NumOverlaysMinus1               : 1
+OverlayIdx                      : 2 5
+LanguageOverlayPresentFlag      : 0 1
+OverlayContentLayerId           : 0 2
+OverlayLabelPresentFlag         : 1 1
+OverlayLabelLayerId             : 1 3
+OverlayAlphaPresentFlag         : 0 0
+OverlayAlphaLayerId             : 
+NumOverlayElementsMinus1        : 3 0
+OverlayElementLabelMin_0        : 40 100 170 230
+OverlayElementLabelMax_0        : 80 140 210 255
+OverlayElementLabelMin_1        : 40
+OverlayElementLabelMax_1        : 80
+OverlayLanguage_0               : Language overlay 0
+OverlayLanguage_1               : Language overlay 1
+OverlayName_0                   : Overlay 0
+OverlayName_1                   : Overlay 1
+OverlayElementName_0_0          : Overlay 0 Element 0
+OverlayElementName_0_1          : Overlay 0 Element 1
+OverlayElementName_0_2          : Overlay 0 Element 2
+OverlayElementName_0_3          : Overlay 0 Element 3
+OverlayElementName_0_4          : Overlay 0 Element 4
+OverlayElementName_1_0          : Overlay 1 Element 0
+OverlayInfoPersistenceFlag      : 1
Index: /trunk/cfg/SEI/subBitstreamPropertySei.cfg
===================================================================
--- /trunk/cfg/SEI/subBitstreamPropertySei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/subBitstreamPropertySei.cfg	(revision 1356)
@@ -0,0 +1,24 @@
+
+PayloadType                     : 164
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : 0                            # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                            # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : 0                            # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : 19 20                       # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                              #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+SbPropertyActiveVpsId           : 0
+NumAdditionalSubStreamsMinus1   : 0
+SubBitstreamMode                : 0
+OlsIdxToVps                     : 0
+HighestSublayerId               : 0
+AvgSbPropertyBitRate            : 0
+MaxSbPropertyBitRate            : 0
Index: /trunk/cfg/SEI/temporalMvPredictionConstraintsSei.cfg
===================================================================
--- /trunk/cfg/SEI/temporalMvPredictionConstraintsSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/temporalMvPredictionConstraintsSei.cfg	(revision 1356)
@@ -0,0 +1,19 @@
+
+PayloadType                     : TBD
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : TBD                            # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : TBD                            # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : TBD                            # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : TBD                            # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : TBD                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+PrevPicsNotUsedFlag             : 0
+NoIntraLayerColPicFlag          : 0
Index: /trunk/cfg/SEI/threeDimensionalReferenceDisplaysInfoSei.cfg
===================================================================
--- /trunk/cfg/SEI/threeDimensionalReferenceDisplaysInfoSei.cfg	(revision 1356)
+++ /trunk/cfg/SEI/threeDimensionalReferenceDisplaysInfoSei.cfg	(revision 1356)
@@ -0,0 +1,30 @@
+
+PayloadType                     : 176
+
+#======== Applicability  ==========    ( SEI is only send for pictures in intersection )
+ApplicableLayerIds              : 0                              # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  : 0                              # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  : 0                              # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          : 19 20                          # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+
+#======== Position in bit stream  ============
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
+
+#======== Payload modification =============
+ModifyByEncoder                 : 0                              #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+
+#======== Payload specification =============
+PrecRefDisplayWidth             : 2
+RefViewingDistanceFlag          : 1
+PrecRefViewingDist              : 1
+NumRefDisplaysMinus1            : 0
+LeftViewId                      : 3
+RightViewId                     : 1
+ExponentRefDisplayWidth         : 36
+MantissaRefDisplayWidth         : 68
+ExponentRefViewingDistance      : 37
+MantissaRefViewingDistance      : 94
+AdditionalShiftPresentFlag      : 1
+NumSampleShiftPlus512           : 482
+ThreeDimensionalReferenceDisplaysExtensionFlag: 0
Index: /trunk/source/App/TAppDecoder/TAppDecCfg.cpp
===================================================================
--- /trunk/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1355)
+++ /trunk/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1356)
@@ -109,5 +109,9 @@
   ("ForceDecodeBitDepth",       m_forceDecodeBitDepth,                 0U,         "Force the decoder to operate at a particular bit-depth (best effort decoding)")
 #endif
+#if NH_MV_SEI
+  ("OutputDecodedSEIMessagesFilename,m",  m_outputDecodedSEIMessagesFilename,    string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n")
+#else
   ("OutputDecodedSEIMessagesFilename",  m_outputDecodedSEIMessagesFilename,    string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n")
+#endif
   ("ClipOutputVideoToRec709Range",      m_bClipOutputVideoToRec709Range,  false, "If true then clip output video to the Rec. 709 Range on saving")
   ;
Index: /trunk/source/App/TAppDecoder/TAppDecCfg.h
===================================================================
--- /trunk/source/App/TAppDecoder/TAppDecCfg.h	(revision 1355)
+++ /trunk/source/App/TAppDecoder/TAppDecCfg.h	(revision 1356)
@@ -82,13 +82,13 @@
   Int           m_targetOptLayerSetIdx;                 ///< target output layer set index
   Int           m_targetDecLayerSetIdx;
-  Int           m_baseLayerOutputFlag; 
-  Int           m_baseLayerPicOutputFlag; 
-  Int           m_auOutputFlag; 
+  Int           m_baseLayerOutputFlag;
+  Int           m_baseLayerPicOutputFlag;
+  Int           m_auOutputFlag;
   Int           m_maxLayerId;                           ///< maximum nuh_layer_id decoded
-  std::ifstream m_bitstreamFile; 
+  std::ifstream m_bitstreamFile;
   Int           m_highestTid;
   Bool          m_targetDecLayerIdSetFileEmpty;       ///< indication if target layers are given by file
 
-  Bool          m_printVpsInfo;                      ///< Output VPS information 
+  Bool          m_printVpsInfo;                      ///< Output VPS information
   Bool          m_printPicOutput;                     ///< Print information on picture output
   Bool          m_printReceivedNalus;                 ///< Print information on received NAL units
@@ -124,4 +124,7 @@
       m_outputBitDepth[channelTypeIndex] = 0;
     }
+#if NH_3D
+    m_pchScaleOffsetFile = NULL;
+#endif
   }
 
Index: /trunk/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /trunk/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1355)
+++ /trunk/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1356)
@@ -223,4 +223,32 @@
 }
 
+
+#if NH_MV_SEI
+Void TAppEncCfg::xParseSeiCfg()
+{
+  for (Int i = 0; i < MAX_NUM_SEIS; i++)
+  {
+    if ( m_seiCfgFileNames[i] != NULL )
+    {
+      Int payloadType; 
+      po::Options opts;     
+      
+      opts.addOptions()("PayloadType", payloadType,-1, "Payload Type");
+      po::setDefaults(opts);      
+
+      po::ErrorReporter err;
+      err.output_on_unknow_parameter = false; 
+      po::parseConfigFile( opts, m_seiCfgFileNames[i], err );
+      SEI* sei = SEI::getNewSEIMessage( (SEI::PayloadType) payloadType ); 
+      assert( sei != NULL );
+
+      sei->setupFromCfgFile( m_seiCfgFileNames[i] ); 
+
+      m_seiMessages.push_back( sei );
+    }
+  }
+}
+#endif
+
 std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry)     //input
 {
@@ -854,30 +882,29 @@
 #endif  
   ("DimensionIdLen",        m_dimensionIdLen     , cfg_dimensionLength  , "Number of bits used to store dimensions Id")
-  ("ViewOrderIndex",        m_viewOrderIndex     , std::vector<Int>(1,0), "View Order Index per layer")
-  ("ViewId",                m_viewId             , std::vector<Int>(1,0), "View Id per View Order Index")
-  ("AuxId",                 m_auxId              , std::vector<Int>(1,0), "AuxId per layer")
+  ("ViewOrderIndex",                 m_viewOrderIndex              , IntAry1d(1,0),                                 "View Order Index per layer")
+  ("ViewId",                         m_viewId                      , IntAry1d(1,0),                                 "View Id per View Order Index")
+  ("AuxId",                          m_auxId                       , IntAry1d(1,0),                                 "AuxId per layer")
 #if NH_3D
-  ("DepthFlag",             m_depthFlag          , std::vector<Int>(1,0), "Depth Flag")
-#endif
-  ("TargetEncLayerIdList",  m_targetEncLayerIdList, std::vector<Int>(0,0), "LayerIds in Nuh to be encoded")  
-  ("LayerIdInNuh",          m_layerIdInNuh        , std::vector<Int>(1,0), "LayerId in Nuh")  
+  ("DepthFlag",                      m_depthFlag                   , IntAry1d(1,0),                                 "Depth Flag")
+#endif
+  ("TargetEncLayerIdList",           m_targetEncLayerIdList        , IntAry1d(0,0),                                 "LayerIds in Nuh to be encoded")  
+  ("LayerIdInNuh",                   m_layerIdInNuh                , IntAry1d(1,0),                                 "LayerId in Nuh")  
   ("SplittingFlag",         m_splittingFlag       , false                , "Splitting Flag")    
 
   // Layer Sets + Output Layer Sets + Profile Tier Level
   ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")    
-  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set")  
+  ("LayerIdsInSet_%d"              , m_layerIdsInSets              , IntAry1d(1,0) , MAX_VPS_OP_SETS_PLUS1      ,   "LayerIds of Layer set")  
   ("NumAddLayerSets"     , m_numAddLayerSets     , 0                                              , "NumAddLayerSets     ")
-  ("HighestLayerIdxPlus1_%d", m_highestLayerIdxPlus1, std::vector< Int  >(0,0)  ,MAX_VPS_NUM_ADD_LAYER_SETS, "HighestLayerIdxPlus1")
+  ("HighestLayerIdxPlus1_%d"       , m_highestLayerIdxPlus1        , IntAry1d(0,0) , MAX_VPS_NUM_ADD_LAYER_SETS ,   "HighestLayerIdxPlus1")
   ("DefaultTargetOutputLayerIdc"     , m_defaultOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
-  ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets")  
-
-  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set")  
-  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set")  
-  ("AltOutputLayerFlag",    m_altOutputLayerFlag , std::vector<Bool>(1,0), "Alt output layer flag")
+  ("OutputLayerSetIdx"             , m_outputLayerSetIdx           , IntAry1d(0,0)                              ,   "Indices of layer sets used as additional output layer sets")
+  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , IntAry1d(0,0) , MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set")  
+  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet , IntAry1d(0,0) , MAX_VPS_OP_SETS_PLUS1,         "Indices in VPS of output layers in layer set")  
+  ("AltOutputLayerFlag"            , m_altOutputLayerFlag          , BoolAry1d(1,0),                                "Alt output layer flag")
   
-  ("ProfileTierLevelIdx_%d",  m_profileTierLevelIdx, std::vector<Int>(0), MAX_NUM_LAYERS, "Indices to profile level tier for ols")
+  ("ProfileTierLevelIdx_%d"        , m_profileTierLevelIdx         , IntAry1d(0)  , MAX_NUM_LAYERS,                  "Indices to profile level tier for ols")
   // Layer dependencies
-  ("DirectRefLayers_%d",    m_directRefLayers    , std::vector<Int>(0,0), MAX_NUM_LAYERS, "LayerIdx in VPS of direct reference layers")
-  ("DependencyTypes_%d",    m_dependencyTypes    , std::vector<Int>(0,0), MAX_NUM_LAYERS, "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion")
+  ("DirectRefLayers_%d"            , m_directRefLayers             , IntAry1d(0,0), MAX_NUM_LAYERS,                  "LayerIdx in VPS of direct reference layers")
+  ("DependencyTypes_%d"            , m_dependencyTypes             , IntAry1d(0,0), MAX_NUM_LAYERS,                  "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion")
 #endif
   ("SourceWidth,-wdt",                                m_iSourceWidth,                                       0, "Source picture width")
@@ -1143,8 +1170,8 @@
   ("BitRatePresentFlag"          , m_bitRatePresentFlag          , BoolAry1d(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "BitRatePresentFlag per sub layer for the N-th layer set")
   ("PicRatePresentFlag"          , m_picRatePresentFlag          , BoolAry1d(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "PicRatePresentFlag per sub layer for the N-th layer set")
-  ("AvgBitRate"                  , m_avgBitRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "AvgBitRate         per sub layer for the N-th layer set")
-  ("MaxBitRate"                  , m_maxBitRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "MaxBitRate         per sub layer for the N-th layer set")
-  ("ConstantPicRateIdc"          , m_constantPicRateIdc          , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
-  ("AvgPicRate"                  , m_avgPicRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
+  ("AvgBitRate"                  , m_avgBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgBitRate         per sub layer for the N-th layer set")
+  ("MaxBitRate"                  , m_maxBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "MaxBitRate         per sub layer for the N-th layer set")
+  ("ConstantPicRateIdc"          , m_constantPicRateIdc           , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
+  ("AvgPicRate"                  , m_avgPicRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
   ("TilesNotInUseFlag"            , m_tilesNotInUseFlag            , true                                          , "TilesNotInUseFlag            ")
   ("TilesInUseFlag"               , m_tilesInUseFlag               , BoolAry1d(1,false)                   , "TilesInUseFlag               ")
@@ -1154,7 +1181,7 @@
   ("TileBoundariesAlignedFlag"   , m_tileBoundariesAlignedFlag   , BoolAry1d(1,0)  ,MAX_NUM_LAYERS       , "TileBoundariesAlignedFlag    per direct reference for the N-th layer")
   ("IlpRestrictedRefLayersFlag"  , m_ilpRestrictedRefLayersFlag  , false                                           , "IlpRestrictedRefLayersFlag")
-  ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1, std::vector< Int  >(1,0)  ,MAX_NUM_LAYERS       , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer")
+  ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1 , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer")
   ("CtuBasedOffsetEnabledFlag"   , m_ctuBasedOffsetEnabledFlag   , BoolAry1d(1,0)  ,MAX_NUM_LAYERS       , "CtuBasedOffsetEnabledFlag    per direct reference for the N-th layer")
-  ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , std::vector< Int  >(1,0)  ,MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
+  ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1  , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
   ("SingleLayerForNonIrapFlag", m_singleLayerForNonIrapFlag, false                                          , "SingleLayerForNonIrapFlag")
   ("HigherLayerIrapSkipFlag"  , m_higherLayerIrapSkipFlag  , false                                          , "HigherLayerIrapSkipFlag  ")
@@ -1305,12 +1332,15 @@
   ("SEIMasteringDisplayWhitePoint",                   cfg_DisplayWhitePointCode,     cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)")
 #if NH_MV
+#if !NH_MV_SEI
   ("SubBitstreamPropSEIEnabled",                      m_subBistreamPropSEIEnabled,    false                     ,"Enable signaling of sub-bitstream property SEI message")
   ("SEISubBitstreamNumAdditionalSubStreams",          m_sbPropNumAdditionalSubStreams,0                         ,"Number of substreams for which additional information is signalled")
-  ("SEISubBitstreamSubBitstreamMode",                 m_sbPropSubBitstreamMode,       std::vector< Int  >(1,0)  ,"Specifies mode of generation of the i-th sub-bitstream (0 or 1)")
-  ("SEISubBitstreamOutputLayerSetIdxToVps",           m_sbPropOutputLayerSetIdxToVps, std::vector< Int  >(1,0)  ,"Specifies output layer set index of the i-th sub-bitstream ")
-  ("SEISubBitstreamHighestSublayerId",                m_sbPropHighestSublayerId,      std::vector< Int  >(1,0)  ,"Specifies highest TemporalId of the i-th sub-bitstream")
-  ("SEISubBitstreamAvgBitRate",                       m_sbPropAvgBitRate,             std::vector< Int  >(1,0)  ,"Specifies average bit rate of the i-th sub-bitstream")
-  ("SEISubBitstreamMaxBitRate",                       m_sbPropMaxBitRate,             std::vector< Int  >(1,0)  ,"Specifies maximum bit rate of the i-th sub-bitstream")
-
+  ("SEISubBitstreamSubBitstreamMode",                 m_sbPropSubBitstreamMode,       IntAry1d (1,0)            ,"Specifies mode of generation of the i-th sub-bitstream (0 or 1)")
+  ("SEISubBitstreamOutputLayerSetIdxToVps",           m_sbPropOutputLayerSetIdxToVps, IntAry1d (1,0)            ,"Specifies output layer set index of the i-th sub-bitstream ")
+  ("SEISubBitstreamHighestSublayerId",                m_sbPropHighestSublayerId,      IntAry1d (1,0)            ,"Specifies highest TemporalId of the i-th sub-bitstream")
+  ("SEISubBitstreamAvgBitRate",                       m_sbPropAvgBitRate,             IntAry1d (1,0)            ,"Specifies average bit rate of the i-th sub-bitstream")
+  ("SEISubBitstreamMaxBitRate",                       m_sbPropMaxBitRate,             IntAry1d (1,0)            ,"Specifies maximum bit rate of the i-th sub-bitstream")
+#else
+  ("SeiCfgFileName_%d",                               m_seiCfgFileNames,             (Char *) 0 , MAX_NUM_SEIS , "SEI cfg file name %d")
+#endif
   ("OutputVpsInfo",                                   m_outputVpsInfo,                false                     ,"Output information about the layer dependencies and layer sets")
 #endif
@@ -1923,4 +1953,7 @@
   }
 
+#if NH_MV_SEI
+  xParseSeiCfg(); 
+#endif
   if( m_masteringDisplay.colourVolumeSEIEnabled )
   {
@@ -3295,4 +3328,5 @@
   }
   }
+#if !NH_MV_SEI
   // Check input parameters for Sub-bitstream property SEI message
   if( m_subBistreamPropSEIEnabled )
@@ -3312,4 +3346,5 @@
     }
   }
+#endif
 #endif
 
Index: /trunk/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /trunk/source/App/TAppEncoder/TAppEncCfg.h	(revision 1355)
+++ /trunk/source/App/TAppEncoder/TAppEncCfg.h	(revision 1356)
@@ -77,15 +77,15 @@
 // VPS specification
   IntAry2d m_dimIds;                   ///< dimension ids ( pointers to m_viewId and m_depthFlag 
-  std::vector<Int>       m_viewId;                            ///< view id
-  std::vector<Int>       m_viewOrderIndex;                    ///< view order index  
-  std::vector<Int>       m_auxId;                             ///< auxiliary id
+  IntAry1d               m_viewId;                            ///< view id
+  IntAry1d               m_viewOrderIndex;                    ///< view order index  
+  IntAry1d               m_auxId;                             ///< auxiliary id
 #if NH_3D
-  std::vector<Int>       m_depthFlag;                         ///< depth flag
-#endif
-  std::vector<Int>       m_targetEncLayerIdList;              ///< layer Ids in Nuh to be encoded
-  std::vector<Int>       m_layerIdInNuh;                      ///< layer Id in Nuh for each layer 
+  IntAry1d               m_depthFlag;                         ///< depth flag
+#endif
+  IntAry1d               m_targetEncLayerIdList;              ///< layer Ids in Nuh to be encoded
+  IntAry1d               m_layerIdInNuh;                      ///< layer Id in Nuh for each layer 
   Bool                   m_splittingFlag;                     ///< Splitting Flag
   Int                    m_scalabilityMask;                   ///< Mask indicating scalabilities, 1: texture; 3: texture + depth                                                                
-  std::vector<Int>       m_dimensionIdLen;                    ///< Length of scalability dimension s 
+  IntAry1d               m_dimensionIdLen;                    ///< Length of scalability dimension s 
   
 // layer sets   
@@ -95,9 +95,9 @@
   IntAry2d m_highestLayerIdxPlus1;      ///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored)
   Int                    m_defaultOutputLayerIdc;             ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
-  std::vector<Int>       m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets  
+  IntAry1d               m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets  
   IntAry2d m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
   IntAry2d m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets
   IntAry2d               m_profileTierLevelIdx;      ///< Indices of of profile, per layer in layer set
-  std::vector<Bool>      m_altOutputLayerFlag;                ///< Alt output layer flag
+  BoolAry1d              m_altOutputLayerFlag;                ///< Alt output layer flag
 
   // Dependencies
@@ -112,10 +112,10 @@
   Bool m_bitRatePresentVpsFlag;
   Bool m_picRatePresentVpsFlag;
-  std::vector< std::vector<Bool > > m_bitRatePresentFlag;
-  std::vector< std::vector<Bool > > m_picRatePresentFlag;
-  std::vector< std::vector<Int  > > m_avgBitRate;
-  std::vector< std::vector<Int  > > m_maxBitRate;
-  std::vector< std::vector<Int  > > m_constantPicRateIdc;
-  std::vector< std::vector<Int  > > m_avgPicRate;
+  BoolAry2d              m_bitRatePresentFlag;
+  BoolAry2d              m_picRatePresentFlag;
+  IntAry2d               m_avgBitRate;
+  IntAry2d               m_maxBitRate;
+  IntAry2d               m_constantPicRateIdc;
+  IntAry2d               m_avgPicRate;
   Bool                              m_tilesNotInUseFlag; 
   BoolAry1d               m_tilesInUseFlag;
@@ -124,9 +124,9 @@
   BoolAry1d               m_wppInUseFlag;
 
-  std::vector< std::vector<Bool > > m_tileBoundariesAlignedFlag;  
+  BoolAry2d              m_tileBoundariesAlignedFlag;  
   Bool m_ilpRestrictedRefLayersFlag;
-  std::vector< std::vector<Int  > > m_minSpatialSegmentOffsetPlus1;
-  std::vector< std::vector<Bool > > m_ctuBasedOffsetEnabledFlag;
-  std::vector< std::vector<Int  > > m_minHorizontalCtuOffsetPlus1;
+  IntAry2d               m_minSpatialSegmentOffsetPlus1;
+  BoolAry2d              m_ctuBasedOffsetEnabledFlag;
+  IntAry2d               m_minHorizontalCtuOffsetPlus1;
   Bool m_singleLayerForNonIrapFlag;
   Bool m_higherLayerIrapSkipFlag;
@@ -195,5 +195,5 @@
   // coding structure
 #if NH_MV
-  std::vector<Int> m_iIntraPeriod;                            ///< period of I-slice (random access period)
+  IntAry1d  m_iIntraPeriod;                            ///< period of I-slice (random access period)
 #else
   Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
@@ -256,4 +256,8 @@
 #endif
   TComSEIMasteringDisplay m_masteringDisplay;
+#if NH_MV_SEI
+  std::vector<char*>     m_seiCfgFileNames;               ///< SEI message files.
+  SEIMessages            m_seiMessages;                       ///< Buffer for SEI messages. 
+#endif
 
   Bool      m_bUseAdaptiveQP;                                 ///< Flag for enabling QP adaptation based on a psycho-visual model
@@ -509,11 +513,13 @@
   UInt        m_summaryVerboseness;                           ///< Specifies the level of the verboseness of the text output.
 #if NH_MV
+#if !NH_MV_SEI
   Bool              m_subBistreamPropSEIEnabled;
   Int               m_sbPropNumAdditionalSubStreams;
-  std::vector<Int>  m_sbPropSubBitstreamMode;
-  std::vector<Int>  m_sbPropOutputLayerSetIdxToVps;
-  std::vector<Int>  m_sbPropHighestSublayerId;
-  std::vector<Int>  m_sbPropAvgBitRate;
-  std::vector<Int>  m_sbPropMaxBitRate;
+  IntAry1d          m_sbPropSubBitstreamMode;
+  IntAry1d          m_sbPropOutputLayerSetIdxToVps;
+  IntAry1d          m_sbPropHighestSublayerId;
+  IntAry1d          m_sbPropAvgBitRate;
+  IntAry1d          m_sbPropMaxBitRate;
+#endif
   Bool              m_outputVpsInfo;
 #endif
@@ -654,4 +660,7 @@
   Void xPrintVectorElem( Double elem ) { printf(" %5.2f", elem            );};  
   Void xPrintVectorElem( Bool   elem ) { printf(" %d"   , ( elem ? 1 : 0 ));};
+#if NH_MV_SEI
+  Void xParseSeiCfg();
+#endif
 #endif
 #if NH_MV
Index: /trunk/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1355)
+++ /trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1356)
@@ -591,4 +591,5 @@
   m_cTEncTop.setScalableNestingSEIEnabled                         ( m_scalableNestingSEIEnabled );
 #if NH_MV
+#if !NH_MV_SEI
   m_cTEncTop.setSubBitstreamPropSEIEnabled                        ( m_subBistreamPropSEIEnabled );
   if( m_subBistreamPropSEIEnabled )                               
@@ -601,4 +602,5 @@
     m_cTEncTop.setMaxBitRate                                      ( m_sbPropMaxBitRate );
   }
+#endif
 #endif
 
@@ -622,4 +624,8 @@
   m_cTEncTop.setKneeSEIOutputKneePoint                            ( m_kneeSEIOutputKneePoint );
   m_cTEncTop.setMasteringDisplaySEI                               ( m_masteringDisplay );
+
+#if NH_MV_SEI
+  m_cTEncTop.setSeiMessages                                       ( &m_seiMessages ); 
+#endif
 
   m_cTEncTop.setTileUniformSpacingFlag                            ( m_tileUniformSpacingFlag );
Index: /trunk/source/Lib/TAppCommon/program_options_lite.cpp
===================================================================
--- /trunk/source/Lib/TAppCommon/program_options_lite.cpp	(revision 1355)
+++ /trunk/source/Lib/TAppCommon/program_options_lite.cpp	(revision 1356)
@@ -111,5 +111,9 @@
     }
 
+#if NH_MV_SEI
+    static void setOptions(Options::NamesPtrList& opt_list, const std::vector<int> idcs, const string& value, ErrorReporter& error_reporter)
+#else
     static void setOptions(Options::NamesPtrList& opt_list, const string& value, ErrorReporter& error_reporter)
+#endif
     {
       /* multiple options may be registered for the same name:
@@ -117,5 +121,14 @@
       for (Options::NamesPtrList::iterator it = opt_list.begin(); it != opt_list.end(); ++it)
       {
+        #if NH_MV_SEI
+          Bool doParsing = (*it)->opt->checkDim( idcs, error_reporter ); 
+          if ( doParsing )
+          {
+            (*it)->opt->parse(value, idcs, error_reporter);
+          }
+          
+        #else
         (*it)->opt->parse(value, error_reporter);
+        #endif
       }
     }
@@ -277,4 +290,29 @@
     bool OptionWriter::storePair(bool allow_long, bool allow_short, const string& name, const string& value)
     {
+#if NH_MV_SEI
+      std::vector<int> idcs;             
+      
+      std::size_t pos_underscore            = name.find("_" );         
+      std::size_t pos_last_underscore_plus1 = pos_underscore+1;       
+      std::size_t pos_first_underscore      = pos_underscore; 
+
+      while ( pos_underscore != string::npos )
+      {        
+        pos_underscore   = name.find("_", pos_last_underscore_plus1  );         
+        size_t subStrlen = ( pos_underscore == string::npos ) ? string::npos : ( pos_underscore - pos_last_underscore_plus1 );
+        string idx_str   = name.substr( pos_last_underscore_plus1, subStrlen ); 
+        idcs.push_back( atoi( idx_str.c_str()));
+        pos_last_underscore_plus1 = pos_underscore + 1;         
+      } 
+
+      string name_idcs = name.substr(0, pos_first_underscore  );
+      for (size_t i = 0; i < idcs.size(); i++ )
+      {
+        name_idcs += "_%d";
+      }      
+
+      bool found_idcs = false; 
+      Options::NamesMap::iterator opt_it_idcs;
+#endif
       bool found = false;
       Options::NamesMap::iterator opt_it;
@@ -286,4 +324,17 @@
           found = true;
         }
+#if NH_MV_SEI
+        if ( idcs.size() > 0 )
+        {
+          opt_it_idcs = opts.opt_long_map.find(name_idcs);
+          if (opt_it_idcs != opts.opt_long_map.end() )
+          {
+            assert( !found );
+            found = true;
+            found_idcs = true; 
+            opt_it = opt_it_idcs;  
+          }
+        }
+#endif
       }
 
@@ -296,14 +347,45 @@
           found = true;
         }
-      }
-
+#if NH_MV_SEI
+        if ( idcs.size() > 0 )
+        {
+          opt_it = opts.opt_short_map.find(name);
+          if (opt_it != opts.opt_short_map.end())
+          {
+            assert( !found );
+            found = true;
+            found_idcs = true; 
+            opt_it = opt_it_idcs;  
+          }
+        }
+#endif
+      }
+
+#if NH_MV_SEI
+    if ( !found_idcs )
+    {
+      idcs.clear(); 
+    }
+#endif
       if (!found)
       {
+#if NH_MV_SEI
+        if (error_reporter.output_on_unknow_parameter )
+        {       
+#endif
+
         error_reporter.error(where())
           << "Unknown option `" << name << "' (value:`" << value << "')\n";
+#if NH_MV_SEI
+        }
+#endif
         return false;
       }
 
+#if NH_MV_SEI
+      setOptions((*opt_it).second, idcs, value, error_reporter);
+#else
       setOptions((*opt_it).second, value, error_reporter);
+#endif
       return true;
     }
Index: /trunk/source/Lib/TAppCommon/program_options_lite.h
===================================================================
--- /trunk/source/Lib/TAppCommon/program_options_lite.h	(revision 1355)
+++ /trunk/source/Lib/TAppCommon/program_options_lite.h	(revision 1356)
@@ -78,9 +78,16 @@
     struct ErrorReporter
     {
+#if NH_MV_SEI
+      ErrorReporter() : is_errored(0), output_on_unknow_parameter(true)  {}
+#else
       ErrorReporter() : is_errored(0) {}
+#endif
       virtual ~ErrorReporter() {}
       virtual std::ostream& error(const std::string& where);
       virtual std::ostream& warn(const std::string& where);
       bool is_errored;
+#if NH_MV_SEI
+      bool output_on_unknow_parameter;
+#endif
     };
 
@@ -98,6 +105,11 @@
     {
 #if NH_MV      
+#if NH_MV_SEI      
+      OptionBase(const std::string& name, const std::string& desc, bool duplicate = false, std::vector< int > maxdim = std::vector< int >(0) )
+        : opt_string(name), opt_desc(desc), opt_duplicate(duplicate), max_dim( maxdim )
+#else
       OptionBase(const std::string& name, const std::string& desc, bool duplicate = false)
         : opt_string(name), opt_desc(desc), opt_duplicate(duplicate)
+#endif
 #else
       OptionBase(const std::string& name, const std::string& desc)
@@ -109,5 +121,97 @@
 
       /* parse argument arg, to obtain a value for the option */
+#if NH_MV_SEI
+      virtual void parse(const std::string& arg, const std::vector<int>& idcs,  ErrorReporter&) = 0;
+      
+      bool   checkDim( std::vector< int > dims, ErrorReporter& err )
+      {     
+        bool doParsing = true; 
+        if ( dims.size() != max_dim.size() )
+        {
+            err.error(" ") << "Number of indices of `" <<  opt_string << "' not matching. Should be " << max_dim.size() << std::endl; 
+            doParsing = false; 
+        }
+
+        for (size_t i = 0 ; i < dims.size(); i++ )
+        {
+          if ( dims[i] >= max_dim[i] )
+          {
+            if (err.output_on_unknow_parameter )
+            {       
+              err.warn(" ") << "Index " << i  << " of  " <<  opt_string << " should be less than " << max_dim[i] << std::endl;             
+              doParsing = false; 
+            }
+          }
+        }
+        return doParsing; 
+      }
+
+      void   xParseVec( const std::string& arg, BoolAry1d& storage )
+      {        
+        char* pcNextStart = (char*) arg.data();
+        char* pcEnd = pcNextStart + arg.length();
+
+        char* pcOldStart = 0; 
+
+        size_t iIdx = 0; 
+
+        while (pcNextStart < pcEnd)
+        {
+          if ( iIdx < storage.size() )
+          {
+            storage[iIdx] = (strtol(pcNextStart, &pcNextStart,10) != 0);
+          }
+          else
+          {
+            storage.push_back(strtol(pcNextStart, &pcNextStart,10) != 0) ;
+          }
+          iIdx++; 
+
+          if ( errno == ERANGE || (pcNextStart == pcOldStart) )
+          {
+            std::cerr << "Error Parsing Bools: `" << arg << "'" << std::endl;
+            exit(EXIT_FAILURE);
+          };   
+          while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++;  
+          pcOldStart = pcNextStart;
+        }
+      }
+
+      void   xParseVec( const std::string& arg, IntAry1d& storage )
+      {        
+        storage.clear();
+
+        char* pcNextStart = (char*) arg.data();
+        char* pcEnd = pcNextStart + arg.length();
+
+        char* pcOldStart = 0; 
+
+        size_t iIdx = 0; 
+
+
+        while (pcNextStart < pcEnd)
+        {
+
+          if ( iIdx < storage.size() )
+          {
+            storage[iIdx] = (int) strtol(pcNextStart, &pcNextStart,10);
+          }
+          else
+          {
+            storage.push_back( (int) strtol(pcNextStart, &pcNextStart,10)) ;
+          }
+          iIdx++; 
+          if ( errno == ERANGE || (pcNextStart == pcOldStart) )
+          {
+            std::cerr << "Error Parsing Integers: `" << arg << "'" << std::endl;
+            exit(EXIT_FAILURE);
+          };   
+          while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++;  
+          pcOldStart = pcNextStart;
+        }      
+      }
+#else
       virtual void parse(const std::string& arg, ErrorReporter&) = 0;
+#endif
       /* set the argument to the default value */
       virtual void setDefault() = 0;
@@ -117,4 +221,7 @@
 #if NH_MV
       bool        opt_duplicate; 
+#if NH_MV_SEI
+      std::vector<int> max_dim;
+#endif
 #endif
     };
@@ -125,6 +232,11 @@
     {
 #if NH_MV
+#if NH_MV_SEI
+      Option(const std::string& name, T& storage, T default_val, const std::string& desc, bool duplicate = false, std::vector< int > maxdim = std::vector< int >(0) )
+        : OptionBase(name, desc, duplicate, maxdim), opt_storage(storage), opt_default_val(default_val)
+#else
       Option(const std::string& name, T& storage, T default_val, const std::string& desc, bool duplicate = false)
         : OptionBase(name, desc, duplicate), opt_storage(storage), opt_default_val(default_val)
+#endif
 #else
       Option(const std::string& name, T& storage, T default_val, const std::string& desc)
@@ -133,5 +245,9 @@
       {}
 
+#if NH_MV_SEI
+      void parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&);
+#else
       void parse(const std::string& arg, ErrorReporter&);
+#endif
 
       void setDefault()
@@ -147,6 +263,14 @@
     template<typename T>
     inline void
+#if NH_MV_SEI
+    Option<T>::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&)
+#else
     Option<T>::parse(const std::string& arg, ErrorReporter&)
-    {
+#endif
+    {
+#if NH_MV_SEI
+      assert( idcs.size() == 0 ); 
+#endif
+      
       std::istringstream arg_ss (arg,std::istringstream::in);
       arg_ss.exceptions(std::ios::failbit);
@@ -165,6 +289,13 @@
     template<>
     inline void
+#if NH_MV_SEI
+    Option<std::string>::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&)
+#else
     Option<std::string>::parse(const std::string& arg, ErrorReporter&)
-    {
+#endif
+    {
+#if NH_MV_SEI
+      assert( idcs.size() == 0 ); 
+#endif
       opt_storage = arg;
     }
@@ -173,8 +304,17 @@
     template<>
     inline void
+#if NH_MV_SEI
+      Option<char*>::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter&)
+#else
       Option<char*>::parse(const std::string& arg, ErrorReporter&)
-    {
+#endif
+    {
+#if NH_MV_SEI
+      assert( idcs.size() == 0 ); 
+#endif
       opt_storage = arg.empty() ? NULL : strdup(arg.c_str()) ;
     }
+
+#if !NH_MV_SEI
 
     template<>
@@ -198,10 +338,17 @@
       }      
     }
-
+#endif
 
     template<>    
     inline void
+#if NH_MV_SEI
+      Option< std::vector<double> >::parse(const std::string& arg, const std::vector< int > & idcs, ErrorReporter&)
+#else
       Option< std::vector<double> >::parse(const std::string& arg, ErrorReporter&)
-    {
+#endif
+    {
+#if NH_MV_SEI
+      assert( idcs.size() == 0 ); 
+#endif
       char* pcNextStart = (char*) arg.data();
       char* pcEnd = pcNextStart + arg.length();
@@ -236,4 +383,67 @@
     }
 
+
+#if NH_MV_SEI
+    template<>
+    inline void
+      Option< IntAry1d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err)
+    {
+      xParseVec( arg, opt_storage );
+    };
+
+    template<>
+    inline void
+      Option< IntAry2d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter&)
+    {
+      xParseVec( arg, opt_storage[ idcs[0] ] );
+    };
+
+    template<>
+    inline void
+      Option< IntAry3d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter&)
+    {
+      xParseVec ( arg, opt_storage[ idcs[0] ][ idcs[1] ] );
+    };
+#if SEI_DRI_F0169
+    template<>
+    inline void
+    Option< std::vector< std::vector<double> > >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter&)
+    {
+        // xParseVec ( arg, opt_storage[ idcs[0] ] );
+        char* pcNextStart = (char*) arg.data();
+        char* pcEnd = pcNextStart + arg.length();
+
+        char* pcOldStart = 0; 
+
+        size_t iIdx = 0; 
+
+        while (pcNextStart < pcEnd)
+        {
+            errno = 0; 
+
+            if ( iIdx < opt_storage[idcs[0]].size() )
+            {
+                opt_storage[idcs[0]][iIdx] = strtod(pcNextStart, &pcNextStart);
+            }
+            else
+            {
+                opt_storage[idcs[0]].push_back( strtod(pcNextStart, &pcNextStart)) ;
+            }
+            iIdx++; 
+
+            if ( errno == ERANGE || (pcNextStart == pcOldStart) )
+            {
+                std::cerr << "Error Parsing Doubles: `" << arg << "'" << std::endl;
+                exit(EXIT_FAILURE);    
+            };   
+            while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++;  
+            pcOldStart = pcNextStart; 
+
+        }       
+
+
+    }
+#endif
+#else
     template<>
     inline void
@@ -272,6 +482,54 @@
       }
     }
-
-
+#endif
+
+#if NH_MV_SEI
+
+    template<>
+    inline void
+      Option< StringAry1d  >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err )
+    {
+
+      opt_storage[ idcs[ 0 ] ] = arg;
+    };
+
+    template<>
+    inline void
+      Option< StringAry2d  >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err )
+    {
+
+      opt_storage[idcs[0]][idcs[1]] = arg;
+    };
+
+
+    template<>
+    inline void
+      Option< std::vector< char*>  >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err )
+    {
+      
+      opt_storage[ idcs[ 0 ] ] = arg.empty() ? NULL : strdup(arg.c_str()) ;
+    };
+
+    template<>
+    inline void
+      Option< BoolAry1d >::parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& err)
+    {      
+      xParseVec( arg, opt_storage );
+    };
+
+    template<>
+    inline void
+      Option< BoolAry2d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err)
+    {     
+      xParseVec( arg, opt_storage[ idcs[0] ] );
+    };
+
+    template<>
+    inline void
+      Option< BoolAry3d >::parse(const std::string& arg, const IntAry1d& idcs, ErrorReporter& err )
+    {     
+      xParseVec( arg, opt_storage[idcs[0]][idcs[1]] );
+    };
+#else
     template<>
     inline void
@@ -307,4 +565,5 @@
     }
 #endif
+#endif
     /** Option class for argument handling using a user provided function */
     struct OptionFunc : public OptionBase
@@ -316,5 +575,9 @@
       {}
 
+#if NH_MV_SEI
+      void parse(const std::string& arg, const std::vector<int>& idcs, ErrorReporter& error_reporter)
+#else
       void parse(const std::string& arg, ErrorReporter& error_reporter)
+#endif
       {
         func(parent, arg, error_reporter);
@@ -388,4 +651,33 @@
         operator()(const std::string& name, std::vector<T>& storage, T default_val, unsigned uiMaxNum, const std::string& desc = "" )
       {
+#if NH_MV_SEI
+        std::vector<T> defVal;
+        defVal.resize( uiMaxNum, default_val ); 
+        std::vector< int > maxSize; 
+        maxSize.push_back( uiMaxNum ); 
+        parent.addOption(new Option< std::vector<T> >( name, storage, defVal, desc, false, maxSize ));
+
+        return *this;
+      }
+
+      template<typename T>
+      OptionSpecific&
+        operator()(const std::string& name, std::vector< std::vector<T> >& storage, T default_val, unsigned uiMaxNumDim1, unsigned uiMaxNumDim2, const std::string& desc = "" )
+      {
+        std::vector< std::vector<T> > defVal;
+        defVal.resize(uiMaxNumDim1);
+        for ( unsigned int idxDim1 = 0; idxDim1 < uiMaxNumDim1; idxDim1++ )
+        {
+          defVal[ idxDim1 ].resize(uiMaxNumDim2, default_val );          
+        }
+
+        std::vector< int > maxSize; 
+        maxSize.push_back( uiMaxNumDim1 ); 
+        maxSize.push_back( uiMaxNumDim2 ); 
+
+        parent.addOption(new Option< std::vector< std::vector<T> > >( name, storage, defVal, desc, false, maxSize ));
+        return *this;
+      }
+#else
         std::string cNameBuffer;
         std::string cDescBuffer;
@@ -415,4 +707,5 @@
         return *this;
       }
+#endif
 #endif
       /**
Index: /trunk/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- /trunk/source/Lib/TLibCommon/CommonDef.h	(revision 1355)
+++ /trunk/source/Lib/TLibCommon/CommonDef.h	(revision 1356)
@@ -173,4 +173,7 @@
 #if NH_MV
 static const Int MAX_NUM_LAYER_IDS =                               63;
+#if NH_MV_SEI
+static const Int MAX_NUM_SEIS      =                               1000;
+#endif
 #else
 static const Int MAX_NUM_LAYER_IDS =                               64;
@@ -280,4 +283,10 @@
 static const Int  MAX_NUM_PICS_RPS          =                     16 ; 
 static const Int  MAX_NUM_REF_LAYERS        =                     63 ;  
+#if NH_MV_SEI
+static IntAry1d getRangeVec( Int rngStart, Int rngEnd ) { IntAry1d rng; for (Int i = rngStart; i<=rngEnd; i++) rng.push_back(i);  return rng; };
+static const IntAry1d IDR_NAL_UNIT_TYPES   = getRangeVec( NAL_UNIT_CODED_SLICE_IDR_W_RADL, NAL_UNIT_CODED_SLICE_IDR_N_LP ); 
+static const IntAry1d IRAP_NAL_UNIT_TYPES  = getRangeVec( NAL_UNIT_CODED_SLICE_BLA_W_LP  , NAL_UNIT_CODED_SLICE_CRA      ); 
+
+#endif
 #endif
 
Index: /trunk/source/Lib/TLibCommon/SEI.cpp
===================================================================
--- /trunk/source/Lib/TLibCommon/SEI.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibCommon/SEI.cpp	(revision 1356)
@@ -32,5 +32,5 @@
  */
 
-/** \file     SEI.cpp
+/** \file     #SEI.cpp
     \brief    helper functions for SEI handling
 */
@@ -38,4 +38,7 @@
 #include "CommonDef.h"
 #include "SEI.h"
+#if NH_MV_SEI
+#include "TComSlice.h"
+#endif
 
 SEIMessages getSeisByType(SEIMessages &seiList, SEI::PayloadType seiType)
@@ -150,7 +153,1496 @@
     case SEI::CHROMA_SAMPLING_FILTER_HINT:          return "Chroma sampling filter hint";
 #if NH_MV
-    case SEI::SUB_BITSTREAM_PROPERTY:               return "Sub-bitstream property SEI message";      
+    case SEI::COLOUR_REMAPPING_INFO:                     return "Colour remapping information";
+    case SEI::DEINTERLACED_FIELD_IDENTIFICATION:         return "Deinterlaced field identification";
+    case SEI::LAYERS_NOT_PRESENT:                        return "Layers not present";
+    case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:         return "Inter-layer constrained tile sets";
+    case SEI::BSP_NESTING:                               return "Bitstream partition nesting";
+    case SEI::BSP_INITIAL_ARRIVAL_TIME:                  return "Bitstream partition initial arrival time";
+    case SEI::SUB_BITSTREAM_PROPERTY:                    return "Sub-bitstream property";
+    case SEI::ALPHA_CHANNEL_INFO:                        return "Alpha channel information";
+    case SEI::OVERLAY_INFO:                              return "Overlay information"  ;
+    case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:        return "Temporal motion vector prediction constraints";
+    case SEI::FRAME_FIELD_INFO:                          return "Frame-field information";
+    case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO: return "3D reference displays information";
+    case SEI::DEPTH_REPRESENTATION_INFO:                 return "Depth representation information";
+    case SEI::MULTIVIEW_SCENE_INFO:                      return "Multiview scene information";
+    case SEI::MULTIVIEW_ACQUISITION_INFO:                return "Multiview acquisition information";
+    case SEI::MULTIVIEW_VIEW_POSITION:                   return "Multiview view position";
+#if NH_3D
+    case SEI::ALTERNATIVE_DEPTH_INFO:                    return "Alternative depth information";
+#endif
 #endif
     default:                                        return "Unknown";
   }
 }
+
+#if NH_MV_SEI
+SEI::SEI()
+{
+  m_scalNestSeiContThisSei = NULL;
+}
+
+SEI* SEI::getNewSEIMessage(SEI::PayloadType payloadType)
+{
+  switch (payloadType)
+  {
+#if NH_MV_SEI_TBD
+    //////////////////////////////////////////////////////////////////////////
+    // TBD: Modify version 1 SEIs to use the same interfaces as Annex GFI SEI messages.
+    //////////////////////////////////////////////////////////////////////////
+
+    case SEI::BUFFERING_PERIOD:                     return new SEIBufferingPeriod;
+    case SEI::PICTURE_TIMING:                       return new SEIPictureTiming;
+    case SEI::PAN_SCAN_RECT:                        return new SEIPanScanRectangle;                    // not currently decoded
+    case SEI::FILLER_PAYLOAD:                       return new SEIFillerPaylod;                       // not currently decoded
+    case SEI::USER_DATA_REGISTERED_ITU_T_T35:       return new SEIUserDataRegistered;                 // not currently decoded
+    case SEI::USER_DATA_UNREGISTERED:               return new SEIuserDataUnregistered;
+    case SEI::RECOVERY_POINT:                       return new SEIRecoveryPoint;
+    case SEI::SCENE_INFO:                           return new SEISceneInformation;                    // not currently decoded
+    case SEI::FULL_FRAME_SNAPSHOT:                  return new SEIPictureSnapshot;                     // not currently decoded
+    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: return new SEIProgressiveRefinementSegmentStart;   // not currently decoded
+    case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END:   return new SEIProgressiveRefinementSegmentEnd;     // not currently decoded
+    case SEI::FILM_GRAIN_CHARACTERISTICS:           return new SEIFilmGrainCharacteristics;            // not currently decoded
+    case SEI::POST_FILTER_HINT:                     return new SEIPostFilterHint;                      // not currently decoded
+    case SEI::TONE_MAPPING_INFO:                    return new SEIToneMappingInfo;
+    case SEI::KNEE_FUNCTION_INFO:                   return new SEIKneeFunctionInfo;
+    case SEI::FRAME_PACKING:                        return new SEIFramePacking;
+    case SEI::DISPLAY_ORIENTATION:                  return new SEIDisplayOrientation;
+    case SEI::SOP_DESCRIPTION:                      return new SEISOPDescription;
+    case SEI::ACTIVE_PARAMETER_SETS:                return new SEIActiveParameterSets;
+    case SEI::DECODING_UNIT_INFO:                   return new SEIDecodingUnitInfo;
+    case SEI::TEMPORAL_LEVEL0_INDEX:                return new SEITemporalLevel0Index
+    case SEI::DECODED_PICTURE_HASH:                 return new SEIDecodedPictureHash;
+    case SEI::SCALABLE_NESTING:                     return new SEIScalableNesting;
+    case SEI::REGION_REFRESH_INFO:                  return new SEIRegionRefreshInfo;
+    case SEI::NO_DISPLAY:                           return new SEINoDisplay;
+    case SEI::TIME_CODE:                            return new SEITimeCode;
+    case SEI::MASTERING_DISPLAY_COLOUR_VOLUME:      return new SEIMasteringDisplayColourVolume;
+    case SEI::SEGM_RECT_FRAME_PACKING:              return new SEISegmentedRectFramePacking;
+    case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:    return new SEITempMotionConstrainedTileSets;
+    case SEI::CHROMA_SAMPLING_FILTER_HINT:          return new SEIChromaSamplingFilterHint
+#endif
+#if NH_MV_SEI
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  case SEI::LAYERS_NOT_PRESENT                    :               return new SEILayersNotPresent;
+#endif
+  case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS     :               return new SEIInterLayerConstrainedTileSets;
+#if NH_MV_SEI_TBD
+  case SEI::BSP_NESTING                           :               return new SEIBspNesting;
+  case SEI::BSP_INITIAL_ARRIVAL_TIME              :               return new SEIBspInitialArrivalTime;
+#endif
+  case SEI::SUB_BITSTREAM_PROPERTY                :               return new SEISubBitstreamProperty;
+  case SEI::ALPHA_CHANNEL_INFO                    :               return new SEIAlphaChannelInfo;
+  case SEI::OVERLAY_INFO                          :               return new SEIOverlayInfo;
+  case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS    :               return new SEITemporalMvPredictionConstraints;
+#if NH_MV_SEI_TBD
+  case SEI::FRAME_FIELD_INFO                      :               return new SEIFrameFieldInfo;
+#endif
+  case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:            return new SEIThreeDimensionalReferenceDisplaysInfo;
+#if SEI_DRI_F0169
+  case SEI::DEPTH_REPRESENTATION_INFO             :               return new SEIDepthRepresentationInfo;
+#endif
+  case SEI::MULTIVIEW_SCENE_INFO                  :               return new SEIMultiviewSceneInfo;
+  case SEI::MULTIVIEW_ACQUISITION_INFO            :               return new SEIMultiviewAcquisitionInfo;
+  case SEI::MULTIVIEW_VIEW_POSITION               :               return new SEIMultiviewViewPosition;
+#if NH_3D
+  case SEI::ALTERNATIVE_DEPTH_INFO                :               return new SEIAlternativeDepthInfo;
+#endif
+#endif
+  default:                                        assert( false ); return NULL;
+  }
+}
+
+Void SEI::setupFromSlice  ( const TComSlice* slice )
+{
+  xPrintCfgErrorIntro();
+  std::cout << getSEIMessageString( payloadType() ) << "Setup by the encoder is currently not possible. Using the default SEI cfg-file." << std::endl;
+}
+
+SEI* SEI::getCopy() const
+{
+  assert( 0 );
+  return NULL;
+}
+
+Void SEI::setupFromCfgFile( const Char* cfgFile )
+{
+  assert( false );
+}
+
+Bool SEI::insertSei( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const
+{
+  Bool insertSeiHere = true;
+  if( !m_applicableLayerIds.empty() )
+  {
+    insertSeiHere = insertSeiHere && ( std::find( m_applicableLayerIds.begin(), m_applicableLayerIds.end(), curLayerId) != m_applicableLayerIds.end() ) ;
+  }
+  if( !m_applicablePocs     .empty() )
+  {
+    insertSeiHere = insertSeiHere && ( std::find( m_applicablePocs    .begin(), m_applicablePocs    .end(), curPoc    ) != m_applicablePocs    .end() ) ;
+  }
+  if( !m_applicableTids     .empty() )
+  {
+    insertSeiHere = insertSeiHere && ( std::find( m_applicableTids    .begin(), m_applicableTids    .end(), curTid    ) != m_applicableTids    .end() ) ;
+  }
+  if( !m_applicableVclNaluTypes.empty() )
+  {
+    insertSeiHere = insertSeiHere && ( std::find( m_applicableVclNaluTypes.begin(), m_applicableVclNaluTypes.end(), curNaluType) != m_applicableVclNaluTypes.end() ) ;
+  }
+  return insertSeiHere;
+}
+
+Bool SEI::checkCfg( const TComSlice* slice )
+{
+  assert( false );
+  return true;
+}
+
+Void SEI::xPrintCfgErrorIntro()
+{
+  std::cout << "Error in configuration of " << getSEIMessageString( payloadType() ) << " SEI: ";
+}
+
+Void SEI::xCheckCfgRange( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName )
+{
+  if ( val < minVal || val > maxVal  )
+  {
+    xPrintCfgErrorIntro();
+    std::cout << "The value of " << seName << "shall be in the range of " << minVal << " to " << maxVal << ", inclusive." << std::endl;
+    wrongConfig = true;
+  }
+}
+
+Void SEI::xAddGeneralOpts(po::Options &opts, IntAry1d defAppLayerIds, IntAry1d deftApplicablePocs,
+                                            IntAry1d defAppTids,     IntAry1d defAppVclNaluTypes,
+                                            Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder)
+{
+  opts.addOptions()
+    ("PayloadType"            , m_payloadType            , -1                    , "Payload Type"                                                         )
+    ("ApplicableLayerIds"     , m_applicableLayerIds     , defAppLayerIds        , "LayerIds      of layers   to which the SEI is added. (all when empty)")
+    ("ApplicablePocs"         , m_applicablePocs         , deftApplicablePocs    , "POCs          of pictures to which the SEI is added. (all when empty)")
+    ("ApplicableTids"         , m_applicableTids         , defAppTids            , "TIds          of pictures to which the SEI is added. (all when empty)")
+    ("ApplicableVclNaluTypes" , m_applicableVclNaluTypes , defAppVclNaluTypes    , "NaluUnitTypes of picture  to which the SEI is added. (all when empty)")
+    ("SeiNaluId"              , m_seiNaluId              , defSeiNaluId          , "Identifies to which NAL unit  the SEI is added." )
+    ("PositionInSeiNalu"      , m_positionInSeiNalu      , defPositionInSeiNalu  , "Identifies the position within the NAL unit.")
+    ("ModifyByEncoder"        , m_modifyByEncoder        , defModifyByEncoder    , "0: Use payload as specified in cfg file   1: Modify SEI by encoder");
+}
+
+Void SEI::xCheckCfg( Bool& wrongConfig, Bool cond, const Char* errStr )
+{
+  if ( !cond  )
+  {
+    xPrintCfgErrorIntro();
+    std::cout << errStr << std::endl;
+    wrongConfig = true;
+  }
+}
+
+
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+Void SEILayersNotPresent::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  // 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.
+  defAppLayerIds    .empty( );
+  defAppPocs        .empty( );
+  defAppTids        .empty( );
+  defAppVclNaluTypes.empty( );
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;   //0: Use payload as specified in cfg file   1: Modify SEI by encoder
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("LnpSeiActiveVpsId"              , m_lnpSeiActiveVpsId                , 0                              , "LnpSeiActiveVpsId"                )   //Why?
+    ("LayerNotPresentFlag"            , m_layerNotPresentFlag              , BoolAry1d(1,0)                 , "LayerNotPresentFlag"              )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+  m_lnpSeiMaxLayers = (UInt) m_layerNotPresentFlag.size();
+};
+
+  Bool SEILayersNotPresent::checkCfg( const TComSlice* slice )
+  {
+  // Check config values
+    Bool wrongConfig = false;
+//
+    const TComVPS* vps = slice->getVPS();
+//  // TBD: Add constraints on presence of SEI here.
+    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." );
+    xCheckCfg     ( wrongConfig, m_lnpSeiMaxLayers == vps->getMaxLayersMinus1(), "The number of LayerNotPresent flags shall be equal to vpsMaxLayersMinus1." );
+
+
+    for (Int i = 0; i < vps->getMaxLayersMinus1(); i++)
+    {
+      if ( m_layerNotPresentFlag[ i ] && i < vps->getMaxLayersMinus1() )
+      {
+        for (Int j = 0; j < vps->getNumPredictedLayers( vps->getLayerIdInNuh( j ) - 1 ); j++ )
+        {
+          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." );
+        }
+      }
+    }
+
+      return wrongConfig;
+  };
+#endif
+
+
+Void SEIInterLayerConstrainedTileSets::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .empty( );
+  defAppPocs        .push_back( 0 );
+  defAppTids        .empty( );
+  defAppVclNaluTypes.empty( );
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  const Int maxNumTileInSet = 100;
+
+  opts.addOptions()
+    ("IlAllTilesExactSampleValueMatchFlag", m_ilAllTilesExactSampleValueMatchFlag, false                    , "IlAllTilesExactSampleValueMatchFlag")
+    ("IlOneTilePerTileSetFlag"        , m_ilOneTilePerTileSetFlag          , false                          , "IlOneTilePerTileSetFlag"          )
+    ("IlNumSetsInMessageMinus1"       , m_ilNumSetsInMessageMinus1         , 0                              , "IlNumSetsInMessageMinus1"         )
+    ("SkippedTileSetPresentFlag"      , m_skippedTileSetPresentFlag        , false                          , "SkippedTileSetPresentFlag"        )
+    ("IlctsId"                        , m_ilctsId                          , IntAry1d (256,0)               , "IlctsId"                          )
+    ("IlNumTileRectsInSetMinus1"      , m_ilNumTileRectsInSetMinus1        , IntAry1d (256,0)               , "IlNumTileRectsInSetMinus1"        )
+    ("IlTopLeftTileIndex_%d"          , m_ilTopLeftTileIndex               , IntAry1d (maxNumTileInSet,0), 256, "IlTopLeftTileIndex"               )
+    ("IlBottomRightTileIndex_%d"      , m_ilBottomRightTileIndex           , IntAry1d (maxNumTileInSet,0), 256, "IlBottomRightTileIndex"           )
+    ("IlcIdc"                         , m_ilcIdc                           , IntAry1d (256,0)               , "IlcIdc"                           )
+    ("IlExactSampleValueMatchFlag"    , m_ilExactSampleValueMatchFlag      , BoolAry1d(256,0)               , "IlExactSampleValueMatchFlag"      )
+    ("AllTilesIlcIdc"                 , m_allTilesIlcIdc                   , 0                              , "AllTilesIlcIdc"                   )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+Bool SEIInterLayerConstrainedTileSets::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+  const TComPPS* pps = slice->getPPS();
+
+  // Currently only the active PPS checked.
+  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." );
+
+  if ( m_ilOneTilePerTileSetFlag )
+  {
+    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."    );
+  }
+  Int numSignificantSets = m_ilNumSetsInMessageMinus1 - m_skippedTileSetPresentFlag + 1;
+
+  for (Int i = 0 ; i < numSignificantSets; i++)
+  {
+    xCheckCfgRange( wrongConfig, m_ilctsId[i]                         , 0 , (1 << 30) - 1, "ilcts_id"                         );
+  }
+
+  return wrongConfig;
+};
+#if NH_MV_SEI_TBD
+
+Void SEIBspNesting::setupFromSlice  ( const TComSlice* slice )
+{
+  sei.m_seiOlsIdx =  TBD ;
+  sei.m_seiPartitioningSchemeIdx =  TBD ;
+  sei.m_bspIdx =  TBD ;
+  while( !ByteaLigned(() ) );
+  {
+    sei.m_bspNestingZeroBit =  TBD ;
+  }
+  sei.m_numSeisInBspMinus1 =  TBD ;
+  for( Int i = 0; i  <=  NumSeisInBspMinus1( ); i++ )
+  {
+    SeiMessage(() );
+  }
+};
+
+Void SEIBspNesting::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .push_back( TBD );
+  defAppPocs        .push_back( TBD );
+  defAppTids        .push_back( TBD );
+  defAppVclNaluTypes.push_back( TBD );
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = TBD;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("SeiOlsIdx"                      , m_seiOlsIdx                        , 0                              , "SeiOlsIdx"                        )
+    ("SeiPartitioningSchemeIdx"       , m_seiPartitioningSchemeIdx         , 0                              , "SeiPartitioningSchemeIdx"         )
+    ("BspIdx"                         , m_bspIdx                           , 0                              , "BspIdx"                           )
+    ("BspNestingZeroBit"              , m_bspNestingZeroBit                , 0                              , "BspNestingZeroBit"                )
+    ("NumSeisInBspMinus1"             , m_numSeisInBspMinus1               , 0                              , "NumSeisInBspMinus1"               )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+Bool SEIBspNesting::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  // TBD: Add constraints on presence of SEI here.
+  xCheckCfg     ( wrongConfig, TBD , "TBD" );
+  xCheckCfg     ( wrongConfig, TBD , "TBD" );
+
+  // TBD: Modify constraints according to the SEI semantics.
+  xCheckCfgRange( wrongConfig, m_seiOlsIdx                      , MINVAL , MAXVAL, "sei_ols_idx"          );
+  xCheckCfgRange( wrongConfig, m_seiPartitioningSchemeIdx       , MINVAL , MAXVAL, "sei_partitioning_scheme_idx"       );
+  xCheckCfgRange( wrongConfig, m_bspIdx                         , MINVAL , MAXVAL, "bsp_idx"              );
+  xCheckCfgRange( wrongConfig, m_bspNestingZeroBit              , MINVAL , MAXVAL, "bsp_nesting_zero_bit ");
+  xCheckCfgRange( wrongConfig, m_numSeisInBspMinus1             , MINVAL , MAXVAL, "num_seis_in_bsp_minus1"           );
+
+  return wrongConfig;
+
+};
+
+Void SEIBspInitialArrivalTime::setupFromSlice  ( const TComSlice* slice )
+{
+  psIdx = SeiPartitioningSchemeIdx();
+  if( nalInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      sei.m_nalInitialArrivalDelay[i] =  TBD ;
+    }
+  }
+  if( vclInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      sei.m_vclInitialArrivalDelay[i] =  TBD ;
+    }
+  }
+};
+
+Void SEIBspInitialArrivalTime::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .push_back( TBD );
+  defAppPocs        .push_back( TBD );
+  defAppTids        .push_back( TBD );
+  defAppVclNaluTypes.push_back( TBD );
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = TBD;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("NalInitialArrivalDelay"         , m_nalInitialArrivalDelay           , IntAry1d (1,0)                 , "NalInitialArrivalDelay"           )
+    ("VclInitialArrivalDelay"         , m_vclInitialArrivalDelay           , IntAry1d (1,0)                 , "VclInitialArrivalDelay"           )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+Bool SEIBspInitialArrivalTime::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  // TBD: Add constraints on presence of SEI here.
+  xCheckCfg     ( wrongConfig, TBD , "TBD" );
+  xCheckCfg     ( wrongConfig, TBD , "TBD" );
+
+  // TBD: Modify constraints according to the SEI semantics.
+  xCheckCfgRange( wrongConfig, m_nalInitialArrivalDelay[i]      , MINVAL , MAXVAL, "nal_initial_arrival_delay"        );
+  xCheckCfgRange( wrongConfig, m_vclInitialArrivalDelay[i]      , MINVAL , MAXVAL, "vcl_initial_arrival_delay"        );
+
+  return wrongConfig;
+
+};
+#endif
+
+Void SEISubBitstreamProperty::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .push_back( 0 );
+  defAppPocs        .push_back( 0 );
+  defAppTids        .push_back( 0 );
+  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("SbPropertyActiveVpsId"          , m_sbPropertyActiveVpsId            , 0                              , "SbPropertyActiveVpsId"            )
+    ("NumAdditionalSubStreamsMinus1"  , m_numAdditionalSubStreamsMinus1    , 0                              , "NumAdditionalSubStreamsMinus1"    )
+    ("SubBitstreamMode"               , m_subBitstreamMode                 , IntAry1d (1,0)                 , "SubBitstreamMode"                 )
+    ("OlsIdxToVps"                    , m_olsIdxToVps                      , IntAry1d (1,0)                 , "OlsIdxToVps"                      )
+    ("HighestSublayerId"              , m_highestSublayerId                , IntAry1d (1,0)                 , "HighestSublayerId"                )
+    ("AvgSbPropertyBitRate"           , m_avgSbPropertyBitRate             , IntAry1d (1,0)                 , "AvgSbPropertyBitRate"             )
+    ("MaxSbPropertyBitRate"           , m_maxSbPropertyBitRate             , IntAry1d (1,0)                 , "MaxSbPropertyBitRate"             )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+Bool SEISubBitstreamProperty::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  // For the current encoder, the initial IRAP access unit has always POC zero.
+  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.");
+
+  Bool sizeNotCorrect =
+    (    ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_subBitstreamMode    .size() )
+    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_olsIdxToVps         .size() )
+    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_highestSublayerId   .size() )
+    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_avgSbPropertyBitRate.size() )
+    || ( ( m_numAdditionalSubStreamsMinus1 + 1 ) != m_maxSbPropertyBitRate.size() );
+
+  xCheckCfg( wrongConfig, !sizeNotCorrect, "Some parameters of some sub-bitstream not provided." );
+  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." );
+
+  xCheckCfgRange( wrongConfig, m_numAdditionalSubStreamsMinus1  , 0 , (1 << 10) - 1 , "num_additional_sub_streams_minus1");
+
+  if ( !sizeNotCorrect )
+  {
+    for (Int i = 0; i <= m_numAdditionalSubStreamsMinus1; i++ )
+    {
+      xCheckCfgRange( wrongConfig, m_subBitstreamMode[i]    , 0 , 1                                          , "sub_bitstream_mode" );
+      xCheckCfgRange( wrongConfig, m_olsIdxToVps[i]         , 0 , slice->getVPS()->getNumOutputLayerSets()-1 , "ols_idx_to_vps"     );
+    }
+  }
+  return wrongConfig;
+};
+
+Void SEISubBitstreamProperty::resizeArrays( )
+{
+  m_subBitstreamMode    .resize( m_numAdditionalSubStreamsMinus1 + 1);
+  m_olsIdxToVps         .resize( m_numAdditionalSubStreamsMinus1 + 1);
+  m_highestSublayerId   .resize( m_numAdditionalSubStreamsMinus1 + 1);
+  m_avgSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1);
+  m_maxSbPropertyBitRate.resize( m_numAdditionalSubStreamsMinus1 + 1);
+}
+
+Void SEIAlphaChannelInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .clear();
+  defAppPocs        .push_back( 0 );
+  defAppTids        .push_back( 0 );
+  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("AlphaChannelCancelFlag"         , m_alphaChannelCancelFlag           , false                          , "AlphaChannelCancelFlag"           )
+    ("AlphaChannelUseIdc"             , m_alphaChannelUseIdc               , 0                              , "AlphaChannelUseIdc"               )
+    ("AlphaChannelBitDepthMinus8"     , m_alphaChannelBitDepthMinus8       , 0                              , "AlphaChannelBitDepthMinus8"       )
+    ("AlphaTransparentValue"          , m_alphaTransparentValue            , 0                              , "AlphaTransparentValue"            )
+    ("AlphaOpaqueValue"               , m_alphaOpaqueValue                 , 255                            , "AlphaOpaqueValue"                 )
+    ("AlphaChannelIncrFlag"           , m_alphaChannelIncrFlag             , false                          , "AlphaChannelIncrFlag"             )
+    ("AlphaChannelClipFlag"           , m_alphaChannelClipFlag             , false                          , "AlphaChannelClipFlag"             )
+    ("AlphaChannelClipTypeFlag"       , m_alphaChannelClipTypeFlag         , false                          , "AlphaChannelClipTypeFlag"         )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+
+};
+
+Bool SEIAlphaChannelInfo::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  int maxInterpretationValue = (1 << (m_alphaChannelBitDepthMinus8+9)) - 1;
+  xCheckCfgRange( wrongConfig, m_alphaChannelCancelFlag         , 0 , 1, "alpha_channel_cancel_flag"        );
+  xCheckCfgRange( wrongConfig, m_alphaChannelUseIdc             , 0 , 7, "alpha_channel_use_idc");
+  xCheckCfgRange( wrongConfig, m_alphaChannelBitDepthMinus8     , 0 , 7, "alpha_channel_bit_depth_minus8"   );
+  xCheckCfgRange( wrongConfig, m_alphaTransparentValue          , 0 , maxInterpretationValue, "alpha_transparent_value"          );
+  xCheckCfgRange( wrongConfig, m_alphaOpaqueValue               , 0 , maxInterpretationValue, "alpha_opaque_value"   );
+  xCheckCfgRange( wrongConfig, m_alphaChannelIncrFlag           , 0 , 1, "alpha_channel_incr_flag"          );
+  xCheckCfgRange( wrongConfig, m_alphaChannelClipFlag           , 0 , 1, "alpha_channel_clip_flag"          );
+  xCheckCfgRange( wrongConfig, m_alphaChannelClipTypeFlag       , 0 , 1, "alpha_channel_clip_type_flag"     );
+
+  return wrongConfig;
+
+};
+
+SEIOverlayInfo::SEIOverlayInfo ( )
+  : m_numOverlaysMax(16)
+  , m_numOverlayElementsMax(256)
+  , m_numStringBytesMax(256) //incl. null termination byte
+{ };
+
+Void SEIOverlayInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .clear();
+  defAppPocs        .push_back( 0 );
+  defAppTids        .push_back( 0 );
+  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("OverlayInfoCancelFlag"          , m_overlayInfoCancelFlag            , false                           , "OverlayInfoCancelFlag"            )
+    ("OverlayContentAuxIdMinus128"    , m_overlayContentAuxIdMinus128      , 0                               , "OverlayContentAuxIdMinus128"      )
+    ("OverlayLabelAuxIdMinus128"      , m_overlayLabelAuxIdMinus128        , 0                               , "OverlayLabelAuxIdMinus128"        )
+    ("OverlayAlphaAuxIdMinus128"      , m_overlayAlphaAuxIdMinus128        , 0                               , "OverlayAlphaAuxIdMinus128"        )
+    ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0                       , "OverlayElementLabelValueLengthMinus8")
+    ("NumOverlaysMinus1"              , m_numOverlaysMinus1                , 0                               , "NumOverlaysMinus1"                )
+    ("OverlayIdx"                     , m_overlayIdx                       , IntAry1d (16,0)                 , "OverlayIdx"                       )
+    ("LanguageOverlayPresentFlag"     , m_languageOverlayPresentFlag       , BoolAry1d(16,0)                 , "LanguageOverlayPresentFlag"       )
+    ("OverlayContentLayerId"          , m_overlayContentLayerId            , IntAry1d (16,0)                 , "OverlayContentLayerId"            )
+    ("OverlayLabelPresentFlag"        , m_overlayLabelPresentFlag          , BoolAry1d(16,0)                 , "OverlayLabelPresentFlag"          )
+    ("OverlayLabelLayerId"            , m_overlayLabelLayerId              , IntAry1d (16,0)                 , "OverlayLabelLayerId"              )
+    ("OverlayAlphaPresentFlag"        , m_overlayAlphaPresentFlag          , BoolAry1d(16,0)                 , "OverlayAlphaPresentFlag"          )
+    ("OverlayAlphaLayerId"            , m_overlayAlphaLayerId              , IntAry1d (16,0)                 , "OverlayAlphaLayerId"              )
+    ("NumOverlayElementsMinus1"       , m_numOverlayElementsMinus1         , IntAry1d (16,0)                 , "NumOverlayElementsMinus1"         )
+    ("OverlayElementLabelMin_%d"      , m_overlayElementLabelMin           , IntAry1d (256,0) ,16            , "OverlayElementLabelMin"           )
+    ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (256,0) ,16            , "OverlayElementLabelMax"           )
+    ("OverlayLanguage_%d"             , m_overlayLanguage                  , std::string(""), 16             , "OverlayLanguage"                  )
+    ("OverlayName_%d"                 , m_overlayName                      , std::string(""), 16             , "OverlayName"                      )
+    ("OverlayElementName_%d_%d"       , m_overlayElementName               , std::string(""), 256 ,16        , "OverlayElementName"               )
+    ("OverlayInfoPersistenceFlag"     , m_overlayInfoPersistenceFlag       , false                           , "OverlayInfoPersistenceFlag"       )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+
+Bool SEIOverlayInfo::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag          , 0 ,   1, "overlay_info_cancel_flag"         );
+  xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128    , 0 ,  31, "overlay_content_aux_id_minus128"  );
+  xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128      , 0 ,  31, "overlay_label_aux_id_minus128"    );
+  xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128      , 0 ,  31, "overlay_alpha_aux_id_minus128"    );
+  xCheckCfgRange( wrongConfig, m_numOverlaysMinus1              , 0 ,  m_numOverlaysMax-1, "num_overlays_minus1"  );
+  for (Int i=0 ; i<=m_numOverlaysMinus1 ; ++i)
+  {
+    xCheckCfgRange( wrongConfig, m_overlayIdx[i]                  , 0 , 255, "overlay_idx"          );
+    xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i]  , 0 ,   1, "language_overlay_present_flag"    );
+    xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , 0 ,   1, "overlay_label_present_flag"       );
+    xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i]     , 0 ,   1, "overlay_alpha_present_flag"       );
+    xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i]       , 0 ,   63, "overlay_content_layer_id"    );
+    xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i]         , 0 ,   63, "overlay_label_layer_id"    );
+    xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , 0 ,   63, "overlay_alpha_layer_id"    );
+    xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , 0 , m_numOverlayElementsMax-1, "num_overlay_elements_minus1"       );
+    for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; ++j)
+    {
+      Int maxLabelMinMaxValue = ( 1 << ( m_overlayElementLabelValueLengthMinus8 + 8 ) )-1;
+      xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_min"    );
+      xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_max"    );
+    }
+  }
+  xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag     , 0 ,   1, "overlay_info_persistence_flag"    );
+
+  return wrongConfig;
+
+};
+
+
+Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .clear    (   );
+  defAppPocs        .push_back( 0 );
+  defAppTids        .push_back( 0 );
+  defAppVclNaluTypes.clear    (   );
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("PrevPicsNotUsedFlag"   , m_prevPicsNotUsedFlag   , false, "PrevPicsNotUsedFlag"    )
+    ("NoIntraLayerColPicFlag", m_noIntraLayerColPicFlag, false, "NoIntraLayerColPicFlag" )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+Bool SEITemporalMvPredictionConstraints::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  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." );
+
+  return wrongConfig;
+};
+
+#if NH_MV_SEI_TBD
+Void SEIFrameFieldInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds    .push_back( TBD );
+  defAppPocs        .push_back( TBD );
+  defAppTids        .push_back( TBD );
+  defAppVclNaluTypes.push_back( TBD );
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("FfinfoPicStruct"     , m_ffinfoPicStruct     , 0     , "FfinfoPicStruct"     )
+    ("FfinfoSourceScanType", m_ffinfoSourceScanType, 0     , "FfinfoSourceScanType")
+    ("FfinfoDuplicateFlag" , m_ffinfoDuplicateFlag , false , "FfinfoDuplicateFlag" )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+
+Bool SEIFrameFieldInfo::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  // TBD: Add constraints on presence of SEI here.
+  xCheckCfg     ( wrongConfig, TBD , "TBD" );
+  xCheckCfg     ( wrongConfig, TBD , "TBD" );
+
+  // TBD: Modify constraints according to the SEI semantics.
+  xCheckCfgRange( wrongConfig, m_ffinfoPicStruct                , MINVAL , MAXVAL, "ffinfo_pic_struct"                );
+  xCheckCfgRange( wrongConfig, m_ffinfoSourceScanType           , MINVAL , MAXVAL, "ffinfo_source_scan_type"          );
+  xCheckCfgRange( wrongConfig, m_ffinfoDuplicateFlag            , MINVAL , MAXVAL, "ffinfo_duplicate_flag"            );
+
+  return wrongConfig;
+
+};
+#endif
+
+Void SEIThreeDimensionalReferenceDisplaysInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // Default values for which layers, POCS, Tids or Nalu types the SEI should be sent.
+  defAppLayerIds      .push_back( 0 );
+  defAppPocs          .push_back( 0 );
+  defAppTids          .push_back( 0 );
+  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = 0;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("PrecRefDisplayWidth"            , m_precRefDisplayWidth              , 0                              , "PrecRefDisplayWidth"              )
+    ("RefViewingDistanceFlag"         , m_refViewingDistanceFlag           , false                          , "RefViewingDistanceFlag"           )
+    ("PrecRefViewingDist"             , m_precRefViewingDist               , 0                              , "PrecRefViewingDist"               )
+    ("NumRefDisplaysMinus1"           , m_numRefDisplaysMinus1             , 0                              , "NumRefDisplaysMinus1"             )
+    ("LeftViewId"                     , m_leftViewId                       , IntAry1d (1,0)                 , "LeftViewId"                       )
+    ("RightViewId"                    , m_rightViewId                      , IntAry1d (1,0)                 , "RightViewId"                      )
+    ("ExponentRefDisplayWidth"        , m_exponentRefDisplayWidth          , IntAry1d (1,0)                 , "ExponentRefDisplayWidth"          )
+    ("MantissaRefDisplayWidth"        , m_mantissaRefDisplayWidth          , IntAry1d (1,0)                 , "MantissaRefDisplayWidth"          )
+    ("ExponentRefViewingDistance"     , m_exponentRefViewingDistance       , IntAry1d (1,0)                 , "ExponentRefViewingDistance"       )
+    ("MantissaRefViewingDistance"     , m_mantissaRefViewingDistance       , IntAry1d (1,0)                 , "MantissaRefViewingDistance"       )
+    ("AdditionalShiftPresentFlag"     , m_additionalShiftPresentFlag       , BoolAry1d(1,0)                 , "AdditionalShiftPresentFlag"       )
+    ("NumSampleShiftPlus512"          , m_numSampleShiftPlus512            , IntAry1d (1,0)                 , "NumSampleShiftPlus512"            )
+    ("ThreeDimensionalReferenceDisplaysExtensionFlag", m_threeDimensionalReferenceDisplaysExtensionFlag, false                          , "ThreeDimensionalReferenceDisplaysExtensionFlag")
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+
+UInt SEIThreeDimensionalReferenceDisplaysInfo::getMantissaReferenceDisplayWidthLen( Int i ) const
+{
+  return xGetSyntaxElementLen( m_exponentRefDisplayWidth[i], m_precRefDisplayWidth, m_mantissaRefDisplayWidth[ i ] );
+}
+
+UInt SEIThreeDimensionalReferenceDisplaysInfo::getMantissaReferenceViewingDistanceLen( Int i ) const
+{
+  return xGetSyntaxElementLen( m_exponentRefViewingDistance[i], m_precRefViewingDist, m_mantissaRefViewingDistance[ i ] );
+}
+
+UInt SEIThreeDimensionalReferenceDisplaysInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
+{
+  UInt len;
+  if( expo == 0 )
+  {
+    len = std::max(0, prec - 30 );
+  }
+  else
+  {
+    len = std::max( 0, expo + prec - 31 );
+  }
+
+  assert( val >= 0 );
+  assert( val <= ( ( 1 << len )- 1) );
+  return len;
+}
+
+Bool SEIThreeDimensionalReferenceDisplaysInfo::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  // The 3D reference display SEI should preferably be sent along with the multiview acquisition SEI. For now the multiview acquisition SEI is restricted to POC = 0, so 3D reference displays SEI is restricted to POC = 0 as well.
+  xCheckCfg     ( wrongConfig, slice->isIRAP() && (slice->getPOC() == 0)  , "The 3D reference displays SEI message currently is associated with an access unit that contains an IRAP picture." );
+
+  xCheckCfgRange( wrongConfig, m_precRefDisplayWidth            , 0 , 31, "prec_ref_display_width"  );
+  xCheckCfgRange( wrongConfig, m_refViewingDistanceFlag         , 0 , 1, "ref_viewing_distance_flag");
+  xCheckCfgRange( wrongConfig, m_precRefViewingDist             , 0 , 31, "prec_ref_viewing_dist"   );
+  xCheckCfgRange( wrongConfig, m_numRefDisplaysMinus1           , 0 , 31, "num_ref_displays_minus1" );
+
+  for (Int i = 0; i <= getNumRefDisplaysMinus1(); i++ )
+  {
+    xCheckCfgRange( wrongConfig, m_exponentRefDisplayWidth[i]     , 0 , 62, "exponent_ref_display_width"   );
+    xCheckCfgRange( wrongConfig, m_exponentRefViewingDistance[i]  , 0 , 62, "exponent_ref_viewing_distance");
+    xCheckCfgRange( wrongConfig, m_additionalShiftPresentFlag[i]  , 0 , 1, "additional_shift_present_flag" );
+    xCheckCfgRange( wrongConfig, m_numSampleShiftPlus512[i]       , 0 , 1023, "num_sample_shift_plus512"   );
+  }
+  xCheckCfgRange( wrongConfig, m_threeDimensionalReferenceDisplaysExtensionFlag, 0 , 1, "three_dimensional_reference_displays_extension_flag");
+
+  return wrongConfig;
+
+};
+
+#if SEI_DRI_F0169
+Void SEIDepthRepresentationInfo::setupFromSlice  ( const TComSlice* slice )
+{
+
+    m_currLayerID=slice->getLayerIdInVps();
+};
+
+Void SEIDepthRepresentationInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  //defAppLayerIds    .push_back( TBD );
+  defAppPocs        .push_back( 0 );
+  //defAppTids        .push_back( TBD );
+  //defAppVclNaluTypes.push_back( TBD );
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = true;
+
+  // Setup config file options
+  po::Options opts;
+
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("ZNear_%d"                      , m_zNear               , std::vector<double>(0,0)       , MAX_NUM_LAYERS , "ZNear"           )
+    ("ZFar_%d"                       , m_zFar                , std::vector<double>(0,0)       , MAX_NUM_LAYERS , "ZFar"            )
+    ("DMin_%d"                       , m_dMin                , std::vector<double>(0,0)       , MAX_NUM_LAYERS , "DMin"            )
+    ("DMax_%d"                       , m_dMax                , std::vector<double>(0,0)       , MAX_NUM_LAYERS , "DMax"            )
+    ("DepthRepresentationInfoSeiPresentFlag_%d",  m_depthRepresentationInfoSeiPresentFlag, BoolAry1d(1,0), MAX_NUM_LAYERS, "DepthRepresentationInfoSeiPresentFlag")
+    ("DepthRepresentationType_%d"        , m_depthRepresentationType          , IntAry1d(0,0), MAX_NUM_LAYERS,  "DepthRepresentationType"        )
+    ("DisparityRefViewId_%d"             , m_disparityRefViewId               ,  IntAry1d(0,0), MAX_NUM_LAYERS,  "DisparityRefViewId"             )
+    ("DepthNonlinearRepresentationNumMinus1_%d", m_depthNonlinearRepresentationNumMinus1, IntAry1d(0,0), MAX_NUM_LAYERS, "DepthNonlinearRepresentationNumMinus1")
+    ("DepthNonlinearRepresentationModel_%d"    , m_depth_nonlinear_representation_model ,   IntAry1d(0,0), MAX_NUM_LAYERS, "DepthNonlinearRepresentationModel") ;
+
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+
+
+  for(int i=0;i<MAX_NUM_LAYERS;i++)
+  {
+    if (m_zNear[i].size()>0)
+    {
+      m_zNearFlag.push_back(true);
+    }
+    else
+    {
+      m_zNearFlag.push_back(false);
+    }
+
+    if (m_zFar[i].size()>0)
+    {
+      m_zFarFlag.push_back(true);
+    }
+    else
+    {
+      m_zFarFlag.push_back(false);
+    }
+
+    if (m_dMin[i].size()>0)
+    {
+      m_dMinFlag.push_back(true);
+    }
+    else
+    {
+      m_dMinFlag.push_back(false);
+    }
+
+    if (m_dMax[i].size()>0)
+    {
+      m_dMaxFlag.push_back(true);
+    }
+    else
+    {
+      m_dMaxFlag.push_back(false);
+    }
+
+
+    if (m_depthRepresentationInfoSeiPresentFlag[i][0])
+    {
+      if ( m_depthRepresentationType[i].size()<=0 )
+      {
+        printf("DepthRepresentationType_%d must be present for layer %d\n",i,i );
+        return;
+      }
+
+      if (  m_depthRepresentationType[i][0]<0 )
+      {
+        printf("DepthRepresentationType_%d must be equal to or greater than 0\n",i );
+        return;
+      }
+
+      if (m_dMinFlag[i] || m_dMaxFlag[i])
+      {
+        if (m_disparityRefViewId[i].size()<=0)
+        {
+          printf("DisparityRefViewId_%d must be present for layer %d\n",i,i );
+          assert(false);
+          return;
+        }
+        if (m_disparityRefViewId[i][0]<0)
+        {
+          printf("DisparityRefViewId_%d must be equal to or greater than 0\n",i );
+          assert(false);
+          return;
+        }
+      }
+
+      if (m_depthRepresentationType[i][0]==3)
+      {
+        if (m_depthNonlinearRepresentationNumMinus1[i].size()<=0)
+        {
+          printf("DepthNonlinearRepresentationNumMinus1_%d must be present for layer %d\n",i,i );
+          assert(false);
+          return;
+        }
+        if (m_depthNonlinearRepresentationNumMinus1[i][0]<0)
+        {
+          printf("DepthNonlinearRepresentationNumMinus1_%d must be equal to or greater than 0\n",i );
+          assert(false);
+          return;
+        }
+
+        if (m_depth_nonlinear_representation_model[i].size() != m_depthNonlinearRepresentationNumMinus1[i][0]+1)
+        {
+          printf("the number of values in Depth_nonlinear_representation_model must be equal to DepthNonlinearRepresentationNumMinus1+1 in layer %d\n",i );
+          assert(false);
+          return;
+        }
+      }
+    }
+  }
+
+  assert(m_zNearFlag.size()==MAX_NUM_LAYERS);
+  assert(m_zFarFlag.size()==MAX_NUM_LAYERS);
+  assert(m_dMinFlag.size()==MAX_NUM_LAYERS);
+  assert(m_dMaxFlag.size()==MAX_NUM_LAYERS);
+}
+
+Bool SEIDepthRepresentationInfo::checkCfg( const TComSlice* slice )
+{
+    // Check config values
+    Bool wrongConfig = false;
+    assert(m_currLayerID>=0);
+
+    if (m_depthRepresentationInfoSeiPresentFlag[m_currLayerID][0]==false)
+    {
+        printf("DepthRepresentationInfoSeiPresentFlag_%d should be equal to 1 when  ApplicableLayerIds is empty or ApplicableLayerIds contains  %d\n",m_currLayerID,slice->getLayerId());
+        assert(false);
+    }
+    // TBD: Add constraints on presence of SEI here.
+    xCheckCfg     ( wrongConfig, m_depthRepresentationType[m_currLayerID][0] >=0 , "depth_representation_type must be equal to or greater than 0" );
+    if ( m_dMaxFlag[m_currLayerID] || m_dMinFlag[m_currLayerID])
+    {
+        xCheckCfg( wrongConfig , m_disparityRefViewId[m_currLayerID][0]>=0, "disparity_ref_view_id must be equal to or greater than 0 when d_min or d_max are present");
+    }
+
+    if (m_depthRepresentationType[m_currLayerID][0]==3)
+    {
+        xCheckCfg(wrongConfig , m_depthNonlinearRepresentationNumMinus1[m_currLayerID][0]>=0, "depth_nonlinear_representation_num_minus1 must be greater than or equal to 0");
+
+        if (m_depthNonlinearRepresentationNumMinus1[m_currLayerID][0]>=0)
+        {
+            xCheckCfg( wrongConfig , m_depthNonlinearRepresentationNumMinus1[m_currLayerID][0]+1 == m_depth_nonlinear_representation_model[m_currLayerID].size() ,"the number of values in depth_nonlinear_representation_model must be equal to depth_nonlinear_representation_num_minus1+1");
+        }
+
+    }
+
+    return wrongConfig;
+}
+#endif
+
+Void SEIMultiviewSceneInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send.
+  defAppLayerIds      .clear();
+  defAppPocs          .clear();
+  defAppTids          .push_back( 0 );
+  defAppVclNaluTypes = IRAP_NAL_UNIT_TYPES;
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("MinDisparity"                   , m_minDisparity                     , 0                              , "MinDisparity"                     )
+    ("MaxDisparityRange"              , m_maxDisparityRange                , 0                              , "MaxDisparityRange"                )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+
+Bool SEIMultiviewSceneInfo::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  xCheckCfg     ( wrongConfig, slice->isIRAP(), "When present, the multiview scene information SEI message shall be associated with an IRAP access unit." );
+
+  xCheckCfgRange( wrongConfig, m_minDisparity              , -1024 , 1023, "min_disparity"                    );
+  xCheckCfgRange( wrongConfig, m_maxDisparityRange         ,     0 , 2047, "max_disparity_range"              );
+
+  return wrongConfig;
+
+};
+
+Void SEIMultiviewAcquisitionInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  defAppLayerIds    .clear();
+  defAppPocs        .push_back( 0 );
+  defAppTids        .push_back( 0 );
+  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
+
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("IntrinsicParamFlag"               , m_intrinsicParamFlag               , false                              , "IntrinsicParamFlag"               )
+    ("ExtrinsicParamFlag"               , m_extrinsicParamFlag               , false                              , "ExtrinsicParamFlag"               )
+    ("IntrinsicParamsEqualFlag"         , m_intrinsicParamsEqualFlag         , false                              , "IntrinsicParamsEqualFlag"         )
+    ("PrecFocalLength"                  , m_precFocalLength                  , 0                                  , "PrecFocalLength"                  )
+    ("PrecPrincipalPoint"               , m_precPrincipalPoint               , 0                                  , "PrecPrincipalPoint"               )
+    ("PrecSkewFactor"                   , m_precSkewFactor                   , 0                                  , "PrecSkewFactor"                   )
+    ("SignFocalLengthX"                 , m_signFocalLengthX                 , BoolAry1d(1,0)                     , "SignFocalLengthX"                 )
+    ("ExponentFocalLengthX"             , m_exponentFocalLengthX             , IntAry1d (1,0)                     , "ExponentFocalLengthX"             )
+    ("MantissaFocalLengthX"             , m_mantissaFocalLengthX             , IntAry1d (1,0)                     , "MantissaFocalLengthX"             )
+    ("SignFocalLengthY"                 , m_signFocalLengthY                 , BoolAry1d(1,0)                     , "SignFocalLengthY"                 )
+    ("ExponentFocalLengthY"             , m_exponentFocalLengthY             , IntAry1d (1,0)                     , "ExponentFocalLengthY"             )
+    ("MantissaFocalLengthY"             , m_mantissaFocalLengthY             , IntAry1d (1,0)                     , "MantissaFocalLengthY"             )
+    ("SignPrincipalPointX"              , m_signPrincipalPointX              , BoolAry1d(1,0)                     , "SignPrincipalPointX"              )
+    ("ExponentPrincipalPointX"          , m_exponentPrincipalPointX          , IntAry1d (1,0)                     , "ExponentPrincipalPointX"          )
+    ("MantissaPrincipalPointX"          , m_mantissaPrincipalPointX          , IntAry1d (1,0)                     , "MantissaPrincipalPointX"          )
+    ("SignPrincipalPointY"              , m_signPrincipalPointY              , BoolAry1d(1,0)                     , "SignPrincipalPointY"              )
+    ("ExponentPrincipalPointY"          , m_exponentPrincipalPointY          , IntAry1d (1,0)                     , "ExponentPrincipalPointY"          )
+    ("MantissaPrincipalPointY"          , m_mantissaPrincipalPointY          , IntAry1d (1,0)                     , "MantissaPrincipalPointY"          )
+    ("SignSkewFactor"                   , m_signSkewFactor                   , BoolAry1d(1,0)                     , "SignSkewFactor"                   )
+    ("ExponentSkewFactor"               , m_exponentSkewFactor               , IntAry1d (1,0)                     , "ExponentSkewFactor"               )
+    ("MantissaSkewFactor"               , m_mantissaSkewFactor               , IntAry1d (1,0)                     , "MantissaSkewFactor"               )
+    ("PrecRotationParam"                , m_precRotationParam                , 0                                  , "PrecRotationParam"                )
+    ("PrecTranslationParam"             , m_precTranslationParam             , 0                                  , "PrecTranslationParam"             )
+    ("SignR_%d_%d"                      , m_signR                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS ,3  , "SignR"                            )
+    ("ExponentR_%d_%d"                  , m_exponentR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "ExponentR"                        )
+    ("MantissaR_%d_%d"                  , m_mantissaR                        , IntAry1d (3,0) ,MAX_NUM_LAYERS ,3  , "MantissaR"                        )
+    ("SignT_%d"                         , m_signT                            , BoolAry1d(3,0) ,MAX_NUM_LAYERS     , "SignT"                            )
+    ("ExponentT_%d"                     , m_exponentT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "ExponentT"                        )
+    ("MantissaT_%d"                     , m_mantissaT                        , IntAry1d (3,0) ,MAX_NUM_LAYERS     , "MantissaT"                        )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthXLen( Int i ) const
+{
+  return xGetSyntaxElementLen( m_exponentFocalLengthX[i], m_precFocalLength, m_mantissaFocalLengthX[ i ] );
+}
+
+Bool SEIMultiviewAcquisitionInfo::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  // Currently the encoder starts with POC 0 for all layers. The condition on POC 0 should be changed, when this changes.
+  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." );
+
+  xCheckCfgRange( wrongConfig, m_precFocalLength         , 0, 31, "prec_focal_length"         );
+  xCheckCfgRange( wrongConfig, m_precPrincipalPoint      , 0, 31, "prec_principle_point"      );
+  xCheckCfgRange( wrongConfig, m_precSkewFactor          , 0, 31, "prec_skew_factor"          );
+
+  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
+  {
+    xCheckCfgRange( wrongConfig, m_exponentFocalLengthX    [ i ], 0, 62, "exponent_focal_length_x"   );
+    xCheckCfgRange( wrongConfig, m_exponentFocalLengthY    [ i ], 0, 62, "exponent_focal_length_y"   );
+    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointX [ i ], 0, 62, "exponent_principal_point_x");
+    xCheckCfgRange( wrongConfig, m_exponentPrincipalPointY [ i ], 0, 62, "exponent_principal_point_y");
+    xCheckCfgRange( wrongConfig, m_exponentSkewFactor      [ i ], 0, 62, "exponent_skew_factor"      );
+  }
+
+  xCheckCfgRange( wrongConfig, m_precRotationParam       , 0, 31, "prec_focal_length"         );
+  xCheckCfgRange( wrongConfig, m_precTranslationParam    , 0, 31, "prec_focal_length"         );
+
+  for (Int i = 0; i <= getNumViewsMinus1(); i++ )
+  {
+    for (Int j = 0; j <= 2; j++)
+    {
+      xCheckCfgRange( wrongConfig, m_exponentT[i][j]     , 0, 62, "exponent_skew_factor"      );
+      for (Int k = 0; k <= 2; k++ )
+      {
+        xCheckCfgRange( wrongConfig, m_exponentR[i][j][k], 0, 62, "exponent_principal_point_y");
+      }
+    }
+  }
+
+  return wrongConfig;
+
+};
+
+UInt SEIMultiviewAcquisitionInfo::getMantissaFocalLengthYLen( Int i ) const
+{
+  return xGetSyntaxElementLen( m_exponentFocalLengthY[i], m_precFocalLength, m_mantissaFocalLengthY[ i ]  );
+}
+
+
+UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointXLen( Int i ) const
+{
+  return xGetSyntaxElementLen( m_exponentPrincipalPointX[i], m_precPrincipalPoint, m_mantissaPrincipalPointX[ i ]  );
+}
+
+UInt SEIMultiviewAcquisitionInfo::getMantissaPrincipalPointYLen( Int i ) const
+{
+  return xGetSyntaxElementLen( m_exponentPrincipalPointY[i], m_precPrincipalPoint, m_mantissaPrincipalPointY[ i ] );
+}
+
+UInt SEIMultiviewAcquisitionInfo::getMantissaSkewFactorLen( Int i ) const
+{
+  return xGetSyntaxElementLen( m_exponentSkewFactor[ i ], m_precSkewFactor, m_mantissaSkewFactor[ i ] );
+}
+
+UInt SEIMultiviewAcquisitionInfo::getMantissaRLen( Int i, Int j, Int k ) const
+{
+  return xGetSyntaxElementLen( m_exponentR[ i ][ j ][ k ], m_precRotationParam, m_mantissaR[ i ][ j] [ k ] );
+}
+
+UInt SEIMultiviewAcquisitionInfo::getMantissaTLen( Int i, Int j ) const
+{
+  return xGetSyntaxElementLen( m_exponentT[ i ][ j ], m_precTranslationParam, m_mantissaT[ i ][ j ] );
+}
+UInt SEIMultiviewAcquisitionInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
+{
+  UInt len;
+  if( expo == 0 )
+  {
+    len = std::max(0, prec - 30 );
+  }
+  else
+  {
+    len = std::max( 0, expo + prec - 31 );
+  }
+
+  assert( val >= 0 );
+  assert( val <= ( ( 1 << len )- 1) );
+  return len;
+}
+
+Void SEIMultiviewViewPosition::setupFromSlice  ( const TComSlice* slice )
+{
+  const TComVPS* vps = slice->getVPS();
+  m_numViewsMinus1 = vps->getNumViews() - 1;
+  m_viewPosition.resize( m_numViewsMinus1 + 1 );
+  for (Int i = 0; i <= m_numViewsMinus1; i++ )
+  {
+    // Assuming that view ids indicate the position
+    m_viewPosition[i] = vps->getViewIdVal( i );
+  }
+}
+
+Void SEIMultiviewViewPosition::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  defAppLayerIds    .push_back( 0 );
+  defAppPocs        .push_back( 0 );
+  defAppTids        .push_back( 0 );
+  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = true;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("NumViewsMinus1"         , m_numViewsMinus1                          , 0                       , "NumViewsMinus1")
+    ("ViewPosition"           , m_viewPosition                            , IntAry1d (1,0)          , "ViewPosition"  );
+  ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+
+Bool SEIMultiviewViewPosition::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+  // TBD: Add constraints on presence of SEI here.
+  xCheckCfg     ( wrongConfig, slice->isIRAP() , "When present, the multiview view position SEI message shall be associated with an IRAP access unit."  );
+
+  // TBD: Modify constraints according to the SEI semantics.
+  xCheckCfgRange( wrongConfig, m_numViewsMinus1                 , 0 , 62, "num_views_minus1");
+  for(Int i = 0; i <= m_numViewsMinus1; i++)
+  {
+    xCheckCfgRange( wrongConfig, m_viewPosition[i]                , 0 , 62, "view_position");
+  }
+
+  return wrongConfig;
+
+};
+
+
+#if NH_3D
+Void SEIAlternativeDepthInfo::setupFromCfgFile(const Char* cfgFile)
+{
+  // Set default values
+  IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes;
+
+  defAppLayerIds    .clear();
+  defAppPocs        .clear();
+  defAppTids        .clear();
+  defAppVclNaluTypes.clear();
+
+  Int      defSeiNaluId                  = 0;
+  Int      defPositionInSeiNalu          = 0;
+  Bool     defModifyByEncoder            = false;
+
+  // Setup config file options
+  po::Options opts;
+  xAddGeneralOpts( opts , defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes, defSeiNaluId, defPositionInSeiNalu, defModifyByEncoder );
+
+  opts.addOptions()
+    ("AlternativeDepthInfoCancelFlag" , m_alternativeDepthInfoCancelFlag  , false               , "AlternativeDepthInfoCancelFlag"  )
+    ("DepthType"                      , m_depthType                       , 1                   , "DepthType"                       )
+    ("NumConstituentViewsGvdMinus1"   , m_numConstituentViewsGvdMinus1    , 1                   , "NumConstituentViewsGvdMinus1"    )
+    ("DepthPresentGvdFlag"            , m_depthPresentGvdFlag             , false               , "DepthPresentGvdFlag"             )
+    ("ZGvdFlag"                       , m_zGvdFlag                        , false               , "ZGvdFlag"                        )
+    ("IntrinsicParamGvdFlag"          , m_intrinsicParamGvdFlag           , false               , "IntrinsicParamGvdFlag"           )
+    ("RotationGvdFlag"                , m_rotationGvdFlag                 , false               , "RotationGvdFlag"                 )
+    ("TranslationGvdFlag"             , m_translationGvdFlag              , false               , "TranslationGvdFlag"              )
+    ("SignGvdZNearFlag_%d"            , m_signGvdZNearFlag                , BoolAry1d(3,0), 3   , "SignGvdZNearFlag"                )
+    ("ExpGvdZNear_%d"                 , m_expGvdZNear                     , IntAry1d (3,0), 3   , "ExpGvdZNear"                     )
+    ("ManLenGvdZNearMinus1_%d"        , m_manLenGvdZNearMinus1            , IntAry1d (3,0), 3   , "ManLenGvdZNearMinus1"            )
+    ("ManGvdZNear_%d"                 , m_manGvdZNear                     , IntAry1d (3,0), 3   , "ManGvdZNear"                     )
+    ("SignGvdZFarFlag_%d"             , m_signGvdZFarFlag                 , BoolAry1d(3,0), 3   , "SignGvdZFarFlag"                 )
+    ("ExpGvdZFar_%d"                  , m_expGvdZFar                      , IntAry1d (3,0), 3   , "ExpGvdZFar"                      )
+    ("ManLenGvdZFarMinus1_%d"         , m_manLenGvdZFarMinus1             , IntAry1d (3,0), 3   , "ManLenGvdZFarMinus1"             )
+    ("ManGvdZFar_%d"                  , m_manGvdZFar                      , IntAry1d (3,0), 3   , "ManGvdZFar"                      )
+    ("PrecGvdFocalLength"             , m_precGvdFocalLength              , 18                  , "PrecGvdFocalLength"              )
+    ("PrecGvdPrincipalPoint"          , m_precGvdPrincipalPoint           , 18                  , "PrecGvdPrincipalPoint"           )
+    ("PrecGvdRotationParam"           , m_precGvdRotationParam            , 18                  , "PrecGvdRotationParam"            )
+    ("PrecGvdTranslationParam"        , m_precGvdTranslationParam         , 18                  , "PrecGvdTranslationParam"         )
+    ("SignGvdFocalLengthX_%d"         , m_signGvdFocalLengthX             , BoolAry1d(3,0), 3   ,"SignGvdFocalLengthX"              )
+    ("ExpGvdFocalLengthX_%d"          , m_expGvdFocalLengthX              , IntAry1d (3,0), 3   ,"ExpGvdFocalLengthX"               )
+    ("ManGvdFocalLengthX_%d"          , m_manGvdFocalLengthX              , IntAry1d (3,0), 3   ,"ManGvdFocalLengthX"               )
+    ("SignGvdFocalLengthY_%d"         , m_signGvdFocalLengthY             , BoolAry1d(3,0), 3   ,"SignGvdFocalLengthY"              )
+    ("ExpGvdFocalLengthY_%d"          , m_expGvdFocalLengthY              , IntAry1d (3,0), 3   ,"ExpGvdFocalLengthY"               )
+    ("ManGvdFocalLengthY_%d"          , m_manGvdFocalLengthY              , IntAry1d (3,0), 3   ,"ManGvdFocalLengthY"               )
+    ("SignGvdPrincipalPointX_%d"      , m_signGvdPrincipalPointX          , BoolAry1d(3,0), 3   ,"SignGvdPrincipalPointX"           )
+    ("ExpGvdPrincipalPointX_%d"       , m_expGvdPrincipalPointX           , IntAry1d (3,0), 3   ,"ExpGvdPrincipalPointX"            )
+    ("ManGvdPrincipalPointX_%d"       , m_manGvdPrincipalPointX           , IntAry1d (3,0), 3   ,"ManGvdPrincipalPointX"            )
+    ("SignGvdPrincipalPointY_%d"      , m_signGvdPrincipalPointY          , BoolAry1d(3,0), 3   ,"SignGvdPrincipalPointY"           )
+    ("ExpGvdPrincipalPointY_%d"       , m_expGvdPrincipalPointY           , IntAry1d (3,0), 3   ,"ExpGvdPrincipalPointY"            )
+    ("ManGvdPrincipalPointY_%d"       , m_manGvdPrincipalPointY           , IntAry1d (3,0), 3   ,"ManGvdPrincipalPointY"            )
+    ("SignGvdR00_%d"                  , m_signGvdR00                      , BoolAry1d(3,0), 3   ,"SignGvdR00"                       )
+    ("ExpGvdR00_%d"                   , m_expGvdR00                       , IntAry1d (3,0), 3   ,"ExpGvdR00"                        )
+    ("ManGvdR00_%d"                   , m_manGvdR00                       , IntAry1d (3,0), 3   ,"ManGvdR00"                        )
+    ("SignGvdR01_%d"                  , m_signGvdR01                      , BoolAry1d(3,0), 3   ,"SignGvdR01"                       )
+    ("ExpGvdR01_%d"                   , m_expGvdR01                       , IntAry1d (3,0), 3   ,"ExpGvdR01"                        )
+    ("ManGvdR01_%d"                   , m_manGvdR01                       , IntAry1d (3,0), 3   ,"ManGvdR01"                        )
+    ("SignGvdR02_%d"                  , m_signGvdR02                      , BoolAry1d(3,0), 3   ,"SignGvdR02"                       )
+    ("ExpGvdR02_%d"                   , m_expGvdR02                       , IntAry1d (3,0), 3   ,"ExpGvdR02"                        )
+    ("ManGvdR02_%d"                   , m_manGvdR02                       , IntAry1d (3,0), 3   ,"ManGvdR02"                        )
+    ("SignGvdR10_%d"                  , m_signGvdR10                      , BoolAry1d(3,0), 3   ,"SignGvdR10"                       )
+    ("ExpGvdR10_%d"                   , m_expGvdR10                       , IntAry1d (3,0), 3   ,"ExpGvdR10"                        )
+    ("ManGvdR10_%d"                   , m_manGvdR10                       , IntAry1d (3,0), 3   ,"ManGvdR10"                        )
+    ("SignGvdR11_%d"                  , m_signGvdR11                      , BoolAry1d(3,0), 3   ,"SignGvdR11"                       )
+    ("ExpGvdR11_%d"                   , m_expGvdR11                       , IntAry1d (3,0), 3   ,"ExpGvdR11"                        )
+    ("ManGvdR11_%d"                   , m_manGvdR11                       , IntAry1d (3,0), 3   ,"ManGvdR11"                        )
+    ("SignGvdR12_%d"                  , m_signGvdR12                      , BoolAry1d(3,0), 3   ,"SignGvdR12"                       )
+    ("ExpGvdR12_%d"                   , m_expGvdR12                       , IntAry1d (3,0), 3   ,"ExpGvdR12"                        )
+    ("ManGvdR12_%d"                   , m_manGvdR12                       , IntAry1d (3,0), 3   ,"ManGvdR12"                        )
+    ("SignGvdR20_%d"                  , m_signGvdR20                      , BoolAry1d(3,0), 3   ,"SignGvdR20"                       )
+    ("ExpGvdR20_%d"                   , m_expGvdR20                       , IntAry1d (3,0), 3   ,"ExpGvdR20"                        )
+    ("ManGvdR20_%d"                   , m_manGvdR20                       , IntAry1d (3,0), 3   ,"ManGvdR20"                        )
+    ("SignGvdR21_%d"                  , m_signGvdR21                      , BoolAry1d(3,0), 3   ,"SignGvdR21"                       )
+    ("ExpGvdR21_%d"                   , m_expGvdR21                       , IntAry1d (3,0), 3   ,"ExpGvdR21"                        )
+    ("ManGvdR21_%d"                   , m_manGvdR21                       , IntAry1d (3,0), 3   ,"ManGvdR21"                        )
+    ("SignGvdR22_%d"                  , m_signGvdR22                      , BoolAry1d(3,0), 3   ,"SignGvdR22"                       )
+    ("ExpGvdR22_%d"                   , m_expGvdR22                       , IntAry1d (3,0), 3   ,"ExpGvdR22"                        )
+    ("ManGvdR22_%d"                   , m_manGvdR22                       , IntAry1d (3,0), 3   ,"ManGvdR22"                        )
+    ("SignGvdTX_%d"                   , m_signGvdTX                       , BoolAry1d(3,0), 3   ,"SignGvdTX"                        )
+    ("ExpGvdTX_%d"                    , m_expGvdTX                        , IntAry1d (3,0), 3   ,"ExpGvdTX"                         )
+    ("ManGvdTX_%d"                    , m_manGvdTX                        , IntAry1d (3,0), 3   ,"ManGvdTX"                         )
+    ("MinOffsetXInt"                  , m_minOffsetXInt                   , 0                   , "MinOffsetXInt"                   )
+    ("MinOffsetXFrac"                 , m_minOffsetXFrac                  , 0                   , "MinOffsetXFrac"                  )
+    ("MaxOffsetXInt"                  , m_maxOffsetXInt                   , 0                   , "MaxOffsetXInt"                   )
+    ("MaxOffsetXFrac"                 , m_maxOffsetXFrac                  , 0                   , "MaxOffsetXFrac"                  )
+    ("OffsetYPresentFlag"             , m_offsetYPresentFlag              , false               , "OffsetYPresentFlag"              )
+    ("MinOffsetYInt"                  , m_minOffsetYInt                   , 0                   , "MinOffsetYInt"                   )
+    ("MinOffsetYFrac"                 , m_minOffsetYFrac                  , 0                   , "MinOffsetYFrac"                  )
+    ("MaxOffsetYInt"                  , m_maxOffsetYInt                   , 0                   , "MaxOffsetYInt"                   )
+    ("MaxOffsetYFrac"                 , m_maxOffsetYFrac                  , 0                   , "MaxOffsetYFrac"                  )
+    ("WarpMapSizePresentFlag"         , m_warpMapSizePresentFlag          , false               , "WarpMapSizePresentFlag"          )
+    ("WarpMapWidthMinus2"             , m_warpMapWidthMinus2              , 0                   , "WarpMapWidthMinus2"              )
+    ("WarpMapHeightMinus2"            , m_warpMapHeightMinus2             , 0                   , "WarpMapHeightMinus2"             )
+    ;
+
+  po::setDefaults(opts);
+
+  // Parse the cfg file
+  po::ErrorReporter err;
+  po::parseConfigFile( opts, cfgFile, err );
+};
+Bool SEIAlternativeDepthInfo::checkCfg( const TComSlice* slice )
+{
+  // Check config values
+  Bool wrongConfig = false;
+
+
+  xCheckCfgRange( wrongConfig, m_alternativeDepthInfoCancelFlag , 0 , 1, "alternative_depth_info_cancel_flag");
+  xCheckCfgRange( wrongConfig, m_depthType                      , 0 , 1, "depth_type"                       );
+
+  xCheckCfgRange( wrongConfig, m_numConstituentViewsGvdMinus1   , 1 , 1, "num_constituent_views_gvd_minus1 "); // 1: 3 views only, cuurent.
+  xCheckCfgRange( wrongConfig, m_depthPresentGvdFlag            , 0 , 1, "depth_present_gvd_flag"           );
+  xCheckCfgRange( wrongConfig, m_zGvdFlag                       , 0 , 1, "z_gvd_flag"                       );
+  xCheckCfgRange( wrongConfig, m_intrinsicParamGvdFlag          , 0 , 1, "intrinsic_param_gvd_flag"         );
+  xCheckCfgRange( wrongConfig, m_rotationGvdFlag                , 0 , 1, "rotation_gvd_flag"                );
+  xCheckCfgRange( wrongConfig, m_translationGvdFlag             , 0 , 1, "translation_gvd_flag"             );
+
+  return wrongConfig;
+
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdFocalLengthXLen       ( Int i, int j ) const
+{
+  UInt rval;
+  rval = xGetSyntaxElementLen( m_expGvdFocalLengthX[i][j], m_precGvdFocalLength, m_manGvdFocalLengthX[i][j]  );
+  if (rval == 0)
+    return m_precGvdFocalLength;
+  else
+    return rval;
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdFocalLengthYLen       ( Int i, int j ) const
+{
+  UInt rval;
+  rval = xGetSyntaxElementLen( m_expGvdFocalLengthY[i][j], m_precGvdFocalLength, m_manGvdFocalLengthY[i][j]  );
+  if (rval == 0)
+    return m_precGvdFocalLength;
+  else
+    return rval;
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdPrincipalPointXLen    ( Int i, int j ) const
+{
+  UInt rval;
+  rval = xGetSyntaxElementLen( m_expGvdPrincipalPointX[i][j], m_precGvdPrincipalPoint, m_manGvdPrincipalPointX[i][j]  );
+  if (rval == 0)
+    return m_precGvdPrincipalPoint;
+  else
+    return rval;
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdPrincipalPointYLen    ( Int i, int j ) const
+{
+  UInt rval;
+  rval = xGetSyntaxElementLen( m_expGvdPrincipalPointY[i][j], m_precGvdPrincipalPoint, m_manGvdPrincipalPointY[i][j]  );
+  if (rval == 0)
+    return m_precGvdPrincipalPoint;
+  else
+    return rval;
+};
+
+UInt SEIAlternativeDepthInfo::getManGvdTXLen                 ( Int i, int j ) const
+{
+  UInt rval;
+  rval = xGetSyntaxElementLen( m_expGvdTX[i][j], m_precGvdTranslationParam, m_manGvdTX[i][j]  );
+  if (rval == 0)
+    return m_precGvdTranslationParam;
+  else
+    return rval;
+};
+
+UInt SEIAlternativeDepthInfo::xGetSyntaxElementLen( Int expo, Int prec, Int val ) const
+{
+  UInt len;
+  if( expo == 0 )
+  {
+    len = std::max(0, prec - 30 );
+  }
+  else
+  {
+    len = std::max( 0, expo + prec - 31 );
+  }
+
+  assert( val >= 0 );
+  assert( val <= ( ( 1 << len )- 1) );
+  return len;
+}
+
+#endif
+
+#endif
Index: /trunk/source/Lib/TLibCommon/SEI.h
===================================================================
--- /trunk/source/Lib/TLibCommon/SEI.h	(revision 1355)
+++ /trunk/source/Lib/TLibCommon/SEI.h	(revision 1356)
@@ -42,7 +42,19 @@
 #include "CommonDef.h"
 #include "libmd5/MD5.h"
+
+
+#if NH_MV_SEI
+#include "TAppCommon/program_options_lite.h"
+using namespace std;
+namespace po = df::program_options_lite;
+#endif
+
 //! \ingroup TLibCommon
 //! \{
 class TComSPS;
+#if NH_MV_SEI
+class TComSlice;
+class SEIScalableNesting;
+#endif
 
 /**
@@ -84,16 +96,63 @@
     CHROMA_SAMPLING_FILTER_HINT          = 140,
     KNEE_FUNCTION_INFO                   = 141
-#if NH_MV
-    ,SUB_BITSTREAM_PROPERTY              = 164
+#if NH_MV_SEI
+    ,COLOUR_REMAPPING_INFO                    = 142,
+    DEINTERLACED_FIELD_IDENTIFICATION         = 143,
+    LAYERS_NOT_PRESENT                        = 160,
+    INTER_LAYER_CONSTRAINED_TILE_SETS         = 161,
+    BSP_NESTING                               = 162,
+    BSP_INITIAL_ARRIVAL_TIME                  = 163,
+    SUB_BITSTREAM_PROPERTY                    = 164,
+    ALPHA_CHANNEL_INFO                        = 165,
+    OVERLAY_INFO                              = 166,
+    TEMPORAL_MV_PREDICTION_CONSTRAINTS        = 167,
+    FRAME_FIELD_INFO                          = 168,
+    THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO = 176,
+    DEPTH_REPRESENTATION_INFO                 = 177,
+    MULTIVIEW_SCENE_INFO                      = 178,
+    MULTIVIEW_ACQUISITION_INFO                = 179,
+    MULTIVIEW_VIEW_POSITION                   = 180
+#if NH_3D
+    ,ALTERNATIVE_DEPTH_INFO                    = 181
 #endif
+#endif
 
   };
 
-  SEI() {}
+  SEI();
+
   virtual ~SEI() {}
-
-  static const Char *getSEIMessageString(SEI::PayloadType payloadType);
-
+  virtual SEI*       getCopy( ) const;
+  static const Char *getSEIMessageString(SEI::PayloadType payloadType );
   virtual PayloadType payloadType() const = 0;
+
+#if NH_MV_SEI
+  static SEI*        getNewSEIMessage         ( SEI::PayloadType payloadType );
+  Bool               insertSei                ( Int curLayerId, Int curPoc, Int curTid, Int curNaluType ) const;
+
+
+  virtual Void       setupFromSlice           ( const TComSlice* slice );
+  virtual Void       setupFromCfgFile         ( const Char* cfgFile );
+  virtual Bool       checkCfg                 ( const TComSlice* slice   );
+
+  Void               xPrintCfgErrorIntro();
+  Void               xCheckCfgRange           ( Bool& wrongConfig, Int val, Int minVal, Int maxVal, const Char* seName );
+  Void               xCheckCfg                ( Bool& wrongConfig, Bool cond, const Char* errStr );
+  Void               xAddGeneralOpts          ( po::Options &opts, IntAry1d defAppLayerIds, IntAry1d defAppPocs, IntAry1d defAppTids, IntAry1d defAppVclNaluTypes,
+                                                Int defSeiNaluId, Int defPositionInSeiNalu, Bool defModifyByEncoder );
+    // Filters where to insert SEI in the bitstream.
+  // When the respected vector is empty, all layersIds, POCs, Tids, and Nalu types are used.
+  IntAry1d                       m_applicableLayerIds;
+  IntAry1d                       m_applicablePocs;
+  IntAry1d                       m_applicableTids;
+  IntAry1d                       m_applicableVclNaluTypes;
+
+  Int                            m_payloadType;              // Payload type
+  Int                            m_seiNaluId;                // Identifies to which NAL unit  the SEI is added.
+  Int                            m_positionInSeiNalu;        // Identifies the order within the NAL unit
+  Bool                           m_modifyByEncoder;          // Don't use the SEI cfg-file, but let let the encoder setup the NALU.
+
+  SEIScalableNesting*            m_scalNestSeiContThisSei;   // Pointer to scalable nesting SEI containing the SEI. When NULL, the SEI is not nested.
+#endif
 };
 
@@ -155,5 +214,5 @@
   Bool m_noParameterSetUpdateFlag;
   Int numSpsIdsMinus1;
-  std::vector<Int> activeSeqParameterSetId; 
+  std::vector<Int> activeSeqParameterSetId;
 };
 
@@ -468,9 +527,10 @@
     SEIMasteringDisplayColourVolume() {}
     virtual ~SEIMasteringDisplayColourVolume(){}
-    
+
     TComSEIMasteringDisplay values;
 };
 
 #if NH_MV
+#if !NH_MV_SEI
 class SEISubBitstreamProperty : public SEI
 {
@@ -490,4 +550,5 @@
 };
 #endif
+#endif
 
 typedef std::list<SEI*> SEIMessages;
@@ -550,5 +611,5 @@
 
     public:
-      Int     m_mcts_id;  
+      Int     m_mcts_id;
       Bool    m_display_tile_set_flag;
       Int     m_num_tile_rects_in_set; //_minus1;
@@ -598,5 +659,703 @@
 };
 
+#if NH_MV_SEI
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+class SEILayersNotPresent : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return LAYERS_NOT_PRESENT; }
+  SEILayersNotPresent ( ) { };
+  ~SEILayersNotPresent( ) { };
+  SEI* getCopy( ) const { return new SEILayersNotPresent(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Int       m_lnpSeiActiveVpsId;
+  UInt      m_lnpSeiMaxLayers;
+  BoolAry1d m_layerNotPresentFlag;
+
+  Void resizeDimI( Int sizeDimI )
+  {
+    m_layerNotPresentFlag.resize( sizeDimI );
+  }
+};
 #endif
 
+class SEIInterLayerConstrainedTileSets : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return INTER_LAYER_CONSTRAINED_TILE_SETS; }
+  SEIInterLayerConstrainedTileSets ( ) { };
+  ~SEIInterLayerConstrainedTileSets( ) { };
+  SEI* getCopy( ) const { return new SEIInterLayerConstrainedTileSets(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Bool      m_ilAllTilesExactSampleValueMatchFlag;
+  Bool      m_ilOneTilePerTileSetFlag;
+  Int       m_ilNumSetsInMessageMinus1;
+  Bool      m_skippedTileSetPresentFlag;
+  IntAry1d  m_ilctsId;
+  IntAry1d  m_ilNumTileRectsInSetMinus1;
+  IntAry2d  m_ilTopLeftTileIndex;
+  IntAry2d  m_ilBottomRightTileIndex;
+  IntAry1d  m_ilcIdc;
+  BoolAry1d m_ilExactSampleValueMatchFlag;
+  Int       m_allTilesIlcIdc;
+
+  Void      resizeDimI( Int sizeDimI )
+  {
+    m_ilctsId                    .resize( sizeDimI );
+    m_ilNumTileRectsInSetMinus1  .resize( sizeDimI );
+    m_ilTopLeftTileIndex         .resize( sizeDimI );
+    m_ilBottomRightTileIndex     .resize( sizeDimI );
+    m_ilcIdc                     .resize( sizeDimI );
+    m_ilExactSampleValueMatchFlag.resize( sizeDimI );
+  }
+
+  Void      resizeDimJ( Int i, Int sizeDimJ )
+  {
+    m_ilTopLeftTileIndex    [i].resize( sizeDimJ );
+    m_ilBottomRightTileIndex[i].resize( sizeDimJ );
+  }
+
+};
+
+#if NH_MV_TBD
+class SEIBspNesting : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return BSP_NESTING; }
+  SEIBspNesting ( ) { };
+  ~SEIBspNesting( ) { };
+  SEI* getCopy( ) const { return new SEIBspNesting(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Void setupFromSlice  ( const TComSlice* slice   );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Int       m_seiOlsIdx;
+  Int       m_seiPartitioningSchemeIdx;
+  Int       m_bspIdx;
+  Int       m_bspNestingZeroBit;
+  Int       m_numSeisInBspMinus1;
+};
+
+class SEIBspInitialArrivalTime : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return BSP_INITIAL_ARRIVAL_TIME; }
+  SEIBspInitialArrivalTime ( ) { };
+  ~SEIBspInitialArrivalTime( ) { };
+  SEI* getCopy( ) const { return new SEIBspInitialArrivalTime(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Void setupFromSlice  ( const TComSlice* slice   );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  IntAry1d  m_nalInitialArrivalDelay;
+  IntAry1d  m_vclInitialArrivalDelay;
+};
+#endif
+
+class SEISubBitstreamProperty : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return SUB_BITSTREAM_PROPERTY; }
+  SEISubBitstreamProperty ( ) { };
+  ~SEISubBitstreamProperty( ) { };
+  SEI* getCopy( ) const { return new SEISubBitstreamProperty(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+  Void resizeArrays    ( );
+
+  Int       m_sbPropertyActiveVpsId;
+  Int       m_numAdditionalSubStreamsMinus1;
+  IntAry1d  m_subBitstreamMode;
+  IntAry1d  m_olsIdxToVps;
+  IntAry1d  m_highestSublayerId;
+  IntAry1d  m_avgSbPropertyBitRate;
+  IntAry1d  m_maxSbPropertyBitRate;
+};
+
+class SEIAlphaChannelInfo : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return ALPHA_CHANNEL_INFO; }
+  SEIAlphaChannelInfo ( ) { };
+  ~SEIAlphaChannelInfo( ) { };
+  SEI* getCopy( ) const { return new SEIAlphaChannelInfo(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Bool      m_alphaChannelCancelFlag;
+  Int       m_alphaChannelUseIdc;
+  Int       m_alphaChannelBitDepthMinus8;
+  Int       m_alphaTransparentValue;
+  Int       m_alphaOpaqueValue;
+  Bool      m_alphaChannelIncrFlag;
+  Bool      m_alphaChannelClipFlag;
+  Bool      m_alphaChannelClipTypeFlag;
+};
+
+class SEIOverlayInfo : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return OVERLAY_INFO; }
+  SEIOverlayInfo ( );
+  ~SEIOverlayInfo( ) { };
+  SEI* getCopy( ) const { return new SEIOverlayInfo(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  const Int m_numOverlaysMax;
+  const Int m_numOverlayElementsMax;
+  const Int m_numStringBytesMax;  //incl. null termination byte
+
+  Bool      m_overlayInfoCancelFlag;
+  Int       m_overlayContentAuxIdMinus128;
+  Int       m_overlayLabelAuxIdMinus128;
+  Int       m_overlayAlphaAuxIdMinus128;
+  Int       m_overlayElementLabelValueLengthMinus8;
+  Int       m_numOverlaysMinus1;
+  IntAry1d  m_overlayIdx;
+  BoolAry1d m_languageOverlayPresentFlag;
+  IntAry1d  m_overlayContentLayerId;
+  BoolAry1d m_overlayLabelPresentFlag;
+  IntAry1d  m_overlayLabelLayerId;
+  BoolAry1d m_overlayAlphaPresentFlag;
+  IntAry1d  m_overlayAlphaLayerId;
+  IntAry1d  m_numOverlayElementsMinus1;
+  IntAry2d  m_overlayElementLabelMin;
+  IntAry2d  m_overlayElementLabelMax;
+  StringAry1d  m_overlayLanguage;
+  StringAry1d  m_overlayName;
+  StringAry2d  m_overlayElementName;
+  Bool      m_overlayInfoPersistenceFlag;
+};
+
+class SEITemporalMvPredictionConstraints : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return TEMPORAL_MV_PREDICTION_CONSTRAINTS; }
+  SEITemporalMvPredictionConstraints ( ) { };
+  ~SEITemporalMvPredictionConstraints( ) { };
+  SEI* getCopy( ) const { return new SEITemporalMvPredictionConstraints(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Bool      m_prevPicsNotUsedFlag;
+  Bool      m_noIntraLayerColPicFlag;
+};
+
+#if NH_MV_SEI_TBD
+class SEIFrameFieldInfo : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return FRAME_FIELD_INFO; }
+  SEIFrameFieldInfo ( ) { };
+  ~SEIFrameFieldInfo( ) { };
+  SEI* getCopy( ) const { return new SEIFrameFieldInfo(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Void setupFromSlice  ( const TComSlice* slice   );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Int       m_ffinfoPicStruct;
+  Int       m_ffinfoSourceScanType;
+  Bool      m_ffinfoDuplicateFlag;
+};
+#endif
+
+class SEIThreeDimensionalReferenceDisplaysInfo : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO; }
+  SEIThreeDimensionalReferenceDisplaysInfo ( ) { };
+  ~SEIThreeDimensionalReferenceDisplaysInfo( ) { };
+  SEI* getCopy( ) const { return new SEIThreeDimensionalReferenceDisplaysInfo(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Int getNumRefDisplaysMinus1( ) const
+  {
+    return m_numRefDisplaysMinus1;
+  }
+
+  Int       m_precRefDisplayWidth;
+  Bool      m_refViewingDistanceFlag;
+  Int       m_precRefViewingDist;
+  Int       m_numRefDisplaysMinus1;
+  IntAry1d  m_leftViewId;
+  IntAry1d  m_rightViewId;
+  IntAry1d  m_exponentRefDisplayWidth;
+  IntAry1d  m_mantissaRefDisplayWidth;
+  IntAry1d  m_exponentRefViewingDistance;
+  IntAry1d  m_mantissaRefViewingDistance;
+  BoolAry1d m_additionalShiftPresentFlag;
+  IntAry1d  m_numSampleShiftPlus512;
+  Bool      m_threeDimensionalReferenceDisplaysExtensionFlag;
+
+  Void resizeArrays( )
+  {
+    Int numReferenceDiaplays = getNumRefDisplaysMinus1() + 1;
+
+    m_leftViewId    .resize( numReferenceDiaplays );
+    m_rightViewId   .resize( numReferenceDiaplays );
+    m_exponentRefDisplayWidth      .resize( numReferenceDiaplays );
+    m_mantissaRefDisplayWidth      .resize( numReferenceDiaplays );
+    m_exponentRefViewingDistance   .resize( numReferenceDiaplays );
+    m_mantissaRefViewingDistance   .resize( numReferenceDiaplays );
+    m_additionalShiftPresentFlag   .resize( numReferenceDiaplays );
+    m_numSampleShiftPlus512        .resize( numReferenceDiaplays );
+  }
+
+  UInt getMantissaReferenceDisplayWidthLen  ( Int i ) const ;
+  UInt getMantissaReferenceViewingDistanceLen  ( Int i ) const ;
+private:
+  UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const;
+};
+
+#if SEI_DRI_F0169
+class SEIDepthRepresentationInfo : public SEI
+{
+    public:
+        PayloadType payloadType( ) const { return DEPTH_REPRESENTATION_INFO; }
+        SEIDepthRepresentationInfo ( )
+        {
+            m_currLayerID=-1;
+        };
+        ~SEIDepthRepresentationInfo( ) { };
+        SEI* getCopy( ) const { return new SEIDepthRepresentationInfo(*this); };
+
+        Void setupFromCfgFile( const Char*      cfgFile );
+        Void setupFromSlice  ( const TComSlice* slice   );
+        Bool checkCfg        ( const TComSlice* slice   );
+        Void clear()
+        {
+            int i;
+            m_zNearFlag.clear();
+            m_zFarFlag.clear();
+            m_dMinFlag.clear();
+            m_dMaxFlag.clear();
+
+            for(i=0;i<m_zNear.size();i++)
+                m_zNear[i].clear();
+            m_zNear.clear();
+
+            for(i=0;i<m_zFar.size();i++)
+                m_zFar[i].clear();
+            m_zFar.clear();
+
+            for(i=0;i<m_dMin.size();i++)
+                m_dMin[i].clear();
+            m_dMin.clear();
+
+            for(i=0;i<m_dMax.size();i++)
+                m_dMax[i].clear();
+            m_dMax.clear();
+
+            for(i=0;i<m_depthRepresentationType.size();i++)
+                m_depthRepresentationType[i].clear();
+            m_depthRepresentationType.clear();
+
+            for(i=0;i<m_disparityRefViewId.size();i++)
+                m_disparityRefViewId[i].clear();
+            m_disparityRefViewId.clear();
+
+            for(i=0;i<m_depthNonlinearRepresentationNumMinus1.size();i++)
+                m_depthNonlinearRepresentationNumMinus1[i].clear();
+            m_depthNonlinearRepresentationNumMinus1.clear();
+
+            for(i=0;i<m_depth_nonlinear_representation_model.size();i++)
+                m_depth_nonlinear_representation_model[i].clear();
+            m_depth_nonlinear_representation_model.clear();
+
+        }
+        Int m_currLayerID;
+        BoolAry1d      m_zNearFlag;
+        BoolAry1d      m_zFarFlag;
+        BoolAry1d      m_dMinFlag;
+        BoolAry1d      m_dMaxFlag;
+        BoolAry2d      m_depthRepresentationInfoSeiPresentFlag;
+        std::vector< std::vector<Double> > m_zNear,m_zFar,m_dMin,m_dMax;
+
+        IntAry2d       m_depthRepresentationType;
+        IntAry2d       m_disparityRefViewId;
+        IntAry2d       m_depthNonlinearRepresentationNumMinus1;
+        IntAry2d       m_depth_nonlinear_representation_model;
+};
+#endif
+
+class SEIMultiviewSceneInfo : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return MULTIVIEW_SCENE_INFO; }
+  SEIMultiviewSceneInfo ( ) { };
+  ~SEIMultiviewSceneInfo( ) { };
+  SEI* getCopy( ) const { return new SEIMultiviewSceneInfo(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Int       m_minDisparity;
+  Int       m_maxDisparityRange;
+};
+
+
+class SEIMultiviewAcquisitionInfo : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return MULTIVIEW_ACQUISITION_INFO; }
+  SEIMultiviewAcquisitionInfo ( ) { };
+  ~SEIMultiviewAcquisitionInfo( ) { };
+  SEI* getCopy( ) const { return new SEIMultiviewAcquisitionInfo(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Int getNumViewsMinus1( ) const
+  {
+    Int numViewsMinus1;
+    if( m_scalNestSeiContThisSei != NULL )
+    {
+      numViewsMinus1 = m_scalNestSeiContThisSei->m_nestingNumLayersMinus1;
+    }
+    else
+    {
+      numViewsMinus1 = 0;
+    }
+    return numViewsMinus1;
+  }
+
+  Void resizeArrays( )
+  {
+    Int numViews = getNumViewsMinus1() + 1;
+    m_signFocalLengthX       .resize( numViews );
+    m_exponentFocalLengthX   .resize( numViews );
+    m_mantissaFocalLengthX   .resize( numViews );
+    m_signFocalLengthY       .resize( numViews );
+    m_exponentFocalLengthY   .resize( numViews );
+    m_mantissaFocalLengthY   .resize( numViews );
+    m_signPrincipalPointX    .resize( numViews );
+    m_exponentPrincipalPointX.resize( numViews );
+    m_mantissaPrincipalPointX.resize( numViews );
+    m_signPrincipalPointY    .resize( numViews );
+    m_exponentPrincipalPointY.resize( numViews );
+    m_mantissaPrincipalPointY.resize( numViews );
+    m_signSkewFactor         .resize( numViews );
+    m_exponentSkewFactor     .resize( numViews );
+    m_mantissaSkewFactor     .resize( numViews );
+
+    m_signR                  .resize( numViews );
+    m_exponentR              .resize( numViews );
+    m_mantissaR              .resize( numViews );
+    m_signT                  .resize( numViews );
+    m_exponentT              .resize( numViews );
+    m_mantissaT              .resize( numViews );
+
+    for( Int i = 0; i  < numViews ; i++ )
+    {
+      m_signR    [i].resize( 3 );
+      m_exponentR[i].resize( 3 );
+      m_mantissaR[i].resize( 3 );
+      m_signT    [i].resize( 3 );
+      m_exponentT[i].resize( 3 );
+      m_mantissaT[i].resize( 3 );
+
+      for (Int j = 0; j < 3; j++)
+      {
+        m_signR    [i][j].resize( 3 );
+        m_exponentR[i][j].resize( 3 );
+        m_mantissaR[i][j].resize( 3 );
+      }
+    }
+  }
+
+  UInt getMantissaFocalLengthXLen   ( Int i ) const ;
+  UInt getMantissaFocalLengthYLen   ( Int i ) const ;
+  UInt getMantissaPrincipalPointXLen( Int i ) const ;
+  UInt getMantissaPrincipalPointYLen( Int i ) const ;
+  UInt getMantissaSkewFactorLen     ( Int i ) const ;
+  UInt getMantissaRLen              ( Int i, Int j, Int k ) const ;
+  UInt getMantissaTLen              ( Int i, Int j )        const ;
+
+  Bool      m_intrinsicParamFlag;
+  Bool      m_extrinsicParamFlag;
+  Bool      m_intrinsicParamsEqualFlag;
+  Int       m_precFocalLength;
+  Int       m_precPrincipalPoint;
+  Int       m_precSkewFactor;
+  BoolAry1d m_signFocalLengthX;
+  IntAry1d  m_exponentFocalLengthX;
+  IntAry1d  m_mantissaFocalLengthX;
+  BoolAry1d m_signFocalLengthY;
+  IntAry1d  m_exponentFocalLengthY;
+  IntAry1d  m_mantissaFocalLengthY;
+  BoolAry1d m_signPrincipalPointX;
+  IntAry1d  m_exponentPrincipalPointX;
+  IntAry1d  m_mantissaPrincipalPointX;
+  BoolAry1d m_signPrincipalPointY;
+  IntAry1d  m_exponentPrincipalPointY;
+  IntAry1d  m_mantissaPrincipalPointY;
+  BoolAry1d m_signSkewFactor;
+  IntAry1d  m_exponentSkewFactor;
+  IntAry1d  m_mantissaSkewFactor;
+  Int       m_precRotationParam;
+  Int       m_precTranslationParam;
+  BoolAry3d m_signR;
+  IntAry3d  m_exponentR;
+  IntAry3d  m_mantissaR;
+  BoolAry2d m_signT;
+  IntAry2d  m_exponentT;
+  IntAry2d  m_mantissaT;
+private:
+  UInt xGetSyntaxElementLen( Int expo, Int prec, Int val ) const;
+};
+
+
+
+class SEIMultiviewViewPosition : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return MULTIVIEW_VIEW_POSITION; }
+  SEIMultiviewViewPosition ( ) { };
+  ~SEIMultiviewViewPosition( ) { };
+  SEI* getCopy( ) const { return new SEIMultiviewViewPosition(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Void setupFromSlice  ( const TComSlice* slice   );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  Int       m_numViewsMinus1;
+  IntAry1d  m_viewPosition;
+};
+
+#if NH_3D
+class SEIAlternativeDepthInfo : public SEI
+{
+public:
+  PayloadType payloadType( ) const { return ALTERNATIVE_DEPTH_INFO; }
+  SEIAlternativeDepthInfo ( ) { };
+  ~SEIAlternativeDepthInfo( ) { };
+  SEI* getCopy( ) const { return new SEIAlternativeDepthInfo(*this); };
+
+  Void setupFromCfgFile( const Char*      cfgFile );
+  Bool checkCfg        ( const TComSlice* slice   );
+
+  UInt getManGvdFocalLengthXLen       ( Int i, Int j ) const;
+  UInt getManGvdFocalLengthYLen       ( Int i, Int j ) const;
+  UInt getManGvdPrincipalPointXLen    ( Int i, Int j ) const;
+  UInt getManGvdPrincipalPointYLen    ( Int i, Int j ) const;
+  //UInt getManGvdRLen                  ( Int i, int j ) const;
+  UInt getManGvdTXLen                 ( Int i, Int j ) const;
+  UInt xGetSyntaxElementLen           ( Int expo, Int prec, Int val ) const;
+
+  Void resizeArrays( )
+  {
+    const Int numViews = 3; // getNumConstituentViewsGvdMinus1() + 1;
+
+    m_signGvdZNearFlag.resize(3);
+    m_expGvdZNear.resize(3);
+    m_manLenGvdZNearMinus1.resize(3);
+    m_manGvdZNear.resize(3);
+    m_signGvdZFarFlag.resize(3);
+    m_expGvdZFar.resize(3);
+    m_manLenGvdZFarMinus1.resize(3);
+    m_manGvdZFar.resize(3);
+
+    m_signGvdFocalLengthX.resize(3);
+    m_expGvdFocalLengthX.resize(3);
+    m_manGvdFocalLengthX.resize(3);
+    m_signGvdFocalLengthY.resize(3);
+    m_expGvdFocalLengthY.resize(3);
+    m_manGvdFocalLengthY.resize(3);
+    m_signGvdPrincipalPointX.resize(3);
+    m_expGvdPrincipalPointX.resize(3);
+    m_manGvdPrincipalPointX.resize(3);
+    m_signGvdPrincipalPointY.resize(3);
+    m_expGvdPrincipalPointY.resize(3);
+    m_manGvdPrincipalPointY.resize(3);
+
+    m_signGvdR00.resize(3);
+    m_expGvdR00.resize(3);
+    m_manGvdR00.resize(3);
+    m_signGvdR01.resize(3);
+    m_expGvdR01.resize(3);
+    m_manGvdR01.resize(3);
+    m_signGvdR02.resize(3);
+    m_expGvdR02.resize(3);
+    m_manGvdR02.resize(3);
+    m_signGvdR10.resize(3);
+    m_expGvdR10.resize(3);
+    m_manGvdR10.resize(3);
+    m_signGvdR11.resize(3);
+    m_expGvdR11.resize(3);
+    m_manGvdR11.resize(3);
+    m_signGvdR12.resize(3);
+    m_expGvdR12.resize(3);
+    m_manGvdR12.resize(3);
+    m_signGvdR20.resize(3);
+    m_expGvdR20.resize(3);
+    m_manGvdR20.resize(3);
+    m_signGvdR21.resize(3);
+    m_expGvdR21.resize(3);
+    m_manGvdR21.resize(3);
+    m_signGvdR22.resize(3);
+    m_expGvdR22.resize(3);
+    m_manGvdR22.resize(3);
+
+    m_signGvdTX.resize(3);
+    m_expGvdTX.resize(3);
+    m_manGvdTX.resize(3);
+
+    for( Int i = 0; i < numViews; i++ )
+    {
+      m_signGvdZNearFlag[i].resize(3);
+      m_expGvdZNear[i].resize(3);
+      m_manLenGvdZNearMinus1[i].resize(3);
+      m_manGvdZNear[i].resize(3);
+      m_signGvdZFarFlag[i].resize(3);
+      m_expGvdZFar[i].resize(3);
+      m_manLenGvdZFarMinus1[i].resize(3);
+      m_manGvdZFar[i].resize(3);
+
+      m_signGvdFocalLengthX[i].resize(3);
+      m_expGvdFocalLengthX[i].resize(3);
+      m_manGvdFocalLengthX[i].resize(3);
+      m_signGvdFocalLengthY[i].resize(3);
+      m_expGvdFocalLengthY[i].resize(3);
+      m_manGvdFocalLengthY[i].resize(3);
+      m_signGvdPrincipalPointX[i].resize(3);
+      m_expGvdPrincipalPointX[i].resize(3);
+      m_manGvdPrincipalPointX[i].resize(3);
+      m_signGvdPrincipalPointY[i].resize(3);
+      m_expGvdPrincipalPointY[i].resize(3);
+      m_manGvdPrincipalPointY[i].resize(3);
+
+      m_signGvdR00[i].resize(3);
+      m_expGvdR00[i].resize(3);
+      m_manGvdR00[i].resize(3);
+      m_signGvdR01[i].resize(3);
+      m_expGvdR01[i].resize(3);
+      m_manGvdR01[i].resize(3);
+      m_signGvdR02[i].resize(3);
+      m_expGvdR02[i].resize(3);
+      m_manGvdR02[i].resize(3);
+      m_signGvdR10[i].resize(3);
+      m_expGvdR10[i].resize(3);
+      m_manGvdR10[i].resize(3);
+      m_signGvdR11[i].resize(3);
+      m_expGvdR11[i].resize(3);
+      m_manGvdR11[i].resize(3);
+      m_signGvdR12[i].resize(3);
+      m_expGvdR12[i].resize(3);
+      m_manGvdR12[i].resize(3);
+      m_signGvdR20[i].resize(3);
+      m_expGvdR20[i].resize(3);
+      m_manGvdR20[i].resize(3);
+      m_signGvdR21[i].resize(3);
+      m_expGvdR21[i].resize(3);
+      m_manGvdR21[i].resize(3);
+      m_signGvdR22[i].resize(3);
+      m_expGvdR22[i].resize(3);
+      m_manGvdR22[i].resize(3);
+
+      m_signGvdTX[i].resize(3);
+      m_expGvdTX[i].resize(3);
+      m_manGvdTX[i].resize(3);
+    }
+
+  }
+
+  Bool      m_alternativeDepthInfoCancelFlag;
+  Int       m_depthType;
+  Int       m_numConstituentViewsGvdMinus1;
+  Bool      m_depthPresentGvdFlag;
+  Bool      m_zGvdFlag;
+  Bool      m_intrinsicParamGvdFlag;
+  Bool      m_rotationGvdFlag;
+  Bool      m_translationGvdFlag;
+  BoolAry2d m_signGvdZNearFlag;
+  IntAry2d  m_expGvdZNear;
+  IntAry2d  m_manLenGvdZNearMinus1;
+  IntAry2d  m_manGvdZNear;
+  BoolAry2d m_signGvdZFarFlag;
+  IntAry2d  m_expGvdZFar;
+  IntAry2d  m_manLenGvdZFarMinus1;
+  IntAry2d  m_manGvdZFar;
+  Int       m_precGvdFocalLength;
+  Int       m_precGvdPrincipalPoint;
+  Int       m_precGvdRotationParam;
+  Int       m_precGvdTranslationParam;
+  BoolAry2d m_signGvdFocalLengthX;
+  IntAry2d  m_expGvdFocalLengthX;
+  IntAry2d  m_manGvdFocalLengthX;
+  BoolAry2d m_signGvdFocalLengthY;
+  IntAry2d  m_expGvdFocalLengthY;
+  IntAry2d  m_manGvdFocalLengthY;
+  BoolAry2d m_signGvdPrincipalPointX;
+  IntAry2d  m_expGvdPrincipalPointX;
+  IntAry2d  m_manGvdPrincipalPointX;
+  BoolAry2d m_signGvdPrincipalPointY;
+  IntAry2d  m_expGvdPrincipalPointY;
+  IntAry2d  m_manGvdPrincipalPointY;
+
+  BoolAry2d m_signGvdR00;
+  IntAry2d  m_expGvdR00;
+  IntAry2d  m_manGvdR00;
+  BoolAry2d m_signGvdR01;
+  IntAry2d  m_expGvdR01;
+  IntAry2d  m_manGvdR01;
+  BoolAry2d m_signGvdR02;
+  IntAry2d  m_expGvdR02;
+  IntAry2d  m_manGvdR02;
+  BoolAry2d m_signGvdR10;
+  IntAry2d  m_expGvdR10;
+  IntAry2d  m_manGvdR10;
+  BoolAry2d m_signGvdR11;
+  IntAry2d  m_expGvdR11;
+  IntAry2d  m_manGvdR11;
+  BoolAry2d m_signGvdR12;
+  IntAry2d  m_expGvdR12;
+  IntAry2d  m_manGvdR12;
+  BoolAry2d m_signGvdR20;
+  IntAry2d  m_expGvdR20;
+  IntAry2d  m_manGvdR20;
+  BoolAry2d m_signGvdR21;
+  IntAry2d  m_expGvdR21;
+  IntAry2d  m_manGvdR21;
+  BoolAry2d m_signGvdR22;
+  IntAry2d  m_expGvdR22;
+  IntAry2d  m_manGvdR22;
+
+  BoolAry2d m_signGvdTX;
+  IntAry2d  m_expGvdTX;
+  IntAry2d  m_manGvdTX;
+
+  Int       m_minOffsetXInt;
+  Int       m_minOffsetXFrac;
+  Int       m_maxOffsetXInt;
+  Int       m_maxOffsetXFrac;
+  Bool      m_offsetYPresentFlag;
+  Int       m_minOffsetYInt;
+  Int       m_minOffsetYFrac;
+  Int       m_maxOffsetYInt;
+  Int       m_maxOffsetYFrac;
+  Bool      m_warpMapSizePresentFlag;
+  Int       m_warpMapWidthMinus2;
+  Int       m_warpMapHeightMinus2;
+};
+
+#endif
+#endif
+
+#endif
 //! \}
Index: /trunk/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /trunk/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1356)
@@ -5466,5 +5466,12 @@
     }
 
+#if NH_3D_FIX_NBDV_COL
+    // The picture pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx) might not be in DPB anymore
+    // So don't access it directly.
+    iColRefViewIdx = pColCU->getSlice()->getVPS()->getViewOrderIdx( pColCU->getSlice()->getRefLayerId( eColRefPicList, iColRefIdx ) );       
+#else
     iColRefViewIdx = pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx)->getViewIndex();
+#endif
+
 
     if ( iColViewIdx    == iColRefViewIdx ) // temporal vector
Index: /trunk/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /trunk/source/Lib/TLibCommon/TypeDef.h	(revision 1355)
+++ /trunk/source/Lib/TLibCommon/TypeDef.h	(revision 1356)
@@ -43,12 +43,12 @@
 //! \{
 /////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////// EXTENSION SELECTION ///////////////////////////////////  
+///////////////////////////////// EXTENSION SELECTION ///////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
 /* HEVC_EXT might be defined by compiler/makefile options.
-   Linux makefiles support the following settings:   
-   make             -> HEVC_EXT not defined    
+   Linux makefiles support the following settings:
+   make             -> HEVC_EXT not defined
    make HEVC_EXT=0  -> NH_MV=0 H_3D=0   --> plain HM
-   make HEVC_EXT=1  -> NH_MV=1 H_3D=0   --> MV only 
-   make HEVC_EXT=2  -> NH_MV=1 H_3D=1   --> full 3D 
+   make HEVC_EXT=1  -> NH_MV=1 H_3D=0   --> MV only
+   make HEVC_EXT=2  -> NH_MV=1 H_3D=1   --> full 3D
 */
 #ifndef HEVC_EXT
@@ -56,22 +56,29 @@
 #endif
 #if ( HEVC_EXT < 0 )||( HEVC_EXT > 2 )
-#error HEVC_EXT must be in the range of 0 to 2, inclusive. 
+#error HEVC_EXT must be in the range of 0 to 2, inclusive.
 #endif
 #define NH_MV          ( HEVC_EXT != 0)
 #define NH_3D          ( HEVC_EXT == 2)
 /////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////   FIXES           ///////////////////////////////////  
+///////////////////////////////////   FIXES AND INTEGRATIONS     ////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
 #if NH_MV
-#define NH_MV_FIX_TICKET_106                      1 // Identical motion check. 
-#define NH_MV_FIX_NO_REF_PICS_CHECK               1 // !!SPEC!! 
-#define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS  1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!! 
+#define NH_MV_SEI_TBD                             0
+#define NH_MV_SEI                                 1
+#define NH_MV_FIX_TICKET_106                      1 // Identical motion check.
+#define NH_MV_FIX_NO_REF_PICS_CHECK               1 // !!SPEC!!
+#define NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS  1 // Derivation of NumActiveRefLayerPIcs. !!SPEC!!
 #define NH_MV_FIX_NUM_POC_TOTAL_CUR               1 // Derivation of NumPocTotalCur for IDR pictures. !!SPEC!!
+#define NH_MV_LAYERS_NOT_PRESENT_SEI              1 // Layers not present SEI message JCTMV-M0043
+#if NH_MV_SEI
+#define SEI_DRI_F0169 1
+#endif
 #endif
 #if NH_3D
 #define H_3D_FIX_ARP_CHECK_NOT_IN_DPB     1
+#define NH_3D_FIX_NBDV_COL                1
 #endif
 /////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////   MAJOR DEFINES   ///////////////////////////////////  
+///////////////////////////////////   MAJOR DEFINES   ///////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
 #if NH_MV
@@ -90,15 +97,15 @@
                                              // LGE_ARP_CTX_F0161                JCT3V-F0161
                                              // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
-                                             // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 
+                                             // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
                                              // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085  Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
-                                             // QC_I0051_ARP_SIMP          
-                                             // SHARP_ARP_CHROMA_I0104     
+                                             // QC_I0051_ARP_SIMP
+                                             // SHARP_ARP_CHROMA_I0104
                                              // MTK_I0072_IVARP_SCALING_FIX
                                              // SEC_ARP_VIEW_REF_CHECK_J0037    Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1
                                              // SEC_ARP_REM_ENC_RESTRICT_K0035    Removal of encoder restriction of ARP, JCT3V-K0035
 #define NH_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
-                                              // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 
+                                              // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
                                               // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055
-#define NH_3D_VSO                          1   // VSO, View synthesis optimization, includes: 
+#define NH_3D_VSO                          1   // VSO, View synthesis optimization, includes:
                                               // HHI_VSO
                                               // HHI_VSO_LS_TABLE_M23714 enable table base Lagrange multiplier optimization
@@ -106,13 +113,13 @@
                                               // LGE_WVSO_A0119
                                               // SCU_HS_VSD_BUGFIX_IMPROV_G0163
-#define NH_3D_NBDV                         1   // Neighboring block disparity derivation 
-                                              // QC_JCT3V-A0097 
+#define NH_3D_NBDV                         1   // Neighboring block disparity derivation
+                                              // QC_JCT3V-A0097
                                               // LGE_DVMCP_A0126
-                                              // LGE_DVMCP_MEM_REDUCTION_B0135     
+                                              // LGE_DVMCP_MEM_REDUCTION_B0135
                                               // QC_SIMPLE_NBDV_B0047
                                               // FIX_LGE_DVMCP_B0133
                                               // QC_NBDV_LDB_FIX_C0055
                                               // MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097
-                                              // MTK_SIMPLIFY_DVTC_C0135           
+                                              // MTK_SIMPLIFY_DVTC_C0135
                                               // QC_CU_NBDV_D0181
                                               // SEC_DEFAULT_DV_D0112
@@ -154,8 +161,8 @@
                                               // NTT_VSP_DC_BUGFIX_E0208 bugfix for sub-PU based DC in VSP, JCT3V-E0208
                                               // NTT_VSP_COMMON_E0207_E0208 common part of JCT3V-E0207 and JCT3V-E0208
-                                              // MTK_F0109_LG_F0120_VSP_BLOCK MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120  
+                                              // MTK_F0109_LG_F0120_VSP_BLOCK MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120
                                               // SHARP_VSP_BLOCK_IN_AMP_F0102 VSP partitioning for AMP
                                               // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
-                                              // LGE_SHARP_VSP_INHERIT_F0104 
+                                              // LGE_SHARP_VSP_INHERIT_F0104
                                               // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP
                                               // Restricted bi-prediction for VSP
@@ -164,11 +171,11 @@
 #define NH_3D_MLC                          1
 #define NH_3D_IV_MERGE                     1  // Inter-view motion merge candidate
-                                              // HHI_INTER_VIEW_MOTION_PRED 
+                                              // HHI_INTER_VIEW_MOTION_PRED
                                               // SAIT_IMPROV_MOTION_PRED_M24829, improved inter-view motion vector prediction
                                               // QC_MRG_CANS_B0048             , JCT3V-B0048, B0086, B0069
                                               // OL_DISMV_POS_B0069            , different pos for disparity MV candidate, B0069
                                               // MTK_INTERVIEW_MERGE_A0049     , second part
-                                              // QC_AMVP_MRG_UNIFY_IVCAN_C0051     
-                                              // QC_INRIA_MTK_MRG_E0126 
+                                              // QC_AMVP_MRG_UNIFY_IVCAN_C0051
+                                              // QC_INRIA_MTK_MRG_E0126
                                               // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate
                                               // MTK_NBDV_IVREF_FIX_G0067      , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067
@@ -187,5 +194,5 @@
                                               // TEXTURE MERGING CANDIDATE     , JCT3V-C0137
                                               // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
-#define NH_3D_TMVP                        1   // QC_TMVP_C0047 
+#define NH_3D_TMVP                        1   // QC_TMVP_C0047
                                               // Sony_M23639
                                               // H_3D_TMVP_SCALING_FIX_K0053       1   // QC/CY for K0053
@@ -207,21 +214,21 @@
                                               // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
                                               // LGE_SIMP_DIM_NOT_PRESENT_FLAG_CODING_H0119_H0135  Use only one context for CABAC of dim_not_present_flag
-                                              // QC_SIMP_DELTADC_CODING_H0131   Simplify detaDC entropy coding 
+                                              // QC_SIMP_DELTADC_CODING_H0131   Simplify detaDC entropy coding
                                               // MTK_DMM_SIMP_CODE_H0092        Remove CABAC context for DMM1 mode coding
                                               // MTK_DELTA_DC_FLAG_ONE_CONTEXT_H0084_H0100_H0113 Use only one context for CABAC of delta_dc_flag as in JCTVC-H0084, JCTVC-H0100 and JCTVC-H0113
                                               // HS_DMM_SIGNALLING_I0120
-                                              // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110 
+                                              // SHARP_DMM1_I0110 LUT size reduction for DMM1 proposed in JCT3V-I0110
                                               // MTK_DMM_SIM_J0035
-                                              // SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation 
+                                              // SHARP_DMM_CLEAN_K0042             1   // Generate DMM pattern with rotation
 #define NH_3D_DLT                         1   // Depth Lookup Table
                                               // HHI_DELTADC_DLT_D0035
                                               // LGE_PRED_RES_CODING_DLT_DOMAIN_F0159 JCT3V-F0159
-                                              // SEC_NO_RESI_DLT_H0105    
-                                              // MTK_DLT_CODING_FIX_H0091 
+                                              // SEC_NO_RESI_DLT_H0105
+                                              // MTK_DLT_CODING_FIX_H0091
                                               // H_3D_DELTA_DLT
                                               // RWTH_DLT_CLIP_I0057
-                                              // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup  
+                                              // SHARP_DLT_SIMP_J0029 DLT(DepthValue2Idx[]) table derivation cleanup
 #define NH_3D_SDC_INTRA                   1   // Segment-wise DC Coding method for INTRA
-#define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER  
+#define NH_3D_SDC_INTER                   1   // Segment-wise DC Coding method for INTER
                                               // RWTH_SDC_DLT_B0036
                                               // INTEL_SDC64_D0193
@@ -249,9 +256,9 @@
                                               // MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
 #define NH_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
-                                              // MTK_DBBP_AMP_REM_H0072   
-                                              // RWTH_DBBP_NO_SPU_H0057   
-                                              // SEC_DBBP_FILTERING_H0104 
-                                              // MTK_DBBP_SIGNALING_H0094    
-                                              // H_3D_FIX_DBBP_IVMP Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself. 
+                                              // MTK_DBBP_AMP_REM_H0072
+                                              // RWTH_DBBP_NO_SPU_H0057
+                                              // SEC_DBBP_FILTERING_H0104
+                                              // MTK_DBBP_SIGNALING_H0094
+                                              // H_3D_FIX_DBBP_IVMP Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself.
                                               // SEC_DBBP_EXPLICIT_SIG_I0077 Remove the partition derivation and signal dbbp_flag only when the partition mode is 2NxN/Nx2N, JCT3V-I0077
                                               // Disallow DBBP in 8x8 CU, JCT3V-I0078
@@ -261,5 +268,5 @@
                                               // RWTH_DBBP_NO_SATD_K0028
                                               // HS_DBBP_CLEAN_K0048
-#define NH_3D_DIS                         1   // Depth intra skip 
+#define NH_3D_DIS                         1   // Depth intra skip
                                               // SEC_DEPTH_INTRA_SKIP_MODE_K0033  Depth intra skip mode
 #define H_3D_FCO                          0   // Flexible coding order for 3D
@@ -272,7 +279,7 @@
                                              // HHI_VPS_3D_EXTENSION_I3_J0107
                                              // HHI_INTER_COMP_PRED_K0052
-                                             // HHI_RES_PRED_K0052       
-                                             // HHI_CAM_PARA_K0052       
-                                             // H_3D_DIRECT_DEP_TYPE     
+                                             // HHI_RES_PRED_K0052
+                                             // HHI_CAM_PARA_K0052
+                                             // H_3D_DIRECT_DEP_TYPE
 // Rate Control
 #define KWU_FIX_URQ                       0
@@ -281,5 +288,5 @@
 #endif // NH_3D
 /////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////   DERIVED DEFINES ///////////////////////////////////  
+///////////////////////////////////   DERIVED DEFINES ///////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
 #if NH_3D
@@ -288,7 +295,7 @@
 #endif
 ///// ***** VIEW SYNTHESIS OPTIMIZAION *********
-#if NH_3D_VSO                                  
+#if NH_3D_VSO
 #define H_3D_VSO_DIST_INT                 1   // Allow negative synthesized view distortion change
-#define H_3D_VSO_COLOR_PLANES             1   // Compute VSO distortion on color planes 
+#define H_3D_VSO_COLOR_PLANES             1   // Compute VSO distortion on color planes
 #define H_3D_VSO_EARLY_SKIP               1   // LGE_VSO_EARLY_SKIP_A0093, A0093 modification 4
 #define H_3D_VSO_RM_ASSERTIONS            0   // Output VSO assertions
@@ -332,5 +339,5 @@
 ///////////////////////////////////   MV_HEVC HLS  //////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////
-// TBD: Check if integration is necessary. 
+// TBD: Check if integration is necessary.
 #define H_MV_HLS_PTL_LIMITS                  0
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -485,15 +492,17 @@
 typedef       UInt            Distortion;        ///< distortion measurement
 #endif
-#if NH_MV                         
+#if NH_MV
+typedef std::vector< std::string > StringAry1d;
+typedef std::vector< StringAry1d > StringAry2d;
 typedef std::vector< Int >        IntAry1d;
-typedef std::vector< IntAry1d >   IntAry2d; 
-typedef std::vector< IntAry2d >   IntAry3d; 
-typedef std::vector< IntAry3d >   IntAry4d; 
-typedef std::vector< IntAry4d >   IntAry5d; 
+typedef std::vector< IntAry1d >   IntAry2d;
+typedef std::vector< IntAry2d >   IntAry3d;
+typedef std::vector< IntAry3d >   IntAry4d;
+typedef std::vector< IntAry4d >   IntAry5d;
 typedef std::vector< Bool >        BoolAry1d;
-typedef std::vector< BoolAry1d >   BoolAry2d; 
-typedef std::vector< BoolAry2d >   BoolAry3d; 
-typedef std::vector< BoolAry3d >   BoolAry4d; 
-typedef std::vector< BoolAry4d >   BoolAry5d; 
+typedef std::vector< BoolAry1d >   BoolAry2d;
+typedef std::vector< BoolAry2d >   BoolAry3d;
+typedef std::vector< BoolAry3d >   BoolAry4d;
+typedef std::vector< BoolAry4d >   BoolAry5d;
 #endif
 #if NH_3D_VSO
@@ -504,10 +513,10 @@
 #if H_3D_VSO_DIST_INT
 typedef       Int64            Dist;       ///< RDO distortion
-typedef       Int64            Dist64; 
+typedef       Int64            Dist64;
 #define       RDO_DIST_MIN     MIN_INT
 #define       RDO_DIST_MAX     MAX_INT
 #else
 typedef       UInt             Dist;       ///< RDO distortion
-typedef       UInt64           Dist; 
+typedef       UInt64           Dist;
 #define       RDO_DIST_MIN     0
 #define       RDO_DIST_MAX     MAX_UINT
@@ -797,5 +806,5 @@
   ANNEX_G,
   ANNEX_H,
-  ANNEX_I  
+  ANNEX_I
 };
 #endif
@@ -813,5 +822,5 @@
     ,MULTIVIEWMAIN = 6,
 #if NH_3D
-    MAIN3D = 8, 
+    MAIN3D = 8,
 #endif
 #endif
@@ -941,5 +950,5 @@
 enum ScalabilityType
 {
-  DEPTH_ID = 0,    
+  DEPTH_ID = 0,
   VIEW_ORDER_INDEX  = 1,
   DEPENDENCY_ID = 2,
Index: /trunk/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/SEIread.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibDecoder/SEIread.cpp	(revision 1356)
@@ -99,5 +99,18 @@
 }
 
+Void SEIReader::sei_read_string(std::ostream *pOS, UInt uiBufSize, UChar* pucCode, UInt& ruiLength, const Char *pSymbolName)
+{
+  READ_STRING(uiBufSize, pucCode, ruiLength, pSymbolName);
+  if (pOS)
+  {
+    (*pOS) << "  " << pSymbolName << ": " << (const char*) pucCode << "\n";
+  }
+}
+
+#if NH_MV_SEI
+inline Void SEIReader::output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize)
+#else
 static inline Void output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize)
+#endif
 {
   if (pDecodedMessageOutputStream)
@@ -105,4 +118,7 @@
     std::string seiMessageHdr(SEI::getSEIMessageString(sei.payloadType())); seiMessageHdr+=" SEI message";
     (*pDecodedMessageOutputStream) << std::setfill('-') << std::setw(seiMessageHdr.size()) << "-" << std::setfill(' ') << "\n" << seiMessageHdr << " (" << payloadSize << " bytes)"<< "\n";
+#if NH_MV_SEI
+    (*pDecodedMessageOutputStream) << std::setfill(' ') << "LayerId: " << m_layerId << std::setw(2) << " Picture: " << m_decOrder << std::setw( 5 ) << std::endl;
+#endif
   }
 }
@@ -117,5 +133,9 @@
  * unmarshal a single SEI message from bitstream bs
  */
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
+#else
 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
+#endif
 {
   setBitstream(bs);
@@ -124,6 +144,9 @@
   do
   {
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+    xReadSEImessage(seis, nalUnitType, vps, sps, pDecodedMessageOutputStream);
+#else
     xReadSEImessage(seis, nalUnitType, sps, pDecodedMessageOutputStream);
-
+#endif
     /* SEI messages are an integer number of bytes, something has failed
     * in the parsing if bitstream not byte-aligned */
@@ -135,5 +158,9 @@
 }
 
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
+#else
 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
+#endif
 {
 #if ENC_DEC_TRACE
@@ -254,5 +281,9 @@
     case SEI::SCALABLE_NESTING:
       sei = new SEIScalableNesting;
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+      xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps, pDecodedMessageOutputStream);
+#else
       xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps, pDecodedMessageOutputStream);
+#endif
       break;
     case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS:
@@ -277,9 +308,89 @@
       xParseSEIMasteringDisplayColourVolume((SEIMasteringDisplayColourVolume&) *sei, payloadSize, pDecodedMessageOutputStream);
       break;
-#if NH_MV
+#if !NH_MV_SEI
     case SEI::SUB_BITSTREAM_PROPERTY:
       sei = new SEISubBitstreamProperty;
       xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei, payloadSize, pDecodedMessageOutputStream );
       break;
+#else
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+    case SEI::LAYERS_NOT_PRESENT:
+      if (!vps)
+      {
+        printf ("Warning: Found Layers not present SEI message, but no active VPS is available. Ignoring.");
+      }
+      else
+      {
+        sei = new SEILayersNotPresent;
+        xParseSEILayersNotPresent((SEILayersNotPresent&) *sei, payloadSize, vps, pDecodedMessageOutputStream);
+      }
+      break;
+#endif
+    case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:
+      sei = new SEIInterLayerConstrainedTileSets;
+      xParseSEIInterLayerConstrainedTileSets((SEIInterLayerConstrainedTileSets&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+#if NH_MV_TBD
+    case SEI::BSP_NESTING:
+      sei = new SEIBspNesting;
+      xParseSEIBspNesting((SEIBspNesting&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+    case SEI::BSP_INITIAL_ARRIVAL_TIME:
+      sei = new SEIBspInitialArrivalTime;
+      xParseSEIBspInitialArrivalTime((SEIBspInitialArrivalTime&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+#endif
+    case SEI::SUB_BITSTREAM_PROPERTY:
+      sei = new SEISubBitstreamProperty;
+      xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+    case SEI::ALPHA_CHANNEL_INFO:
+      sei = new SEIAlphaChannelInfo;
+      xParseSEIAlphaChannelInfo((SEIAlphaChannelInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+    case SEI::OVERLAY_INFO:
+      sei = new SEIOverlayInfo;
+      xParseSEIOverlayInfo((SEIOverlayInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+    case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:
+      sei = new SEITemporalMvPredictionConstraints;
+      xParseSEITemporalMvPredictionConstraints((SEITemporalMvPredictionConstraints&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+#if NH_MV_SEI_TBD
+    case SEI::FRAME_FIELD_INFO:
+      sei = new SEIFrameFieldInfo;
+      xParseSEIFrameFieldInfo((SEIFrameFieldInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+#endif
+    case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:
+      sei = new SEIThreeDimensionalReferenceDisplaysInfo;
+      xParseSEIThreeDimensionalReferenceDisplaysInfo((SEIThreeDimensionalReferenceDisplaysInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+#if SEI_DRI_F0169
+    case SEI::DEPTH_REPRESENTATION_INFO:
+        sei = new SEIDepthRepresentationInfo;
+        xParseSEIDepthRepresentationInfo((SEIDepthRepresentationInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+        break;
+#endif
+    case SEI::MULTIVIEW_SCENE_INFO:
+      sei = new SEIMultiviewSceneInfo;
+      xParseSEIMultiviewSceneInfo((SEIMultiviewSceneInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+
+    case SEI::MULTIVIEW_ACQUISITION_INFO:
+      sei = new SEIMultiviewAcquisitionInfo;
+      xParseSEIMultiviewAcquisitionInfo((SEIMultiviewAcquisitionInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+
+    case SEI::MULTIVIEW_VIEW_POSITION:
+      sei = new SEIMultiviewViewPosition;
+      xParseSEIMultiviewViewPosition((SEIMultiviewViewPosition&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+#if NH_3D
+    case SEI::ALTERNATIVE_DEPTH_INFO:
+      sei = new SEIAlternativeDepthInfo;
+      xParseSEIAlternativeDepthInfo((SEIAlternativeDepthInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
+      break;
+#endif
 #endif
     default:
@@ -455,5 +566,5 @@
 Void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
 {
-  UInt val; 
+  UInt val;
   output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
 
@@ -805,5 +916,9 @@
 }
 
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
+#else
 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
+#endif
 {
   UInt uiCode;
@@ -847,5 +962,9 @@
   do
   {
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+    xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, pDecodedMessageOutputStream);
+#else
     xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, pDecodedMessageOutputStream);
+#endif
   } while (m_pcBitstream->getNumBitsLeft() > 8);
 
@@ -857,4 +976,5 @@
 
 #if NH_MV
+#if !NH_MV_SEI
 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream )
 {
@@ -872,5 +992,5 @@
     sei_read_code( pDecodedMessageOutputStream,  16, code, "avg_bit_rate[i]"                 ); sei.m_avgBitRate[i] = code;
     sei_read_code( pDecodedMessageOutputStream,  16, code, "max_bit_rate[i]"                 ); sei.m_maxBitRate[i] = code;
-  }  
+  }
 }
 
@@ -883,4 +1003,5 @@
   sei.m_maxBitRate.resize( sei.m_numAdditionalSubStreams );
 }
+#endif
 #endif
 
@@ -1101,3 +1222,602 @@
 }
 
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+  sei_read_code( pDecodedMessageOutputStream, 4, code, "lnp_sei_active_vps_id" ); sei.m_lnpSeiActiveVpsId = code;
+  assert(vps->getVPSId() == sei.m_lnpSeiActiveVpsId);
+
+  sei.m_lnpSeiMaxLayers = vps->getMaxLayersMinus1() + 1;
+  sei.resizeDimI(sei.m_lnpSeiMaxLayers);
+  for (Int i = 0; i < sei.m_lnpSeiMaxLayers; i++)
+  {
+    sei_read_flag( pDecodedMessageOutputStream, code, "layer_not_present_flag" );
+    sei.m_layerNotPresentFlag[i] = (code == 1);
+  }
+};
+#endif
+
+Void SEIReader::xParseSEIInterLayerConstrainedTileSets(SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_flag( pDecodedMessageOutputStream, code, "il_all_tiles_exact_sample_value_match_flag" ); sei.m_ilAllTilesExactSampleValueMatchFlag = (code == 1);
+  sei_read_flag( pDecodedMessageOutputStream, code, "il_one_tile_per_tile_set_flag"              ); sei.m_ilOneTilePerTileSetFlag             = (code == 1);
+  if( !sei.m_ilOneTilePerTileSetFlag )
+  {
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "il_num_sets_in_message_minus1" ); sei.m_ilNumSetsInMessageMinus1 = code;
+    if( sei.m_ilNumSetsInMessageMinus1 )
+    {
+      sei_read_flag( pDecodedMessageOutputStream, code, "skipped_tile_set_present_flag" ); sei.m_skippedTileSetPresentFlag = (code == 1);
+    }
+    Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1;
+
+    sei.resizeDimI( numSignificantSets );
+    for( Int i = 0; i < numSignificantSets; i++ )
+    {
+      sei_read_uvlc( pDecodedMessageOutputStream, code, "ilcts_id"                        ); sei.m_ilctsId                  [i] = code;
+      sei_read_uvlc( pDecodedMessageOutputStream, code, "il_num_tile_rects_in_set_minus1" ); sei.m_ilNumTileRectsInSetMinus1[i] = code;
+
+      sei.resizeDimJ( i, sei.m_ilNumTileRectsInSetMinus1[ i ] + 1 );
+      for( Int j = 0; j  <=  sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ )
+      {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "il_top_left_tile_index"     ); sei.m_ilTopLeftTileIndex    [i][j] = code;
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "il_bottom_right_tile_index" ); sei.m_ilBottomRightTileIndex[i][j] = code;
+      }
+      sei_read_code( pDecodedMessageOutputStream, 2, code, "ilc_idc" ); sei.m_ilcIdc[i] = code;
+      if ( !sei.m_ilAllTilesExactSampleValueMatchFlag )
+      {
+        sei_read_flag( pDecodedMessageOutputStream, code, "il_exact_sample_value_match_flag" ); sei.m_ilExactSampleValueMatchFlag[i] = (code == 1);
+      }
+    }
+  }
+  else
+  {
+    sei_read_code( pDecodedMessageOutputStream, 2, code, "all_tiles_ilc_idc" ); sei.m_allTilesIlcIdc = code;
+  }
+};
+
+#if NH_MV_SEI_TBD
+Void SEIReader::xParseSEIBspNesting(SEIBspNesting& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "sei_ols_idx" ); sei.m_seiOlsIdx = code;
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "sei_partitioning_scheme_idx" ); sei.m_seiPartitioningSchemeIdx = code;
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "bsp_idx" ); sei.m_bspIdx = code;
+  while( !ByteaLigned(() ) );
+  {
+    sei_read_code( pDecodedMessageOutputStream, *equalto0*/u1, code, "bsp_nesting_zero_bit" ); sei.m_bspNestingZeroBit = code;
+  }
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "num_seis_in_bsp_minus1" ); sei.m_numSeisInBspMinus1 = code;
+  for( Int i = 0; i  <=  NumSeisInBspMinus1( ); i++ )
+  {
+    SeiMessage(() );
+  }
+};
+
+Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  psIdx = SeiPartitioningSchemeIdx();
+  if( nalInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      sei_read_code( pDecodedMessageOutputStream, getNalInitialArrivalDelayLen ), code, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = code;
+    }
+  }
+  if( vclInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      sei_read_code( pDecodedMessageOutputStream, getVclInitialArrivalDelayLen ), code, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = code;
+    }
+  }
+};
+#endif
+
+Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_code( pDecodedMessageOutputStream, 4, code, "sb_property_active_vps_id" ); sei.m_sbPropertyActiveVpsId = code;
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "num_additional_sub_streams_minus1" ); sei.m_numAdditionalSubStreamsMinus1 = code;
+  sei.resizeArrays( );
+  for( Int i = 0; i  <=  sei.m_numAdditionalSubStreamsMinus1; i++ )
+  {
+    sei_read_code( pDecodedMessageOutputStream, 2, code, "sub_bitstream_mode" ); sei.m_subBitstreamMode[i] = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "ols_idx_to_vps" ); sei.m_olsIdxToVps[i] = code;
+    sei_read_code( pDecodedMessageOutputStream, 3, code, "highest_sublayer_id" ); sei.m_highestSublayerId[i] = code;
+    sei_read_code( pDecodedMessageOutputStream, 16, code, "avg_sb_property_bit_rate" ); sei.m_avgSbPropertyBitRate[i] = code;
+    sei_read_code( pDecodedMessageOutputStream, 16, code, "max_sb_property_bit_rate" ); sei.m_maxSbPropertyBitRate[i] = code;
+  }
+};
+
+Void SEIReader::xParseSEIAlphaChannelInfo(SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_cancel_flag" ); sei.m_alphaChannelCancelFlag = (code == 1);
+  if( !sei.m_alphaChannelCancelFlag )
+  {
+    sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_use_idc" ); sei.m_alphaChannelUseIdc = code;
+    sei_read_code( pDecodedMessageOutputStream, 3, code, "alpha_channel_bit_depth_minus8" ); sei.m_alphaChannelBitDepthMinus8 = code;
+    sei_read_code( pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8+9, code, "alpha_transparent_value" ); sei.m_alphaTransparentValue = code;
+    sei_read_code( pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8+9, code, "alpha_opaque_value" ); sei.m_alphaOpaqueValue = code;
+    sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_incr_flag" ); sei.m_alphaChannelIncrFlag = (code == 1);
+    sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_clip_flag" ); sei.m_alphaChannelClipFlag = (code == 1);
+    if( sei.m_alphaChannelClipFlag )
+    {
+      sei_read_flag( pDecodedMessageOutputStream, code, "alpha_channel_clip_type_flag" ); sei.m_alphaChannelClipTypeFlag = (code == 1);
+    }
+  }
+};
+
+Void SEIReader::xParseSEIOverlayInfo(SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_cancel_flag" ); sei.m_overlayInfoCancelFlag = (code == 1);
+  if( !sei.m_overlayInfoCancelFlag )
+  {
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_content_aux_id_minus128" );            sei.m_overlayContentAuxIdMinus128 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_label_aux_id_minus128" );              sei.m_overlayLabelAuxIdMinus128 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_alpha_aux_id_minus128" );              sei.m_overlayAlphaAuxIdMinus128 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_element_label_value_length_minus8" );  sei.m_overlayElementLabelValueLengthMinus8 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlays_minus1" );                        sei.m_numOverlaysMinus1 = code;
+
+    sei.m_overlayIdx.resize( sei.m_numOverlaysMinus1+1 );
+    sei.m_languageOverlayPresentFlag.resize( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayContentLayerId.resize     ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayLabelPresentFlag.resize   ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayLabelLayerId.resize       ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayAlphaPresentFlag.resize   ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayAlphaLayerId.resize       ( sei.m_numOverlaysMinus1+1 );
+    sei.m_numOverlayElementsMinus1.resize  ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayElementLabelMin.resize    ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayElementLabelMax.resize    ( sei.m_numOverlaysMinus1+1 );
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
+    {
+      sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_idx" );                    sei.m_overlayIdx[i]                 = code;
+      sei_read_flag( pDecodedMessageOutputStream, code, "language_overlay_present_flag" );  sei.m_languageOverlayPresentFlag[i] = (code == 1);
+      sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_content_layer_id" );    sei.m_overlayContentLayerId[i]      = code;
+      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_label_present_flag" );     sei.m_overlayLabelPresentFlag[i]    = (code == 1);
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_label_layer_id" );     sei.m_overlayLabelLayerId[i]       = code;
+      }
+      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_alpha_present_flag" );      sei.m_overlayAlphaPresentFlag[i]   = (code == 1);
+      if( sei.m_overlayAlphaPresentFlag[i] )
+      {
+        sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_alpha_layer_id" );     sei.m_overlayAlphaLayerId[i]       = code;
+      }
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlay_elements_minus1" );   sei.m_numOverlayElementsMinus1[i]  = code;
+        sei.m_overlayElementLabelMin[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
+        sei.m_overlayElementLabelMax[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          sei_read_code( pDecodedMessageOutputStream, sei.m_overlayElementLabelValueLengthMinus8 + 8, code, "overlay_element_label_min" ); sei.m_overlayElementLabelMin[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_overlayElementLabelValueLengthMinus8 + 8, code, "overlay_element_label_max" ); sei.m_overlayElementLabelMax[i][j] = code;
+        }
+      }
+    }
+
+    // byte alignment
+    while ( m_pcBitstream->getNumBitsRead() % 8 != 0 )
+    {
+      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_zero_bit" );
+      assert( code==0 );
+    }
+
+    UChar* sval = new UChar[sei.m_numStringBytesMax];
+    UInt slen;
+    sei.m_overlayLanguage   .resize( sei.m_numOverlaysMinus1 + 1 );
+    sei.m_overlayName       .resize( sei.m_numOverlaysMinus1 + 1 );
+    sei.m_overlayElementName.resize( sei.m_numOverlaysMinus1 + 1 );
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
+    {
+      if( sei.m_languageOverlayPresentFlag[i] )
+      {
+        sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_language");
+        sei.m_overlayLanguage[i] = std::string((const char*) sval);
+      }
+      sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_name");
+      sei.m_overlayName[i] = std::string((const char*) sval);
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        sei.m_overlayElementName[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_element_name");
+          sei.m_overlayElementName[i][j] = std::string((const char*) sval);
+        }
+      }
+    }
+    delete [] sval;
+    sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_persistence_flag" ); sei.m_overlayInfoPersistenceFlag = (code == 1);
+  }
+};
+
+Void SEIReader::xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_flag( pDecodedMessageOutputStream, code, "prev_pics_not_used_flag"     ); sei.m_prevPicsNotUsedFlag    = (code == 1);
+  sei_read_flag( pDecodedMessageOutputStream, code, "no_intra_layer_col_pic_flag" ); sei.m_noIntraLayerColPicFlag = (code == 1);
+};
+
+#if NH_MV_SEI_TBD
+Void SEIReader::xParseSEIFrameFieldInfo(SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_code( pDecodedMessageOutputStream, 4, code, "ffinfo_pic_struct" ); sei.m_ffinfoPicStruct = code;
+  sei_read_code( pDecodedMessageOutputStream, 2, code, "ffinfo_source_scan_type" ); sei.m_ffinfoSourceScanType = code;
+  sei_read_flag( pDecodedMessageOutputStream, code, "ffinfo_duplicate_flag" ); sei.m_ffinfoDuplicateFlag = (code == 1);
+};
+#endif
+
+Void SEIReader::xParseSEIThreeDimensionalReferenceDisplaysInfo(SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_ref_display_width" ); sei.m_precRefDisplayWidth = code;
+  sei_read_flag( pDecodedMessageOutputStream, code, "ref_viewing_distance_flag" ); sei.m_refViewingDistanceFlag = (code == 1);
+  if( sei.m_refViewingDistanceFlag )
+  {
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_ref_viewing_dist" ); sei.m_precRefViewingDist = code;
+  }
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "num_ref_displays_minus1" ); sei.m_numRefDisplaysMinus1 = code;
+  sei.resizeArrays( );
+  for( Int i = 0; i  <=  sei.getNumRefDisplaysMinus1( ); i++ )
+  {
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "left_view_id" ); sei.m_leftViewId[i] = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "right_view_id" ); sei.m_rightViewId[i] = code;
+    sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_display_width" ); sei.m_exponentRefDisplayWidth[i] = code;
+    sei_read_code( pDecodedMessageOutputStream, sei.getMantissaReferenceDisplayWidthLen(i), code, "mantissa_ref_display_width" ); sei.m_mantissaRefDisplayWidth[i] =  code      ;
+    if( sei.m_refViewingDistanceFlag )
+    {
+      sei_read_code( pDecodedMessageOutputStream, 6, code, "exponent_ref_viewing_distance" ); sei.m_exponentRefViewingDistance[i] = code;
+      sei_read_code( pDecodedMessageOutputStream, sei.getMantissaReferenceViewingDistanceLen(i), code, "mantissa_ref_viewing_distance" ); sei.m_mantissaRefViewingDistance[i] = code;
+    }
+    sei_read_flag( pDecodedMessageOutputStream, code, "additional_shift_present_flag" ); sei.m_additionalShiftPresentFlag[i] = (code == 1);
+    if( sei.m_additionalShiftPresentFlag[i] )
+    {
+      sei_read_code( pDecodedMessageOutputStream, 10, code, "num_sample_shift_plus512" ); sei.m_numSampleShiftPlus512[i] = code;
+    }
+  }
+  sei_read_flag( pDecodedMessageOutputStream, code, "three_dimensional_reference_displays_extension_flag" ); sei.m_threeDimensionalReferenceDisplaysExtensionFlag = (code == 1);
+};
+
+#if SEI_DRI_F0169
+Void SEIReader::xParseSEIDepthRepInfoElement(double& f,std::ostream *pDecodedMessageOutputStream)
+{
+    UInt val;
+    UInt x_sign,x_mantissa_len,x_mantissa;
+    Int x_exp;
+
+    sei_read_flag(pDecodedMessageOutputStream,     val,"da_sign_flag");  x_sign = val ? 1 : 0 ;
+    sei_read_code(pDecodedMessageOutputStream,  7, val, "da_exponent" );         x_exp = val-31;
+    sei_read_code(pDecodedMessageOutputStream,  5, val, "da_mantissa_len_minus1" );         x_mantissa_len = val+1;
+    sei_read_code(pDecodedMessageOutputStream,  x_mantissa_len, val, "da_mantissa" );         x_mantissa = val;
+    if (x_mantissa_len>=16)
+    {
+        f =1.0 +  (x_mantissa*1.0)/(1u<<(x_mantissa_len-16))/(256.0*256.0 );
+    }else
+    {
+        f =1.0 +  (x_mantissa*1.0)/(1u<<x_mantissa_len);
+    }
+    double m=1.0;
+    int i;
+    if (x_exp<0)
+    {
+        for(i=0;i<-x_exp;i++)
+            m = m * 2;
+
+        f = f/m;
+    }
+    else
+    {
+        for(i=0;i<x_exp;i++)
+            m = m * 2;
+
+        f= f * m;
+    }
+    if (x_sign==1)
+    {
+        f= -f;
+    }
+};
+
+Void SEIReader::xParseSEIDepthRepresentationInfo(SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+    UInt code;
+    double zNear,zFar,dMin,dMax;
+    bool zNearFlag,zFarFlag,dMinFlag,dMaxFlag;
+    int depth_representation_type,disparityRefViewId,depthNonlinearRepresentationNumMinus1;
+    std::vector<int> DepthNonlinearRepresentationModel;
+
+    sei.clear();
+
+    output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+    sei_read_flag( pDecodedMessageOutputStream, code, "z_near_flag" );    zNearFlag  = (code == 1);
+    sei_read_flag( pDecodedMessageOutputStream, code, "z_far_flag" );     zFarFlag = (code == 1);
+    sei_read_flag( pDecodedMessageOutputStream, code, "d_min_flag" );     dMinFlag = (code == 1);
+    sei_read_flag( pDecodedMessageOutputStream, code, "d_max_flag" );     dMaxFlag = (code == 1);
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_representation_type" ); depth_representation_type = code;
+
+    sei.m_zNearFlag.push_back(zNearFlag);
+    sei.m_zFarFlag.push_back(zFarFlag);
+    sei.m_dMinFlag.push_back(dMinFlag);
+    sei.m_dMaxFlag.push_back(dMaxFlag);
+
+    sei.m_depthRepresentationType.push_back(IntAry1d(1,depth_representation_type));
+
+    if( dMinFlag  ||  dMaxFlag )
+    {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "disparity_ref_view_id" ); disparityRefViewId = code;
+        sei.m_disparityRefViewId.push_back(IntAry1d(1,disparityRefViewId));
+    }
+    if( zNearFlag )
+    {
+        xParseSEIDepthRepInfoElement(zNear , pDecodedMessageOutputStream);
+        sei.m_zNear.push_back(std::vector<double>(1,zNear));
+    }
+    if( zFarFlag )
+    {
+        xParseSEIDepthRepInfoElement(zFar , pDecodedMessageOutputStream);
+        sei.m_zFar.push_back(std::vector<double>(1,zFar));
+    }
+    if( dMinFlag )
+    {
+        xParseSEIDepthRepInfoElement(dMin , pDecodedMessageOutputStream);
+        sei.m_dMin.push_back(std::vector<double>(1,dMin));
+    }
+    if( dMaxFlag )
+    {
+        xParseSEIDepthRepInfoElement(dMax , pDecodedMessageOutputStream);
+        sei.m_dMax.push_back(std::vector<double>(1,dMax));
+    }
+    if( depth_representation_type  ==  3 )
+    {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_nonlinear_representation_num_minus1" ); depthNonlinearRepresentationNumMinus1 = code;
+        sei.m_depthNonlinearRepresentationNumMinus1.push_back(IntAry1d(1,depthNonlinearRepresentationNumMinus1));
+        for( Int i = 1; i  <=  depthNonlinearRepresentationNumMinus1 + 1; i++ )
+        {
+            sei_read_uvlc(pDecodedMessageOutputStream,code,"DepthNonlinearRepresentationModel" ) ;
+            DepthNonlinearRepresentationModel.push_back(code);
+        }
+
+        sei.m_depth_nonlinear_representation_model.push_back(DepthNonlinearRepresentationModel);
+    }
+}
+#endif
+Void SEIReader::xParseSEIMultiviewSceneInfo(SEIMultiviewSceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt  code;
+  Int  sCode;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_svlc( pDecodedMessageOutputStream, sCode, "min_disparity" )      ; sei.m_minDisparity      = sCode;
+  sei_read_uvlc( pDecodedMessageOutputStream, code , "max_disparity_range" ); sei.m_maxDisparityRange = code;
+};
+
+Void SEIReader::xParseSEIMultiviewAcquisitionInfo(SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei.resizeArrays( );
+  sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_param_flag" ); sei.m_intrinsicParamFlag = (code == 1);
+  sei_read_flag( pDecodedMessageOutputStream, code, "extrinsic_param_flag" ); sei.m_extrinsicParamFlag = (code == 1);
+  if( sei.m_intrinsicParamFlag )
+  {
+    sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_params_equal_flag" ); sei.m_intrinsicParamsEqualFlag = (code == 1);
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_focal_length"           ); sei.m_precFocalLength          =  code      ;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_principal_point"        ); sei.m_precPrincipalPoint       =  code      ;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_skew_factor"            ); sei.m_precSkewFactor           =  code      ;
+
+    for( Int i = 0; i  <=  ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ )
+    {
+      sei_read_flag( pDecodedMessageOutputStream,                                         code, "sign_focal_length_x"        ); sei.m_signFocalLengthX       [i] = (code == 1);
+      sei_read_code( pDecodedMessageOutputStream, 6,                                      code, "exponent_focal_length_x"    ); sei.m_exponentFocalLengthX   [i] =  code      ;
+      sei_read_code( pDecodedMessageOutputStream, sei.getMantissaFocalLengthXLen   ( i ), code, "mantissa_focal_length_x"    ); sei.m_mantissaFocalLengthX   [i] =  code      ;
+      sei_read_flag( pDecodedMessageOutputStream,                                         code, "sign_focal_length_y"        ); sei.m_signFocalLengthY       [i] = (code == 1);
+      sei_read_code( pDecodedMessageOutputStream, 6,                                      code, "exponent_focal_length_y"    ); sei.m_exponentFocalLengthY   [i] =  code      ;
+      sei_read_code( pDecodedMessageOutputStream, sei.getMantissaFocalLengthYLen   ( i ), code, "mantissa_focal_length_y"    ); sei.m_mantissaFocalLengthY   [i] =  code      ;
+      sei_read_flag( pDecodedMessageOutputStream,                                         code, "sign_principal_point_x"     ); sei.m_signPrincipalPointX    [i] = (code == 1);
+      sei_read_code( pDecodedMessageOutputStream, 6,                                      code, "exponent_principal_point_x" ); sei.m_exponentPrincipalPointX[i] =  code      ;
+      sei_read_code( pDecodedMessageOutputStream, sei.getMantissaPrincipalPointXLen( i ), code, "mantissa_principal_point_x" ); sei.m_mantissaPrincipalPointX[i] =  code      ;
+      sei_read_flag( pDecodedMessageOutputStream,                                         code, "sign_principal_point_y"     ); sei.m_signPrincipalPointY    [i] = (code == 1);
+      sei_read_code( pDecodedMessageOutputStream, 6,                                      code, "exponent_principal_point_y" ); sei.m_exponentPrincipalPointY[i] =  code      ;
+      sei_read_code( pDecodedMessageOutputStream, sei.getMantissaPrincipalPointYLen( i ), code, "mantissa_principal_point_y" ); sei.m_mantissaPrincipalPointY[i] =  code      ;
+      sei_read_flag( pDecodedMessageOutputStream,                                         code, "sign_skew_factor"           ); sei.m_signSkewFactor         [i] = (code == 1);
+      sei_read_code( pDecodedMessageOutputStream, 6,                                      code, "exponent_skew_factor"       ); sei.m_exponentSkewFactor     [i] =  code      ;
+      sei_read_code( pDecodedMessageOutputStream, sei.getMantissaSkewFactorLen     ( i ), code, "mantissa_skew_factor"       ); sei.m_mantissaSkewFactor     [i] =  code      ;
+    }
+  }
+  if( sei.m_extrinsicParamFlag )
+  {
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_rotation_param"    ); sei.m_precRotationParam    = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_translation_param" ); sei.m_precTranslationParam = code;
+
+    for( Int i = 0; i  <=  sei.getNumViewsMinus1(); i++ )
+    {
+      for( Int j = 0; j  <=  2; j++ )  /* row */
+      {
+        for( Int k = 0; k  <=  2; k++ )  /* column */
+        {
+          sei_read_flag( pDecodedMessageOutputStream,                                 code, "sign_r"     ); sei.m_signR    [i][j][k] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6,                              code, "exponent_r" ); sei.m_exponentR[i][j][k] =  code      ;
+          sei_read_code( pDecodedMessageOutputStream, sei.getMantissaRLen( i, j, k ), code, "mantissa_r" ); sei.m_mantissaR[i][j][k] =  code      ;
+        }
+        sei_read_flag( pDecodedMessageOutputStream,                              code, "sign_t"     ); sei.m_signT    [i][j] = (code == 1);
+        sei_read_code( pDecodedMessageOutputStream, 6,                           code, "exponent_t" ); sei.m_exponentT[i][j] =  code      ;
+        sei_read_code( pDecodedMessageOutputStream, sei.getMantissaTLen( i, j ), code, "mantissa_t" ); sei.m_mantissaT[i][j] =  code      ;
+      }
+    }
+  }
+};
+
+
+
+Void SEIReader::xParseSEIMultiviewViewPosition(SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_uvlc( pDecodedMessageOutputStream, code, "num_views_minus1" ); sei.m_numViewsMinus1 = code;
+  sei.m_viewPosition.resize( sei.m_numViewsMinus1 + 1 );
+  for( Int i = 0; i  <=  sei.m_numViewsMinus1; i++ )
+  {
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "view_position" ); sei.m_viewPosition[i] = code;
+  }
+};
+
+#if NH_3D
+Void SEIReader::xParseSEIAlternativeDepthInfo(SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
+{
+  UInt code;
+  Int scode;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei.resizeArrays( );
+  sei_read_flag( pDecodedMessageOutputStream, code, "alternative_depth_info_cancel_flag" ); sei.m_alternativeDepthInfoCancelFlag = (code == 1);
+  if( sei.m_alternativeDepthInfoCancelFlag  ==  0 )
+  {
+    sei_read_code( pDecodedMessageOutputStream, 2, code, "depth_type" ); sei.m_depthType = code;
+    if( sei.m_depthType  ==  0 )
+    {
+      sei_read_uvlc( pDecodedMessageOutputStream, code, "num_constituent_views_gvd_minus1" ); sei.m_numConstituentViewsGvdMinus1 = code;
+      sei_read_flag( pDecodedMessageOutputStream, code, "depth_present_gvd_flag" ); sei.m_depthPresentGvdFlag = (code == 1);
+      sei_read_flag( pDecodedMessageOutputStream, code, "z_gvd_flag" ); sei.m_zGvdFlag = (code == 1);
+      sei_read_flag( pDecodedMessageOutputStream, code, "intrinsic_param_gvd_flag" ); sei.m_intrinsicParamGvdFlag = (code == 1);
+      sei_read_flag( pDecodedMessageOutputStream, code, "rotation_gvd_flag" ); sei.m_rotationGvdFlag = (code == 1);
+      sei_read_flag( pDecodedMessageOutputStream, code, "translation_gvd_flag" ); sei.m_translationGvdFlag = (code == 1);
+      if( sei.m_zGvdFlag )
+      {
+        for( Int i = 0, j = 0; j <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
+        {
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_near_flag" ); sei.m_signGvdZNearFlag[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_near" ); sei.m_expGvdZNear[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_near_minus1" ); sei.m_manLenGvdZNearMinus1[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZNearMinus1[i][j]+1, code, "man_gvd_z_near" ); sei.m_manGvdZNear[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_z_far_flag" ); sei.m_signGvdZFarFlag[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 7, code, "exp_gvd_z_far" ); sei.m_expGvdZFar[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, 5, code, "man_len_gvd_z_far_minus1" ); sei.m_manLenGvdZFarMinus1[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_manLenGvdZFarMinus1[i][j]+1, code, "man_gvd_z_far" ); sei.m_manGvdZFar[i][j] = code;
+        }
+      }
+      if( sei.m_intrinsicParamGvdFlag )
+      {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_focal_length" ); sei.m_precGvdFocalLength = code;
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_principal_point" ); sei.m_precGvdPrincipalPoint = code;
+      }
+      if( sei.m_rotationGvdFlag )
+      {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_rotation_param" ); sei.m_precGvdRotationParam = code;
+      }
+      if( sei.m_translationGvdFlag )
+      {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "prec_gvd_translation_param" ); sei.m_precGvdTranslationParam = code;
+      }
+      for( Int i = 0, j = 0; j <= sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
+      {
+        if( sei.m_intrinsicParamGvdFlag )
+        {
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_x" ); sei.m_signGvdFocalLengthX[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_x" ); sei.m_expGvdFocalLengthX[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthXLen(i,j), code, "man_gvd_focal_length_x" ); sei.m_manGvdFocalLengthX[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_focal_length_y" ); sei.m_signGvdFocalLengthY[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_focal_length_y" ); sei.m_expGvdFocalLengthY[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdFocalLengthYLen(i,j), code, "man_gvd_focal_length_y" ); sei.m_manGvdFocalLengthY[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_x" ); sei.m_signGvdPrincipalPointX[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_x" ); sei.m_expGvdPrincipalPointX[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointXLen(i,j), code, "man_gvd_principal_point_x" ); sei.m_manGvdPrincipalPointX[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_principal_point_y" ); sei.m_signGvdPrincipalPointY[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_principal_point_y" ); sei.m_expGvdPrincipalPointY[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdPrincipalPointYLen(i,j), code, "man_gvd_principal_point_y" ); sei.m_manGvdPrincipalPointY[i][j] = code;
+        }
+        if( sei.m_rotationGvdFlag )
+        {
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r00" ); sei.m_signGvdR00[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r00" ); sei.m_expGvdR00[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r00" ); sei.m_manGvdR00[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r01" ); sei.m_signGvdR01[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r01" ); sei.m_expGvdR01[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r01" ); sei.m_manGvdR01[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r02" ); sei.m_signGvdR02[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r02" ); sei.m_expGvdR02[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r02" ); sei.m_manGvdR02[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r10" ); sei.m_signGvdR10[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r10" ); sei.m_expGvdR10[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r10" ); sei.m_manGvdR10[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r11" ); sei.m_signGvdR11[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r11" ); sei.m_expGvdR11[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r11" ); sei.m_manGvdR11[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r12" ); sei.m_signGvdR12[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r12" ); sei.m_expGvdR12[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r12" ); sei.m_manGvdR12[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r20" ); sei.m_signGvdR20[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r20" ); sei.m_expGvdR20[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r20" ); sei.m_manGvdR20[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r21" ); sei.m_signGvdR21[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r21" ); sei.m_expGvdR21[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r21" ); sei.m_manGvdR21[i][j] = code;
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_r22" ); sei.m_signGvdR22[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_r22" ); sei.m_expGvdR22[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_precGvdRotationParam, code, "man_gvd_r22" ); sei.m_manGvdR22[i][j] = code;
+          //sei_read_code( pDecodedMessageOutputStream, sei.getManGvdRLen(i,j,k), code, "man_gvd_r" ); sei.m_manGvdR[i][j] = code;
+        }
+        if( sei.m_translationGvdFlag )
+        {
+          sei_read_flag( pDecodedMessageOutputStream, code, "sign_gvd_t_x" ); sei.m_signGvdTX[i][j] = (code == 1);
+          sei_read_code( pDecodedMessageOutputStream, 6, code, "exp_gvd_t_x" ); sei.m_expGvdTX[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.getManGvdTXLen(i,j), code, "man_gvd_t_x" ); sei.m_manGvdTX[i][j] = code;
+        }
+      }
+    }
+
+    if( sei.m_depthType  ==  1 )
+    {
+      sei_read_svlc( pDecodedMessageOutputStream, scode, "min_offset_x_int" ); sei.m_minOffsetXInt = scode;
+      sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_x_frac" ); sei.m_minOffsetXFrac = code;
+      sei_read_svlc( pDecodedMessageOutputStream, scode, "max_offset_x_int" ); sei.m_maxOffsetXInt = scode;
+      sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_x_frac" ); sei.m_maxOffsetXFrac = code;
+      sei_read_flag( pDecodedMessageOutputStream, code, "offset_y_present_flag" ); sei.m_offsetYPresentFlag = (code == 1);
+      if( sei.m_offsetYPresentFlag )
+      {
+        sei_read_svlc( pDecodedMessageOutputStream, scode, "min_offset_y_int" ); sei.m_minOffsetYInt = scode;
+        sei_read_code( pDecodedMessageOutputStream, 8, code, "min_offset_y_frac" ); sei.m_minOffsetYFrac = code;
+        sei_read_svlc( pDecodedMessageOutputStream, scode, "max_offset_y_int" ); sei.m_maxOffsetYInt = scode;
+        sei_read_code( pDecodedMessageOutputStream, 8, code, "max_offset_y_frac" ); sei.m_maxOffsetYFrac = code;
+      }
+      sei_read_flag( pDecodedMessageOutputStream, code, "warp_map_size_present_flag" ); sei.m_warpMapSizePresentFlag = (code == 1);
+      if( sei.m_warpMapSizePresentFlag )
+      {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_width_minus2" ); sei.m_warpMapWidthMinus2 = code;
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "warp_map_height_minus2" ); sei.m_warpMapHeightMinus2 = code;
+      }
+    }
+  }
+};
+#endif
+
 //! \}
Index: /trunk/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- /trunk/source/Lib/TLibDecoder/SEIread.h	(revision 1355)
+++ /trunk/source/Lib/TLibDecoder/SEIread.h	(revision 1356)
@@ -56,7 +56,19 @@
   SEIReader() {};
   virtual ~SEIReader() {};
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
+#else
   Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
+#endif
+#if NH_MV_SEI
+  Void setLayerId                            ( Int   layerId )   { m_layerId  = layerId; }; 
+  Void setDecOrder                           ( Int64 decOrder )  { m_decOrder = decOrder; }; 
+#endif
 protected:
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
+#else
   Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
+#endif
   Void xParseSEIuserDataUnregistered          (SEIuserDataUnregistered &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
   Void xParseSEIActiveParameterSets           (SEIActiveParameterSets  &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
@@ -74,5 +86,9 @@
   Void xParseSEIToneMappingInfo               (SEIToneMappingInfo& sei,               UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
   Void xParseSEISOPDescription                (SEISOPDescription &sei,                UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
+#else
   Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
+#endif
   Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
   Void xParseSEITimeCode                      (SEITimeCode& sei,                      UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
@@ -81,6 +97,38 @@
   Void xParseSEIMasteringDisplayColourVolume  (SEIMasteringDisplayColourVolume& sei,  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
 #if NH_MV
+#if !NH_MV_SEI
   Void  xParseSEISubBitstreamProperty         (SEISubBitstreamProperty &sei        ,  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
   Void  xResizeSubBitstreamPropertySeiArrays  (SEISubBitstreamProperty &sei);
+#endif
+#endif
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  Void xParseSEILayersNotPresent              (SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps ,std::ostream *pDecodedMessageOutputStream);
+#endif
+  Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+#if NH_MV_SEI_TBD
+  Void xParseSEIBspNesting                    (SEIBspNesting& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+  Void xParseSEIBspInitialArrivalTime         (SEIBspInitialArrivalTime& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+#endif
+  Void xParseSEISubBitstreamProperty          (SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+  Void xParseSEIAlphaChannelInfo              (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+  Void xParseSEIOverlayInfo                   (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+  Void xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+#if NH_MV_SEI_TBD
+  Void xParseSEIFrameFieldInfo                (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+#endif
+  Void xParseSEIThreeDimensionalReferenceDisplaysInfo (SEIThreeDimensionalReferenceDisplaysInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+#if SEI_DRI_F0169
+  Void xParseSEIDepthRepInfoElement           (double &f,std::ostream *pDecodedMessageOutputStream);
+  Void xParseSEIDepthRepresentationInfo       (SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+#endif
+  Void xParseSEIMultiviewSceneInfo            (SEIMultiviewSceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+
+  Void xParseSEIMultiviewAcquisitionInfo      (SEIMultiviewAcquisitionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+
+#if NH_MV_SEI
+  Void xParseSEIMultiviewViewPosition         (SEIMultiviewViewPosition& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
+#endif
+#if NH_3D
+  Void xParseSEIAlternativeDepthInfo          (SEIAlternativeDepthInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
 #endif
 
@@ -89,4 +137,11 @@
   Void sei_read_svlc(std::ostream *pOS,                Int&  ruiCode, const Char *pSymbolName);
   Void sei_read_flag(std::ostream *pOS,                UInt& ruiCode, const Char *pSymbolName);
+  Void sei_read_string(std::ostream *pOS, UInt uiBufSize, UChar* pucCode, UInt& ruiLength, const Char *pSymbolName);
+#if NH_MV_SEI
+  inline Void output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize);
+private: 
+  Int   m_layerId; 
+  Int64 m_decOrder;   
+#endif
 };
 
Index: /trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1356)
@@ -152,4 +152,16 @@
 }
 
+Void  SyntaxElementParser::xReadStringTr        (UInt buSize, UChar *pValue, UInt& rLength, const Char *pSymbolName)
+{
+#if RExt__DECODER_DEBUG_BIT_STATISTICS
+  xReadString (buSize, pValue, rLength, pSymbolName);
+#else
+  xReadString(buSize, pValue, rLength);
+#endif  
+  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+  fprintf( g_hTrace, "%-50s st(v=%d)  : %s\n", pSymbolName, rLength, pValue ); 
+  fflush ( g_hTrace );
+}
+
 Void  xTraceAccessUnitDelimiter ()
 {
@@ -269,4 +281,26 @@
 }
 
+#if RExt__DECODER_DEBUG_BIT_STATISTICS
+Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength, const Char *pSymbolName)
+#else
+Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength)
+#endif
+{
+  assert( m_pcBitstream->getNumBitsRead() % 8 == 0 ); //always start reading at a byte-aligned position  
+  UInt val;
+  UInt i;
+  for (i=0 ; i<bufSize ; ++i ) 
+  {
+    m_pcBitstream->readByte( val );
+    pVal[i] = val;
+    if ( val == 0)
+    {
+      break;
+    }
+  }
+  rLength = i;
+  assert( pVal[rLength] == 0 );  
+}
+
 Void SyntaxElementParser::xReadRbspTrailingBits()
 {
Index: /trunk/source/Lib/TLibDecoder/SyntaxElementParser.h
===================================================================
--- /trunk/source/Lib/TLibDecoder/SyntaxElementParser.h	(revision 1355)
+++ /trunk/source/Lib/TLibDecoder/SyntaxElementParser.h	(revision 1356)
@@ -49,4 +49,5 @@
 #define READ_SVLC(        code, name)     xReadSvlcTr (         code, name )
 #define READ_FLAG(        code, name)     xReadFlagTr (         code, name )
+#define READ_STRING(bufSize, code, length, name)   xReadStringTr ( bufSize, code, length, name )
 
 #else
@@ -58,4 +59,5 @@
 #define READ_SVLC(        code, name)     xReadSvlc (         code, name )
 #define READ_FLAG(        code, name)     xReadFlag (         code, name )
+#define READ_STRING(bufSize, code, length, name)   xReadString ( bufSize, code, length, name )
 
 #else
@@ -65,4 +67,5 @@
 #define READ_SVLC(        code, name)     xReadSvlc (         code )
 #define READ_FLAG(        code, name)     xReadFlag (         code )
+#define READ_STRING(bufSize, code, length, name)   xReadString ( bufSize, code, length )
 
 #endif
@@ -92,4 +95,5 @@
   Void  xReadSvlc    ( Int&   val, const Char *pSymbolName );
   Void  xReadFlag    ( UInt&  val, const Char *pSymbolName );
+  Void  xReadString  ( UInt bufSize, UChar *val, UInt& length, const Char *pSymbolName);
 #else
   Void  xReadCode    ( UInt   length, UInt& val );
@@ -97,4 +101,5 @@
   Void  xReadSvlc    ( Int&   val );
   Void  xReadFlag    ( UInt&  val );
+  Void  xReadString  ( UInt bufSize, UChar *val, UInt& length);
 #endif
 #if ENC_DEC_TRACE
@@ -103,4 +108,5 @@
   Void  xReadSvlcTr  (               Int& rValue, const Char *pSymbolName);
   Void  xReadFlagTr  (              UInt& rValue, const Char *pSymbolName);
+  Void  xReadStringTr(UInt bufSize, UChar *pValue, UInt& rLength, const Char *pSymbolName);
 #endif
 public:
Index: /trunk/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1356)
@@ -59,6 +59,6 @@
   m_iLog2Precision   = LOG2_DISP_PREC_LUT;
   m_uiBitDepthForLUT = 8; // fixed
-  m_receivedIdc = NULL; 
-  m_vps         = NULL; 
+  m_receivedIdc = NULL;
+  m_vps         = NULL;
 }
 
@@ -75,5 +75,8 @@
   xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
   xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
-  xDeleteArray( m_receivedIdc, m_vps->getNumViews() );
+  if ( m_receivedIdc != NULL )
+  {
+    xDeleteArray( m_receivedIdc, m_vps->getNumViews() );
+  }
 }
 
@@ -84,37 +87,37 @@
   assert( !isInitialized() ); // Only one initialization currently supported
   m_bInitialized            = true;
-  m_vps                     = vps; 
-  m_bCamParsVaryOverTime    = false;   
-  m_lastPoc                 = -1;   
-  m_firstReceivedPoc        = -2; 
+  m_vps                     = vps;
+  m_bCamParsVaryOverTime    = false;
+  m_lastPoc                 = -1;
+  m_firstReceivedPoc        = -2;
 
   for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++)
   {
-    Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ; 
-    m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps );    
-  }
-
-  assert( m_receivedIdc == NULL ); 
-  m_receivedIdc = new Int*[ m_vps->getNumViews() ]; 
+    Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ;
+    m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps );
+  }
+
+  assert( m_receivedIdc == NULL );
+  m_receivedIdc = new Int*[ m_vps->getNumViews() ];
   for (Int i = 0; i < m_vps->getNumViews(); i++)
   {
-    m_receivedIdc[i] = new Int[ m_vps->getNumViews() ]; 
-  }
-
-  xResetReceivedIdc( true ); 
+    m_receivedIdc[i] = new Int[ m_vps->getNumViews() ];
+  }
+
+  xResetReceivedIdc( true );
 
   for (Int voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )
   {
-    if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 
+    if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) )
     {
       for (Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )
-      { 
+      {
         if( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )
         {
-          m_receivedIdc   [ baseVoiInVps ][ voiInVps ] = -1; 
+          m_receivedIdc   [ baseVoiInVps ][ voiInVps ] = -1;
           m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = m_vps->getCodedScale    (voiInVps) [ baseVoiInVps ];
           m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = m_vps->getCodedOffset   (voiInVps) [ baseVoiInVps ];
 
-          m_receivedIdc   [ voiInVps ][ baseVoiInVps ] = -1; 
+          m_receivedIdc   [ voiInVps ][ baseVoiInVps ] = -1;
           m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedScale (voiInVps) [ baseVoiInVps ];
           m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedOffset(voiInVps) [ baseVoiInVps ];
@@ -131,11 +134,11 @@
 {
   for (Int i = 0; i < m_vps->getNumViews(); i++)
-  {  
+  {
     for (Int j = 0; j < m_vps->getNumViews(); j++)
     {
       if ( overWriteFlag ||  ( m_receivedIdc[i][j] != -1 ) )
       {
-        m_receivedIdc[i][j] = 0; 
-      }      
+        m_receivedIdc[i][j] = 0;
+      }
     }
   }
@@ -171,5 +174,5 @@
 }
 
-Void 
+Void
   CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT)
 {
@@ -234,11 +237,11 @@
   if( m_firstReceivedPoc == -2 )
   {
-    m_firstReceivedPoc = curPoc; 
-  }
-
-  Bool newPocFlag = ( m_lastPoc != curPoc );  
+    m_firstReceivedPoc = curPoc;
+  }
+
+  Bool newPocFlag = ( m_lastPoc != curPoc );
 
   if ( newPocFlag )
-  {    
+  {
     if( m_lastPoc != -1 )
     {
@@ -246,23 +249,23 @@
     }
 
-    xResetReceivedIdc( false ); 
+    xResetReceivedIdc( false );
     m_lastPoc = pcSlice->getPOC();
   }
 
-  UInt voiInVps          = m_vps->getVoiInVps(pcSlice->getViewIndex());  
+  UInt voiInVps          = m_vps->getVoiInVps(pcSlice->getViewIndex());
   if( m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) // check consistency of slice parameters here
-  {   
+  {
     for( Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ )
-    {        
+    {
       if ( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) )
       {
         if ( m_receivedIdc[ voiInVps ][ baseVoiInVps ] != 0 )
-        {      
+        {
           AOF( m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedScale () [ baseVoiInVps ] );
           AOF( m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedOffset() [ baseVoiInVps ] );
         }
         else
-        {          
-          m_receivedIdc   [ voiInVps ][ baseVoiInVps ]  = 1; 
+        {
+          m_receivedIdc   [ voiInVps ][ baseVoiInVps ]  = 1;
           m_aaiCodedScale [ voiInVps ][ baseVoiInVps ]  = pcSlice->getInvCodedScale () [ baseVoiInVps ];
           m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ]  = pcSlice->getInvCodedOffset() [ baseVoiInVps ];
@@ -270,11 +273,11 @@
         }
         if ( m_receivedIdc[ baseVoiInVps ][ voiInVps ] != 0 )
-        {      
+        {
           AOF( m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedScale    () [ baseVoiInVps ] );
           AOF( m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedOffset   () [ baseVoiInVps ] );
         }
         else
-        {        
-          m_receivedIdc   [ baseVoiInVps ][ voiInVps ]  = 1; 
+        {
+          m_receivedIdc   [ baseVoiInVps ][ voiInVps ]  = 1;
           m_aaiCodedScale [ baseVoiInVps ][ voiInVps ]  = pcSlice->getCodedScale    () [ baseVoiInVps ];
           m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ]  = pcSlice->getCodedOffset   () [ baseVoiInVps ];
@@ -283,5 +286,5 @@
       }
     }
-  }  
+  }
 }
 
@@ -295,5 +298,5 @@
       fprintf( m_pCodedScaleOffsetFile, "#ViewOrderIdx     ViewIdVal\n" );
       fprintf( m_pCodedScaleOffsetFile, "#------------ -------------\n" );
-      
+
       for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ )
       {
@@ -315,10 +318,10 @@
           {
             if ( m_receivedIdc[baseVoiInVps][voiInVps] != 0 )
-            {            
+            {
               fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
-                iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ), 
-                m_aaiCodedScale [ baseVoiInVps ][ voiInVps ], 
+                iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ),
+                m_aaiCodedScale [ baseVoiInVps ][ voiInVps ],
                 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_vps->getCpPrecision() );
-            }            
+            }
           }
         }
@@ -334,5 +337,5 @@
 #if !NH_MV
   , m_associatedIRAPType(NAL_UNIT_INVALID)
-  , m_pocCRA(0)  
+  , m_pocCRA(0)
   , m_pocRandomAccess(MAX_INT)
   , m_cListPic()
@@ -426,5 +429,5 @@
     fclose( g_hTrace );
   }
-#endif  
+#endif
 #endif
   while (!m_prefixSEINALUs.empty())
@@ -465,5 +468,5 @@
 #endif
 #if NH_MV
-  m_cCavlcDecoder.setDecTop( this ); 
+  m_cCavlcDecoder.setDecTop( this );
 #endif
   m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO);
@@ -653,6 +656,6 @@
 #if NH_MV
     const TComVPS* vps = m_parameterSetManager.getVPS(sps->getVPSId());
-    assert (vps != 0); 
-    // TBD: check the condition on m_firstPicInLayerDecodedFlag 
+    assert (vps != 0);
+    // TBD: check the condition on m_firstPicInLayerDecodedFlag
     if (!m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP() || !m_firstPicInLayerDecodedFlag[m_layerId] , m_layerId ) )
 #else
@@ -671,17 +674,21 @@
       {
         //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0.
-        assert( sps->getUpdateRepFormatFlag() == false ); 
-      }
-      sps->checkRpsMaxNumPics( vps, getLayerId() ); 
-
-      // It is a requirement of bitstream conformance that, when the SPS is referred to by 
-      // any current picture that belongs to an independent non-base layer, the value of 
+        assert( sps->getUpdateRepFormatFlag() == false );
+      }
+      sps->checkRpsMaxNumPics( vps, getLayerId() );
+
+      // It is a requirement of bitstream conformance that, when the SPS is referred to by
+      // any current picture that belongs to an independent non-base layer, the value of
       // MultiLayerExtSpsFlag derived from the SPS shall be equal to 0.
 
       if ( m_layerId > 0 && vps->getNumRefLayers( m_layerId ) == 0 )
-      {  
-        assert( sps->getMultiLayerExtSpsFlag() == 0 ); 
-      }
-    }
+      {
+        assert( sps->getMultiLayerExtSpsFlag() == 0 );
+      }
+    }
+#if NH_MV_SEI
+    m_seiReader.setLayerId ( newPic->getLayerId      ( ) );
+    m_seiReader.setDecOrder( newPic->getDecodingOrder( ) );
+#endif
 #endif
 
@@ -707,5 +714,5 @@
     m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
 #else
-    m_pcPic = newPic; 
+    m_pcPic = newPic;
 #endif
 
@@ -723,7 +730,7 @@
 #if NH_MV
     pSlice->setPic( m_pcPic );
-    vps=pSlice->getVPS();  
+    vps=pSlice->getVPS();
     // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
-    assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) );   
+    assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) );
     // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
     assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, sps->getLayerId() ) );
@@ -775,6 +782,6 @@
   {
 #if NH_MV
-    assert( m_pcPic != NULL ); 
-    assert( newPic  == NULL ); 
+    assert( m_pcPic != NULL );
+    assert( newPic  == NULL );
 #endif
     // make the slice-pilot a real slice, and set up the slice-pilot for the next slice
@@ -832,5 +839,9 @@
     InputNALUnit &nalu=*m_prefixSEINALUs.front();
 #if NH_MV
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+    m_seiReader.parseSEImessage(&(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream);
+#else
     m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream );
+#endif
 #else
     m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream );
@@ -855,12 +866,12 @@
   m_cEntropyDecoder.setBitstream      (&(nalu.getBitstream()));
 
-  assert( nalu.m_nuhLayerId == m_layerId );   
+  assert( nalu.m_nuhLayerId == m_layerId );
   m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice
   // it is not associated with picture, sps or pps structures.
-  m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 
-  m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot );   
+  m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId );
+  m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot );
   if ( m_apcSlicePilot->getFirstSliceSegementInPicFlag() )
   {
-#endif  
+#endif
     m_uiSliceIdx = 0;
   }
@@ -908,5 +919,5 @@
   if (m_apcSlicePilot->getRapPicFlag())
   {
-      if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 
+      if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
         (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
         (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
@@ -924,5 +935,5 @@
     else
     {
-      m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 
+      m_apcSlicePilot->setNoOutputPriorPicsFlag(false);
     }
 
@@ -950,5 +961,5 @@
     }
   }
-  
+
   if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
   {
@@ -1044,11 +1055,11 @@
   {
     //Check Multiview Main profile constraint in G.11.1.1
-    //  When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 
-    //  for the layer with nuh_layer_id equal to i in subBitstream, 
-    //  inter_view_mv_vert_constraint_flag shall be equal to 1 
+    //  When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1
+    //  for the layer with nuh_layer_id equal to i in subBitstream,
+    //  inter_view_mv_vert_constraint_flag shall be equal to 1
     //  in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer.
     if( pcSlice->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN
       &&
-      pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1 
+      pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1
       )
     {
@@ -1061,8 +1072,8 @@
     m_pcPic->setViewIndex( getViewIndex() );
     m_pcPic->setIsDepth  ( getIsDepth  () );
-    pcSlice->setIvPicLists( m_dpb );         
-#endif
-#endif
-    
+    pcSlice->setIvPicLists( m_dpb );
+#endif
+#endif
+
     // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses.
     // Now, having set up the maps, convert them to the correct form.
@@ -1097,5 +1108,5 @@
         else
         {
-          assert( false ); 
+          assert( false );
         }
       }
@@ -1104,7 +1115,7 @@
 #endif
 #if NH_3D_ARP
-      pcSlice->setPocsInCurrRPSs(); 
+      pcSlice->setPocsInCurrRPSs();
       pcSlice->setARPStepNum(m_dpb);
-#endif     
+#endif
 #endif
 
@@ -1191,5 +1202,5 @@
     if ( decProcAnnexI() )
     {
-      pcSlice->checkInCompPredRefLayers(); 
+      pcSlice->checkInCompPredRefLayers();
     }
 #endif
@@ -1230,5 +1241,5 @@
   TComSPS* sps = new TComSPS();
 #if NH_MV
-  sps->setLayerId( getLayerId() ); 
+  sps->setLayerId( getLayerId() );
 #endif
 #if O0043_BEST_EFFORT_DECODING
@@ -1246,5 +1257,5 @@
   TComPPS* pps = new TComPPS();
 #if NH_MV
-  pps->setLayerId( getLayerId() ); 
+  pps->setLayerId( getLayerId() );
 #endif
 #if NH_3D_DLT
@@ -1304,5 +1315,9 @@
       {
 #if NH_MV
-        m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream );
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+      m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream);
+#else
+      m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream );
+#endif
 #else
         m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream );
@@ -1332,6 +1347,6 @@
     case NAL_UNIT_CODED_SLICE_RASL_R:
 #if NH_MV
-      assert( false ); 
-      return 1; 
+      assert( false );
+      return 1;
 #else
       return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
@@ -1506,5 +1521,5 @@
 {
   //Output of this process is PicOrderCntVal, the picture order count of the current picture.
-  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 
+  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and
   //  motion vector prediction and for decoder conformance checking (see clause F.13.5).
 
@@ -1513,35 +1528,35 @@
   TComSlice* slice = m_apcSlicePilot;
   const Int nuhLayerId   = slice->getLayerId();
-  const TComVPS*   vps   = slice->getVPS(); 
-  const TComSPS*   sps   = slice->getSPS(); 
-
-  Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ]; 
+  const TComVPS*   vps   = slice->getVPS();
+  const TComSPS*   sps   = slice->getSPS();
+
+  Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ];
 
   if ( isFstPicOfAllLayOfPocResetPer )
   {
-    //  When the current picture is the first picture among all layers of a POC resetting period, 
+    //  When the current picture is the first picture among all layers of a POC resetting period,
     //  the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive.
-    pocDecrementedInDpbFlag = false; 
+    pocDecrementedInDpbFlag = false;
   }
 
   //  The variable pocResettingFlag is derived as follows:
-  Bool pocResettingFlag; 
+  Bool pocResettingFlag;
   if ( isPocResettingPicture )
   {
-    //-  If the current picture is a POC resetting picture, the following applies:    
+    //-  If the current picture is a POC resetting picture, the following applies:
     if( vps->getVpsPocLsbAlignedFlag()  )
     {
       //  -  If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1.
-      pocResettingFlag = true; 
+      pocResettingFlag = true;
     }
     else if ( pocDecrementedInDpbFlag )
     {
       //  -  Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0.
-      pocResettingFlag = false; 
+      pocResettingFlag = false;
     }
     else
     {
       //  -  Otherwise, pocResettingFlag is set equal to 1.
-      pocResettingFlag = true; 
+      pocResettingFlag = true;
     }
   }
@@ -1549,9 +1564,9 @@
   {
     //  -  Otherwise, pocResettingFlag is set equal to 0.
-    pocResettingFlag = false; 
-  }
-
-  Int picOrderCntMsb; 
-  Int picOrderCntVal; 
+    pocResettingFlag = false;
+  }
+
+  Int picOrderCntMsb;
+  Int picOrderCntVal;
 
   //  Depending on pocResettingFlag, the following applies:
@@ -1561,14 +1576,14 @@
     if( slice->getPocResetIdc()  ==  1 )
     {
-      picOrderCntVal = slice->getSlicePicOrderCntLsb(); 
-    }
-    else if (slice->getPocResetIdc()  ==  2 ) 
-    {
-      picOrderCntVal = 0; 
+      picOrderCntVal = slice->getSlicePicOrderCntLsb();
+    }
+    else if (slice->getPocResetIdc()  ==  2 )
+    {
+      picOrderCntVal = 0;
     }
     else
     {
-      picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 
-      picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
+      picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() );
+      picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
     }
   }
@@ -1580,5 +1595,5 @@
     if( slice->getPocMsbCycleValPresentFlag() )
     {
-      picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 
+      picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb();
     }
     else if( !firstPicInLayerDecodedFlag  ||
@@ -1586,13 +1601,13 @@
     {
       picOrderCntMsb = 0; //     (F 62)
-    }    
+    }
     else
     {
       Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );
-      Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 
-      picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 
-    }
-    picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
-  }  
+      Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;
+      picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );
+    }
+    picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
+  }
   return picOrderCntVal;
 }
@@ -1607,19 +1622,19 @@
     if ( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] != MIN_INT )
     {
-      // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer 
-      //   of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the 
+      // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer
+      //   of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the
       //   poc_reset_period_id of picA.
 
-      m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] ); 
+      m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] );
     }
     else
     {
       //- Otherwise, the value of poc_reset_period_id is inferred to be equal to 0.
-      m_apcSlicePilot->setPocResetPeriodId( 0 ); 
+      m_apcSlicePilot->setPocResetPeriodId( 0 );
     }
   }
   else
   {
-    m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId();  
+    m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId();
   }
 }
@@ -1627,5 +1642,5 @@
 
 Void TDecTop::decodePocAndRps( )
-{ 
+{
   assert( m_uiSliceIdx == 0 );
   Int nuhLayerId = m_pcPic->getLayerId();
@@ -1634,12 +1649,12 @@
     // 8.1.3 Decoding process for a coded picture with nuh_layer_id equal to 0
 
-    // Variables and functions relating to picture order count are derived as 
-    // specified in clause 8.3.1. This needs to be invoked only for the first slice 
+    // Variables and functions relating to picture order count are derived as
+    // specified in clause 8.3.1. This needs to be invoked only for the first slice
     // segment of a picture.
     x831DecProcForPicOrderCount( );
 
-    // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 
-    // pictures may be marked as "unused for reference" or "used for long-term 
-    // reference". This needs to be invoked only for the first slice segment of a 
+    // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference
+    // pictures may be marked as "unused for reference" or "used for long-term
+    // reference". This needs to be invoked only for the first slice segment of a
     // picture.
     x832DecProcForRefPicSet    (  false );
@@ -1654,12 +1669,12 @@
       // --> Clause 8.1.3 is invoked with replacments of 8.3.1, 8.3.2, and 8.3.3 by F.8.3.1, 8.3.2, and 8.3.3
 
-      // Variables and functions relating to picture order count are derived as 
-      // specified in clause 8.3.1. This needs to be invoked only for the first slice 
+      // Variables and functions relating to picture order count are derived as
+      // specified in clause 8.3.1. This needs to be invoked only for the first slice
       // segment of a picture.
       xF831DecProcForPicOrderCount( );
 
-      // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 
-      // pictures may be marked as "unused for reference" or "used for long-term 
-      // reference". This needs to be invoked only for the first slice segment of a 
+      // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference
+      // pictures may be marked as "unused for reference" or "used for long-term
+      // reference". This needs to be invoked only for the first slice segment of a
       // picture.
       xF832DecProcForRefPicSet( );
@@ -1670,13 +1685,13 @@
       // nuh_layer_id greater than 0
 
-      // Variables and functions relating to picture order count are derived in clause F.8.3.1. 
-      // This needs to be invoked only for the first slice segment of a picture. It is a requirement 
-      // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the 
+      // Variables and functions relating to picture order count are derived in clause F.8.3.1.
+      // This needs to be invoked only for the first slice segment of a picture. It is a requirement
+      // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the
       // same value during and at the end of decoding of the access unit
       xF831DecProcForPicOrderCount( );
 
-      // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with 
-      // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for 
-      // long-term reference" and any picture with a different value of nuh_layer_id is not marked. 
+      // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with
+      // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for
+      // long-term reference" and any picture with a different value of nuh_layer_id is not marked.
       // This needs to be invoked only for the first slice segment of a picture.
       xF832DecProcForRefPicSet( );
@@ -1685,10 +1700,10 @@
   else
   {
-    assert( false ); 
+    assert( false );
   }
 }
 
 Void TDecTop::genUnavailableRefPics( )
-{ 
+{
   assert( m_uiSliceIdx == 0 );
   Int nuhLayerId = m_pcPic->getLayerId();
@@ -1699,9 +1714,9 @@
     if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) )
     {
-      // When the current picture is a BLA picture or is a CRA picture 
-      // with NoRaslOutputFlag equal to 1, the decoding process for generating 
-      // unavailable reference pictures specified in clause 8.3.3 is invoked, 
+      // When the current picture is a BLA picture or is a CRA picture
+      // with NoRaslOutputFlag equal to 1, the decoding process for generating
+      // unavailable reference pictures specified in clause 8.3.3 is invoked,
       // which needs to be invoked only for the first slice segment of a picture.
-      x8331GenDecProcForGenUnavilRefPics();       
+      x8331GenDecProcForGenUnavilRefPics();
     }
   }
@@ -1717,14 +1732,14 @@
       if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) )
       {
-        // When the current picture is a BLA picture or is a CRA picture 
-        // with NoRaslOutputFlag equal to 1, the decoding process for generating 
-        // unavailable reference pictures specified in clause 8.3.3 is invoked, 
+        // When the current picture is a BLA picture or is a CRA picture
+        // with NoRaslOutputFlag equal to 1, the decoding process for generating
+        // unavailable reference pictures specified in clause 8.3.3 is invoked,
         // which needs to be invoked only for the first slice segment of a picture.
-        xF833DecProcForGenUnavRefPics(); 
+        xF833DecProcForGenUnavRefPics();
       }
 #if NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS
-      TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
+      TComDecodedRps* decRps = m_pcPic->getDecodedRps();
       decRps->m_numActiveRefLayerPics0 = 0;
-      decRps->m_numActiveRefLayerPics1 = 0;      
+      decRps->m_numActiveRefLayerPics1 = 0;
 #endif
     }
@@ -1736,6 +1751,6 @@
       if ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] )
       {
-        // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating 
-        // unavailable reference pictures for pictures first in decoding order within a layer specified in 
+        // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating
+        // unavailable reference pictures for pictures first in decoding order within a layer specified in
         // clause F.8.1.7 is invoked, which needs to be invoked only for the first slice segment of a picture.
         xF817DecProcForGenUnavRefPicForPicsFrstInDecOrderInLay();
@@ -1744,9 +1759,9 @@
       if ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && ( m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) )
       {
-        // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP 
-        // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference 
-        // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice 
+        // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP
+        // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference
+        // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice
         // segment of a picture.
-        xF833DecProcForGenUnavRefPics(); 
+        xF833DecProcForGenUnavRefPics();
       }
 
@@ -1760,12 +1775,12 @@
   else
   {
-    assert( false ); 
-  }
-
-  xCheckUnavailableRefPics();      
+    assert( false );
+  }
+
+  xCheckUnavailableRefPics();
 }
 Void TDecTop::executeLoopFilters( )
 {
-  assert( m_pcPic != NULL ); 
+  assert( m_pcPic != NULL );
   if ( !m_pcPic->getHasGeneratedRefPics() && !m_pcPic->getIsGenerated() )
   {
@@ -1779,6 +1794,6 @@
   if( m_pcPic->isIrap() )
   {
-    m_prevIrapPoc           = m_pcPic->getPOC(); 
-    m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder(); 
+    m_prevIrapPoc           = m_pcPic->getPOC();
+    m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder();
   }
   if( m_pcPic->isStsa() )
@@ -1791,44 +1806,44 @@
 
 Void TDecTop::initFromActiveVps( const TComVPS* vps )
-{   
-  setViewId   ( vps->getViewId   ( getLayerId() )      );  
+{
+  setViewId   ( vps->getViewId   ( getLayerId() )      );
 #if NH_3D
-  setViewIndex( vps->getViewIndex( getLayerId() )      );  
-  setIsDepth  ( vps->getDepthId  ( getLayerId() ) == 1 );  
+  setViewIndex( vps->getViewIndex( getLayerId() )      );
+  setIsDepth  ( vps->getDepthId  ( getLayerId() ) == 1 );
 #endif
 
   if ( !vps->getVpsExtensionFlag() )
   {
-    m_decodingProcess = CLAUSE_8; 
+    m_decodingProcess = CLAUSE_8;
     m_isInOwnTargetDecLayerIdList = ( getLayerId() ==  0 );
   }
   else
-  {  
+  {
     if ( m_targetOlsIdx == -1 )
     {
-      // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 
-      m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 
-    }
-
-    Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 
+      // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. )
+      m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1();
+    }
+
+    Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx );
 
     if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && vps->getVpsBaseLayerInternalFlag() )
     {
-      m_smallestLayerId = 0; 
+      m_smallestLayerId = 0;
     }
     else if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && !vps->getVpsBaseLayerInternalFlag() )
     {
-      m_smallestLayerId = 0; 
+      m_smallestLayerId = 0;
     }
     else if ( targetDecLayerSetIdx > vps->getVpsNumLayerSetsMinus1() && vps->getNumLayersInIdList( targetDecLayerSetIdx) == 1 )
     {
-      
-      // m_smallestLayerId = 0;       
-      // For now don't do change of layer id here. 
-      m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];    
+
+      // m_smallestLayerId = 0;
+      // For now don't do change of layer id here.
+      m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];
     }
     else
     {
-      m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];    
+      m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ];
     }
 
@@ -1836,19 +1851,19 @@
     // Set profile
     Int lsIdx = vps->olsIdxToLsIdx( m_targetOlsIdx );
-    Int lIdx = -1; 
+    Int lIdx = -1;
     for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ) ; j++ )
     {
       if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() )
-      {        
-        lIdx = j;         
-        break; 
-      }        
-    }
-    m_isInOwnTargetDecLayerIdList = (lIdx != -1); 
+      {
+        lIdx = j;
+        break;
+      }
+    }
+    m_isInOwnTargetDecLayerIdList = (lIdx != -1);
 
     if ( m_isInOwnTargetDecLayerIdList )
     {
       Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOlsIdx, lIdx ) )->getGeneralPTL()->getProfileIdc();
-      assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 
+      assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 );
 
       if (  profileIdc == 6 )
@@ -1881,41 +1896,41 @@
 
   //  Output of this process is PicOrderCntVal, the picture order count of the current picture.
-  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 
+  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and
   //  motion vector prediction, and for decoder conformance checking (see clause C.5).
   //  Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal.
 
-  const TComSlice* curSlice = m_pcPic->getSlice(0); 
-
-  Int prevPicOrderCntLsb = MIN_INT; 
-  Int prevPicOrderCntMsb = MIN_INT;  
-  if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() )  )  
-  {
-    //  When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1, 
+  const TComSlice* curSlice = m_pcPic->getSlice(0);
+
+  Int prevPicOrderCntLsb = MIN_INT;
+  Int prevPicOrderCntMsb = MIN_INT;
+  if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() )  )
+  {
+    //  When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1,
     //  the variables prevPicOrderCntLsb and prevPicOrderCntMsb are derived as follows:
 
-    //  -  Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, 
+    //  -  Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture,
     //     a RADL picture or an SLNR picture.
 
     //  -  The variable prevPicOrderCntLsb is set equal to slice_pic_order_cnt_lsb of prevTid0Pic.
-    prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb; 
+    prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb;
 
     //  -  The variable prevPicOrderCntMsb is set equal to PicOrderCntMsb of prevTid0Pic.
-    prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb; 
-  }
-
-  //  The variable PicOrderCntMsb of the current picture is derived as follows:  
-  
+    prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb;
+  }
+
+  //  The variable PicOrderCntMsb of the current picture is derived as follows:
+
   Int slicePicOrderCntLsb = curSlice->getSlicePicOrderCntLsb();
 
-  Int picOrderCntMsb; 
+  Int picOrderCntMsb;
 
   if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag()  )
   {
     //-  If the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, PicOrderCntMsb is set equal to 0.
-    picOrderCntMsb = 0; 
+    picOrderCntMsb = 0;
   }
   else
   {
-    Int maxPicOrderCntLsb   = curSlice->getSPS()->getMaxPicOrderCntLsb(); 
+    Int maxPicOrderCntLsb   = curSlice->getSPS()->getMaxPicOrderCntLsb();
 
   //  -  Otherwise, PicOrderCntMsb is derived as follows:
@@ -1933,15 +1948,15 @@
     else
     {
-      picOrderCntMsb = prevPicOrderCntMsb; 
-    }
-  }
-  
+      picOrderCntMsb = prevPicOrderCntMsb;
+    }
+  }
+
   //PicOrderCntVal is derived as follows:
   Int picOrderCntVal = picOrderCntMsb + slicePicOrderCntLsb; //   (8 2)
 
-  //  NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR 
+  //  NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR
   //  pictures and prevPicOrderCntLsb and prevPicOrderCntMsb are both set equal to 0.
 
-  m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 
+  m_pcPic->getSlice(0)->setPOC( picOrderCntVal );
 
   // Update prevTid0Pic
@@ -1949,6 +1964,6 @@
   if( curSlice->getTemporalId() == 0  && !m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() )
   {
-    m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb;     
-    m_prevTid0PicPicOrderCntMsb      = picOrderCntMsb;  
+    m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb;
+    m_prevTid0PicPicOrderCntMsb      = picOrderCntMsb;
   }
 }
@@ -1957,42 +1972,42 @@
 {
   //Output of this process is PicOrderCntVal, the picture order count of the current picture.
-  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 
+  //  Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and
   //  motion vector prediction and for decoder conformance checking (see clause F.13.5).
 
   //  Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal.
 
-  const TComSlice* slice = m_pcPic->getSlice(0); 
-  const Int nuhLayerId   = m_pcPic->getLayerId(); 
-  const TComVPS*   vps   = slice->getVPS(); 
-  const TComSPS*   sps   = slice->getSPS(); 
+  const TComSlice* slice = m_pcPic->getSlice(0);
+  const Int nuhLayerId   = m_pcPic->getLayerId();
+  const TComVPS*   vps   = slice->getVPS();
+  const TComSPS*   sps   = slice->getSPS();
   if ( m_pcPic->getIsFstPicOfAllLayOfPocResetPer() )
   {
-    //  When the current picture is the first picture among all layers of a POC resetting period, 
+    //  When the current picture is the first picture among all layers of a POC resetting period,
     //  the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive.
     for (Int i = 0; i <= 62; i++)
     {
-      m_pocDecrementedInDpbFlag[ i ] = 0; 
+      m_pocDecrementedInDpbFlag[ i ] = 0;
     }
   }
 
   //  The variable pocResettingFlag is derived as follows:
-  Bool pocResettingFlag; 
+  Bool pocResettingFlag;
   if (m_pcPic->getIsPocResettingPic() )
   {
-    //-  If the current picture is a POC resetting picture, the following applies:    
+    //-  If the current picture is a POC resetting picture, the following applies:
     if( vps->getVpsPocLsbAlignedFlag()  )
     {
       //  -  If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1.
-      pocResettingFlag = true; 
+      pocResettingFlag = true;
     }
     else if ( m_pocDecrementedInDpbFlag[ nuhLayerId ] )
     {
       //  -  Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0.
-      pocResettingFlag = false; 
+      pocResettingFlag = false;
     }
     else
     {
       //  -  Otherwise, pocResettingFlag is set equal to 1.
-      pocResettingFlag = true; 
+      pocResettingFlag = true;
     }
   }
@@ -2000,21 +2015,21 @@
   {
     //  -  Otherwise, pocResettingFlag is set equal to 0.
-    pocResettingFlag = false; 
+    pocResettingFlag = false;
   }
 
   //  The list affectedLayerList is derived as follows:
-  std::vector<Int> affectedLayerList; 
+  std::vector<Int> affectedLayerList;
   if (! vps->getVpsPocLsbAlignedFlag() )
   {
     //-  If vps_poc_lsb_aligned_flag is equal to 0, affectedLayerList consists of the nuh_layer_id of the current picture.
-    affectedLayerList.push_back( nuhLayerId ); 
+    affectedLayerList.push_back( nuhLayerId );
   }
   else
   {
-    //  -  Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values 
-    //     equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1, 
+    //  -  Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values
+    //     equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1,
     //     inclusive, where currNuhLayerId is the nuh_layer_id value of the current picture.
-    affectedLayerList.push_back( nuhLayerId ); 
-    Int currNuhLayerId = nuhLayerId; 
+    affectedLayerList.push_back( nuhLayerId );
+    Int currNuhLayerId = nuhLayerId;
     for (Int j = 0; j <= vps->getNumPredictedLayers( currNuhLayerId )-1; j++ )
     {
@@ -2022,7 +2037,7 @@
     }
   }
-  
-  Int picOrderCntMsb; 
-  Int picOrderCntVal; 
+
+  Int picOrderCntMsb;
+  Int picOrderCntVal;
 
   //  Depending on pocResettingFlag, the following applies:
@@ -2033,20 +2048,20 @@
     {
       //-  The variables pocMsbDelta, pocLsbDelta and DeltaPocVal are derived as follows:
-      Int pocMsbDelta; 
-      Int pocLsbDelta; 
-      Int deltaPocVal;       
-
-      {
-        Int pocLsbVal; 
-        Int prevPicOrderCntLsb; 
-        Int prevPicOrderCntMsb; 
+      Int pocMsbDelta;
+      Int pocLsbDelta;
+      Int deltaPocVal;
+
+      {
+        Int pocLsbVal;
+        Int prevPicOrderCntLsb;
+        Int prevPicOrderCntMsb;
 
         if( slice->getPocResetIdc() ==  3 )
         {
-          pocLsbVal = slice->getPocLsbVal(); 
-        }      
+          pocLsbVal = slice->getPocLsbVal();
+        }
         else
         {
-          pocLsbVal = slice->getSlicePicOrderCntLsb(); 
+          pocLsbVal = slice->getSlicePicOrderCntLsb();
         }
 
@@ -2054,25 +2069,25 @@
         {
           pocMsbDelta = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb();   // (F 60)
-        }      
-        else
-        {
-          prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 
-          prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 
-
-          pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 
-        }
-
-        if( slice->getPocResetIdc() == 2 ||  ( slice->getPocResetIdc() == 3  &&  slice->getFullPocResetFlag() ) )
-        {
-          pocLsbDelta = pocLsbVal; 
         }
         else
         {
-          pocLsbDelta = 0; 
+          prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );
+          prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;
+
+          pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );
         }
-        deltaPocVal = pocMsbDelta + pocLsbDelta; 
-      }
-
-      //-  The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0 
+
+        if( slice->getPocResetIdc() == 2 ||  ( slice->getPocResetIdc() == 3  &&  slice->getFullPocResetFlag() ) )
+        {
+          pocLsbDelta = pocLsbVal;
+        }
+        else
+        {
+          pocLsbDelta = 0;
+        }
+        deltaPocVal = pocMsbDelta + pocLsbDelta;
+      }
+
+      //-  The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0
       //   and that is equal to any value in affectedLayerList is decremented by DeltaPocVal.
       for (Int i = 0; i < (Int) affectedLayerList.size(); i++ )
@@ -2080,5 +2095,5 @@
         if ( !m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] )
         {
-          m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal ); 
+          m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal );
         }
       }
@@ -2087,21 +2102,21 @@
       for (Int i = 0; i < (Int) affectedLayerList.size(); i++ )
       {
-        m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true; 
-      }
-    } 
+        m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true;
+      }
+    }
 
     //-  The PicOrderCntVal of the current picture is derived as follows:
     if( slice->getPocResetIdc()  ==  1 )
     {
-      picOrderCntVal = slice->getSlicePicOrderCntLsb(); 
-    }
-    else if (slice->getPocResetIdc()  ==  2 ) 
-    {
-      picOrderCntVal = 0; 
+      picOrderCntVal = slice->getSlicePicOrderCntLsb();
+    }
+    else if (slice->getPocResetIdc()  ==  2 )
+    {
+      picOrderCntVal = 0;
     }
     else
     {
-       picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 
-       picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
+       picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() );
+       picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
     }
   }
@@ -2110,8 +2125,8 @@
     //-  Otherwise (pocResettingFlag is equal to 0), the following applies:
     //-  The PicOrderCntVal of the current picture is derived as follows:
-    
+
     if( slice->getPocMsbCycleValPresentFlag() )
     {
-      picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 
+      picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb();
     }
     else if( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]  ||
@@ -2119,29 +2134,29 @@
     {
       picOrderCntMsb = 0; //     (F 62)
-    }    
+    }
     else
     {
         Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );
-        Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 
-        picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 
-    }
-    picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 
-  }
-  
-  m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 
-  
+        Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;
+        picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );
+    }
+    picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb();
+  }
+
+  m_pcPic->getSlice(0)->setPOC( picOrderCntVal );
+
   for (Int lId = 0; lId < (Int) affectedLayerList.size(); lId++ )
-  {  
+  {
     //  The value of PrevPicOrderCnt[ lId ] for each of the lId values included in affectedLayerList is derived as follows:
 
     if (!m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() && slice->getTemporalId() == 0 && !slice->getDiscardableFlag() )
     {
-      //-  If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture 
+      //-  If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture
       //   has TemporalId equal to 0 and discardable_flag equal to 0, PrevPicOrderCnt[ lId ] is set equal to PicOrderCntVal.
-      m_prevPicOrderCnt = picOrderCntVal; 
+      m_prevPicOrderCnt = picOrderCntVal;
     }
     else if ( slice->getPocResetIdc() == 3 &&  (
-      ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) || 
-      ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() ) 
+      ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) ||
+      ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() )
       ) )
     {
@@ -2149,5 +2164,5 @@
       //     -  FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0.
       //     -  FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is a POC resetting picture.
-      m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() ); 
+      m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() );
     }
   }
@@ -2156,5 +2171,5 @@
 Int TDecTop::xGetCurrMsb( Int cl, Int pl, Int pm, Int ml )
 {
-  Int currMsb; 
+  Int currMsb;
   if ((pl - cl) >= (ml/ 2))
   {
@@ -2163,13 +2178,13 @@
   else if ( (cl - pl) > (ml / 2))
   {
-    currMsb = pm - ml; 
+    currMsb = pm - ml;
   }
   else
   {
-    currMsb = pm; 
-  }
-
-  return currMsb;  
-}   
+    currMsb = pm;
+  }
+
+  return currMsb;
+}
 
 
@@ -2181,30 +2196,30 @@
   ///////////////////////////////////////////////////////////////////////////////////////
 
-  TComSlice* slice = m_pcPic->getSlice( 0 ); 
-  const TComSPS* sps = slice->getSPS(); 
-  //  This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior 
-  //  to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3. 
-  //  This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or 
+  TComSlice* slice = m_pcPic->getSlice( 0 );
+  const TComSPS* sps = slice->getSPS();
+  //  This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior
+  //  to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3.
+  //  This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or
   //  "used for long-term reference".
 
   // The variable currPicLayerId is set equal to nuh_layer_id of the current picture.
-  Int currPicLayerId = m_pcPic->getLayerId(); 
-  Int picOrderCntVal = m_pcPic->getPOC(); 
+  Int currPicLayerId = m_pcPic->getLayerId();
+  Int picOrderCntVal = m_pcPic->getPOC();
 
   if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag()  )
-  {     
-    // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 
-    // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the 
+  {
+    // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1,
+    // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the
     // DPB (if any) are marked as "unused for reference".
-    m_dpb->markSubDpbAsUnusedForReference( currPicLayerId ); 
-  }
-  // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by 
+    m_dpb->markSubDpbAsUnusedForReference( currPicLayerId );
+  }
+  // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by
   // their PicOrderCntVal values or their slice_pic_order_cnt_lsb values.
 
-  // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore, 
-  // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll, 
+  // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore,
+  // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll,
   // NumPocLtCurr and NumPocLtFoll number of elements, respectively. The five lists and the five variables are derived as follows:
-  
-  TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
+
+  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
 
   std::vector<Int>& pocStCurrBefore = decRps->m_pocStCurrBefore;
@@ -2214,16 +2229,16 @@
   std::vector<Int>& pocLtFoll       = decRps->m_pocLtFoll;
 
-  Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore; 
+  Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore;
   Int& numPocStCurrAfter  = decRps->m_numPocStCurrAfter;
   Int& numPocStFoll       = decRps->m_numPocStFoll;
   Int& numPocLtCurr       = decRps->m_numPocLtCurr;
-  Int& numPocLtFoll       = decRps->m_numPocLtFoll;   
-
-  std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag; 
+  Int& numPocLtFoll       = decRps->m_numPocLtFoll;
+
+  std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag;
 
   if (m_pcPic->isIdr() )
   {
-    // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll, 
-    //   PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore, 
+    // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll,
+    //   PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore,
     //   NumPocStCurrAfter, NumPocStFoll, NumPocLtCurr and NumPocLtFoll are all set equal to 0.
 
@@ -2233,9 +2248,9 @@
     pocLtCurr      .clear();
     pocLtFoll      .clear();
-    numPocStCurrBefore = 0; 
-    numPocStCurrAfter  = 0; 
-    numPocStFoll       = 0; 
-    numPocLtCurr       = 0; 
-    numPocLtFoll       = 0; 
+    numPocStCurrBefore = 0;
+    numPocStCurrAfter  = 0;
+    numPocStFoll       = 0;
+    numPocLtCurr       = 0;
+    numPocLtFoll       = 0;
   }
   else
@@ -2244,6 +2259,6 @@
     // -  Otherwise, the following applies:
 
-    Int j = 0; 
-    Int k = 0; 
+    Int j = 0;
+    Int k = 0;
     for( Int i = 0; i < stRps->getNumNegativePicsVar() ; i++ )
     {
@@ -2257,12 +2272,12 @@
       }
     }
-    numPocStCurrBefore = j;    
-
-    j = 0; 
+    numPocStCurrBefore = j;
+
+    j = 0;
     for (Int i = 0; i < stRps->getNumPositivePicsVar(); i++ )
     {
       if (stRps->getUsedByCurrPicS1Var( i ) )
       {
-        pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++; 
+        pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++;
       }
       else
@@ -2275,9 +2290,9 @@
 
 
-    j = 0; 
-    k = 0; 
+    j = 0;
+    k = 0;
     for( Int i = 0; i < slice->getNumLongTermSps( ) + slice->getNumLongTermPics(); i++ )
     {
-      Int pocLt = slice->getPocLsbLtVar( i ); 
+      Int pocLt = slice->getPocLsbLtVar( i );
       if( slice->getDeltaPocMsbPresentFlag( i ) )
       {
@@ -2286,13 +2301,13 @@
       }
 
-      if( slice->getUsedByCurrPicLtVar(i)) 
+      if( slice->getUsedByCurrPicLtVar(i))
       {
         pocLtCurr.push_back( pocLt );
-        currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++; 
-      } 
+        currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++;
+      }
       else
       {
         pocLtFoll.push_back( pocLt );
-        follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++; 
+        follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++;
       }
     }
@@ -2303,23 +2318,23 @@
   assert(numPocStCurrAfter  == pocStCurrAfter   .size() );
   assert(numPocStCurrBefore == pocStCurrBefore  .size() );
-  assert(numPocStFoll       == pocStFoll        .size() );  
-  assert(numPocLtCurr       == pocLtCurr        .size() );  
+  assert(numPocStFoll       == pocStFoll        .size() );
+  assert(numPocLtCurr       == pocLtCurr        .size() );
   assert(numPocLtFoll       == pocLtFoll        .size() );
 
   // where PicOrderCntVal is the picture order count of the current picture as specified in clause 8.3.1.
 
-  //   NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive, 
-  //   indicates that a candidate short-term RPS from the active SPS for the current layer is being used, 
-  //   where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled 
-  //   in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that 
+  //   NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive,
+  //   indicates that a candidate short-term RPS from the active SPS for the current layer is being used,
+  //   where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled
+  //   in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that
   //   the short-term RPS of the current picture is directly signalled in the slice header.
 
   for (Int i = 0; i <= numPocLtCurr - 1; i++  )
   {
-      // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1, 
+      // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1,
       // it is a requirement of bitstream conformance that the following conditions apply:
     if ( currDeltaPocMsbPresentFlag[i] )
     {
-      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive,
       //    for which PocLtCurr[ i ] is equal to PocStCurrBefore[ j ].
       for (Int j = 0; j <= numPocStCurrBefore - 1; j++ )
@@ -2328,6 +2343,6 @@
       }
 
-      // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 
-      //    for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ]. 
+      // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive,
+      //    for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ].
       for (Int j = 0; j <= numPocStCurrAfter - 1; j++ )
       {
@@ -2335,5 +2350,5 @@
       }
 
-      // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive,
       //    for which PocLtCurr[ i ] is equal to PocStFoll[ j ].
       for (Int j = 0; j <= numPocStFoll - 1; j++ )
@@ -2342,10 +2357,10 @@
       }
 
-      // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive,
       //    where j is not equal to i, for which PocLtCurr[ i ] is equal to PocLtCurr[ j ].
       for (Int j = 0; j <= numPocLtCurr - 1; j++ )
       {
         if ( i != j )
-        {        
+        {
           assert(!( pocLtCurr[ i ] == pocLtCurr[ j ] ) );
         }
@@ -2356,9 +2371,9 @@
   for (Int i = 0; i <= numPocLtFoll - 1; i++  )
   {
-    // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1, 
+    // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1,
     // it is a requirement of bitstream conformance that the following conditions apply:
     if ( follDeltaPocMsbPresentFlag[i] )
     {
-      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive,
       //    for which PocLtFoll[ i ] is equal to PocStCurrBefore[ j ].
       for (Int j = 0; j <= numPocStCurrBefore - 1; j++ )
@@ -2367,5 +2382,5 @@
       }
 
-      // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive,
       //    for which PocLtFoll[ i ] is equal to PocStCurrAfter[ j ].
       for (Int j = 0; j <= numPocStCurrAfter - 1; j++ )
@@ -2374,5 +2389,5 @@
       }
 
-      // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive,
       //    for which PocLtFoll[ i ] is equal to PocStFoll[ j ].
       for (Int j = 0; j <= numPocStFoll - 1; j++ )
@@ -2381,5 +2396,5 @@
       }
 
-      // -  There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive,
       //    where j is not equal to i, for which PocLtFoll[ i ] is equal to PocLtFoll[ j ].
       for (Int j = 0; j <= numPocLtFoll - 1; j++ )
@@ -2391,5 +2406,5 @@
       }
 
-      // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive,
       //    for which PocLtFoll[ i ] is equal to PocLtCurr[ j ].
       for (Int j = 0; j <= numPocLtCurr - 1; j++ )
@@ -2400,12 +2415,12 @@
   }
 
-  Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb(); 
+  Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb();
   for (Int i = 0; i <= numPocLtCurr - 1; i++  )
   {
-    // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0, 
+    // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0,
     // it is a requirement of bitstream conformance that the following conditions apply:
     if ( currDeltaPocMsbPresentFlag[ i ] == 0  )
     {
-      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 
+      // -  There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive,
       //    for which PocLtCurr[ i ] is equal to ( PocStCurrBefore[ j ] & ( MaxPicOrderCntLsb - 1 ) ).
       for (Int j = 0; j <= numPocStCurrBefore - 1; j++ )
@@ -2442,5 +2457,5 @@
   for (Int i = 0; i <= numPocLtFoll - 1; i++  )
   {
-    // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0, 
+    // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0,
     // it is a requirement of bitstream conformance that the following conditions apply:
     if ( follDeltaPocMsbPresentFlag[ i ] == 0  )
@@ -2474,5 +2489,5 @@
         {
           assert(!( pocLtFoll[ i ] == ( pocLtFoll[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) );
-        }          
+        }
       }
 
@@ -2487,6 +2502,6 @@
 
   if ( !annexFModifications )
-  {  
-    // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2. 
+  {
+    // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2.
 
     // It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr:
@@ -2494,19 +2509,19 @@
     {
       // -  If the current picture is a BLA or CRA picture, the value of NumPicTotalCurr shall be equal to 0.
-      assert( slice->getNumPicTotalCurr() == 0 ); 
+      assert( slice->getNumPicTotalCurr() == 0 );
     }
     else
     {
-      // -  Otherwise, 
+      // -  Otherwise,
       if ( slice->isInterP() || slice->isInterB() )
       {
         // when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0.
-        assert( slice->getNumPicTotalCurr() != 0 ); 
-      }
-    }
-  }
-    
-  // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll, 
-  // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively 
+        assert( slice->getNumPicTotalCurr() != 0 );
+      }
+    }
+  }
+
+  // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll,
+  // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively
   // referred to as the short-term RPS. RefPicSetLtCurr and RefPicSetLtFoll are collectively referred to as the long-term RPS.
 
@@ -2516,11 +2531,11 @@
   std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr      ;
   std::vector<TComPic*>& refPicSetLtFoll       = decRps->m_refPicSetLtFoll      ;
-  
+
   std::vector<TComPic*>** refPicSetsCurr       = decRps->m_refPicSetsCurr       ;
   std::vector<TComPic*>** refPicSetsLt         = decRps->m_refPicSetsLt         ;
   std::vector<TComPic*>** refPicSetsAll        = decRps->m_refPicSetsAll        ;
-  //   NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be 
+  //   NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be
   //   used for inter prediction of the current picture and one or more pictures that follow the current picture in decoding order.
-  //   RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current 
+  //   RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current
   //   picture but may be used in inter prediction for one or more pictures that follow the current picture in decoding order.
 
@@ -2528,16 +2543,16 @@
   // 1.  The following applies:
 
-  TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false );   
+  TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false );
   assert( refPicSetLtCurr.empty() );
-  for( Int i = 0; i < numPocLtCurr; i++ ) 
-  {
-    if( !currDeltaPocMsbPresentFlag[ i ] ) 
-    {    
-      refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) );       
+  for( Int i = 0; i < numPocLtCurr; i++ )
+  {
+    if( !currDeltaPocMsbPresentFlag[ i ] )
+    {
+      refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) );
     }
     else
     {
-      refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] ));       
-    }    
+      refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] ));
+    }
   }
 
@@ -2551,9 +2566,9 @@
    else
    {
-     refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] ));       
+     refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] ));
    }
   }
-  
-  // 2.  All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal 
+
+  // 2.  All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal
   //     to currPicLayerId are marked as "used for long-term reference".
   for (Int i = 0; i < numPocLtCurr; i++)
@@ -2561,6 +2576,6 @@
     if ( refPicSetLtCurr[i] != NULL )
     {
-      refPicSetLtCurr[i]->markAsUsedForLongTermReference(); 
-    }    
+      refPicSetLtCurr[i]->markAsUsedForLongTermReference();
+    }
   }
 
@@ -2569,6 +2584,6 @@
     if ( refPicSetLtFoll[i] != NULL )
     {
-      refPicSetLtFoll[i]->markAsUsedForLongTermReference(); 
-    }    
+      refPicSetLtFoll[i]->markAsUsedForLongTermReference();
+    }
   }
 
@@ -2577,5 +2592,5 @@
   for( Int i = 0; i < numPocStCurrBefore; i++ )
   {
-    refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] )); 
+    refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] ));
   }
 
@@ -2583,5 +2598,5 @@
   for( Int i = 0; i < numPocStCurrAfter; i++ )
   {
-    refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] )); 
+    refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] ));
   }
 
@@ -2589,24 +2604,24 @@
   for( Int i = 0; i < numPocStFoll; i++ )
   {
-    refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] )); 
-  }
-  
-  // 4.  All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore, 
+    refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] ));
+  }
+
+  // 4.  All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore,
   //     RefPicSetStCurrAfter, or RefPicSetStFoll and have nuh_layer_id equal to currPicLayerId are marked as "unused for reference".
-  TComSubDpb picsToMark = (*dpb); 
+  TComSubDpb picsToMark = (*dpb);
   for (Int j = 0; j < 5; j++ )
   {
-    picsToMark.removePics( *refPicSetsAll[j] ); 
-  }  
-  picsToMark.markAllAsUnusedForReference(); 
-  
-  //     NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because 
-  //     the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal 
-  //     to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in 
+    picsToMark.removePics( *refPicSetsAll[j] );
+  }
+  picsToMark.markAllAsUnusedForReference();
+
+  //     NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because
+  //     the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal
+  //     to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in
   //     RefPicSetStCurrBefore, RefPicSetStCurrAfter, or RefPicSetLtCurr that is equal to "no reference picture".
 
   //     NOTE 5 - A picture cannot be included in more than one of the five RPS lists.
 
-  
+
   // It is a requirement of bitstream conformance that the RPS is restricted as follows:
 
@@ -2614,59 +2629,59 @@
 #if NH_MV_FIX_NO_REF_PICS_CHECK
   if ( !annexFModifications || m_firstPicInLayerDecodedFlag[ m_pcPic->getLayerId() ] )
-  { 
+  {
 #endif
     for (Int j = 0; j < 3; j++ )
     {
-      // -  There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr 
+      // -  There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr
       //    for which one or more of the following are true:
 
-      std::vector<TComPic*>* currSet = refPicSetsCurr[j]; 
+      std::vector<TComPic*>* currSet = refPicSetsCurr[j];
       for (Int i = 0; i < currSet->size(); i++)
       {
-        TComPic* pic = (*currSet)[i]; 
+        TComPic* pic = (*currSet)[i];
 
         // -  The entry is equal to "no reference picture".
-        assert( ! (pic == NULL ) ); 
+        assert( ! (pic == NULL ) );
 
         // -  The entry is an SLNR picture and has TemporalId equal to that of the current picture.
-        assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 
+        assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) );
 
         // -  The entry is a picture that has TemporalId greater than that of the current picture.
-        assert( !(  pic->getTemporalId() > m_pcPic->getTemporalId() ) ); 
-      }      
+        assert( !(  pic->getTemporalId() > m_pcPic->getTemporalId() ) );
+      }
     }
 #if NH_MV_FIX_NO_REF_PICS_CHECK
   }
 #endif
-  
-  //  -  There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the 
-  //     difference between the picture order count value of the current picture and the picture order count 
+
+  //  -  There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the
+  //     difference between the picture order count value of the current picture and the picture order count
   //     value of the entry is greater than or equal to 2^24.
   for (Int j = 0; j < 2; j++ )
-  {    
-    std::vector<TComPic*>* ltSet = refPicSetsLt[j]; 
+  {
+    std::vector<TComPic*>* ltSet = refPicSetsLt[j];
     for (Int i = 0; i < ltSet->size(); i++)
     {
-      TComPic* pic = (*ltSet)[i]; 
+      TComPic* pic = (*ltSet)[i];
       if( pic != NULL )
       {
-        assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) )); 
-      }
-    }
-  }
-
-  //   -  When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture 
+        assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) ));
+      }
+    }
+  }
+
+  //   -  When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture
   //      included in the RPS with TemporalId greater than or equal to the TemporalId of the current picture.
   if (m_pcPic->isTsa() )
   {
     for (Int j = 0; j < 5; j++ )
-    {    
-      std::vector<TComPic*>* aSet = refPicSetsAll[j]; 
+    {
+      std::vector<TComPic*>* aSet = refPicSetsAll[j];
       for (Int i = 0; i < aSet->size(); i++)
       {
-        TComPic* pic = (*aSet)[i]; 
+        TComPic* pic = (*aSet)[i];
         if( pic != NULL )
         {
-          assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) ); 
+          assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) );
         }
       }
@@ -2674,5 +2689,5 @@
   }
 
-  //   -  When the current picture is a step-wise temporal sub-layer access (STSA) picture, 
+  //   -  When the current picture is a step-wise temporal sub-layer access (STSA) picture,
   //      there shall be no picture included in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr that has
   //      TemporalId equal to that of the current picture.
@@ -2680,12 +2695,12 @@
   {
     for (Int j = 0; j < 3; j++ )
-    {    
-      std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
+    {
+      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
       for (Int i = 0; i < cSet->size(); i++)
       {
-        TComPic* pic = (*cSet)[i]; 
+        TComPic* pic = (*cSet)[i];
         if( pic != NULL )
         {
-          assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 
+          assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) );
         }
       }
@@ -2700,17 +2715,17 @@
   {
     for (Int j = 0; j < 3; j++ )
-    {    
-      std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
+    {
+      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
       for (Int i = 0; i < cSet->size(); i++)
       {
-        TComPic* pic = (*cSet)[i]; 
+        TComPic* pic = (*cSet)[i];
         if( pic != NULL )
         {
-          assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder  ) ); 
+          assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder  ) );
         }
       }
     }
   }
-  
+
   //   -  When the current picture is a CRA picture, there shall be no picture included in the RPS that
   //      precedes, in output order or decoding order, any preceding IRAP picture in decoding order (when present).
@@ -2718,19 +2733,19 @@
   {
     for (Int j = 0; j < 5; j++ )
-    {    
-      std::vector<TComPic*>* aSet = refPicSetsAll[j]; 
+    {
+      std::vector<TComPic*>* aSet = refPicSetsAll[j];
       for (Int i = 0; i < aSet->size(); i++)
       {
         // TBD check whether it sufficient to test only the last IRAP
-        TComPic* pic = (*aSet)[i]; 
+        TComPic* pic = (*aSet)[i];
         if( pic != NULL )
-        {        
-          assert( ! (pic->getPOC()           < m_prevIrapPoc           ) );           
-          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 
+        {
+          assert( ! (pic->getPOC()           < m_prevIrapPoc           ) );
+          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) );
         }
       }
     }
   }
-  
+
   Bool isTrailingPicture = ( !m_pcPic->isIrap() ) && ( m_pcPic->getPOC() > m_prevIrapPoc );
   //   -  When the current picture is a trailing picture, there shall be no picture in RefPicSetStCurrBefore,
@@ -2740,12 +2755,12 @@
   {
     for (Int j = 0; j < 3; j++ )
-    {    
-      std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
+    {
+      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
       for (Int i = 0; i < cSet->size(); i++)
       {
-        TComPic* pic = (*cSet)[i]; 
+        TComPic* pic = (*cSet)[i];
         if( pic != NULL )
         {
-          assert( ! (pic->getIsGeneratedCl833() ) ); 
+          assert( ! (pic->getIsGeneratedCl833() ) );
         }
       }
@@ -2758,14 +2773,14 @@
   {
     for (Int j = 0; j < 5; j++ )
-    {    
-      std::vector<TComPic*>* aSet = refPicSetsAll[j]; 
+    {
+      std::vector<TComPic*>* aSet = refPicSetsAll[j];
       for (Int i = 0; i < aSet->size(); i++)
       {
         // TBD check whether it sufficient to test only the last IRAP
-         TComPic* pic = (*aSet)[i]; 
+         TComPic* pic = (*aSet)[i];
         if( pic != NULL )
-        {         
-          assert( ! (pic->getPOC()           < m_prevIrapPoc           ) ); 
-          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 
+        {
+          assert( ! (pic->getPOC()           < m_prevIrapPoc           ) );
+          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) );
         }
       }
@@ -2778,42 +2793,42 @@
   {
     for (Int j = 0; j < 3; j++ )
-    {    
-      std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
+    {
+      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
       for (Int i = 0; i < cSet->size(); i++)
-      {        
-        TComPic* pic = (*cSet)[i]; 
+      {
+        TComPic* pic = (*cSet)[i];
         if( pic != NULL )
-        {        
+        {
           // -  A RASL picture
-          assert( ! (pic->isRasl() ) ); 
-          // -  A picture that was generated by the decoding process for generating unavailable reference pictures 
+          assert( ! (pic->isRasl() ) );
+          // -  A picture that was generated by the decoding process for generating unavailable reference pictures
           //    as specified in clause 8.3.3
-          assert( ! (pic->getIsGeneratedCl833() ) ); 
+          assert( ! (pic->getIsGeneratedCl833() ) );
           // -  A picture that precedes the associated IRAP picture in decoding order
-          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 
+          assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) );
         }
       }
     }
   }
-  
-  
+
+
   if ( sps->getTemporalIdNestingFlag() )
   {
     // -  When sps_temporal_id_nesting_flag is equal to 1, the following applies:
     //    -  Let tIdA be the value of TemporalId of the current picture picA.
-    TComPic* picA = m_pcPic; 
+    TComPic* picA = m_pcPic;
     Int      tIdA = picA->getTemporalId();
-    //   -  Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in 
-    //      RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that 
+    //   -  Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in
+    //      RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that
     //      has TemporalId less than tIdB, follows picB in decoding order, and precedes picA in decoding order.
     for (Int j = 0; j < 3; j++ )
-    {    
-      std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
+    {
+      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
       for (Int i = 0; i < cSet->size(); i++)
       {
-        TComPic* picB = (*cSet)[i]; 
+        TComPic* picB = (*cSet)[i];
         if( picB != NULL )
         {
-          Int tIdB = picB->getTemporalId(); 
+          Int tIdB = picB->getTemporalId();
 
           if (tIdB <= tIdA)
@@ -2821,6 +2836,6 @@
             for ( TComSubDpb::iterator itP = dpb->begin(); itP != dpb->end(); itP++ )
             {
-              TComPic* picC = (*itP); 
-              assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder()  )  ); 
+              TComPic* picC = (*itP);
+              assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder()  )  );
             }
           }
@@ -2828,5 +2843,5 @@
       }
     }
-  }    
+  }
 }
 
@@ -2839,14 +2854,14 @@
 
   // The specifications in clause 8.3.2 apply with the following changes:
-  // -  The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to 
+  // -  The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to
   //    clauses F.7.4.7.2, F.8.3.1, F.8.3.3 and F.8.3.4, respectively.
 
-  x832DecProcForRefPicSet( true ); 
+  x832DecProcForRefPicSet( true );
 
   // -  The following specifications are added:
   if (m_pcPic->isIrap() && m_pcPic->getLayerId() == m_smallestLayerId )
   {
-    // -  When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId, 
-    //    all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked 
+    // -  When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId,
+    //    all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked
     //    as "unused for reference" when at least one of the following conditions is true:
 
@@ -2860,5 +2875,5 @@
 
   // -  It is a requirement of bitstream conformance that the RPS is restricted as follows:
-  // -  When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter 
+  // -  When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter
   //    or RefPicSetLtCurr.
 
@@ -2867,8 +2882,8 @@
   if ( m_pcPic->isCra() )
   {
-    for (Int j = 0; j < 3; j++ )   
-    {    
-      std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
-      assert ( cSet->size() == 0 ); 
+    for (Int j = 0; j < 3; j++ )
+    {
+      std::vector<TComPic*>* cSet = refPicSetsCurr[j];
+      assert ( cSet->size() == 0 );
     }
   }
@@ -2876,12 +2891,12 @@
   // -  The constraints specified in clause 8.3.2 on the value of NumPicTotalCurr are replaced with the following:
   //    -  It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr:
-  Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr(); 
-  Int currPicLayerId  = m_pcPic->getLayerId(); 
-  const TComVPS* vps  = m_pcPic->getSlice(0)->getVPS(); 
+  Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr();
+  Int currPicLayerId  = m_pcPic->getLayerId();
+  const TComVPS* vps  = m_pcPic->getSlice(0)->getVPS();
 
   if ( ( m_pcPic->isBla() || m_pcPic->isCra() ) && (  (currPicLayerId == 0 ) || ( vps->getNumDirectRefLayers( currPicLayerId ) == 0 ) ) )
-  {   
-    assert( numPicTotalCurr == 0 ); 
-    // -  If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or 
+  {
+    assert( numPicTotalCurr == 0 );
+    // -  If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or
     //     NumDirectRefLayers[ currPicLayerId ] is equal to 0, the value of NumPicTotalCurr shall be equal to 0.
   }
@@ -2892,5 +2907,5 @@
     {
       // -  Otherwise, when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0.
-      assert( numPicTotalCurr != 0 ); 
+      assert( numPicTotalCurr != 0 );
     }
   }
@@ -2904,10 +2919,10 @@
   ////////////////////////////////////////////////////////////////////
 
-  // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1 
+  // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1
   // and the variables NumActiveRefLayerPics0 and NumActiveRefLayerPics1.
 
-  TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
-  TComSlice* slice       = m_pcPic->getSlice( 0 ); 
-  const TComVPS* vps     =  slice->getVPS(); 
+  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
+  TComSlice* slice       = m_pcPic->getSlice( 0 );
+  const TComVPS* vps     =  slice->getVPS();
 
   Int&                   numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0;
@@ -2915,24 +2930,24 @@
 
   std::vector<TComPic*>& refPicSetInterLayer0   = decRps->m_refPicSetInterLayer0;
-  std::vector<TComPic*>& refPicSetInterLayer1   = decRps->m_refPicSetInterLayer1; 
+  std::vector<TComPic*>& refPicSetInterLayer1   = decRps->m_refPicSetInterLayer1;
 
   // The variable currLayerId is set equal to nuh_layer_id of the current picture.
-  Int currLayerId = getLayerId(); 
-
-  // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1 
+  Int currLayerId = getLayerId();
+
+  // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1
   // are set equal to 0 and the following applies:
 
-  refPicSetInterLayer0.clear(); 
-  refPicSetInterLayer1.clear(); 
-
-  numActiveRefLayerPics0 = 0; 
-  numActiveRefLayerPics1 = 0; 
-
-  Int viewIdCurrLayerId  = vps->getViewId( currLayerId ); 
+  refPicSetInterLayer0.clear();
+  refPicSetInterLayer1.clear();
+
+  numActiveRefLayerPics0 = 0;
+  numActiveRefLayerPics1 = 0;
+
+  Int viewIdCurrLayerId  = vps->getViewId( currLayerId );
   Int viewId0            = vps->getViewId( 0   );
 
-  for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ )   
-  {
-    Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) ); 
+  for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ )
+  {
+    Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) );
 
     Bool refPicSet0Flag =
@@ -2944,5 +2959,5 @@
     {
       // there is a picture picX in the DPB that is in the same access unit as the current picture and has
-      // nuh_layer_id equal to RefPicLayerId[ i ] 
+      // nuh_layer_id equal to RefPicLayerId[ i ]
 
       if ( refPicSet0Flag )
@@ -2960,5 +2975,5 @@
       assert( ! picX->getSlice(0)->getDiscardableFlag() );
 
-      // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1 
+      // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1
       // that is a RASL picture.
       if ( m_pcPic->isRadl() )
@@ -2992,12 +3007,12 @@
   ///////////////////////////////////////////////////////////////////////////////////////
 
-  // This process is invoked once per coded picture when the current picture is a 
+  // This process is invoked once per coded picture when the current picture is a
   // BLA picture or is a CRA picture with NoRaslOutputFlag equal to 1.
 
   assert( m_pcPic->isBla() || (m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) );
-  TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
+  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
 
   std::vector<TComPic*>& refPicSetStFoll      = decRps->m_refPicSetStFoll;
-  std::vector<TComPic*>& refPicSetLtFoll      = decRps->m_refPicSetLtFoll; 
+  std::vector<TComPic*>& refPicSetLtFoll      = decRps->m_refPicSetLtFoll;
 
   const std::vector<Int>& pocStFoll             = decRps->m_pocStFoll;
@@ -3005,5 +3020,5 @@
 
   const Int               numPocStFoll          = decRps->m_numPocStFoll;
-  const Int               numPocLtFoll          = decRps->m_numPocLtFoll;   
+  const Int               numPocLtFoll          = decRps->m_numPocLtFoll;
 
   // When this process is invoked, the following applies:
@@ -3012,13 +3027,13 @@
     if ( refPicSetStFoll[ i ] == NULL )
     {
-      //-  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal 
+      //-  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal
       //   to "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies:
-      TComPic* genPic = x8332GenOfOneUnavailPic( true );  
+      TComPic* genPic = x8332GenOfOneUnavailPic( true );
 
       // -  The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ].
       genPic->getSlice(0)->setPOC( pocStFoll[ i ] );
 
-      //-  The value of PicOutputFlag for the generated picture is set equal to 0.  
-      genPic->setPicOutputFlag( false ); 
+      //-  The value of PicOutputFlag for the generated picture is set equal to 0.
+      genPic->setPicOutputFlag( false );
 
       // -  The generated picture is marked as "used for short-term reference".
@@ -3029,8 +3044,8 @@
 
       // -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture.
-      genPic->setLayerId( m_pcPic-> getLayerId() ); 
+      genPic->setLayerId( m_pcPic-> getLayerId() );
 
       // Insert to DPB
-      m_dpb->addNewPic( genPic ); 
+      m_dpb->addNewPic( genPic );
     }
   }
@@ -3040,7 +3055,7 @@
     if ( refPicSetLtFoll[ i ] == NULL )
     {
-      //-  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to 
+      //-  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to
       //   "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies:
-      TComPic* genPic = x8332GenOfOneUnavailPic( true );  
+      TComPic* genPic = x8332GenOfOneUnavailPic( true );
 
       //-  The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ].
@@ -3048,8 +3063,8 @@
 
       //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtFoll[ i ] & ( MaxPicOrderCntLsb - 1 ) ).
-      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) ); 
-
-      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.    
-      genPic->setPicOutputFlag( false ); 
+      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) );
+
+      //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
+      genPic->setPicOutputFlag( false );
 
       //  -  The generated picture is marked as "used for long-term reference".
@@ -3060,8 +3075,8 @@
 
       //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture.
-      genPic->setLayerId( m_pcPic-> getLayerId() ); 
+      genPic->setLayerId( m_pcPic-> getLayerId() );
 
       // Insert to DPB
-      m_dpb->addNewPic( genPic ); 
+      m_dpb->addNewPic( genPic );
     }
   }
@@ -3075,8 +3090,8 @@
   ///////////////////////////////////////////////////////////////////////////////////////
 
-  TComPic* genPic = new TComPic; 
-  genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true ); 
-  genPic->setIsGenerated( true );     
-  genPic->setIsGeneratedCl833( calledFromCl8331 ); 
+  TComPic* genPic = new TComPic;
+  genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true );
+  genPic->setIsGenerated( true );
+  genPic->setIsGeneratedCl833( calledFromCl8331 );
   return genPic;
 }
@@ -3086,19 +3101,19 @@
 {
   ///////////////////////////////////////////////////////////////////////////////////////
-  // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures 
+  // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures
   //         first in decoding order within a layer
   ///////////////////////////////////////////////////////////////////////////////////////
 
-  //  This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0.   
+  //  This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0.
   assert( !m_firstPicInLayerDecodedFlag[ getLayerId() ] );
 
 
-  TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
-
-  std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 
+  TComDecodedRps* decRps = m_pcPic->getDecodedRps();
+
+  std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore;
   std::vector<TComPic*>& refPicSetStCurrAfter  = decRps->m_refPicSetStCurrAfter;
   std::vector<TComPic*>& refPicSetStFoll       = decRps->m_refPicSetStFoll;
-  std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr; 
-  std::vector<TComPic*>& refPicSetLtFoll       = decRps->m_refPicSetLtFoll; 
+  std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr;
+  std::vector<TComPic*>& refPicSetLtFoll       = decRps->m_refPicSetLtFoll;
 
 
@@ -3109,18 +3124,18 @@
   const std::vector<Int>& pocLtFoll            = decRps->m_pocLtFoll;
 
-  const Int numPocStCurrBefore                 = decRps->m_numPocStCurrBefore; 
+  const Int numPocStCurrBefore                 = decRps->m_numPocStCurrBefore;
   const Int numPocStCurrAfter                  = decRps->m_numPocStCurrAfter;
   const Int numPocStFoll                       = decRps->m_numPocStFoll;
   const Int numPocLtCurr                       = decRps->m_numPocLtCurr;
-  const Int numPocLtFoll                       = decRps->m_numPocLtFoll;   
-
-  Int nuhLayerId = m_pcPic-> getLayerId(); 
+  const Int numPocLtFoll                       = decRps->m_numPocLtFoll;
+
+  Int nuhLayerId = m_pcPic-> getLayerId();
   for ( Int i = 0 ; i <= numPocStCurrBefore - 1; i++ )
   {
     if ( refPicSetStCurrBefore[ i ] == NULL )
     {
-      //-  For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is 
+      //-  For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is
       //  equal to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
-      TComPic* genPic = x8332GenOfOneUnavailPic( false );  
+      TComPic* genPic = x8332GenOfOneUnavailPic( false );
 
       //-  The value of PicOrderCntVal for the generated picture is set equal to PocStCurrBefore[ i ].
@@ -3128,5 +3143,5 @@
 
       //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
-      genPic->setPicOutputFlag( false ); 
+      genPic->setPicOutputFlag( false );
 
       //  -  The generated picture is marked as "used for short-term reference".
@@ -3137,8 +3152,8 @@
 
       //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
-      genPic->setLayerId( nuhLayerId ); 
+      genPic->setLayerId( nuhLayerId );
 
       // Insert to DPB
-      m_dpb->addNewPic( genPic ); 
+      m_dpb->addNewPic( genPic );
     }
   }
@@ -3148,7 +3163,7 @@
     if ( refPicSetStCurrAfter[ i ] == NULL )
     {
-      //  -  For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal 
+      //  -  For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal
       //     to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
-      TComPic* genPic = x8332GenOfOneUnavailPic( false );  
+      TComPic* genPic = x8332GenOfOneUnavailPic( false );
 
       //  -  The value of PicOrderCntVal for the generated picture is set equal to PocStCurrAfter[ i ].
@@ -3156,5 +3171,5 @@
 
       //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
-      genPic->setPicOutputFlag( false ); 
+      genPic->setPicOutputFlag( false );
 
       //  -  The generated picture is marked as "used for short-term reference".
@@ -3165,8 +3180,8 @@
 
       //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
-      genPic->setLayerId( nuhLayerId ); 
+      genPic->setLayerId( nuhLayerId );
 
       // Insert to DPB
-      m_dpb->addNewPic( genPic ); 
+      m_dpb->addNewPic( genPic );
 
     }
@@ -3177,7 +3192,7 @@
     if ( refPicSetStFoll[ i ] == NULL )
     {
-      //  -  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no 
+      //  -  For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no
       //     reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
-      TComPic* genPic = x8332GenOfOneUnavailPic( false );  
+      TComPic* genPic = x8332GenOfOneUnavailPic( false );
 
       //  -  The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ].
@@ -3185,5 +3200,5 @@
 
       //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
-      genPic->setPicOutputFlag( false ); 
+      genPic->setPicOutputFlag( false );
 
       //  -  The generated picture is marked as "used for short-term reference".
@@ -3194,29 +3209,29 @@
 
       //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
-      genPic->setLayerId( nuhLayerId ); 
+      genPic->setLayerId( nuhLayerId );
 
       // Insert to DPB
-      m_dpb->addNewPic( genPic ); 
-    }
-  }
-
-  Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb();  
+      m_dpb->addNewPic( genPic );
+    }
+  }
+
+  Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb();
   for ( Int i = 0 ; i <= numPocLtCurr - 1; i++ )
   {
     if ( refPicSetLtCurr[ i ] == NULL )
     {
-      //  -  For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no 
+      //  -  For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no
       //     reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
-      TComPic* genPic = x8332GenOfOneUnavailPic( false );  
+      TComPic* genPic = x8332GenOfOneUnavailPic( false );
 
       //  -  The value of PicOrderCntVal for the generated picture is set equal to PocLtCurr[ i ].
       genPic->getSlice(0)->setPOC( pocLtCurr[ i ] );
 
-      //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 
+      //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & (
       //     MaxPicOrderCntLsb - 1 ) ).
-      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 
+      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) );
 
       //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
-      genPic->setPicOutputFlag( false ); 
+      genPic->setPicOutputFlag( false );
 
       //  -  The generated picture is marked as "used for long-term reference".
@@ -3227,8 +3242,8 @@
 
       //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
-      genPic->setLayerId( nuhLayerId ); 
+      genPic->setLayerId( nuhLayerId );
 
       // Insert to DPB
-      m_dpb->addNewPic( genPic ); 
+      m_dpb->addNewPic( genPic );
     }
   }
@@ -3238,17 +3253,17 @@
     if ( refPicSetLtFoll[ i ] == NULL )
     {
-      //  -  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no 
+      //  -  For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no
       //     reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies:
-      TComPic* genPic = x8332GenOfOneUnavailPic( false );  
+      TComPic* genPic = x8332GenOfOneUnavailPic( false );
 
       //  -  The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ].
       genPic->getSlice(0)->setPOC( pocLtFoll[ i ] );
 
-      //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 
+      //  -  The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & (
       //     MaxPicOrderCntLsb - 1 ) ).
-      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 
+      genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) );
 
       //  -  The value of PicOutputFlag for the generated picture is set equal to 0.
-      genPic->setPicOutputFlag( false ); 
+      genPic->setPicOutputFlag( false );
 
       //  -  The generated picture is marked as "used for long-term reference".
@@ -3259,8 +3274,8 @@
 
       //  -  The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id.
-      genPic->setLayerId( nuhLayerId ); 
+      genPic->setLayerId( nuhLayerId );
 
       // Insert to DPB
-      m_dpb->addNewPic( genPic ); 
+      m_dpb->addNewPic( genPic );
     }
   }
@@ -3280,8 +3295,8 @@
   std::vector<TComPic*>** refPicSetsCurr       = m_pcPic->getDecodedRps()->m_refPicSetsCurr;
 
-  Bool hasGeneratedRefPic = false; 
-  for (Int j = 0; j < 3; j++ )   
-  {    
-    std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 
+  Bool hasGeneratedRefPic = false;
+  for (Int j = 0; j < 3; j++ )
+  {
+    std::vector<TComPic*>* cSet = refPicSetsCurr[j];
     for (Int i = 0 ; i < cSet->size();  i++ )
     {
@@ -3289,9 +3304,9 @@
       if ((*cSet)[i]->getIsGenerated() )
       {
-        hasGeneratedRefPic = true; 
-      }
-    }
-  }
-  m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic ); 
+        hasGeneratedRefPic = true;
+      }
+    }
+  }
+  m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic );
 }
 
Index: /trunk/source/Lib/TLibEncoder/SEIEncoder.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/SEIEncoder.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/SEIEncoder.cpp	(revision 1356)
@@ -465,4 +465,5 @@
 
 #if NH_MV
+#if !NH_MV_SEI
 Void SEIEncoder::initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps)
 {
@@ -476,5 +477,37 @@
   seiSubBitstreamProperty->m_maxBitRate              = m_pcCfg->getMaxBitRate();  
 }
+#else
+Void SEIEncoder::createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice )
+{
+  const SEIMessages* seiMessageCfg = m_pcCfg->getSeiMessages(); 
+
+  for( SEIMessages::const_iterator itS = seiMessageCfg->begin(); itS != seiMessageCfg->end(); itS++ )    
+  {      
+    const SEI* curSei = (*itS); 
+    SEI* newSei; 
+    if ( curSei->insertSei( slice->getLayerId(), slice->getPOC(), slice->getTemporalId(), slice->getNalUnitType() ) )
+    {
+      newSei = curSei->getCopy( ) ;
+
+      if ( curSei->m_modifyByEncoder )
+      {
+        newSei->setupFromSlice  ( slice ); 
+      } 
+
+      if ( newSei   ->checkCfg( slice ) )
+      {
+        std::cout << "--> Omit sending SEI."  <<  std::endl; 
+        delete newSei; 
+      }
+      else
+      {
+        seiMessage.push_back(newSei); 
+      }
+
+    }
+  }
+}
 #endif
+#endif
 
 //! \}
Index: /trunk/source/Lib/TLibEncoder/SEIEncoder.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/SEIEncoder.h	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/SEIEncoder.h	(revision 1356)
@@ -86,5 +86,9 @@
   Void initTemporalLevel0IndexSEI(SEITemporalLevel0Index *sei, TComSlice *slice);
 #if NH_MV
+#if !NH_MV_SEI
   Void initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps);
+#else
+  Void createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice );;
+#endif
 #endif
 private:
Index: /trunk/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1356)
@@ -122,8 +122,69 @@
     break;
 #if NH_MV
+#if !NH_MV_SEI
    case SEI::SUB_BITSTREAM_PROPERTY:
    xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
    break;
 #endif
+#endif
+#if NH_MV_SEI
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+   case SEI::LAYERS_NOT_PRESENT:
+       xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
+     break;
+#endif
+   case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:
+     xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei));
+     break;
+#if NH_MV_SEI_TBD
+   case SEI::BSP_NESTING:
+     xWriteSEIBspNesting(*static_cast<const SEIBspNesting*>(&sei));
+     break;
+   case SEI::BSP_INITIAL_ARRIVAL_TIME:
+     xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei));
+     break;
+#endif
+   case SEI::SUB_BITSTREAM_PROPERTY:
+     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
+     break;
+   case SEI::ALPHA_CHANNEL_INFO:
+     xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei));
+     break;
+   case SEI::OVERLAY_INFO:
+     xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei));
+     break;
+   case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:
+     xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei));
+     break;
+#if NH_MV_SEI_TBD
+   case SEI::FRAME_FIELD_INFO:
+     xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei));
+     break;
+#endif
+   case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:
+     xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei));
+     break;
+#if SEI_DRI_F0169
+   case SEI::DEPTH_REPRESENTATION_INFO:
+       xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei));
+       break;
+#endif
+   case SEI::MULTIVIEW_SCENE_INFO:
+     xWriteSEIMultiviewSceneInfo(*static_cast<const SEIMultiviewSceneInfo*>(&sei));
+     break;
+   case SEI::MULTIVIEW_ACQUISITION_INFO:
+     xWriteSEIMultiviewAcquisitionInfo(*static_cast<const SEIMultiviewAcquisitionInfo*>(&sei));
+     break;
+
+   case SEI::MULTIVIEW_VIEW_POSITION:
+     xWriteSEIMultiviewViewPosition(*static_cast<const SEIMultiviewViewPosition*>(&sei));
+     break;
+#if NH_3D
+   case SEI::ALTERNATIVE_DEPTH_INFO:
+     xWriteSEIAlternativeDepthInfo(*static_cast<const SEIAlternativeDepthInfo*>(&sei));
+     break;
+#endif
+#endif
+
 
   default:
@@ -246,5 +307,5 @@
   for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
   {
-    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 
+    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id");
   }
 }
@@ -384,5 +445,5 @@
 {
   WRITE_FLAG( sei.m_arrangementCancelFlag,          "segmented_rect_frame_packing_arrangement_cancel_flag" );
-  if( sei.m_arrangementCancelFlag == 0 ) 
+  if( sei.m_arrangementCancelFlag == 0 )
   {
     WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" );
@@ -553,5 +614,5 @@
 {
   //UInt code;
-  WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 
+  WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag");
   WRITE_FLAG((sei.m_each_tile_one_tile_set_flag                ? 1 : 0), "each_tile_one_tile_set_flag"               );
 
@@ -568,19 +629,19 @@
 
         if(sei.m_limited_tile_set_display_flag)
-        { 
-          WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag");  
-        }
-
-        WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 
-        
+        {
+          WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag");
+        }
+
+        WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1");
+
         for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++)
         {
-          WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index");  
-          WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index");  
+          WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index");
+          WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index");
         }
 
         if(!sei.m_mc_all_tiles_exact_sample_value_match_flag)
         {
-          WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag");  
+          WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag");
         }
 
@@ -590,5 +651,5 @@
         {
           WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag");
-          WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc"); 
+          WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc");
         }
       }
@@ -601,6 +662,6 @@
     if(sei.m_max_mcs_tier_level_idc_present_flag)
     {
-      WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag");  
-      WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc"); 
+      WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag");
+      WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc");
     }
   }
@@ -702,5 +763,5 @@
   userVerticalCoefficients[2][2] = 100;
   userVerticalCoefficients[2][3] = -10;
-  
+
   Int const iNumHorizontalFilters = 1;
   Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3};
@@ -748,4 +809,5 @@
 
 #if NH_MV
+#if !NH_MV_SEI
 Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
 {
@@ -765,9 +827,10 @@
 }
 #endif
+#endif
 
 Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei)
 {
   WRITE_UVLC( sei.m_kneeId, "knee_function_id" );
-  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 
+  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" );
   if ( !sei.m_kneeCancelFlag )
   {
@@ -800,5 +863,5 @@
   WRITE_CODE( sei.values.whitePoint[0],    16,  "white_point_x" );
   WRITE_CODE( sei.values.whitePoint[1],    16,  "white_point_y" );
-    
+
   WRITE_CODE( sei.values.maxLuminance,     32,  "max_display_mastering_luminance" );
   WRITE_CODE( sei.values.minLuminance,     32,  "min_display_mastering_luminance" );
@@ -818,3 +881,558 @@
 }
 
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
+{
+  WRITE_CODE( sei.m_lnpSeiActiveVpsId, 4, "lnp_sei_active_vps_id" );
+  for( Int i = 0; i  <  sei.m_lnpSeiMaxLayers; i++ )
+  {
+    WRITE_FLAG( ( sei.m_layerNotPresentFlag[i] ? 1 : 0 ), "layer_not_present_flag" );
+  }
+};
+#endif
+
+
+
+Void SEIWriter::xWriteSEIInterLayerConstrainedTileSets( const SEIInterLayerConstrainedTileSets& sei)
+{
+  WRITE_FLAG( ( sei.m_ilAllTilesExactSampleValueMatchFlag ? 1 : 0 ), "il_all_tiles_exact_sample_value_match_flag" );
+  WRITE_FLAG( ( sei.m_ilOneTilePerTileSetFlag ? 1 : 0 ),             "il_one_tile_per_tile_set_flag" );
+  if( !sei.m_ilOneTilePerTileSetFlag )
+  {
+    WRITE_UVLC( sei.m_ilNumSetsInMessageMinus1, "il_num_sets_in_message_minus1" );
+    if( sei.m_ilNumSetsInMessageMinus1 )
+    {
+      WRITE_FLAG( ( sei.m_skippedTileSetPresentFlag ? 1 : 0 ), "skipped_tile_set_present_flag" );
+    }
+    Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1;
+    for( Int i = 0; i < numSignificantSets; i++ )
+    {
+      WRITE_UVLC( sei.m_ilctsId[i],                   "ilcts_id" );
+      WRITE_UVLC( sei.m_ilNumTileRectsInSetMinus1[i], "il_num_tile_rects_in_set_minus1" );
+      for( Int j = 0; j  <= sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ )
+      {
+        WRITE_UVLC( sei.m_ilTopLeftTileIndex[i][j],     "il_top_left_tile_index" );
+        WRITE_UVLC( sei.m_ilBottomRightTileIndex[i][j], "il_bottom_right_tile_index" );
+      }
+      WRITE_CODE( sei.m_ilcIdc[i], 2, "ilc_idc" );
+      if ( !sei.m_ilAllTilesExactSampleValueMatchFlag )
+      {
+        WRITE_FLAG( ( sei.m_ilExactSampleValueMatchFlag[i] ? 1 : 0 ), "il_exact_sample_value_match_flag" );
+      }
+    }
+  }
+  else
+  {
+    WRITE_CODE( sei.m_allTilesIlcIdc, 2, "all_tiles_ilc_idc" );
+  }
+};
+
+#if NH_MV_SEI_TBD
+Void SEIWriter::xWriteSEIBspNesting( const SEIBspNesting& sei)
+{
+  WRITE_UVLC( sei.m_seiOlsIdx, "sei_ols_idx" );
+  WRITE_UVLC( sei.m_seiPartitioningSchemeIdx, "sei_partitioning_scheme_idx" );
+  WRITE_UVLC( sei.m_bspIdx, "bsp_idx" );
+  while( !ByteaLigned(() ) );
+  {
+    WRITE_CODE( sei.m_bspNestingZeroBit, *equalto0*/u1, "bsp_nesting_zero_bit" );
+  }
+  WRITE_UVLC( sei.m_numSeisInBspMinus1, "num_seis_in_bsp_minus1" );
+  for( Int i = 0; i  <=  NumSeisInBspMinus1( ); i++ )
+  {
+    SeiMessage(() );
+  }
+};
+
+Void SEIWriter::xWriteSEIBspInitialArrivalTime( const SEIBspInitialArrivalTime& sei)
+{
+  psIdx = SeiPartitioningSchemeIdx();
+  if( nalInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      WRITE_CODE( sei.m_nalInitialArrivalDelay[i], getNalInitialArrivalDelayLen ), "nal_initial_arrival_delay" );
+    }
+  }
+  if( vclInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      WRITE_CODE( sei.m_vclInitialArrivalDelay[i], getVclInitialArrivalDelayLen ), "vcl_initial_arrival_delay" );
+    }
+  }
+};
+#endif
+Void SEIWriter::xWriteSEISubBitstreamProperty( const SEISubBitstreamProperty& sei)
+{
+  WRITE_CODE( sei.m_sbPropertyActiveVpsId, 4,      "sb_property_active_vps_id"         );
+  WRITE_UVLC( sei.m_numAdditionalSubStreamsMinus1, "num_additional_sub_streams_minus1" );
+  for( Int i = 0; i  <=  sei.m_numAdditionalSubStreamsMinus1; i++ )
+  {
+    WRITE_CODE( sei.m_subBitstreamMode    [i], 2,  "sub_bitstream_mode"       );
+    WRITE_UVLC( sei.m_olsIdxToVps         [i],     "ols_idx_to_vps"           );
+    WRITE_CODE( sei.m_highestSublayerId   [i], 3,  "highest_sublayer_id"      );
+    WRITE_CODE( sei.m_avgSbPropertyBitRate[i], 16, "avg_sb_property_bit_rate" );
+    WRITE_CODE( sei.m_maxSbPropertyBitRate[i], 16, "max_sb_property_bit_rate" );
+  }
+};
+
+Void SEIWriter::xWriteSEIAlphaChannelInfo( const SEIAlphaChannelInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_alphaChannelCancelFlag ? 1 : 0 ), "alpha_channel_cancel_flag" );
+  if( !sei.m_alphaChannelCancelFlag )
+  {
+    WRITE_CODE( sei.m_alphaChannelUseIdc, 3, "alpha_channel_use_idc" );
+    WRITE_CODE( sei.m_alphaChannelBitDepthMinus8, 3, "alpha_channel_bit_depth_minus8" );
+    WRITE_CODE( sei.m_alphaTransparentValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_transparent_value" );
+    WRITE_CODE( sei.m_alphaOpaqueValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_opaque_value" );
+    WRITE_FLAG( ( sei.m_alphaChannelIncrFlag ? 1 : 0 ), "alpha_channel_incr_flag" );
+    WRITE_FLAG( ( sei.m_alphaChannelClipFlag ? 1 : 0 ), "alpha_channel_clip_flag" );
+    if( sei.m_alphaChannelClipFlag )
+    {
+      WRITE_FLAG( ( sei.m_alphaChannelClipTypeFlag ? 1 : 0 ), "alpha_channel_clip_type_flag" );
+    }
+  }
+};
+
+Void SEIWriter::xWriteSEIOverlayInfo( const SEIOverlayInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_overlayInfoCancelFlag ? 1 : 0 ), "overlay_info_cancel_flag" );
+  if( !sei.m_overlayInfoCancelFlag )
+  {
+    WRITE_UVLC( sei.m_overlayContentAuxIdMinus128, "overlay_content_aux_id_minus128" );
+    WRITE_UVLC( sei.m_overlayLabelAuxIdMinus128, "overlay_label_aux_id_minus128" );
+    WRITE_UVLC( sei.m_overlayAlphaAuxIdMinus128, "overlay_alpha_aux_id_minus128" );
+    WRITE_UVLC( sei.m_overlayElementLabelValueLengthMinus8, "overlay_element_label_value_length_minus8" );
+    WRITE_UVLC( sei.m_numOverlaysMinus1, "num_overlays_minus1" );
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1 ; i++ )
+    {
+      WRITE_UVLC( sei.m_overlayIdx[i], "overlay_idx" );
+      WRITE_FLAG( ( sei.m_languageOverlayPresentFlag[i] ? 1 : 0 ), "language_overlay_present_flag" );
+      WRITE_CODE( sei.m_overlayContentLayerId[i], 6, "overlay_content_layer_id" );
+      WRITE_FLAG( ( sei.m_overlayLabelPresentFlag[i] ? 1 : 0 ), "overlay_label_present_flag" );
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        WRITE_CODE( sei.m_overlayLabelLayerId[i], 6, "overlay_label_layer_id" );
+      }
+      WRITE_FLAG( ( sei.m_overlayAlphaPresentFlag[i] ? 1 : 0 ), "overlay_alpha_present_flag" );
+      if( sei.m_overlayAlphaPresentFlag[i] )
+      {
+        WRITE_CODE( sei.m_overlayAlphaLayerId[i], 6, "overlay_alpha_layer_id" );
+      }
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        WRITE_UVLC( sei.m_numOverlayElementsMinus1[i], "num_overlay_elements_minus1" );
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          WRITE_CODE( sei.m_overlayElementLabelMin[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_min" );
+          WRITE_CODE( sei.m_overlayElementLabelMax[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_max" );
+        }
+      }
+    }
+
+    // byte alignment
+    while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
+    {
+      WRITE_FLAG( 0, "overlay_zero_bit" );
+    }
+
+    UChar* stmp;
+    UInt ilength;
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
+    {
+      if( sei.m_languageOverlayPresentFlag[i] )
+      {
+        stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() );
+        ilength = (UInt) sei.m_overlayLanguage[i].size();
+        WRITE_STRING( stmp, ilength, "overlay_language" );
+        free(stmp);
+      }
+      stmp = (UChar*) strdup( sei.m_overlayName[i].c_str() );
+      ilength = (UInt) sei.m_overlayName[i].size();
+      WRITE_STRING( stmp, ilength, "overlay_name" );
+      free(stmp);
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          stmp = (UChar*) strdup( sei.m_overlayElementName[i][j].c_str() );
+          ilength = (UInt) sei.m_overlayElementName[i][j].size();
+          WRITE_STRING( stmp, ilength, "overlay_element_name" );
+          free(stmp);
+        }
+      }
+    }
+    WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" );
+  }
+};
+
+Void SEIWriter::xWriteSEITemporalMvPredictionConstraints( const SEITemporalMvPredictionConstraints& sei)
+{
+  WRITE_FLAG( ( sei.m_prevPicsNotUsedFlag    ? 1 : 0 ), "prev_pics_not_used_flag"     );
+  WRITE_FLAG( ( sei.m_noIntraLayerColPicFlag ? 1 : 0 ), "no_intra_layer_col_pic_flag" );
+};
+
+#if NH_MV_SEI_TBD
+Void SEIWriter::xWriteSEIFrameFieldInfo( const SEIFrameFieldInfo& sei)
+{
+  WRITE_CODE( sei.m_ffinfoPicStruct, 4, "ffinfo_pic_struct" );
+  WRITE_CODE( sei.m_ffinfoSourceScanType, 2, "ffinfo_source_scan_type" );
+  WRITE_FLAG( ( sei.m_ffinfoDuplicateFlag ? 1 : 0 ), "ffinfo_duplicate_flag" );
+};
+#endif
+
+Void SEIWriter::xWriteSEIThreeDimensionalReferenceDisplaysInfo( const SEIThreeDimensionalReferenceDisplaysInfo& sei)
+{
+  WRITE_UVLC( sei.m_precRefDisplayWidth, "prec_ref_display_width" );
+  WRITE_FLAG( ( sei.m_refViewingDistanceFlag ? 1 : 0 ), "ref_viewing_distance_flag" );
+  if( sei.m_refViewingDistanceFlag )
+  {
+    WRITE_UVLC( sei.m_precRefViewingDist, "prec_ref_viewing_dist" );
+  }
+  WRITE_UVLC( sei.m_numRefDisplaysMinus1, "num_ref_displays_minus1" );
+  for( Int i = 0; i  <=  sei.getNumRefDisplaysMinus1( ); i++ )
+  {
+    WRITE_UVLC( sei.m_leftViewId[i], "left_view_id" );
+    WRITE_UVLC( sei.m_rightViewId[i], "right_view_id" );
+    WRITE_CODE( sei.m_exponentRefDisplayWidth[i], 6, "exponent_ref_display_width" );
+    WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], sei.getMantissaReferenceDisplayWidthLen(i) , "mantissa_ref_display_width" );
+    if( sei.m_refViewingDistanceFlag )
+    {
+      WRITE_CODE( sei.m_exponentRefViewingDistance[i], 6, "exponent_ref_viewing_distance" );
+      WRITE_CODE( sei.m_mantissaRefViewingDistance[i], sei.getMantissaReferenceViewingDistanceLen(i), "mantissa_ref_viewing_distance" );
+    }
+    WRITE_FLAG( ( sei.m_additionalShiftPresentFlag[i] ? 1 : 0 ), "additional_shift_present_flag" );
+    if( sei.m_additionalShiftPresentFlag[i] )
+    {
+      WRITE_CODE( sei.m_numSampleShiftPlus512[i], 10, "num_sample_shift_plus512" );
+    }
+  }
+  WRITE_FLAG( ( sei.m_threeDimensionalReferenceDisplaysExtensionFlag ? 1 : 0 ), "three_dimensional_reference_displays_extension_flag" );
+};
+
+#if SEI_DRI_F0169
+Void SEIWriter::xWriteSEIDepthRepresentationInfo( const SEIDepthRepresentationInfo& sei)
+{
+
+    assert(sei.m_currLayerID>=0);
+
+    WRITE_FLAG( ( sei.m_zNearFlag[sei.m_currLayerID] ? 1 : 0 ), "z_near_flag" );
+    WRITE_FLAG( ( sei.m_zFarFlag[sei.m_currLayerID] ? 1 : 0 ), "z_far_flag" );
+    WRITE_FLAG( ( sei.m_dMinFlag[sei.m_currLayerID] ? 1 : 0 ), "d_min_flag" );
+    WRITE_FLAG( ( sei.m_dMaxFlag[sei.m_currLayerID] ? 1 : 0 ), "d_max_flag" );
+    WRITE_UVLC( sei.m_depthRepresentationType[sei.m_currLayerID][0], "depth_representation_type" );
+    if( sei.m_dMinFlag[sei.m_currLayerID]  ||  sei.m_dMaxFlag[sei.m_currLayerID] )
+    {
+        WRITE_UVLC( sei.m_disparityRefViewId[sei.m_currLayerID][0], "disparity_ref_view_id" );
+    }
+    if( sei.m_zNearFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_zNear[sei.m_currLayerID][0]);
+    }
+    if( sei.m_zFarFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_zFar[sei.m_currLayerID][0]);
+    }
+    if( sei.m_dMinFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_dMin[sei.m_currLayerID][0]);
+    }
+    if( sei.m_dMaxFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_dMax[sei.m_currLayerID][0]);
+    }
+
+    if (sei.m_depthRepresentationType[sei.m_currLayerID][0] == 3)
+    {
+        WRITE_UVLC( sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0], "depth_nonlinear_representation_num_minus1" );
+        for( Int i = 1; i  <=  sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0] + 1; i++ )
+        {
+            WRITE_UVLC(sei.m_depth_nonlinear_representation_model[sei.m_currLayerID][i-1],"depth_nonlinear_representation_model[ i ]");
+        }
+    }
+}
+
+Void SEIWriter::xWriteSEIDepthRepInfoElement( double f)
+{
+    UInt x_sign, x_exp, x_mantissa,x_mantissa_len;
+    if (f < 0)
+    {
+        f = f * (-1);
+        x_sign = 1;
+    }
+    else
+    {
+        x_sign = 0;
+    }
+    int exponent=0;
+    if(f >= 1)
+    {
+        while(f>=2)
+        {
+            exponent++;
+            f = f/2;
+        }
+    }
+    else
+    {
+        while (f<1)
+        {
+            exponent++;
+            f = f*2;
+        }
+        exponent=-exponent;
+    }
+
+    int i;
+    f = f -1;
+    double s = 1;
+    char s_mantissa[32];
+    double thr=1.0/(4.0*(1<<30));
+
+    if (f>=thr)
+    {
+        for(i=0;i<32;i++)
+        {
+            s /= 2;
+            if(f>=s)
+            {
+                f = f-s;
+                s_mantissa[i]=1;
+
+                if (f<thr)
+                    break;
+            }
+            else
+            {
+                s_mantissa[i]=0;
+            }
+        }
+
+        if (i<32)
+            x_mantissa_len=i+1;
+        else
+            x_mantissa_len=32;
+
+        x_mantissa=0;
+
+        for(i=0;i<x_mantissa_len;i++)
+        {
+            if (s_mantissa[i]==1)
+                x_mantissa += (1u)<<(x_mantissa_len-1-i) ;
+        }
+
+    }
+    else
+    {
+        x_mantissa=0;
+        x_mantissa_len=1;
+    }
+
+    assert(exponent>=-31 && exponent<= (1<<7)-32);
+    x_exp=exponent+31;
+
+    WRITE_FLAG(  x_sign,                         "da_sign_flag" );
+    WRITE_CODE(  x_exp, 7 ,                      "da_exponent" );
+    WRITE_CODE( x_mantissa_len-1, 5 ,            "da_mantissa_len_minus1" );
+    WRITE_CODE( x_mantissa, x_mantissa_len ,     "da_mantissa" );
+
+};
+#endif
+Void SEIWriter::xWriteSEIMultiviewSceneInfo( const SEIMultiviewSceneInfo& sei)
+{
+  WRITE_SVLC( sei.m_minDisparity     , "min_disparity"       );
+  WRITE_UVLC( sei.m_maxDisparityRange, "max_disparity_range" );
+};
+
+
+Void SEIWriter::xWriteSEIMultiviewAcquisitionInfo( const SEIMultiviewAcquisitionInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_intrinsicParamFlag ? 1 : 0 ), "intrinsic_param_flag" );
+  WRITE_FLAG( ( sei.m_extrinsicParamFlag ? 1 : 0 ), "extrinsic_param_flag" );
+  if( sei.m_intrinsicParamFlag )
+  {
+    WRITE_FLAG( ( sei.m_intrinsicParamsEqualFlag ? 1 : 0 ), "intrinsic_params_equal_flag" );
+    WRITE_UVLC(   sei.m_precFocalLength                   , "prec_focal_length"           );
+    WRITE_UVLC(   sei.m_precPrincipalPoint                , "prec_principal_point"        );
+    WRITE_UVLC(   sei.m_precSkewFactor                    , "prec_skew_factor"            );
+
+    for( Int i = 0; i  <=  ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ )
+    {
+      WRITE_FLAG( ( sei.m_signFocalLengthX       [i] ? 1 : 0 ),                                         "sign_focal_length_x"        );
+      WRITE_CODE(   sei.m_exponentFocalLengthX   [i]          , 6                                  ,    "exponent_focal_length_x"    );
+      WRITE_CODE(   sei.m_mantissaFocalLengthX   [i]          , sei.getMantissaFocalLengthXLen( i ),    "mantissa_focal_length_x"    );
+      WRITE_FLAG( ( sei.m_signFocalLengthY       [i] ? 1 : 0 ),                                         "sign_focal_length_y"        );
+      WRITE_CODE(   sei.m_exponentFocalLengthY   [i]          , 6                                  ,    "exponent_focal_length_y"    );
+      WRITE_CODE(   sei.m_mantissaFocalLengthY   [i]          , sei.getMantissaFocalLengthYLen( i ),    "mantissa_focal_length_y"    );
+      WRITE_FLAG( ( sei.m_signPrincipalPointX    [i] ? 1 : 0 ),                                         "sign_principal_point_x"     );
+      WRITE_CODE(   sei.m_exponentPrincipalPointX[i]          , 6,                                      "exponent_principal_point_x" );
+      WRITE_CODE(   sei.m_mantissaPrincipalPointX[i]          , sei.getMantissaPrincipalPointXLen( i ), "mantissa_principal_point_x" );
+      WRITE_FLAG( ( sei.m_signPrincipalPointY    [i] ? 1 : 0 ),                                         "sign_principal_point_y"     );
+      WRITE_CODE(   sei.m_exponentPrincipalPointY[i]          , 6,                                      "exponent_principal_point_y" );
+      WRITE_CODE(   sei.m_mantissaPrincipalPointY[i]          , sei.getMantissaPrincipalPointYLen( i ), "mantissa_principal_point_y" );
+      WRITE_FLAG( ( sei.m_signSkewFactor         [i] ? 1 : 0 ),                                         "sign_skew_factor"           );
+      WRITE_CODE(   sei.m_exponentSkewFactor     [i]          , 6,                                      "exponent_skew_factor"       );
+      WRITE_CODE(   sei.m_mantissaSkewFactor     [i]          , sei.getMantissaSkewFactorLen( i )  ,    "mantissa_skew_factor"       );
+    }
+  }
+  if( sei.m_extrinsicParamFlag )
+  {
+    WRITE_UVLC( sei.m_precRotationParam   , "prec_rotation_param"    );
+    WRITE_UVLC( sei.m_precTranslationParam, "prec_translation_param" );
+    for( Int i = 0; i  <=  sei.getNumViewsMinus1(); i++ )
+    {
+      for( Int j = 0; j  <=  2; j++ )  /* row */
+      {
+        for( Int k = 0; k  <=  2; k++ )  /* column */
+        {
+          WRITE_FLAG( ( sei.m_signR    [i][j][k] ? 1 : 0 ),                                "sign_r"     );
+          WRITE_CODE(   sei.m_exponentR[i][j][k]          , 6,                             "exponent_r" );
+          WRITE_CODE(   sei.m_mantissaR[i][j][k]          , sei.getMantissaRLen( i,j,k ) , "mantissa_r" );
+        }
+        WRITE_FLAG( ( sei.m_signT    [i][j] ? 1 : 0 ),                          "sign_t"     );
+        WRITE_CODE(   sei.m_exponentT[i][j]          , 6,                       "exponent_t" );
+        WRITE_CODE(   sei.m_mantissaT[i][j]          , sei.getMantissaTLen( i,j ),"mantissa_t" );
+      }
+    }
+  }
+};
+
+
+#if NH_MV_SEI
+Void SEIWriter::xWriteSEIMultiviewViewPosition( const SEIMultiviewViewPosition& sei)
+{
+  WRITE_UVLC( sei.m_numViewsMinus1, "num_views_minus1" );
+  for( Int i = 0; i  <=  sei.m_numViewsMinus1; i++ )
+  {
+    WRITE_UVLC( sei.m_viewPosition[i], "view_position" );
+  }
+};
+#endif
+
+#if NH_3D
+Void SEIWriter::xWriteSEIAlternativeDepthInfo( const SEIAlternativeDepthInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_alternativeDepthInfoCancelFlag ? 1 : 0 ), "alternative_depth_info_cancel_flag" );
+  if( sei.m_alternativeDepthInfoCancelFlag  ==  0 )
+  {
+    WRITE_CODE( sei.m_depthType, 2, "depth_type" );
+
+    if( sei.m_depthType  ==  0 )
+    {
+      WRITE_UVLC( sei.m_numConstituentViewsGvdMinus1, "num_constituent_views_gvd_minus1" );
+      WRITE_FLAG( ( sei.m_depthPresentGvdFlag ? 1 : 0 ), "depth_present_gvd_flag" );
+      WRITE_FLAG( ( sei.m_zGvdFlag ? 1 : 0 ), "z_gvd_flag" );
+      WRITE_FLAG( ( sei.m_intrinsicParamGvdFlag ? 1 : 0 ), "intrinsic_param_gvd_flag" );
+      WRITE_FLAG( ( sei.m_rotationGvdFlag ? 1 : 0 ), "rotation_gvd_flag" );
+      WRITE_FLAG( ( sei.m_translationGvdFlag ? 1 : 0 ), "translation_gvd_flag" );
+      if( sei.m_zGvdFlag )
+      {
+        for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
+        {
+          WRITE_FLAG( ( sei.m_signGvdZNearFlag[i][j] ? 1 : 0 ), "sign_gvd_z_near_flag" );
+          WRITE_CODE( sei.m_expGvdZNear[i][j], 7, "exp_gvd_z_near" );
+          WRITE_CODE( sei.m_manLenGvdZNearMinus1[i][j], 5, "man_len_gvd_z_near_minus1" );
+          WRITE_CODE( sei.m_manGvdZNear[i][j], sei.m_manLenGvdZNearMinus1[i][j] + 1, "man_gvd_z_near" );
+          WRITE_FLAG( ( sei.m_signGvdZFarFlag[i][j] ? 1 : 0 ), "sign_gvd_z_far_flag" );
+          WRITE_CODE( sei.m_expGvdZFar[i][j], 7, "exp_gvd_z_far" );
+          WRITE_CODE( sei.m_manLenGvdZFarMinus1[i][j], 5, "man_len_gvd_z_far_minus1" );
+          WRITE_CODE( sei.m_manGvdZFar[i][j], sei.m_manLenGvdZFarMinus1[i][j] + 1, "man_gvd_z_far" );
+        }
+      }
+      if( sei.m_intrinsicParamGvdFlag )
+      {
+        WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" );
+        WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" );
+      }
+      if( sei.m_rotationGvdFlag )
+      {
+        WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" );
+      }
+      if( sei.m_translationGvdFlag )
+      {
+        WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" );
+      }
+      for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
+      {
+        if( sei.m_intrinsicParamGvdFlag )
+        {
+          WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" );
+          WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" );
+          WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.getManGvdFocalLengthXLen(i,j), "man_gvd_focal_length_x" );
+          WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" );
+          WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" );
+          WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.getManGvdFocalLengthYLen(i,j), "man_gvd_focal_length_y" );
+          WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" );
+          WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" );
+          WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.getManGvdPrincipalPointXLen(i,j), "man_gvd_principal_point_x" );
+          WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" );
+          WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" );
+          WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.getManGvdPrincipalPointYLen(i,j), "man_gvd_principal_point_y" );
+        }
+        if( sei.m_rotationGvdFlag )
+        {
+          WRITE_FLAG( ( sei.m_signGvdR00[i][j] ? 1 : 0 ), "sign_gvd_r00" );
+          WRITE_CODE( sei.m_expGvdR00[i][j], 6, "exp_gvd_r00" );
+          WRITE_CODE( sei.m_manGvdR00[i][j], sei.m_precGvdRotationParam, "man_gvd_r00" );
+          WRITE_FLAG( ( sei.m_signGvdR01[i][j] ? 1 : 0 ), "sign_gvd_r01" );
+          WRITE_CODE( sei.m_expGvdR01[i][j], 6, "exp_gvd_r01" );
+          WRITE_CODE( sei.m_manGvdR01[i][j], sei.m_precGvdRotationParam, "man_gvd_r01" );
+          WRITE_FLAG( ( sei.m_signGvdR02[i][j] ? 1 : 0 ), "sign_gvd_r02" );
+          WRITE_CODE( sei.m_expGvdR02[i][j], 6, "exp_gvd_r02" );
+          WRITE_CODE( sei.m_manGvdR02[i][j], sei.m_precGvdRotationParam, "man_gvd_r02" );
+          WRITE_FLAG( ( sei.m_signGvdR10[i][j] ? 1 : 0 ), "sign_gvd_r10" );
+          WRITE_CODE( sei.m_expGvdR10[i][j], 6, "exp_gvd_r10" );
+          WRITE_CODE( sei.m_manGvdR10[i][j], sei.m_precGvdRotationParam, "man_gvd_r10" );
+          WRITE_FLAG( ( sei.m_signGvdR11[i][j] ? 1 : 0 ), "sign_gvd_r11" );
+          WRITE_CODE( sei.m_expGvdR11[i][j], 6, "exp_gvd_r11" );
+          WRITE_CODE( sei.m_manGvdR11[i][j], sei.m_precGvdRotationParam, "man_gvd_r11" );
+          WRITE_FLAG( ( sei.m_signGvdR12[i][j] ? 1 : 0 ), "sign_gvd_r12" );
+          WRITE_CODE( sei.m_expGvdR12[i][j], 6, "exp_gvd_r12" );
+          WRITE_CODE( sei.m_manGvdR12[i][j], sei.m_precGvdRotationParam, "man_gvd_r12" );
+          WRITE_FLAG( ( sei.m_signGvdR20[i][j] ? 1 : 0 ), "sign_gvd_r20" );
+          WRITE_CODE( sei.m_expGvdR20[i][j], 6, "exp_gvd_r20" );
+          WRITE_CODE( sei.m_manGvdR20[i][j], sei.m_precGvdRotationParam, "man_gvd_r20" );
+          WRITE_FLAG( ( sei.m_signGvdR21[i][j] ? 1 : 0 ), "sign_gvd_r21" );
+          WRITE_CODE( sei.m_expGvdR21[i][j], 6, "exp_gvd_r21" );
+          WRITE_CODE( sei.m_manGvdR21[i][j], sei.m_precGvdRotationParam, "man_gvd_r21" );
+          WRITE_FLAG( ( sei.m_signGvdR22[i][j] ? 1 : 0 ), "sign_gvd_r22" );
+          WRITE_CODE( sei.m_expGvdR22[i][j], 6, "exp_gvd_r22" );
+          WRITE_CODE( sei.m_manGvdR22[i][j], sei.m_precGvdRotationParam, "man_gvd_r22" );
+        }
+        if( sei.m_translationGvdFlag )
+        {
+          WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" );
+          WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" );
+          WRITE_CODE( sei.m_manGvdTX[i][j], sei.getManGvdTXLen(i,j), "man_gvd_t_x" );
+        }
+      }
+    }
+
+    if( sei.m_depthType  ==  1 )
+    {
+      WRITE_SVLC( sei.m_minOffsetXInt, "min_offset_x_int" );
+      WRITE_CODE( sei.m_minOffsetXFrac, 8, "min_offset_x_frac" );
+      WRITE_SVLC( sei.m_maxOffsetXInt, "max_offset_x_int" );
+      WRITE_CODE( sei.m_maxOffsetXFrac, 8, "max_offset_x_frac" );
+      WRITE_FLAG( ( sei.m_offsetYPresentFlag ? 1 : 0 ), "offset_y_present_flag" );
+      if( sei.m_offsetYPresentFlag )
+      {
+        WRITE_SVLC( sei.m_minOffsetYInt, "min_offset_y_int" );
+        WRITE_CODE( sei.m_minOffsetYFrac, 8, "min_offset_y_frac" );
+        WRITE_SVLC( sei.m_maxOffsetYInt, "max_offset_y_int" );
+        WRITE_CODE( sei.m_maxOffsetYFrac, 8, "max_offset_y_frac" );
+      }
+      WRITE_FLAG( ( sei.m_warpMapSizePresentFlag ? 1 : 0 ), "warp_map_size_present_flag" );
+      if( sei.m_warpMapSizePresentFlag )
+      {
+        WRITE_UVLC( sei.m_warpMapWidthMinus2, "warp_map_width_minus2" );
+        WRITE_UVLC( sei.m_warpMapHeightMinus2, "warp_map_height_minus2" );
+      }
+    }
+  }
+};
+#endif
+
+
 //! \}
Index: /trunk/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 1356)
@@ -72,5 +72,7 @@
   Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps);
 #if NH_MV
+#if !NH_MV_SEI
   Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
+#endif
 #endif
   Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets& sei);
@@ -81,6 +83,34 @@
   Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei);
 
+#if NH_MV_SEI
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  Void xWriteSEILayersNotPresent              ( const SEILayersNotPresent& sei);
+#endif
+  Void xWriteSEIInterLayerConstrainedTileSets ( const SEIInterLayerConstrainedTileSets& sei);
+#if NH_MV_SEI_TBD
+  Void xWriteSEIBspNesting                    ( const SEIBspNesting& sei);
+  Void xWriteSEIBspInitialArrivalTime         ( const SEIBspInitialArrivalTime& sei);
+#endif
+  Void xWriteSEISubBitstreamProperty          ( const SEISubBitstreamProperty& sei);
+  Void xWriteSEIAlphaChannelInfo              ( const SEIAlphaChannelInfo& sei);
+  Void xWriteSEIOverlayInfo                   ( const SEIOverlayInfo& sei);
+  Void xWriteSEITemporalMvPredictionConstraints ( const SEITemporalMvPredictionConstraints& sei);
+#if NH_MV_SEI_TBD
+  Void xWriteSEIFrameFieldInfo                ( const SEIFrameFieldInfo& sei);
+#endif
+  Void xWriteSEIThreeDimensionalReferenceDisplaysInfo ( const SEIThreeDimensionalReferenceDisplaysInfo& sei);
+#if SEI_DRI_F0169
+  Void xWriteSEIDepthRepInfoElement           ( double f);
+  Void xWriteSEIDepthRepresentationInfo       ( const SEIDepthRepresentationInfo& sei);
+#endif
+  Void xWriteSEIMultiviewSceneInfo            ( const SEIMultiviewSceneInfo& sei);
+  Void xWriteSEIMultiviewAcquisitionInfo      ( const SEIMultiviewAcquisitionInfo& sei);
+  Void xWriteSEIMultiviewViewPosition         ( const SEIMultiviewViewPosition& sei);
+#if NH_3D
+  Void xWriteSEIAlternativeDepthInfo          ( const SEIAlternativeDepthInfo& sei);
+#endif
   Void xWriteByteAlign();
 };
+#endif
 
 //! \}
Index: /trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1356)
@@ -127,4 +127,14 @@
 }
 
+Void  SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const Char *pSymbolName)
+{
+  xWriteString(value, length);
+  if( g_HLSTraceEnable )
+  {
+    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+    fprintf( g_hTrace, "%-50s st(v=%d)  : %s\n", pSymbolName, length, value ); 
+  }
+}
+
 #endif
 
@@ -166,4 +176,14 @@
 }
 
+Void  SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength)
+{
+  assert(m_pcBitIf->getNumberOfWrittenBits() % 8 == 0 );
+  for (Int i=0 ; i<uiLength; i++)
+  {
+    m_pcBitIf->write( sCode[i], 8 );
+  }
+  m_pcBitIf->write( 0, 8 ); //zero-termination byte
+}
+
 Void SyntaxElementWriter::xWriteRbspTrailingBits()
 {
Index: /trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1356)
@@ -56,4 +56,5 @@
 #define WRITE_SVLC( value,         name)    xWriteSvlcTr ( value,         name )
 #define WRITE_FLAG( value,         name)    xWriteFlagTr ( value,         name )
+#define WRITE_STRING( value, length, name)   xWriteStringTr( value, length, name )
 
 #else
@@ -63,4 +64,5 @@
 #define WRITE_SVLC( value,         name)     xWriteSvlc ( value )
 #define WRITE_FLAG( value,         name)     xWriteFlag ( value )
+#define WRITE_STRING( value, length, name)   xWriteString( value, length )
 
 #endif
@@ -82,4 +84,5 @@
   Void  xWriteSvlc            ( Int  iCode   );
   Void  xWriteFlag            ( UInt uiCode );
+  Void  xWriteString          ( UChar* sCode, UInt uiLength);
 #if ENC_DEC_TRACE
   Void  xWriteCodeTr          ( UInt value, UInt  length, const Char *pSymbolName);
@@ -87,4 +90,5 @@
   Void  xWriteSvlcTr          ( Int  value,               const Char *pSymbolName);
   Void  xWriteFlagTr          ( UInt value,               const Char *pSymbolName);
+  Void  xWriteStringTr        ( UChar* value, UInt length, const Char *pSymbolName);
 #endif
   Void xWriteRbspTrailingBits();
Index: /trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1356)
@@ -49,4 +49,8 @@
 #include "TAppCommon/TAppComCamPara.h"
 #include "TLibRenderer/TRenModSetupStrParser.h"
+#endif
+
+#if NH_MV
+#include "TLibCommon/SEI.h"
 #endif
 
@@ -350,4 +354,7 @@
   Int*      m_kneeSEIOutputKneePoint;
   TComSEIMasteringDisplay m_masteringDisplay;
+#if NH_MV_SEI
+  SEIMessages* m_seiMessages; 
+#endif
   //====== Weighted Prediction ========
   Bool      m_useWeightedPred;       //< Use of Weighting Prediction (P_SLICE)
@@ -432,4 +439,5 @@
 
 #if NH_MV
+#if !NH_MV_SEI
   Bool              m_subBistreamPropSEIEnabled;
   Int               m_numAdditionalSubStreams;
@@ -439,4 +447,5 @@
   std::vector<Int>  m_avgBitRate;
   std::vector<Int>  m_maxBitRate;
+#endif
 #endif
 
@@ -933,4 +942,8 @@
   const TComSEIMasteringDisplay &getMasteringDisplaySEI() const      { return m_masteringDisplay; }
 #if NH_MV
+#if NH_MV_SEI
+  Void setSeiMessages(SEIMessages *p)                                { m_seiMessages = p;    }
+  const SEIMessages*  getSeiMessages()                               { return m_seiMessages; }
+#else
   Bool   getSubBitstreamPropSEIEnabled()                             { return m_subBistreamPropSEIEnabled;}
   Void   setSubBitstreamPropSEIEnabled(Bool x)                       { m_subBistreamPropSEIEnabled = x;}
@@ -958,5 +971,5 @@
   Int   getMaxBitRate(Int idx)                                       { return m_maxBitRate[idx];}
   Void  setMaxBitRate(std::vector<Int> &x)                           { m_maxBitRate = x;}
-
+#endif
 #endif
 
Index: /trunk/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1355)
+++ /trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1356)
@@ -100,7 +100,7 @@
   m_layerId      = 0;
   m_viewId       = 0;
-  m_pocLastCoded = -1; 
+  m_pocLastCoded = -1;
 #if NH_3D
-  m_viewIndex  =   0; 
+  m_viewIndex  =   0;
   m_isDepth = false;
 #endif
@@ -147,5 +147,5 @@
 
 #if NH_MV
-  m_ivPicLists           = pcTEncTop->getIvPicLists(); 
+  m_ivPicLists           = pcTEncTop->getIvPicLists();
   m_layerId              = pcTEncTop->getLayerId();
   m_viewId               = pcTEncTop->getViewId();
@@ -156,6 +156,6 @@
 #endif
 #if NH_3D_IC
-  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate(); 
-  m_aICEnableNum         = pcTEncTop->getICEnableNum(); 
+  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate();
+  m_aICEnableNum         = pcTEncTop->getICEnableNum();
 #endif
 #if KWU_FIX_URQ
@@ -207,5 +207,5 @@
 #if NH_MV
   if ( getLayerId() == 0 )
-  {  
+  {
     actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
   }
@@ -277,5 +277,5 @@
 
   while ( (itNalu!=accessUnit.end())&&
-    ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 
+    ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER
     || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS
     || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS
@@ -288,5 +288,5 @@
   SEIMessages localMessages = seiMessages;
   SEIMessages currentMessages;
-  
+
 #if ENC_DEC_TRACE
   g_HLSTraceEnable = !testWrite;
@@ -299,5 +299,5 @@
   xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
   xClearSEIs(currentMessages, !testWrite);
-  
+
   // Buffering period SEI must always be following active parameter sets
   currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD);
@@ -328,4 +328,11 @@
   xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
   xClearSEIs(currentMessages, !testWrite);
+
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  // Layers not present SEI message
+  currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT);
+  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
+  xClearSEIs(currentMessages, !testWrite);
+#endif
 
   // And finally everything else one by one
@@ -412,9 +419,6 @@
 Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps)
 {
-#if NH_MV
-  OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());
-#else
   OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
-#endif
+
   if(m_pcCfg->getActiveParameterSetsSEIEnabled())
   {
@@ -472,5 +476,5 @@
     seiMessages.push_back(sei);
   }
-    
+
   if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled)
   {
@@ -482,10 +486,12 @@
 
 #if NH_MV
+#if !NH_MV_SEI
   if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) )
   {
     SEISubBitstreamProperty *sei = new SEISubBitstreamProperty;
-    m_seiEncoder.initSEISubBitstreamProperty( sei, sps );   
+    m_seiEncoder.initSEISubBitstreamProperty( sei, sps );
     seiMessages.push_back(sei);
   }
+#endif
 #endif
 }
@@ -679,5 +685,5 @@
       }
     }
-    
+
     if( m_pcCfg->getPictureTimingSEIEnabled() )
     {
@@ -715,5 +721,5 @@
     return;
   }
-  // fix first 
+  // fix first
   UInt numNalUnits = (UInt)testAU.size();
   UInt numRBSPBytes = 0;
@@ -927,5 +933,5 @@
           IRAPGOPid = iGOPid;
           IRAPtoReorder = true;
-          swapIRAPForward = true; 
+          swapIRAPForward = true;
           break;
         }
@@ -935,5 +941,5 @@
           IRAPGOPid = iGOPid;
           IRAPtoReorder = true;
-          swapIRAPForward = false; 
+          swapIRAPForward = false;
           break;
         }
@@ -1066,6 +1072,6 @@
 #endif
 #if NH_MV
-Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 
-                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP, 
+Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic,
+                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP,
                                 Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid )
 #else
@@ -1170,5 +1176,5 @@
     pcPic->setCurrSliceIdx(0);
 #if NH_MV
-    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );     
+    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );
 #else
     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField );
@@ -1181,17 +1187,17 @@
     pcSlice->setSliceIdx(0);
 #if NH_MV
-    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 
+    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
     pcPic  ->setLayerId     ( getLayerId()   );
-    pcPic  ->setViewId      ( getViewId()    );    
+    pcPic  ->setViewId      ( getViewId()    );
 #if !NH_3D
     pcSlice->setLayerId     ( getLayerId() );
-    pcSlice->setViewId      ( getViewId()  );    
+    pcSlice->setViewId      ( getViewId()  );
     pcSlice->setVPS         ( m_pcEncTop->getVPS() );
 #else
-    pcPic  ->setViewIndex   ( getViewIndex() ); 
+    pcPic  ->setViewIndex   ( getViewIndex() );
     pcPic  ->setIsDepth( getIsDepth() );
-    pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );    
-#endif
-#endif 
+    pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );
+#endif
+#endif
     //set default slice level flag to the same as SPS level flag
     pcSlice->setLFCrossSliceBoundaryFlag(  pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()  );
@@ -1201,6 +1207,6 @@
     if( pcSlice->getSliceType() == B_SLICE )
     {
-      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
-      { 
+      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
+      {
         pcSlice->setSliceType( P_SLICE );
       }
@@ -1210,6 +1216,6 @@
     if( pcSlice->getSliceType() == B_SLICE )
     {
-      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 
-      { 
+      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' )
+      {
         pcSlice->setSliceType( I_SLICE );
       }
@@ -1225,5 +1231,5 @@
       pcSlice->setSliceType(I_SLICE);
     }
-    
+
     // Set the nal unit type
     pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
@@ -1279,5 +1285,5 @@
     pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     }
-    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 
+    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
       || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
       )
@@ -1288,5 +1294,5 @@
     pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
 
-    if(pcSlice->getTLayer() > 0 
+    if(pcSlice->getTLayer() > 0
       &&  !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     // Check if not a leading picture
           || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
@@ -1358,34 +1364,34 @@
     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     {
-      // Some more sophisticated algorithm to determine discardable_flag might be added here. 
-      pcSlice->setDiscardableFlag           ( false );     
-    }    
-
-    const TComVPS*           vps = pcSlice->getVPS();     
+      // Some more sophisticated algorithm to determine discardable_flag might be added here.
+      pcSlice->setDiscardableFlag           ( false );
+    }
+
+    const TComVPS*           vps = pcSlice->getVPS();
 #if NH_3D
-    Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() ); 
+    Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() );
 #else
-    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() ); 
+    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
 #endif
 #if NH_3D
-    pcSlice->setIvPicLists( m_ivPicLists );         
+    pcSlice->setIvPicLists( m_ivPicLists );
 
     Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
-    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );     
+    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );
 #else
-    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
-#endif
-
-
-    
-    Bool interLayerPredLayerIdcPresentFlag = false; 
+    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );
+#endif
+
+
+
+    Bool interLayerPredLayerIdcPresentFlag = false;
     if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
-    {         
-      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
+    {
+      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );
       if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
       {
         if ( !vps->getMaxOneActiveRefLayerFlag() )
-        {    
-          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 
+        {
+          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
         }
 #if NH_3D
@@ -1394,9 +1400,9 @@
         if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
 #endif
-        {        
-          interLayerPredLayerIdcPresentFlag = true; 
+        {
+          interLayerPredLayerIdcPresentFlag = true;
           for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
           {
-            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 
+            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
           }
         }
@@ -1405,5 +1411,5 @@
     if ( !interLayerPredLayerIdcPresentFlag )
     {
-      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
+      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )
       {
         pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) );
@@ -1412,13 +1418,13 @@
 
 
-    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 
-    
+    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
+
 #if NH_3D
     if ( m_pcEncTop->decProcAnnexI() )
-    {    
-      pcSlice->deriveInCmpPredAndCpAvailFlag( ); 
+    {
+      pcSlice->deriveInCmpPredAndCpAvailFlag( );
       if ( pcSlice->getInCmpPredAvailFlag() )
-      {      
-        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 
+      {
+        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );
       }
       else
@@ -1434,11 +1440,11 @@
             printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
           }
-          
+
           exit(EXIT_FAILURE);
         }
       }
-      pcSlice->init3dToolParameters(); 
-      pcSlice->checkInCompPredRefLayers(); 
-    }   
+      pcSlice->init3dToolParameters();
+      pcSlice->checkInCompPredRefLayers();
+    }
 #if NH_3D_IV_MERGE
     // This needs to be done after initialization of 3D tool parameters.
@@ -1447,5 +1453,5 @@
 #endif
 
-    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
+    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
     pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
@@ -1456,7 +1462,7 @@
 
     pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
-    
-
-    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );    
+
+
+    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );
 #else
     pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
@@ -1464,6 +1470,6 @@
 #endif
     //  Set reference list
-#if NH_MV    
-    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 
+#if NH_MV
+    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr );
 #else
     pcSlice->setRefPicList ( rcListPic );
@@ -1477,6 +1483,6 @@
 #endif
 #if NH_3D_IC
-    pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
-    pcSlice->setICEnableNum( m_aICEnableNum );         
+    pcSlice->setICEnableCandidate( m_aICEnableCandidate );
+    pcSlice->setICEnableNum( m_aICEnableNum );
 #endif
 
@@ -1485,7 +1491,7 @@
     if ( pcSlice->getSliceType() == B_SLICE )
     {
-      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
-      { 
-        pcSlice->setSliceType( P_SLICE ); 
+      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
+      {
+        pcSlice->setSliceType( P_SLICE );
       }
     }
@@ -1566,8 +1572,8 @@
 
 #if NH_3D_VSO
-  // Should be moved to TEncTop !!! 
+  // Should be moved to TEncTop !!!
   Bool bUseVSO = m_pcEncTop->getUseVSO();
-  
-  TComRdCost* pcRdCost = m_pcEncTop->getRdCost();   
+
+  TComRdCost* pcRdCost = m_pcEncTop->getRdCost();
 
   pcRdCost->setUseVSO( bUseVSO );
@@ -1725,5 +1731,5 @@
 #endif
 #if NH_3D
-      pcSlice->setDepthToDisparityLUTs(); 
+      pcSlice->setDepthToDisparityLUTs();
 
 #endif
@@ -1835,4 +1841,8 @@
     xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice);
 
+#if NH_MV_SEI
+    m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice );
+#endif
+
     /* use the main bitstream buffer for storing the marshalled picture */
     m_pcEntropyCoder->setBitstream(NULL);
@@ -1980,5 +1990,5 @@
     cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled());
 #if NH_3D
-      pcPic->compressMotion(2); 
+      pcPic->compressMotion(2);
 #else
     pcPic->compressMotion();
@@ -2055,7 +2065,7 @@
     pcPic->setReconMark   ( true );
 #if NH_MV
-      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );  
-      std::vector<Int> temp; 
-      TComSlice::markCurrPic( pcPic ); 
+      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
+      std::vector<Int> temp;
+      TComSlice::markCurrPic( pcPic );
 #endif
     m_bFirst = false;
@@ -2094,5 +2104,5 @@
   //-- all
 #if NH_MV
-  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );   
+  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );
 #else
   printf( "\n\nSUMMARY --------------------------------------------------------\n" );
@@ -2402,6 +2412,6 @@
 #if H_3D_VSO_SYNTH_DIST_OUT
 }
-#endif 
-#endif  
+#endif
+#endif
   /* calculate the size of the access unit, excluding:
    *  - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
@@ -2526,5 +2536,5 @@
 
 #if  NH_MV
-  assert( 0 ); // Field coding and MV need to be aligned. 
+  assert( 0 ); // Field coding and MV need to be aligned.
 #else
 
@@ -2969,21 +2979,21 @@
 #if NH_MV
 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid )
-{ 
-  
+{
+
   if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
   {
     return;
   }
-  
+
   GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid );
-  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 
-
-  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList();  
-
-  // GT: check if SliceType should be checked here. 
+  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
+
+  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList();
+
+  // GT: check if SliceType should be checked here.
   for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
   {
-    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 
-            
+    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 );
+
     Int finalIdxToTempIdxMap[16];
     for( Int k = 0; k < 16; k++ )
@@ -2999,38 +3009,38 @@
         // get position in temp. list
         Int refPicLayerId = pcSlice->getRefPicLayerId(k);
-        Int idxInTempList = 0; 
+        Int idxInTempList = 0;
         for (; idxInTempList < numPicsInTempList; idxInTempList++)
         {
           if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId )
           {
-            break; 
+            break;
           }
         }
 
         Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ];
-        
-        // Add negative from behind 
-        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 
-        
+
+        // Add negative from behind
+        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList;
+
         Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ;
         if ( curIsModified )
         {
-          isModified = true; 
+          isModified = true;
           assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
         }
-        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;              
+        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;
       }
     }
 
     TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
-    refPicListModification->setRefPicListModificationFlagL( li, isModified );  
+    refPicListModification->setRefPicListModificationFlagL( li, isModified );
 
     if( isModified )
     {
       Int refIdx = 0;
-      
+
       for( Int i = 0; i < numPicsInFinalRefList; i++ )
       {
-        if( finalIdxToTempIdxMap[i] >= 0 ) 
+        if( finalIdxToTempIdxMap[i] >= 0 )
         {
           refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] );
@@ -3042,5 +3052,5 @@
           while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId())  )
           {
-            refIdx++; 
+            refIdx++;
           }
           refPicListModification->setRefPicSetIdxL( li, i, refIdx );
Index: /trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h
===================================================================
--- /trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1355)
+++ /trunk/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1356)
@@ -87,6 +87,6 @@
                                 );
 
-  std::vector<Int>* getSynthViews() { return &m_aiAllSynthViewNums;  }
-  std::vector<Int>* getBaseViews()  { return &m_aiAllBaseViewIdx;    }
+  IntAry1d*  getSynthViews() { return &m_aiAllSynthViewNums;  }
+  IntAry1d*  getBaseViews()  { return &m_aiAllBaseViewIdx;    }
 
   TRenModSetupStrParser();
@@ -95,15 +95,15 @@
 
 private:
-  std::vector< std::vector<Int > > m_aaaiBaseViewsIdx  [2];
-  std::vector< std::vector<Int > > m_aaaiVideoDistMode [2];
-  std::vector< std::vector<Int > > m_aaaiDepthDistMode [2];
-  std::vector< std::vector<Int > > m_aaaiModelNums     [2];
-  std::vector< std::vector<Int > > m_aaaiSynthViewNums [2];
-  std::vector< std::vector<Bool> > m_aaabOrgRef        [2];
-  std::vector< std::vector<Bool> > m_aaabExtrapolate   [2];
-  std::vector< std::vector<Int > > m_aaaiBlendMode     [2];
+  IntAry2d                         m_aaaiBaseViewsIdx  [2];
+  IntAry2d                         m_aaaiVideoDistMode [2];
+  IntAry2d                         m_aaaiDepthDistMode [2];
+  IntAry2d                         m_aaaiModelNums     [2];
+  IntAry2d                         m_aaaiSynthViewNums [2];
+  BoolAry2d                        m_aaabOrgRef        [2];
+  BoolAry2d                        m_aaabExtrapolate   [2];
+  IntAry2d                         m_aaaiBlendMode     [2];
 
-  std::vector<Int>                 m_aiAllBaseViewIdx;
-  std::vector<Int>                 m_aiAllSynthViewNums;
+  IntAry1d                         m_aiAllBaseViewIdx;
+  IntAry1d                         m_aiAllSynthViewNums;
 
   Bool                             m_bCurrentViewSet;
