Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/NonCTC/delta_aux_3view.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/NonCTC/delta_aux_3view.cfg	(revision 1373)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/NonCTC/delta_aux_3view.cfg	(revision 1373)
@@ -0,0 +1,158 @@
+#======== Legend for comments ===================== 
+# (m) specification per layer/dimension/layerset possible
+# (c) cyclic repetition of values, if not given for all layers/dimensions/layersets. (e.g. 5 layers and 1 2 3 -> 1 2 3 1 2  )
+
+
+NumberOfLayers         : 6       
+
+#======== VPS ============================
+ScalabilityMask        : 10        # Scalability Mask             ( Scalability Mask: 2: Multiview, 8: Auxiliary, 10: Multiview + Auxiliary )
+DimensionIdLen         : 4 4       #  Number of bits to store Ids,  per scalability dimension, (m)
+ViewOrderIndex         : 0 0 1 1 2 2    #  # ViewOrderIndex, per layer (m)
+AuxId                  : 0 2 0 2 0 2 # Auxiliary Id, per layer (m), ( 0: none, 1: Alpha, 2: Depth )
+LayerIdInNuh           : 0 1 2 3 4 5   #  Layer Id in NAL unit header, (0: no explicit signalling, otherwise per layer ) (m)
+
+#======== VPS/ Layer sets ================
+VpsNumLayerSets        : 2           #  Number of layer sets    
+LayerIdsInSet_0        : 0           #  Indices in VPS of layers in layer set 0  (here: LS 0)
+LayerIdsInSet_1        : 0 2 4       #  Indices in VPS of layers in layer set 1  (here: LS 1)
+
+NumAddLayerSets        : 2           #  Additional layer sets for independent decodable non-base layer
+HighestLayerIdxPlus1_0 : -1 1        # Highest layer idx plus 1 for the 0-th additional layer set, per independent layer (m) (first value will be ignored) (here: LS 2)
+HighestLayerIdxPlus1_1 : -1 3        # Highest layer idx plus 1 for the 1-th additional layer set, per independent layer (m) (first value will be ignored) (here: LS 3)
+
+#======== VPS / Output layer sets ================
+OutputLayerSetIdx           : 1 1 1 1 1 3 3 3 3 3 3 #  Indices of layer sets used to derive additional output layer sets
+
+# TREE 0 (LS Idx (1))
+LayerIdsInAddOutputLayerSet_0 : 0 2     #  Indices in VPS of output layers in additional output layer set 0   (here: OLS 4)
+LayerIdsInAddOutputLayerSet_1 : 0 4     #  Indices in VPS of output layers in additional output layer set 1   (here: OLS 5)
+LayerIdsInAddOutputLayerSet_2 : 2 4     #  Indices in VPS of output layers in additional output layer set 2   (here: OLS 6)
+LayerIdsInAddOutputLayerSet_3 : 2       #  Indices in VPS of output layers in additional output layer set 3   (here: OLS 7)
+LayerIdsInAddOutputLayerSet_4 : 4       #  Indices in VPS of output layers in additional output layer set 4   (here: OLS 8)
+                                                                                                              
+# TREE 1 (additional LS  (3))                                                                                          
+LayerIdsInAddOutputLayerSet_5 : 1        #  Indices in VPS of output layers in additional output layer set 5  (here: OLS 9)
+LayerIdsInAddOutputLayerSet_6 : 1 3      #  Indices in VPS of output layers in additional output layer set 6  (here: OLS 10)
+LayerIdsInAddOutputLayerSet_7 : 1 5      #  Indices in VPS of output layers in additional output layer set 7  (here: OLS 11)
+LayerIdsInAddOutputLayerSet_8 : 3 5      #  Indices in VPS of output layers in additional output layer set 8  (here: OLS 12)
+LayerIdsInAddOutputLayerSet_9 : 3        #  Indices in VPS of output layers in additional output layer set 9  (here: OLS 13)
+LayerIdsInAddOutputLayerSet_10: 5        #  Indices in VPS of output layers in additional output layer set 10 (here: OLS 14)
+
+
+#======== VPS / PTLI ================
+
+Profile                       : main main multiview-main main  # Profile indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+Level                         : none none none           none  # Level   indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+Tier                          : main main main           main  # Tier    indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+InblFlag                      : 0    0    0              1     # Inbl    indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+
+# For OLS corresponding to layer set
+ProfileTierLevelIdx_0         : 1                          # VpsProfileTierLevel indices of layers in output layer set 0 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_1         : 1  2  2                    # VpsProfileTierLevel indices of layers in output layer set 1 (m) (should be -1, when layer is not necessary)
+# For OLS corresponding to additional layer sets 
+ProfileTierLevelIdx_2         : 3                          # VpsProfileTierLevel indices of layers in output layer set 2 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_3         : 1  2  2                    # VpsProfileTierLevel indices of layers in output layer set 3 (m) (should be -1, when layer is not necessary)
+# For additional OLS
+ProfileTierLevelIdx_4         : 1  2 -1                    # VpsProfileTierLevel indices of layers in output layer set 4 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_5         : 1 -1  2                    # VpsProfileTierLevel indices of layers in output layer set 5 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_6         : 1  2  2                    # VpsProfileTierLevel indices of layers in output layer set 6 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_7         : 1  2 -1                    # VpsProfileTierLevel indices of layers in output layer set 7 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_8         : 1 -1  2                    # VpsProfileTierLevel indices of layers in output layer set 8 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_9         : 1 -1 -1                    # VpsProfileTierLevel indices of layers in output layer set 9 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_10        : 1  2 -1                    # VpsProfileTierLevel indices of layers in output layer set 10 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_11        : 1 -1  2                    # VpsProfileTierLevel indices of layers in output layer set 11 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_12        : 1  2  2                    # VpsProfileTierLevel indices of layers in output layer set 12 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_13        : 1  2 -1                    # VpsProfileTierLevel indices of layers in output layer set 13 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_14        : 1 -1  2                    # VpsProfileTierLevel indices of layers in output layer set 14 (m) (should be -1, when layer is not necessary)
+
+
+#======== VPS / Dependencies ================
+DirectRefLayers_1      :          #  Indices in VPS of direct reference layers 
+DirectRefLayers_2      : 0        #  Indices in VPS of direct reference layers 
+DirectRefLayers_3      : 1        #  Indices in VPS of direct reference layers 
+DirectRefLayers_4      : 0        #  Indices in VPS of direct reference layers 
+DirectRefLayers_5      : 1        #  Indices in VPS of direct reference layers 
+
+DependencyTypes_1      :          #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_2      : 2        #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_3      : 2        #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_4      : 2        #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_5      : 2        #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+
+
+#======== Coding Structure =============
+
+#                           QPfactor      betaOffsetDiv2   #ref_pics_active  reference pictures     deltaRPS     reference idcs          ilPredLayerIdc       refLayerPicPosIl_L1
+#         Type  POC QPoffset     tcOffsetDiv2      temporal_id      #ref_pics                 predict     #ref_idcs        #ActiveRefLayerPics     refLayerPicPosIl_L0   
+Frame1:     B    8     1     0.442    0        0        0        4      4     -8 -10 -12 -16     0      0
+Frame2:     B    4     2     0.3536   0        0        0        2      3     -4 -6  4           1      4    5     1 1 0 0 1       0
+Frame3:     B    2     3     0.3536   0        0        0        2      4     -2 -4  2 6         1      2    4     1 1 1 1         0
+Frame4:     B    1     4     0.68     0        0        0        2      4     -1  1  3 7         1      1    5     1 0 1 1 1       0
+Frame5:     B    3     4     0.68     0        0        0        2      4     -1 -3  1 5         1     -2    5     1 1 1 1 0       0
+Frame6:     B    6     3     0.3536   0        0        0        2      4     -2 -4 -6 2         1     -3    5     1 1 1 1 0       0
+Frame7:     B    5     4     0.68     0        0        0        2      4     -1 -5  1 3         1      1    5     1 0 1 1 1       0
+Frame8:     B    7     4     0.68     0        0        0        2      4     -1 -3 -7 1         1     -2    5     1 1 1 1 0       0
+    
+FrameI_l1:  I    0     0     0.442    0        0        0        0      0                        0                                 0             
+Frame1_l1:  B    8     1     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 0             
+Frame2_l1:  B    4     2     0.3536   0        0        0        2      3     -4 -6  4           1      4    5     1 1 0 0 1       0             
+Frame3_l1:  B    2     3     0.3536   0        0        0        2      4     -2 -4  2 6         1      2    4     1 1 1 1         0             
+Frame4_l1:  B    1     4     0.68     0        0        0        2      4     -1  1  3 7         1      1    5     1 0 1 1 1       0             
+Frame5_l1:  B    3     4     0.68     0        0        0        2      4     -1 -3  1 5         1     -2    5     1 1 1 1 0       0             
+Frame6_l1:  B    6     3     0.3536   0        0        0        2      4     -2 -4 -6 2         1     -3    5     1 1 1 1 0       0             
+Frame7_l1:  B    5     4     0.68     0        0        0        2      4     -1 -5  1 3         1      1    5     1 0 1 1 1       0             
+Frame8_l1:  B    7     4     0.68     0        0        0        2      4     -1 -3 -7 1         1     -2    5     1 1 1 1 0       0             
+
+FrameI_l2:  P    0     3     0.442    0        0        0        1      0                        0                                 1            0         0          -1    
+Frame1_l2:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 1            0         1          -1    
+Frame2_l2:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       1            0         1          -1    
+Frame3_l2:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         1            0         1          -1    
+Frame4_l2:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       1            0         1          -1    
+Frame5_l2:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       1            0         2          -1    
+Frame6_l2:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       1            0         2          -1    
+Frame7_l2:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       1            0         2          -1    
+Frame8_l2:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       1            0         2          -1    
+
+FrameI_l3:  P    0     3     0.442    0        0        0        1      0                        0                                 1            0         0          -1    
+Frame1_l3:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 1            0         1          -1    
+Frame2_l3:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       1            0         1          -1    
+Frame3_l3:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         1            0         1          -1    
+Frame4_l3:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       1            0         1          -1    
+Frame5_l3:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       1            0         2          -1    
+Frame6_l3:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       1            0         2          -1    
+Frame7_l3:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       1            0         2          -1    
+Frame8_l3:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       1            0         2          -1    
+
+FrameI_l4:  P    0     3     0.442    0        0        0        1      0                        0                                 1            0         0          -1    
+Frame1_l4:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 1            0         1          -1    
+Frame2_l4:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       1            0         1          -1    
+Frame3_l4:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         1            0         1          -1    
+Frame4_l4:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       1            0         1          -1    
+Frame5_l4:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       1            0         2          -1    
+Frame6_l4:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       1            0         2          -1    
+Frame7_l4:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       1            0         2          -1    
+Frame8_l4:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       1            0         2          -1    
+
+FrameI_l5:  P    0     3     0.442    0        0        0        1      0                        0                                 1            0         0          -1    
+Frame1_l5:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 1            0         1          -1    
+Frame2_l5:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       1            0         1          -1    
+Frame3_l5:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         1            0         1          -1    
+Frame4_l5:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       1            0         1          -1    
+Frame5_l5:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       1            0         2          -1    
+Frame6_l5:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       1            0         2          -1    
+Frame7_l5:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       1            0         2          -1    
+Frame8_l5:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       1            0         2          -1    
+
+LoopFilterDisable             : 0 1         # Disable deblocking filter (0=Filter, 1=No Filter) (mc)
+SAO                           : 1 0         # Sample adaptive offset  (0: OFF, 1: ON) (mc)
+
+#========== view synthesis optimization (VSO) ==========
+VSO                       : 1                          # use of view synthesis optimization for depth coding
+VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
+#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string for FCO = 1
+WVSO                      : 1                                    # use of WVSO (Depth distortion metric with a weighted depth fidelity term) 
+VSOWeight                 : 10                                   # weight of VSO ( in SAD case, cf. squared in SSE case )
+VSDWeight                 : 1                                    # weight of VSD ( in SAD case, cf. squared in SSE case )
+DWeight                   : 1                                    # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
+UseEstimatedVSD           : 1                                    # Model based VSD estimation instead of rendering based for some encoder decisions      
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/NonCTC/delta_aux_3view_simu.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/NonCTC/delta_aux_3view_simu.cfg	(revision 1373)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/NonCTC/delta_aux_3view_simu.cfg	(revision 1373)
@@ -0,0 +1,154 @@
+#======== Legend for comments ===================== 
+# (m) specification per layer/dimension/layerset possible
+# (c) cyclic repetition of values, if not given for all layers/dimensions/layersets. (e.g. 5 layers and 1 2 3 -> 1 2 3 1 2  )
+
+
+NumberOfLayers         : 6       
+
+#======== VPS ============================
+ScalabilityMask        : 10        # Scalability Mask             ( Scalability Mask: 2: Multiview, 8: Auxiliary, 10: Multiview + Auxiliary )
+DimensionIdLen         : 4 4       #  Number of bits to store Ids,  per scalability dimension, (m)
+ViewOrderIndex         : 0 0 1 1 2 2    #  # ViewOrderIndex, per layer (m)
+AuxId                  : 0 2 0 2 0 2 # Auxiliary Id, per layer (m), ( 0: none, 1: Alpha, 2: Depth )
+LayerIdInNuh           : 0 1 2 3 4 5   #  Layer Id in NAL unit header, (0: no explicit signalling, otherwise per layer ) (m)
+
+#======== VPS/ Layer sets ================
+VpsNumLayerSets        : 1           #  Number of layer sets    
+LayerIdsInSet_0        : 0           #  Indices in VPS of layers in layer set 0  (here: LS 0)
+LayerIdsInSet_1        :             #  Indices in VPS of layers in layer set 1  (here: LS 1)
+LayerIdsInSet_2        :             #  Indices in VPS of layers in layer set 1  (here: LS 1)
+LayerIdsInSet_3        :             #  Indices in VPS of layers in layer set 1  (here: LS 1)
+
+NumAddLayerSets        : 5                             #  Additional layer sets for independent decodable non-base layer
+HighestLayerIdxPlus1_0 : -1 1 0 0 0 0                  # Highest layer idx plus 1 for the 0-th additional layer set, per independent layer (m) (first value will be ignored) (here: LS 1)
+HighestLayerIdxPlus1_1 : -1 0 1 0 0 0                  # Highest layer idx plus 1 for the 1-th additional layer set, per independent layer (m) (first value will be ignored) (here: LS 2)
+HighestLayerIdxPlus1_2 : -1 0 0 1 0 0                  # Highest layer idx plus 1 for the 1-th additional layer set, per independent layer (m) (first value will be ignored) (here: LS 3)
+HighestLayerIdxPlus1_3 : -1 0 0 0 1 0                  # Highest layer idx plus 1 for the 1-th additional layer set, per independent layer (m) (first value will be ignored) (here: LS 4)
+HighestLayerIdxPlus1_4 : -1 0 0 0 0 1                  # Highest layer idx plus 1 for the 1-th additional layer set, per independent layer (m) (first value will be ignored) (here: LS 5)
+
+#======== VPS / Output layer sets ================
+OutputLayerSetIdx           :               #  Indices of layer sets used to derive additional output layer sets
+
+# TREE 0 (LS Idx (1))
+LayerIdsInAddOutputLayerSet_0 :         #  Indices in VPS of output layers in additional output layer set 0   (here: OLS 7)
+# TREE 1 (LS Idx (2))            
+LayerIdsInAddOutputLayerSet_1 :         #  Indices in VPS of output layers in additional output layer set 1   (here: OLS 8)
+# TREE 2 (LS Idx (4))            
+LayerIdsInAddOutputLayerSet_2 :         #  Indices in VPS of output layers in additional output layer set 2   (here: OLS 9)
+# TREE 3 (LS Idx (5))            
+LayerIdsInAddOutputLayerSet_3 :         #  Indices in VPS of output layers in additional output layer set 3   (here: OLS 10)
+# TREE 4 (LS Idx (6))            
+LayerIdsInAddOutputLayerSet_4 :         #  Indices in VPS of output layers in additional output layer set 4   (here: OLS 11)
+
+LayerIdsInAddOutputLayerSet_5 :         #  Indices in VPS of output layers in additional output layer set 4   (here: OLS 12)
+LayerIdsInAddOutputLayerSet_6 :         #  Indices in VPS of output layers in additional output layer set 4   (here: OLS 13)
+LayerIdsInAddOutputLayerSet_7 :         #  Indices in VPS of output layers in additional output layer set 4   (here: OLS 14)
+
+
+#======== VPS / PTLI ================
+
+Profile                       : main main main  # Profile indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+Level                         : none none none  # Level   indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+Tier                          : main main main  # Tier    indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+InblFlag                      : 0    0    1     # Inbl    indication in VpsProfileTierLevel, per VpsProfileTierLevel syntax structure  (m) 
+
+# For OLS corresponding to layer set
+ProfileTierLevelIdx_0         : 1                          # VpsProfileTierLevel indices of layers in output layer set 0 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_1         : 2                          # VpsProfileTierLevel indices of layers in output layer set 0 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_2         : 2                          # VpsProfileTierLevel indices of layers in output layer set 2 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_3         : 2                          # VpsProfileTierLevel indices of layers in output layer set 3 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_4         : 2                          # VpsProfileTierLevel indices of layers in output layer set 4 (m) (should be -1, when layer is not necessary)
+ProfileTierLevelIdx_5         : 2                          # VpsProfileTierLevel indices of layers in output layer set 5 (m) (should be -1, when layer is not necessary)
+
+
+#======== VPS / Dependencies ================
+DirectRefLayers_1      :         #  Indices in VPS of direct reference layers 
+DirectRefLayers_2      :         #  Indices in VPS of direct reference layers 
+DirectRefLayers_3      :         #  Indices in VPS of direct reference layers 
+DirectRefLayers_4      :         #  Indices in VPS of direct reference layers 
+DirectRefLayers_5      :         #  Indices in VPS of direct reference layers 
+
+DependencyTypes_1      :         #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_2      :         #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_3      :         #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_4      :         #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+DependencyTypes_5      :         #  Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion
+
+
+#======== Coding Structure =============
+
+#                           QPfactor      betaOffsetDiv2   #ref_pics_active  reference pictures     deltaRPS     reference idcs          ilPredLayerIdc       refLayerPicPosIl_L1
+#         Type  POC QPoffset     tcOffsetDiv2      temporal_id      #ref_pics                 predict     #ref_idcs        #ActiveRefLayerPics     refLayerPicPosIl_L0   
+Frame1:     B    8     1     0.442    0        0        0        4      4     -8 -10 -12 -16     0      0
+Frame2:     B    4     2     0.3536   0        0        0        2      3     -4 -6  4           1      4    5     1 1 0 0 1       0
+Frame3:     B    2     3     0.3536   0        0        0        2      4     -2 -4  2 6         1      2    4     1 1 1 1         0
+Frame4:     B    1     4     0.68     0        0        0        2      4     -1  1  3 7         1      1    5     1 0 1 1 1       0
+Frame5:     B    3     4     0.68     0        0        0        2      4     -1 -3  1 5         1     -2    5     1 1 1 1 0       0
+Frame6:     B    6     3     0.3536   0        0        0        2      4     -2 -4 -6 2         1     -3    5     1 1 1 1 0       0
+Frame7:     B    5     4     0.68     0        0        0        2      4     -1 -5  1 3         1      1    5     1 0 1 1 1       0
+Frame8:     B    7     4     0.68     0        0        0        2      4     -1 -3 -7 1         1     -2    5     1 1 1 1 0       0
+    
+FrameI_l1:  I    0     0     0.442    0        0        0        0      0                        0                                 0             
+Frame1_l1:  B    8     1     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 0             
+Frame2_l1:  B    4     2     0.3536   0        0        0        2      3     -4 -6  4           1      4    5     1 1 0 0 1       0             
+Frame3_l1:  B    2     3     0.3536   0        0        0        2      4     -2 -4  2 6         1      2    4     1 1 1 1         0             
+Frame4_l1:  B    1     4     0.68     0        0        0        2      4     -1  1  3 7         1      1    5     1 0 1 1 1       0             
+Frame5_l1:  B    3     4     0.68     0        0        0        2      4     -1 -3  1 5         1     -2    5     1 1 1 1 0       0             
+Frame6_l1:  B    6     3     0.3536   0        0        0        2      4     -2 -4 -6 2         1     -3    5     1 1 1 1 0       0             
+Frame7_l1:  B    5     4     0.68     0        0        0        2      4     -1 -5  1 3         1      1    5     1 0 1 1 1       0             
+Frame8_l1:  B    7     4     0.68     0        0        0        2      4     -1 -3 -7 1         1     -2    5     1 1 1 1 0       0             
+
+FrameI_l2:  I    0     3     0.442    0        0        0        1      0                        0                                 0            
+Frame1_l2:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 0            
+Frame2_l2:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       0            
+Frame3_l2:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         0            
+Frame4_l2:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       0            
+Frame5_l2:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       0            
+Frame6_l2:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       0            
+Frame7_l2:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       0            
+Frame8_l2:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       0            
+
+FrameI_l3:  I    0     3     0.442    0        0        0        1      0                        0                                 0            
+Frame1_l3:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 0            
+Frame2_l3:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       0            
+Frame3_l3:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         0            
+Frame4_l3:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       0            
+Frame5_l3:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       0            
+Frame6_l3:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       0            
+Frame7_l3:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       0            
+Frame8_l3:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       0            
+
+FrameI_l4:  I    0     3     0.442    0        0        0        1      0                        0                                 0            
+Frame1_l4:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 0            
+Frame2_l4:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       0            
+Frame3_l4:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         0            
+Frame4_l4:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       0            
+Frame5_l4:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       0            
+Frame6_l4:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       0            
+Frame7_l4:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       0            
+Frame8_l4:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       0            
+
+FrameI_l5:  I    0     3     0.442    0        0        0        1      0                        0                                 0            
+Frame1_l5:  B    8     4     0.442    0        0        0        4      4     -8 -10 -12 -16     0                                 0            
+Frame2_l5:  B    4     5     0.3536   0        0        0        3      3     -4 -6  4           1     4     5     1 1 0 0 1       0            
+Frame3_l5:  B    2     6     0.3536   0        0        0        3      4     -2 -4  2 6         1     2     4     1 1 1 1         0            
+Frame4_l5:  B    1     7     0.68     0        0        0        3      4     -1  1  3 7         1     1     5     1 0 1 1 1       0            
+Frame5_l5:  B    3     7     0.68     0        0        0        3      4     -1 -3  1 5         1    -2     5     1 1 1 1 0       0            
+Frame6_l5:  B    6     6     0.3536   0        0        0        3      4     -2 -4 -6 2         1    -3     5     1 1 1 1 0       0            
+Frame7_l5:  B    5     7     0.68     0        0        0        3      4     -1 -5  1 3         1     1     5     1 0 1 1 1       0            
+Frame8_l5:  B    7     7     0.68     0        0        0        3      4     -1 -3 -7 1         1    -2     5     1 1 1 1 0       0            
+
+
+LoopFilterDisable             : 0 1         # Disable deblocking filter (0=Filter, 1=No Filter) (mc)
+SAO                           : 1 0         # Sample adaptive offset  (0: OFF, 1: ON) (mc)
+
+
+#========== view synthesis optimization (VSO) ==========
+VSO                       : 1                          # use of view synthesis optimization for depth coding
+VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
+#VSOConfig                 : [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string for FCO = 1
+WVSO                      : 1                                    # use of WVSO (Depth distortion metric with a weighted depth fidelity term) 
+VSOWeight                 : 10                                   # weight of VSO ( in SAD case, cf. squared in SSE case )
+VSDWeight                 : 1                                    # weight of VSD ( in SAD case, cf. squared in SSE case )
+DWeight                   : 1                                    # weight of depth distortion itself ( in SAD case, cf. squared in SSE case )
+UseEstimatedVSD           : 1                                    # Model based VSD estimation instead of rendering based for some encoder decisions      
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Balloons.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Balloons.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Balloons.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 30                                     # frame rate in frames per second
 FramesToBeEncoded         : 300                                    # number of frames to be coded
-#BaseViewCameraNumbers     : 3 1 5                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers     : 3 1 5                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_GhostTownFly.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_GhostTownFly.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_GhostTownFly.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 25                                     # frame rate in frames per second
 FramesToBeEncoded         : 250                                    # number of frames to be coded
-#BaseViewCameraNumbers     : 5 9 1                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers     : 5 9 1                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Kendo.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Kendo.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Kendo.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 30                                     # frame rate in frames per second
 FramesToBeEncoded         : 300                                    # number of frames to be coded
-#BaseViewCameraNumbers     : 3 1 5                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers     : 3 1 5                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Newspaper.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Newspaper.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Newspaper.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 30                                     # frame rate in frames per second
 FramesToBeEncoded         : 300                                    # number of frames to be coded
-#BaseViewCameraNumbers     : 4 2 6                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers     : 4 2 6                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_PoznanHall2.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_PoznanHall2.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_PoznanHall2.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 25                                     # frame rate in frames per second
 FramesToBeEncoded         : 200                                    # number of frames to be coded
-#BaseViewCameraNumbers     : 6 7 5                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers     : 6 7 5                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_PoznanStreet.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_PoznanStreet.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_PoznanStreet.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 25                                     # frame rate in frames per second
 FramesToBeEncoded         : 250                                    # number of frames to be coded
-#BaseViewCameraNumbers     : 4 5 3                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers     : 4 5 3                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Shark.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Shark.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_Shark.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 30                                     # frame rate in frames per second
 FramesToBeEncoded         : 300                                    # number of frames to be coded
-#BaseViewCameraNumbers    : 5 9 1                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers    : 5 9 1                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_UndoDancer.cfg
===================================================================
--- /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_UndoDancer.cfg	(revision 1372)
+++ /branches/HTM-15.2-dev/cfg/MV-HEVC/seqCfg_UndoDancer.cfg	(revision 1373)
@@ -5,4 +5,4 @@
 FrameRate                 : 25                                     # frame rate in frames per second
 FramesToBeEncoded         : 250                                    # number of frames to be coded
-#BaseViewCameraNumbers     : 5 1 9                                  # camera numbers of coded views (in coding order)
+BaseViewCameraNumbers     : 5 1 9                                  # camera numbers of coded views (in coding order)
 
Index: /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.cpp	(revision 1373)
@@ -90,5 +90,5 @@
   ("OutputColourSpaceConvert",  outputColourSpaceConvert,              string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false))
 #if NH_MV
-  ("TargetOptLayerSetIdx,x",    m_targetOptLayerSetIdx,                -1,         "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded.  
+  ("TargetOptLayerSetIdx,x", m_targetOptLayerSetInd, std::vector<Int>(1,-1), "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded.  
 #endif
   ("MaxTemporalLayer,t",        m_iMaxTemporalLayer,                   -1,         "Maximum Temporal Layer to be decoded. -1 to decode all layers")
Index: /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.h
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecCfg.h	(revision 1373)
@@ -81,5 +81,7 @@
   std::vector<TChar*> m_pchReconFiles;                ///< array of output reconstruction file name create from output reconstruction file name
 
-  Int           m_targetOptLayerSetIdx;               ///< target output layer set index
+  std::vector<Int> m_targetOptLayerSetInd;            ///< target output layer set indices (multiple decoding when more than one element, e.g. for additional layer sets)
+  Int           m_targetOptLayerSetIdx;               ///< current target output layer set index
+
   Int           m_targetDecLayerSetIdx;
   Int           m_baseLayerOutputFlag;
@@ -138,4 +140,7 @@
 
   Bool  parseCfg        ( Int argc, TChar* argv[] );   ///< initialize option class from configuration
+#if NH_MV
+  Int   getNumDecodings ( ) { return (Int) m_targetOptLayerSetInd.size();  }; 
+#endif
 };
 
Index: /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.cpp	(revision 1373)
@@ -152,8 +152,8 @@
  .
  */
-
 #if NH_MV
-Void TAppDecTop::decode()
-{
+Void TAppDecTop::decode( Int num )
+{
+  m_targetOptLayerSetIdx = m_targetOptLayerSetInd[ num ]; 
   // create & initialize internal classes
   xInitFileIO  ();
@@ -213,5 +213,5 @@
 
 #if !NH_MV
-Void TAppDecTop::decode()
+Void TAppDecTop::decode( )
 {
   Int                 poc;
@@ -1092,5 +1092,5 @@
     m_newVpsActivatedbyCurAu  = true; //TBD
     m_newVpsActivatedbyCurPic = true;
-#if NH_3D
+#if NH_3D_VSO
     m_dpb.setVPS( m_vps ); 
 #endif
@@ -1256,5 +1256,5 @@
   }
 
-  if ( m_printVpsInfo  && ( m_decProcCvsg == ANNEX_F ) )
+  if ( m_printVpsInfo  && ( m_decProcCvsg == ANNEX_F ) && ( m_targetOptLayerSetIdx == m_targetOptLayerSetInd[ 0 ] ) )
   {
     m_vps->printScalabilityId();
@@ -2003,5 +2003,5 @@
       // - After all slices of the current picture have been decoded, the decoding process for ending the decoding of a
       //   coded picture with nuh_layer_id greater than 0 specified in clause F.8.1.6 is invoked.
-      xF816decProcEndDecOfCodPicLIdGrtZero( );
+      xF816decProcEndDecOfCodPicLIdGrtZero( );      
     }
 
Index: /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.h
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppDecoder/TAppDecTop.h	(revision 1373)
@@ -137,9 +137,11 @@
   Void  create            (); ///< create internal members
   Void  destroy           (); ///< destroy internal members
-  Void  decode            (); ///< main decoding function
+  
 #if NH_MV
+  Void  decode            ( Int i ); ///< main decoding function
   UInt  getNumberOfChecksumErrorsDetected( ) const;
   UInt  getNumberOfChecksumErrorsDetected( Int decIdx ) const { return m_tDecTop[decIdx]->getNumberOfChecksumErrorsDetected(); }
 #else
+  Void  decode            ( ); ///< main decoding function
   UInt  getNumberOfChecksumErrorsDetected() const { return m_cTDecTop.getNumberOfChecksumErrorsDetected(); }
 #endif
Index: /branches/HTM-15.2-dev/source/App/TAppDecoder/decmain.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppDecoder/decmain.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppDecoder/decmain.cpp	(revision 1373)
@@ -51,6 +51,7 @@
 {
   Int returnCode = EXIT_SUCCESS;
+#if !NH_MV
   TAppDecTop  cTAppDecTop;
-
+#endif
   // print information
   fprintf( stdout, "\n" );
@@ -65,35 +66,61 @@
   fprintf( stdout, "\n" );
 
-  // create application decoder class
-  cTAppDecTop.create();
+#if NH_MV
+  Int numDecodings = 1; 
+  Int curDecoding  = 0; 
+  Double dResult = 0; 
+  do {
+    TAppDecTop  cTAppDecTop;
+#endif
+    // create application decoder class
+    cTAppDecTop.create();
 
-  // parse configuration
-  if(!cTAppDecTop.parseCfg( argc, argv ))
-  {
-    cTAppDecTop.destroy();
-    returnCode = EXIT_FAILURE;
-    return returnCode;
-  }
+    // parse configuration
+    if(!cTAppDecTop.parseCfg( argc, argv ))
+    {
+      cTAppDecTop.destroy();
+      returnCode = EXIT_FAILURE;
+      return returnCode;
+    }
+#if NH_MV
+    numDecodings = cTAppDecTop.getNumDecodings(); 
+#endif
 
-  // starting time
+    // starting time    
+#if !NH_MV
   Double dResult;
-  clock_t lBefore = clock();
+#endif
+    clock_t lBefore = clock();
 
-  // call decoding function
-  cTAppDecTop.decode();
+    // call decoding function
+#if NH_MV
+    cTAppDecTop.decode( curDecoding );
+#else
+    cTAppDecTop.decode();
+#endif
 
-  if (cTAppDecTop.getNumberOfChecksumErrorsDetected() != 0)
-  {
-    printf("\n\n***ERROR*** A decoding mismatch occured: signalled md5sum does not match\n");
-    returnCode = EXIT_FAILURE;
-  }
+    if (cTAppDecTop.getNumberOfChecksumErrorsDetected() != 0)
+    {
+      printf("\n\n***ERROR*** A decoding mismatch occured: signalled md5sum does not match\n");
+      returnCode = EXIT_FAILURE;
+    }
 
-  // ending time
+    // ending time
+#if NH_MV
+    dResult += (double)(clock()-lBefore) / CLOCKS_PER_SEC;
+#else
   dResult = (Double)(clock()-lBefore) / CLOCKS_PER_SEC;
   printf("\n Total Time: %12.3f sec.\n", dResult);
+#endif
 
-  // destroy application decoder class
-  cTAppDecTop.destroy();
+    // destroy application decoder class
+    cTAppDecTop.destroy();
+#if NH_MV
+    curDecoding++; 
+  } 
+  while ( curDecoding < numDecodings );
 
+  printf("\n Total Time: %12.3f sec.\n", dResult);
+#endif
   return returnCode;
 }
Index: /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1373)
@@ -177,7 +177,10 @@
     }
   }
-#endif
-
-#if NH_3D
+
+  if ( m_pchBaseViewCameraNumbers != NULL )
+  {
+    free ( m_pchBaseViewCameraNumbers ); 
+  }
+#endif
 #if NH_3D_VSO
   if (  m_pchVSOConfig != NULL)
@@ -185,13 +188,8 @@
     free (  m_pchVSOConfig );
   }
-#endif
+  
   if ( m_pchCameraParameterFile != NULL )
   {
     free ( m_pchCameraParameterFile ); 
-  }
-
-  if ( m_pchBaseViewCameraNumbers != NULL )
-  {
-    free ( m_pchBaseViewCameraNumbers ); 
   }
 #endif
@@ -818,5 +816,5 @@
   ("ViewId",                         m_viewId                      , IntAry1d(1,0),                                 "View Id per View Order Index")
   ("AuxId",                          m_auxId                       , IntAry1d(1,0),                                 "AuxId per layer")
-#if NH_3D
+#if NH_3D_VSO
   ("DepthFlag",                      m_depthFlag                   , IntAry1d(1,0),                                 "Depth Flag")
 #endif
@@ -1107,28 +1105,28 @@
 // A lot of this stuff could should actually be derived by the encoder.
   // VPS VUI
-  ("VpsVuiPresentFlag"           , m_vpsVuiPresentFlag           , false                                           , "VpsVuiPresentFlag           ")
-  ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false                                           , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
-  ("CrossLayerIrapAlignedFlag"   , m_crossLayerIrapAlignedFlag   , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
-  ("AllLayersIdrAlignedFlag"     , m_allLayersIdrAlignedFlag     , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
-  ("BitRatePresentVpsFlag"       , m_bitRatePresentVpsFlag       , false                                           , "BitRatePresentVpsFlag       ")
-  ("PicRatePresentVpsFlag"       , m_picRatePresentVpsFlag       , false                                           , "PicRatePresentVpsFlag       ")
-  ("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                   , 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            ")
+  ("VpsVuiPresentFlag"            , m_vpsVuiPresentFlag            , false                                , "VpsVuiPresentFlag           ")
+  ("CrossLayerPicTypeAlignedFlag" , m_crossLayerPicTypeAlignedFlag , false                                , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
+  ("CrossLayerIrapAlignedFlag"    , m_crossLayerIrapAlignedFlag    , false                                , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
+  ("AllLayersIdrAlignedFlag"      , m_allLayersIdrAlignedFlag      , false                                , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
+  ("BitRatePresentVpsFlag"        , m_bitRatePresentVpsFlag        , false                                , "BitRatePresentVpsFlag       ")
+  ("PicRatePresentVpsFlag"        , m_picRatePresentVpsFlag        , false                                , "PicRatePresentVpsFlag       ")
+  ("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                   , 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               ")
-  ("LoopFilterNotAcrossTilesFlag" , m_loopFilterNotAcrossTilesFlag , BoolAry1d(1,false)                  , "LoopFilterNotAcrossTilesFlag ")
-  ("WppNotInUseFlag"              , m_wppNotInUseFlag              , true                                          , "WppNotInUseFlag              ")
-  ("WppInUseFlag"                 , m_wppInUseFlag                 , BoolAry1d(1,0)                      , "WppInUseFlag                 ")
-  ("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 , 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  , 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  ")
+  ("LoopFilterNotAcrossTilesFlag" , m_loopFilterNotAcrossTilesFlag , BoolAry1d(1,false)                   , "LoopFilterNotAcrossTilesFlag ")
+  ("WppNotInUseFlag"              , m_wppNotInUseFlag              , true                                 , "WppNotInUseFlag              ")
+  ("WppInUseFlag"                 , m_wppInUseFlag                 , BoolAry1d(1,0)                       , "WppInUseFlag                 ")
+  ("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 , 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  , 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  ")
 #endif
 
@@ -1290,13 +1288,15 @@
 #endif
   ("OutputVpsInfo",                                   m_outputVpsInfo,                false                     ,"Output information about the layer dependencies and layer sets")
+
+/* Camera parameters */    
+  ("BaseViewCameraNumbers",                           m_pchBaseViewCameraNumbers,   (TChar *) 0                 , "Numbers of base views")
 #endif
 #if NH_3D
-/* Camera parameters */  
   ("Depth420OutputFlag",                              m_depth420OutputFlag,           true                     , "Output depth layers in 4:2:0 ") 
+#endif
+#if NH_3D_VSO  
   ("CameraParameterFile,cpf",                         m_pchCameraParameterFile,    (TChar *) 0                 , "Camera Parameter File Name")
-  ("BaseViewCameraNumbers",                           m_pchBaseViewCameraNumbers,  (TChar *) 0                 , "Numbers of base views")
   ("CodedCamParsPrecision",                           m_iCodedCamParPrecision,      STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" )
 
-#if NH_3D_VSO
   /* View Synthesis Optimization */
   ("VSOConfig",                                       m_pchVSOConfig            , (TChar *) 0                   ,"VSO configuration")
@@ -1317,5 +1317,9 @@
 #endif //HHI_VSO
 /* 3D- HEVC Tools */                                                            
+#if NH_3D_QTL
   ("QTL"                   ,                          m_bUseQTL                 , true                          , "Use depth quad tree limitation (encoder only)" )
+#endif
+#if NH_3D
+
   ("IvMvPredFlag"          ,                          m_ivMvPredFlag            , BoolAry1d(2,true)             , "Inter-view motion prediction"              )
   ("IvMvScalingFlag"       ,                          m_ivMvScalingFlag         , BoolAry1d(2,true)             , "Inter-view motion vector scaling"          )
@@ -1813,5 +1817,5 @@
   xResizeVector( m_auxId );
 
-#if NH_3D
+#if NH_3D_VSO
   xResizeVector( m_depthFlag ); 
 #endif
@@ -2022,5 +2026,5 @@
   }
 
-#if NH_3D
+
 #if NH_3D_VSO
   // Table base optimization 
@@ -2039,5 +2043,5 @@
     for (Int layer = 0; layer < m_numberOfLayers; layer++ )
     {
-      if ( m_depthFlag[ layer ])
+      if ( m_depthFlag[ layer ]  || m_auxId[ layer ] == 2 )
       {
         firstDepthLayer = layer;
@@ -2076,4 +2080,5 @@
       LOG2_DISP_PREC_LUT );
   }
+#if NH_3D
   else
   {
@@ -2089,17 +2094,6 @@
       LOG2_DISP_PREC_LUT );
   }
-#else
-  m_cCameraData     .init     ( ((UInt) m_iNumberOfViews ), 
-    m_internalBitDepth[ CHANNEL_TYPE_LUMA],
-    (UInt) m_iCodedCamParPrecision,
-    m_FrameSkip,
-    (UInt) m_framesToBeEncoded,
-    m_pchCameraParameterFile,
-    m_pchBaseViewCameraNumbers,
-    NULL,
-    NULL,
-    LOG2_DISP_PREC_LUT );
-#endif
   m_cCameraData.check( false, true );
+#endif
 #endif
 
@@ -2286,5 +2280,5 @@
 #endif
 
-#if NH_3D
+#if NH_3D_VSO
   if ( m_scalabilityMask & ( 1 << DEPTH_ID ) )
   {
@@ -2645,10 +2639,9 @@
   }
 
-#if NH_3D
+#if NH_3D_VSO
   xConfirmPara( m_pchCameraParameterFile    == 0                ,   "CameraParameterFile must be given");
   xConfirmPara( m_pchBaseViewCameraNumbers  == 0                ,   "BaseViewCameraNumbers must be given" );
   xConfirmPara( m_iNumberOfViews != m_cCameraData.getBaseViewNumbers().size() ,   "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" );
   xConfirmPara    ( m_iCodedCamParPrecision < 0 || m_iCodedCamParPrecision > 5,       "CodedCamParsPrecision must be in range of 0..5" );
-#if NH_3D_VSO
     if( m_bUseVSO )
     {
@@ -2656,5 +2649,4 @@
       xConfirmPara( m_uiVSOMode > 4 ,                                                "VSO Mode must be less than 5");
     }
-#endif
 #endif
   // max CU width and height should be power of 2
@@ -3430,5 +3422,5 @@
   xPrintParaVector( "AuxId", m_auxId );
 #endif
-#if NH_3D
+#if NH_3D_VSO
   xPrintParaVector( "DepthLayerFlag", m_depthFlag ); 
   printf("Coded Camera Param. Precision     : %d\n", m_iCodedCamParPrecision);  
@@ -3632,8 +3624,7 @@
 
   printf("Max Num Merge Candidates          : %d\n", m_maxNumMergeCand);
-#if NH_3D
+#if NH_3D_VSO
   printf("BaseViewCameraNumbers             : %s\n", m_pchBaseViewCameraNumbers ); 
   printf("Coded Camera Param. Precision     : %d\n", m_iCodedCamParPrecision);
-#if NH_3D_VSO
   printf("Force use of Lambda Scale         : %d\n", m_bForceLambdaScaleVSO );
 
@@ -3653,5 +3644,4 @@
   }
 #endif //HHI_VSO
-#endif //NH_3D
   printf("\n");
 #if NH_MV
@@ -3720,6 +3710,8 @@
   printf("WVSO:%d ", m_bUseWVSO );  
 #endif
+#if NH_3D_QTL
+  printf( "QTL:%d "                  , m_bUseQTL);
+#endif
 #if NH_3D
-  printf( "QTL:%d "                  , m_bUseQTL);
   printf( "IlluCompEnable:%d "       , m_abUseIC);
   printf( "IlluCompLowLatencyEnc:%d ",  m_bUseLowLatencyICEnc);
Index: /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1373)
@@ -80,5 +80,5 @@
   IntAry1d               m_viewOrderIndex;                    ///< view order index  
   IntAry1d               m_auxId;                             ///< auxiliary id
-#if NH_3D
+#if NH_3D_VSO
   IntAry1d               m_depthFlag;                         ///< depth flag
 #endif
@@ -533,14 +533,16 @@
 #endif
   Bool              m_outputVpsInfo;
-#endif
+  TChar*            m_pchBaseViewCameraNumbers;
+#endif
+
 #if NH_3D
   // Output Format
   Bool      m_depth420OutputFlag;                             ///< Output depth layers in 4:2:0 format
-  // Camera parameters
+#endif
+    // Camera parameters
+#if NH_3D_VSO
   TChar*    m_pchCameraParameterFile;                         ///< camera parameter file
-  TChar*    m_pchBaseViewCameraNumbers;
   TAppComCamPara m_cCameraData;
   Int       m_iCodedCamParPrecision;                          ///< precision for coding of camera parameters
-#if NH_3D_VSO
   TChar*    m_pchVSOConfig;
   Bool      m_bUseVSO;                                        ///< flag for using View Synthesis Optimization
@@ -566,7 +568,11 @@
   TRenModSetupStrParser       m_cRenModStrParser;
 #endif
-
+#if NH_3D
   Bool       m_useDLT;                                        ///< flag for using DLT
+#endif
+#if NH_3D_QTL
   Bool       m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
+#endif
+#if NH_3D
   BoolAry1d  m_ivMvPredFlag;
   BoolAry1d  m_ivMvScalingFlag;
Index: /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1373)
@@ -147,4 +147,6 @@
 #if NH_3D
   xSetCamPara              ( vps ); 
+#endif
+#if NH_3D_VSO
   m_ivPicLists.setVPS      ( &vps );
 #endif
@@ -276,27 +278,29 @@
     m_cTEncTop.setViewId                       ( vps.getViewId      (  layerId ) );
     m_cTEncTop.setViewIndex                    ( vps.getViewIndex   (  layerId ) );
-#if NH_3D
-    Bool isDepth = ( vps.getDepthId     ( layerId ) != 0 ) ;
-    m_cTEncTop.setIsDepth                      ( isDepth );
+#if NH_3D_VSO
+    Bool isDepth    = ( vps.getDepthId     ( layerId ) != 0  ) ;
+    Bool isAuxDepth = ( vps.getAuxId       ( layerId ) ==  2 ) ; // TBD: define 2 as AUX_DEPTH
+    m_cTEncTop.setIsDepth                  ( isDepth    );
+    m_cTEncTop.setIsAuxDepth               ( isAuxDepth ); 
     //====== Camera Parameters =========
     m_cTEncTop.setCameraParameters             ( &m_cCameraData );     
-#if NH_3D_VSO
     //====== VSO =========
     m_cTEncTop.setRenderModelParameters        ( &m_cRenModStrParser ); 
-    m_cTEncTop.setForceLambdaScaleVSO          ( isDepth ? m_bForceLambdaScaleVSO : false );
-    m_cTEncTop.setLambdaScaleVSO               ( isDepth ? m_dLambdaScaleVSO      : 1     );
-    m_cTEncTop.setVSOMode                      ( isDepth ? m_uiVSOMode            : 0     );
-
-    m_cTEncTop.setAllowNegDist                 ( isDepth ? m_bAllowNegDist        : false );
+    m_cTEncTop.setForceLambdaScaleVSO          ( isDepth || isAuxDepth ? m_bForceLambdaScaleVSO : false );
+    m_cTEncTop.setLambdaScaleVSO               ( isDepth || isAuxDepth ? m_dLambdaScaleVSO      : 1     );
+    m_cTEncTop.setVSOMode                      ( isDepth || isAuxDepth ? m_uiVSOMode            : 0     );
+
+    m_cTEncTop.setAllowNegDist                 ( isDepth || isAuxDepth ? m_bAllowNegDist        : false );
 
     // SAIT_VSO_EST_A0033
-    m_cTEncTop.setUseEstimatedVSD              ( isDepth ? m_bUseEstimatedVSD     : false );
+    m_cTEncTop.setUseEstimatedVSD              ( isDepth || isAuxDepth ? m_bUseEstimatedVSD     : false );
 
     // LGE_WVSO_A0119
-    m_cTEncTop.setUseWVSO                      ( isDepth ? m_bUseWVSO             : false );   
-    m_cTEncTop.setVSOWeight                    ( isDepth ? m_iVSOWeight           : 0     );
-    m_cTEncTop.setVSDWeight                    ( isDepth ? m_iVSDWeight           : 0     );
-    m_cTEncTop.setDWeight                      ( isDepth ? m_iDWeight             : 0     );
+    m_cTEncTop.setUseWVSO                      ( isDepth || isAuxDepth ? m_bUseWVSO             : false );   
+    m_cTEncTop.setVSOWeight                    ( isDepth || isAuxDepth ? m_iVSOWeight           : 0     );
+    m_cTEncTop.setVSDWeight                    ( isDepth || isAuxDepth ? m_iVSDWeight           : 0     );
+    m_cTEncTop.setDWeight                      ( isDepth || isAuxDepth ? m_iDWeight             : 0     );
 #endif // H_3D_VSO
+#if NH_3D
 #if NH_3D_IC
     m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
@@ -308,5 +312,9 @@
     m_cTEncTop.setUseSDC                       ( isDepth ? m_intraSdcFlag     : false );
     m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT   : false );
-    m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL  : false );
+#endif
+#if NH_3D_QTL
+    m_cTEncTop.setUseQTL                       ( isDepth || isAuxDepth ? m_bUseQTL  : false );
+#endif
+#if NH_3D
     m_cTEncTop.setSps3dExtension               ( m_sps3dExtension );
 #endif // NH_3D
@@ -811,5 +819,5 @@
         TEncTop* pcEncTop =  m_acTEncTopList[ layer ]; 
         Int iViewNum      = pcEncTop->getViewIndex(); 
-        Int iContent      = pcEncTop->getIsDepth() ? 1 : 0; 
+        Int iContent      = pcEncTop->getIsDepth() || pcEncTop->getIsAuxDepth() ? 1 : 0; 
         Int iNumOfModels  = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent);
 
@@ -1043,5 +1051,5 @@
     for ( Int gopId=0; gopId < gopSize; gopId++ )
     {
-#if NH_3D
+#if NH_3D_VSO
       UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
       if ( iNextPoc < m_framesToBeEncoded )
@@ -1685,5 +1693,5 @@
           if( m_depthFlag[ curLayerIdInVps ] && ( m_mpiFlag|| m_qtPredFlag || m_intraContourFlag ) ) 
           {          
-            Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false ); 
+            Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false, 0 ); 
             if ( nuhLayerIdTex == refLayerIdInNuh )
             {
@@ -1711,5 +1719,5 @@
                 for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++ )
                 {
-                  Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true ); 
+                  Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true, 0 ); 
                   if ( nuhLayerIdDep == refLayerIdInNuh )
                   {
Index: /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncTop.h
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncTop.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppEncoder/TAppEncTop.h	(revision 1373)
@@ -46,5 +46,5 @@
 #include "TLibCommon/AccessUnit.h"
 #include "TAppEncCfg.h"
-#if NH_3D
+#if NH_3D_VSO
 #include "../../Lib/TLibRenderer/TRenTop.h"
 #endif
Index: /branches/HTM-15.2-dev/source/App/TAppRenderer/RendererMain.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppRenderer/RendererMain.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppRenderer/RendererMain.cpp	(revision 1373)
@@ -35,5 +35,5 @@
 #include <time.h>
 #include "../../Lib/TLibCommon/CommonDef.h"
-#if NH_3D
+#if NH_3D_VSO
 #include "TAppRendererTop.h"
 // ====================================================================================================================
Index: /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.cpp	(revision 1373)
@@ -44,5 +44,5 @@
 #include "../../Lib/TAppCommon/program_options_lite.h"
 
-#if NH_3D
+#if NH_3D_VSO
 
 using namespace std;
Index: /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.h
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererCfg.h	(revision 1373)
@@ -47,5 +47,5 @@
 #include <vector>
 
-#if NH_3D
+#if NH_3D_VSO
 
 // ====================================================================================================================
Index: /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererTop.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererTop.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererTop.cpp	(revision 1373)
@@ -41,5 +41,5 @@
 #include "TAppRendererTop.h"
 
-#if NH_3D
+#if NH_3D_VSO
 
 // ====================================================================================================================
Index: /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererTop.h
===================================================================
--- /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererTop.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/App/TAppRenderer/TAppRendererTop.h	(revision 1373)
@@ -40,5 +40,5 @@
 #define __TAppRendererTOP__
 #include "../../Lib/TLibCommon/CommonDef.h"
-#if NH_3D
+#if NH_3D_VSO
 #include "../../Lib/TLibRenderer/TRenTop.h"
 #include "../../Lib/TLibVideoIO/TVideoIOYuv.h"
Index: /branches/HTM-15.2-dev/source/Lib/TAppCommon/TAppComCamPara.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TAppCommon/TAppComCamPara.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TAppCommon/TAppComCamPara.cpp	(revision 1373)
@@ -49,5 +49,5 @@
 #include <functional>
 #include <string>
-#if NH_3D
+#if NH_3D_VSO
 
 
@@ -194,4 +194,6 @@
 TAppComCamPara::xReadCameraParameterFile( TChar* pchCfgFileName )
 {
+  assert( pchCfgFileName != NULL );
+
   std::ifstream cCfgStream( pchCfgFileName, std::ifstream::in );
   if( !cCfgStream )
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/CommonDef.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/CommonDef.h	(revision 1373)
@@ -446,5 +446,5 @@
 #endif
 
-#if NH_3D
+#if NH_3D_VSO
 //PICYUV
 #define PICYUV_PAD         16
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPic.cpp	(revision 1373)
@@ -60,5 +60,5 @@
 , m_viewId                                (0)
 , m_bPicOutputFlag                        (false)
-#if NH_3D
+#if NH_3D_VSO
 , m_viewIndex                             (0)
 , m_isDepth                               (false)
@@ -993,14 +993,14 @@
 }
 
-#if NH_3D
-TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon )
+#if NH_3D_VSO
+TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int auxId, Int poc, Bool recon )
 {  
-  Int layerIdInNuh = m_vps->getLayerIdInNuh( viewIndex, depthFlag ); 
+  Int layerIdInNuh = m_vps->getLayerIdInNuh( viewIndex, depthFlag, auxId ); 
   return getPicYuv( layerIdInNuh, poc, recon );
 }
 
-TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int poc )
-{
-  return getPic   ( m_vps->getLayerIdInNuh( viewIndex, depthFlag ), poc );
+TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int auxId, Int poc )
+{
+  return getPic   ( m_vps->getLayerIdInNuh( viewIndex, depthFlag, auxId ), poc );
 }
 
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPic.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPic.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPic.h	(revision 1373)
@@ -154,5 +154,5 @@
   TComDecodedRps        m_decodedRps;
 #endif
-#if NH_3D
+#if NH_3D_VSO
   Int                   m_viewIndex;
   Bool                  m_isDepth;
@@ -311,5 +311,5 @@
    Void          print( Int outputLevel );
 
-#if NH_3D
+#if NH_3D_VSO
    Void          setViewIndex          ( Int viewIndex )  { m_viewIndex = viewIndex;   }
    Int           getViewIndex          () const           { return m_viewIndex;     }
@@ -404,5 +404,5 @@
   TComList<TComSubDpb*>       m_subDpbs; 
   Bool                        m_printPicOutput; 
-#if NH_3D                     
+#if NH_3D_VSO
   const TComVPS*              m_vps; 
 #endif
@@ -448,8 +448,8 @@
   Void                   print(); 
 
-#if NH_3D                                   
+#if NH_3D_VSO
   Void                   setVPS                        ( const TComVPS* vps ) { m_vps = vps;  }; 
-  TComPic*               getPic                        ( Int viewIndex, Bool depthFlag, Int poc );
-  TComPicYuv*            getPicYuv                     ( Int viewIndex, Bool depthFlag, Int poc, Bool recon );
+  TComPic*               getPic                        ( Int viewIndex, Bool depthFlag, Int auxId, Int poc );
+  TComPicYuv*            getPicYuv                     ( Int viewIndex, Bool depthFlag, Int auxId, Int poc, Bool recon );
 #endif  
 
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPicYuv.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPicYuv.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComPicYuv.h	(revision 1373)
@@ -183,8 +183,10 @@
   Bool          getBorderExtension( )     { return m_bIsBorderExtended; }
 #endif
-#if NH_3D
+#if NH_3D_VSO
   // Set Function 
   Void  setLumaTo    ( Pel pVal );  
   Void  setChromaTo  ( Pel pVal );  
+#endif
+#if NH_3D
 #if NH_3D_IV_MERGE
   // sample to block and block to sample conversion
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComRdCost.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComRdCost.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComRdCost.cpp	(revision 1373)
@@ -41,5 +41,5 @@
 #include "TComRom.h"
 #include "TComRdCost.h"
-#if NH_3D
+#if NH_3D_VSO
 #include "TComDataCU.h"
 #include "TComRectangle.h"
@@ -503,6 +503,7 @@
 
   cDtParam.bitDepth   = bitDepth;
-
+#if NH_3D
   cDtParam.bUseIC       = false;
+#endif
 #if NH_3D_SDC_INTER
   cDtParam.bUseSDCMRSAD = false;
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComRdCost.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComRdCost.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComRdCost.h	(revision 1373)
@@ -46,5 +46,5 @@
 #include "TComSlice.h"
 #include "TComRdCostWeightPrediction.h"
-#if NH_3D
+#if NH_3D_VSO
 #include "../TLibRenderer/TRenModel.h"
 #include "TComYuv.h"
@@ -57,5 +57,5 @@
 class DistParam;
 class TComPattern;
-#if NH_3D
+#if NH_3D_VSO
 class TComRdCost; 
 #endif
@@ -68,8 +68,7 @@
 typedef Distortion (*FpDistFunc) (DistParam*); // TODO: can this pointer be replaced with a reference? - there are no NULL checks on pointer.
 
-#if NH_3D
+
 #if NH_3D_VSO
 typedef Dist (TComRdCost::*FpDistFuncVSO) ( Int, Int, Pel*, Int, Pel*, Int, UInt, UInt, Bool );
-#endif
 #endif
 // ====================================================================================================================
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1373)
@@ -118,5 +118,5 @@
 , m_viewId                        (0)
 , m_viewIndex                     (0)
-#if NH_3D
+#if NH_3D_VSO
 , m_isDepth                       (false)
 #endif
@@ -2182,6 +2182,6 @@
 }
 
-#if NH_3D
-Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag ) const
+#if NH_3D_VSO
+Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag, Int auxId ) const
 {
   Int foundLayerIdinNuh = -1; 
@@ -2190,5 +2190,9 @@
   {
     Int layerIdInNuh = getLayerIdInNuh( layerIdInVps ); 
+#if !NH_3D
+    if( ( getViewIndex( layerIdInNuh ) == viewIndex ) && ( getAuxId( layerIdInNuh ) == ( depthFlag ? 2 : 0 ) )  )
+#else
     if( ( getViewIndex( layerIdInNuh ) == viewIndex ) && ( getDepthId( layerIdInNuh ) == ( depthFlag ? 1 : 0 ) )  )
+#endif
     {
       foundLayerIdinNuh = layerIdInNuh; 
@@ -2198,5 +2202,6 @@
   return foundLayerIdinNuh;
 }
-
+#endif
+#if NH_3D
 Void TComVPS::createCamPars(Int iNumViews)
 {
@@ -3857,5 +3862,5 @@
 }
 #endif
-#if NH_3D
+#if NH_3D_QTL
 Void TComSlice::setIvPicLists( TComPicLists* m_ivPicLists )
 {  
@@ -3864,8 +3869,10 @@
     for ( Int depthId = 0; depthId < 2; depthId++ )
     {
-      m_ivPicsCurrPoc[ depthId ][ i ] = ( i <= m_viewIndex ) ? m_ivPicLists->getPic( i, ( depthId == 1) , getPOC() ) : NULL;
+      m_ivPicsCurrPoc[ depthId ][ i ] = ( i <= m_viewIndex ) ? m_ivPicLists->getPic( i, ( depthId == 1) , 0, getPOC() ) : NULL;
     }        
   }  
 }
+#endif
+#if NH_3D
 Void TComSlice::setDepthToDisparityLUTs()
 { 
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1373)
@@ -1384,8 +1384,9 @@
   /// VPS EXTENSION 2 SYNTAX ELEMENTS
   Int     getDepthId                   ( Int layerIdInNuh)             const    { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); }
-#if NH_3D                                                             
+#if NH_3D_VSO                                                             
   Bool    getVpsDepthFlag              ( Int layerIdInNuh)             const    { return (getDepthId( layerIdInNuh ) > 0);  }
-  Int     getLayerIdInNuh              ( Int viewIndex, Bool depthFlag ) const;   
-          
+  Int     getLayerIdInNuh              ( Int viewIndex, Bool depthFlag, Int auxId ) const;   
+#endif
+#if NH_3D
   Void    createCamPars                ( Int iNumViews );  
   Void    initCamParaVPS               ( Int vOIdxInVps, Int numCp, Bool cpInSliceSegmentHeaderFlag, Int* cpRefVoi, Int** aaiScale, Int** aaiOffset );                                                
@@ -2700,5 +2701,5 @@
   Int        m_viewId;
   Int        m_viewIndex; 
-#if NH_3D
+#if NH_3D_VSO
   Bool       m_isDepth;
 #endif
@@ -2752,5 +2753,9 @@
   Bool       m_cpAvailableFlag; 
   Int        m_numViews; 
+#endif
+#if NH_3D_QTL
   TComPic*   m_ivPicsCurrPoc [2][MAX_NUM_LAYERS];  
+#endif
+#if NH_3D
   Int**      m_depthToDisparityB; 
   Int**      m_depthToDisparityF; 
@@ -2850,5 +2855,8 @@
   Int                         getNumCurCmpLIds( )                      const         { return (Int) m_inCmpRefViewIdcs.size();                       }
   TComPic*                    getIvPic( Bool depthFlag, Int viewIndex) const         { return  m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ];    }
+#endif
+#if NH_3D_QTL
   TComPic*                    getTexturePic       ()                                 { return  m_ivPicsCurrPoc[0][ m_viewIndex ];                    }
+
 #endif                            
 #if NH_3D_IC                                                                                                                                          
@@ -3155,9 +3163,14 @@
   Int                         getFirstTRefIdx        ( RefPicList e )                { return  m_aiFirstTRefIdx[e];                                  }
   Void                        setFirstTRefIdx        ( RefPicList e, Int i )         { m_aiFirstTRefIdx[e]    = i;                                   }
-  Bool                        getArpRefPicAvailable  ( RefPicList e, Int viewIdx)    { return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, 0)]; }
+
+  Bool                        getArpRefPicAvailable  ( RefPicList e, Int viewIdx)    { return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, false, 0 )]; }
   IntAry1d                    getPocsInCurrRPSs()                                    { return m_pocsInCurrRPSs;                                      } 
-#endif                                                                                                                                               
+#endif                        
+#endif
+#if NH_3D_VSO
   Void                        setIsDepth            ( Bool isDepth )                 { m_isDepth = isDepth;                                          }
   Bool                        getIsDepth            () const                         { return m_isDepth;                                             }
+#endif
+#if NH_3D
   Void                        setCamparaSlice       ( Int** aaiScale = 0, Int** aaiOffset = 0 );      
 
@@ -3179,5 +3192,9 @@
   Int                         getCpInvOff( Int j )                                   { return m_aaiCodedOffset[1][j];                                }
                                                                                                                                                         
+#endif
+#if NH_3D_QTL
   Void                        setIvPicLists( TComPicLists* m_ivPicLists );                                                                              
+#endif
+#if NH_3D
   Void                        setDepthToDisparityLUTs();                                                                                                
                                                                                                                                                         
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComYuv.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComYuv.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TComYuv.h	(revision 1373)
@@ -204,6 +204,8 @@
   UInt         getComponentScaleX         (const ComponentID id) const { return ::getComponentScaleX(id, m_chromaFormatIDC); }
   UInt         getComponentScaleY         (const ComponentID id) const { return ::getComponentScaleY(id, m_chromaFormatIDC); }
+#if NH_3D_VSO
+  Void         addClipPartLuma( Int bitDepth, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
+#endif
 #if NH_3D
-  Void         addClipPartLuma( Int bitDepth, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
 #if NH_3D_ARP
   Void         addARP                     ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiAbsPartIdx, UInt uiWidth , UInt uiHeight , Bool bClip, const BitDepths &clipBitDepths );
Index: /branches/HTM-15.2-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1373)
@@ -105,4 +105,5 @@
                                              // 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_QTL                          1
 #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
@@ -496,4 +497,6 @@
 typedef std::vector< std::string > StringAry1d;
 typedef std::vector< StringAry1d > StringAry2d;
+typedef std::vector< std::string > StringAry1d; 
+typedef std::vector< StringAry1d > StringAry2d; 
 typedef std::vector< Int >        IntAry1d;
 typedef std::vector< IntAry1d >   IntAry2d;
@@ -1003,5 +1006,5 @@
 };
 #endif
-#if NH_3D
+#if NH_3D_VSO
 // Renderer
 enum BlenMod
Index: /branches/HTM-15.2-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1373)
@@ -1771,4 +1771,12 @@
         xG813DecProcForInterLayerRefPicSet();
       }
+      else
+      {
+#if NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS
+        TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 
+        decRps->m_numActiveRefLayerPics0 = 0;
+        decRps->m_numActiveRefLayerPics1 = 0;      
+#endif
+      }
     }
   }
Index: /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1373)
@@ -46,5 +46,5 @@
 #include "TLibCommon/TComSlice.h"
 #include <assert.h>
-#if NH_3D
+#if NH_3D_VSO
 #include "TAppCommon/TAppComCamPara.h"
 #include "TLibRenderer/TRenModSetupStrParser.h"
@@ -469,11 +469,11 @@
 #endif 
 
-#if NH_3D
+#if NH_3D_VSO
   Bool      m_isDepth;
+  Bool      m_isAuxDepth; 
 
   //====== Camera Parameters ======
   TAppComCamPara* m_cameraParameters; 
   
-#if NH_3D_VSO
   //====== View Synthesis Optimization ======
   TRenModSetupStrParser* m_renderModelParameters; 
@@ -492,4 +492,5 @@
   Double    m_dDispCoeff;
 #endif
+#if NH_3D
 
   Bool      m_bUseIC;
@@ -498,7 +499,10 @@
   Bool      m_useSDC;
   Bool      m_useDLT;
+#endif
+#if NH_3D_QTL
   Bool      m_bUseQTL;
+#endif
+#if NH_3D
   Int       m_profileIdc;
-
 #endif
 public:
@@ -511,9 +515,10 @@
   , m_viewId(-1)
   , m_viewIndex(-1)
+#if NH_3D_VSO
+  , m_isDepth(false)
+  , m_isAuxDepth(false)
+  , m_bUseVSO(false)
+#endif
 #if NH_3D
-  , m_isDepth(false)
-#if NH_3D_VSO
-  , m_bUseVSO(false)
-#endif
   , m_profileIdc( -1 )
 #endif
@@ -561,7 +566,11 @@
   Void      setViewIndex                     ( Int viewIndex  )   { m_viewIndex  = viewIndex;  }
   Int       getViewIndex                     ()                   { return m_viewIndex;    }
-#if NH_3D
+#if NH_3D_VSO
   Void      setIsDepth                       ( Bool isDepth )   { m_isDepth = isDepth; }
   Bool      getIsDepth                       ()                 { return m_isDepth; }
+  Void      setIsAuxDepth                    ( Bool isAuxDepth ) { m_isAuxDepth = isAuxDepth; }
+  Bool      getIsAuxDepth                       ()               { return m_isAuxDepth; }
+
+
 #endif
 #endif
@@ -1188,5 +1197,5 @@
   UInt      getSummaryVerboseness( ) const                           { return m_summaryVerboseness; }
 
-#if NH_3D
+#if NH_3D_VSO
   // Only flags that are not in the SPS3dExtension should go here. 
   /// 3D Tools 
@@ -1194,6 +1203,4 @@
  //==== CAMERA PARAMETERS  ==========
   Void      setCameraParameters             ( TAppComCamPara* c) { m_cameraParameters   = c; }
-
-#if NH_3D_VSO
  //==== VSO  ==========
   Void      setRenderModelParameters ( TRenModSetupStrParser* c ) { m_renderModelParameters = c; }
@@ -1225,5 +1232,5 @@
   Void      setDispCoeff                    ( Double  d )   { m_dDispCoeff  = d; }
 #endif // NH_3D_VSO
-
+#if NH_3D
   Bool      getUseDMM                       ()        { return m_useDMM; }
   Void      setUseDMM                       ( Bool b) { m_useDMM = b;    }
@@ -1233,7 +1240,11 @@
   Bool      getUseDLT                       ()        { return m_useDLT; }
   Void      setUseDLT                       ( Bool b) { m_useDLT = b;    }
-
+#endif
+
+#if NH_3D_QTL
   Void      setUseQTL                       ( Bool b ) { m_bUseQTL = b;    }
   Bool      getUseQTL                       ()         { return m_bUseQTL; }
+#endif
+#if NH_3D
 
   Void      setProfileIdc( Int a )    { assert( a == 1 || a == 6 || a == 8 ); m_profileIdc = a;  }
Index: /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1373)
@@ -420,7 +420,10 @@
   const UInt fastDeltaQPCuMaxSize    = Clip3(sps.getMaxCUHeight()>>sps.getLog2DiffMaxMinCodingBlockSize(), sps.getMaxCUHeight(), 32u);
 
-
+#if NH_3D_QTL
 #if NH_3D_QTLPC
   Bool  bLimQtPredFalg    = pcPic->getSlice(0)->getQtPredFlag(); 
+#else
+  Bool  bLimQtPredFalg    = false;
+#endif
   TComPic *pcTexture      = rpcBestCU->getSlice()->getTexturePic();
 
@@ -437,5 +440,5 @@
   m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getCtuRsAddr(), rpcBestCU->getZorderIdxInCtu() );
 
-#if NH_3D_QTLPC  
+#if NH_3D_QTL  
   Bool    bTrySplit     = true;
   Bool    bTrySplitDQP  = true;
@@ -534,5 +537,5 @@
       }
 
-#if NH_3D_QTLPC
+#if NH_3D_QTL
       bTrySplit    = true;
 #endif
@@ -552,5 +555,5 @@
 
       rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
-#if NH_3D_QTLPC
+#if NH_3D_QTL
       //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
 #if H_3D_FCO
@@ -734,5 +737,5 @@
 #endif
       }
-#if NH_3D_QTLPC      
+#if NH_3D_QTL
       if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
       {
@@ -789,5 +792,5 @@
           {
             if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() && doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTrySplit
 #endif
@@ -809,5 +812,5 @@
 
           if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
             && bTryNx2N
 #endif
@@ -830,5 +833,5 @@
           }
           if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
             && bTry2NxN
 #endif
@@ -871,5 +874,5 @@
             {
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTry2NxN
 #endif
@@ -891,5 +894,5 @@
               }
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTry2NxN
 #endif
@@ -917,5 +920,5 @@
             {
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTry2NxN
 #endif
@@ -939,5 +942,5 @@
               }
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTry2NxN
 #endif
@@ -966,5 +969,5 @@
             {
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTryNx2N
 #endif
@@ -987,5 +990,5 @@
               }
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTryNx2N
 #endif
@@ -1007,5 +1010,5 @@
             {
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTryNx2N
 #endif
@@ -1027,5 +1030,5 @@
               }
               if(doNotBlockPu
-#if NH_3D_QTLPC
+#if NH_3D_QTL
                 && bTryNx2N
 #endif
@@ -1048,5 +1051,5 @@
 
 #else
-#if NH_3D_QTLPC
+#if NH_3D_QTL
             if (bTry2NxN)
             {
@@ -1063,5 +1066,5 @@
             rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
 #endif
-#if NH_3D_QTLPC
+#if NH_3D_QTL
             }
             if (bTryNx2N)
@@ -1078,5 +1081,5 @@
             rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
 #endif
-#if NH_3D_QTLPC
+#if NH_3D_QTL
             }
 #endif
@@ -1134,5 +1137,5 @@
           if( uiDepth == sps.getLog2DiffMaxMinCodingBlockSize() )
           {
-#if NH_3D_QTLPC //Try IntraNxN
+#if NH_3D_QTL //Try IntraNxN
               if(bTrySplit)
               {
@@ -1150,5 +1153,5 @@
               rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
             }
-#if NH_3D_QTLPC
+#if NH_3D_QTL
               }
 #endif
@@ -1252,5 +1255,5 @@
   const Bool bSubBranch = bBoundary || !( m_pcEncCfg->getUseEarlyCU() && rpcBestCU->getTotalCost()!=MAX_DOUBLE && rpcBestCU->isSkipped(0) );
 #endif
-#if NH_3D_QTLPC
+#if NH_3D_QTL
   if( bSubBranch && uiDepth < sps.getLog2DiffMaxMinCodingBlockSize() && (!getFastDeltaQp() || uiWidth > fastDeltaQPCuMaxSize || bBoundary) && bTrySplitDQP )
 #else
Index: /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1373)
@@ -1434,6 +1434,9 @@
     Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
 #endif
+#if NH_3D_QTL
+    pcSlice->setIvPicLists( m_ivPicLists );
+#endif
 #if NH_3D
-    pcSlice->setIvPicLists( m_ivPicLists );
+
 
     Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
@@ -1654,9 +1657,11 @@
     pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false, pcSlice->getPOC(), flagRec ) );
     pcRdCost->setDepthPicYuv   ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true, pcSlice->getPOC(), false ) );
-#else
-    pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false , pcSlice->getPOC(), true ) );
-    pcRdCost->setDepthPicYuv   ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), true  , pcSlice->getPOC(), false ) );
-#endif
-
+#else    
+    Int curAuxId     = pcSlice->getVPS()->getAuxId( getLayerId() ); 
+    Int curDepthFlag = pcSlice->getIsDepth(); 
+    assert( curAuxId == 2 || curDepthFlag  ); 
+    pcRdCost->setVideoRecPicYuv( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), false       , 0       , pcSlice->getPOC(), true ) );
+    pcRdCost->setDepthPicYuv   ( m_pcEncTop->getIvPicLists()->getPicYuv( pcSlice->getViewIndex(), curDepthFlag, curAuxId, pcSlice->getPOC(), false ) );
+#endif
     // LGE_WVSO_A0119
     Bool bUseWVSO  = m_pcEncTop->getUseWVSO();
Index: /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1373)
@@ -461,5 +461,5 @@
 
 #if NH_3D_VSO
-  m_pcRdCost->setUseLambdaScaleVSO  ( (m_pcCfg->getUseVSO() ||  m_pcCfg->getForceLambdaScaleVSO()) && m_pcCfg->getIsDepth() );
+  m_pcRdCost->setUseLambdaScaleVSO  ( (m_pcCfg->getUseVSO() ||  m_pcCfg->getForceLambdaScaleVSO()) && ( m_pcCfg->getIsDepth()  | m_pcCfg->getIsAuxDepth() ) );
   m_pcRdCost->setLambdaVSO          ( dLambda * m_pcCfg->getLambdaScaleVSO() );
 
@@ -470,5 +470,5 @@
 
   // LGE_WVSO_A0119
-  if( m_pcCfg->getUseWVSO() && m_pcCfg->getIsDepth() )
+  if( m_pcCfg->getUseWVSO() && ( m_pcCfg->getIsDepth() || m_pcCfg->getIsAuxDepth() ) )
   {
     m_pcRdCost->setDWeight  ( m_pcCfg->getDWeight()   );
@@ -713,5 +713,5 @@
 
     // compute RD cost and choose the best
-#if NH_3D
+#if NH_3D_VSO
     Double dPicRdCost = m_pcRdCost->calcRdCost( (Double)m_uiPicTotalBits, uiPicDist, DF_SSE_FRAME);
 #else
@@ -899,5 +899,5 @@
         iLastPosY = iCurPosY;         
         TEncTop* pcEncTop = (TEncTop*) m_pcCfg; // Fix this later.
-        pcEncTop->setupRenModel( pcSlice->getPOC() , pcSlice->getViewIndex(), pcSlice->getIsDepth() ? 1 : 0, iCurPosY, pcSlice->getSPS()->getMaxCUHeight() );
+        pcEncTop->setupRenModel( pcSlice->getPOC() , pcSlice->getViewIndex(), pcSlice->getIsDepth() || pcSlice->getVPS()->getAuxId( pcSlice->getLayerId()  ) ? 1 : 0, iCurPosY, pcSlice->getSPS()->getMaxCUHeight() );
       }
     }
Index: /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1373)
@@ -1565,8 +1565,23 @@
     Int iBaseViewIdx = m_cameraParameters->getBaseSortedId2Id()[ iBaseViewSIdx ];
 
-    TComPicYuv* pcPicYuvVideoRec  = m_ivPicLists->getPicYuv( iBaseViewIdx, false, iPoc, true  );
-    TComPicYuv* pcPicYuvDepthRec  = m_ivPicLists->getPicYuv( iBaseViewIdx, true , iPoc, true  );
-    TComPicYuv* pcPicYuvVideoOrg  = m_ivPicLists->getPicYuv( iBaseViewIdx, false, iPoc, false );
-    TComPicYuv* pcPicYuvDepthOrg  = m_ivPicLists->getPicYuv( iBaseViewIdx, true , iPoc, false );    
+    Int  auxId     =   getVPS()->getAuxId  ( getLayerId() );     
+    Bool depthFlag = ( getVPS()->getDepthId( getLayerId() ) == 1 ); 
+
+    if( auxId == 0 && !depthFlag  )
+    {
+      // Defaults for texture layers
+#if NH_3D
+      depthFlag = true; 
+      auxId     = 0; 
+#else
+      depthFlag = false; 
+      auxId     = 2; 
+#endif
+    }
+
+    TComPicYuv* pcPicYuvVideoRec  = m_ivPicLists->getPicYuv( iBaseViewIdx, false    , 0    , iPoc, true  );
+    TComPicYuv* pcPicYuvDepthRec  = m_ivPicLists->getPicYuv( iBaseViewIdx, depthFlag, auxId, iPoc, true  );
+    TComPicYuv* pcPicYuvVideoOrg  = m_ivPicLists->getPicYuv( iBaseViewIdx, false,     0    , iPoc, false );
+    TComPicYuv* pcPicYuvDepthOrg  = m_ivPicLists->getPicYuv( iBaseViewIdx, depthFlag, auxId, iPoc, false );    
 
     TComPicYuv* pcPicYuvVideoRef  = ( iVideoDistMode == 2 ) ? pcPicYuvVideoOrg  : NULL;
@@ -1633,5 +1648,5 @@
     if ( iOrgRefBaseViewSIdx != -1 )
     {
-      pcPicYuvOrgRef = m_ivPicLists->getPicYuv(  m_cameraParameters->getBaseSortedId2Id()[ iOrgRefBaseViewSIdx ] , false, iPoc, false );
+      pcPicYuvOrgRef = m_ivPicLists->getPicYuv(  m_cameraParameters->getBaseSortedId2Id()[ iOrgRefBaseViewSIdx ] , false, 0, iPoc, false );
       AOF ( pcPicYuvOrgRef );
     }
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenFilter.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenFilter.cpp	(revision 1373)
@@ -36,5 +36,5 @@
 #include "TRenFilter.h"
 #include "TRenInterpFilter.h"
-#if NH_3D
+#if NH_3D_VSO
 
 ///// COMMON /////
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenFilter.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenFilter.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenFilter.h	(revision 1373)
@@ -39,5 +39,5 @@
 #include "TRenImage.h"
 #include "TRenInterpFilter.h"
-#if NH_3D
+#if NH_3D_VSO
 
 typedef Int (TRenInterpFilter<REN_BIT_DEPTH>::*FpChromaIntFilt) ( Pel*, Int );
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImage.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImage.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImage.cpp	(revision 1373)
@@ -37,5 +37,5 @@
 #include "TRenFilter.h"
 #include "assert.h"
-#if NH_3D
+#if NH_3D_VSO
 
 
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImage.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImage.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImage.h	(revision 1373)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 #include "TRenImagePlane.h"
-#if NH_3D
+#if NH_3D_VSO
 
 
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImagePlane.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImagePlane.cpp	(revision 1373)
@@ -36,5 +36,5 @@
 #include "TRenFilter.h"
 #include <string.h>
-#if NH_3D
+#if NH_3D_VSO
 
 /////// TRenImagePlane ///////
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImagePlane.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenImagePlane.h	(revision 1373)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 
-#if NH_3D
+#if NH_3D_VSO
 #define PelImagePlane     TRenImagePlane<Pel>
 #define DoubleImagePlane  TRenImagePlane<Double>
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenInterpFilter.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenInterpFilter.cpp	(revision 1373)
@@ -39,5 +39,5 @@
 
 #include "TRenInterpFilter.h"
-#if NH_3D
+#if NH_3D_VSO
 
 // ====================================================================================================================
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenInterpFilter.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenInterpFilter.h	(revision 1373)
@@ -44,5 +44,5 @@
 #include "TLibCommon/CommonDef.h"
 #include "assert.h"
-#if NH_3D
+#if NH_3D_VSO
 
 // ====================================================================================================================
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenModSetupStrParser.cpp	(revision 1373)
@@ -37,5 +37,5 @@
 #include "TRenModSetupStrParser.h"
 
-#if NH_3D
+#if NH_3D_VSO
 Int
 TRenModSetupStrParser::getNumOfModels()
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenModSetupStrParser.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenModSetupStrParser.h	(revision 1373)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TypeDef.h"
 #include "../TAppCommon/TAppComCamPara.h"
-#if NH_3D
+#if NH_3D_VSO
 
 
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenTop.cpp
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenTop.cpp	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenTop.cpp	(revision 1373)
@@ -40,5 +40,5 @@
 #include <math.h>
 #include "../TLibCommon/CommonDef.h"
-#if NH_3D
+#if NH_3D_VSO
 
 
Index: /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenTop.h
===================================================================
--- /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenTop.h	(revision 1372)
+++ /branches/HTM-15.2-dev/source/Lib/TLibRenderer/TRenTop.h	(revision 1373)
@@ -39,5 +39,5 @@
 #include "../TLibCommon/TComPicYuv.h"
 
-#if NH_3D
+#if NH_3D_VSO
 #include <list>
 #include <vector>
