Index: trunk/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 210)
+++ trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 296)
@@ -97,5 +97,4 @@
     m_acTEncTopList[iViewIdx]->setSourceWidth                  ( m_iSourceWidth );
     m_acTEncTopList[iViewIdx]->setSourceHeight                 ( m_iSourceHeight );
-#if PIC_CROPPING
     m_acTEncTopList[iViewIdx]->setCroppingMode                 ( m_croppingMode );
     m_acTEncTopList[iViewIdx]->setCropLeft                     ( m_cropLeft );
@@ -103,5 +102,4 @@
     m_acTEncTopList[iViewIdx]->setCropTop                      ( m_cropTop );
     m_acTEncTopList[iViewIdx]->setCropBottom                   ( m_cropBottom );
-#endif
     m_acTEncTopList[iViewIdx]->setFrameToBeEncoded             ( m_iFrameToBeEncoded );
     m_acTEncTopList[iViewIdx]->setViewId                       ( iViewIdx );
@@ -121,4 +119,7 @@
     m_cVPS.setDependentFlag                                    ( iViewIdx ? true:false, layerId );
     m_cVPS.setDependentLayer                                   ( layerId - (m_bUsingDepthMaps ? 2:1), layerId );
+#if INTER_VIEW_VECTOR_SCALING_C0115
+    m_cVPS.setIVScalingFlag                                    ( m_bUseIVS );
+#endif
 #endif
     
@@ -135,5 +136,4 @@
     m_acTEncTopList[iViewIdx]->setGopList                      ( m_GOPListsMvc[iViewIdx] );
     m_acTEncTopList[iViewIdx]->setExtraRPSs                    ( m_extraRPSs[iViewIdx] );
-#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
     for(Int i = 0; i < MAX_TLAYER; i++)
     {
@@ -141,8 +141,4 @@
       m_acTEncTopList[iViewIdx]->setMaxDecPicBuffering         ( m_maxDecPicBuffering[iViewIdx][i], i );
     }
-#else
-    m_acTEncTopList[iViewIdx]->setNumReorderFrames             ( m_numReorderFrames );
-    m_acTEncTopList[iViewIdx]->setMaxNumberOfReferencePictures ( m_maxNumberOfReferencePictures );
-#endif
     for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop )
     {
@@ -154,10 +150,5 @@
     m_acTEncTopList[iViewIdx]->setPad                          ( m_aiPad );
     
-#if H0566_TLA
     m_acTEncTopList[iViewIdx]->setMaxTempLayer                 ( m_maxTempLayer[iViewIdx] );
-#else
-    m_acTEncTopList[iViewIdx]->setTLayering                    ( m_bTLayering );
-    m_acTEncTopList[iViewIdx]->setTLayerSwitchingFlag          ( m_abTLayerSwitchingFlag );
-#endif
 
     m_acTEncTopList[iViewIdx]->setDisInter4x4                  ( m_bDisInter4x4);
@@ -173,7 +164,5 @@
     m_acTEncTopList[iViewIdx]->setLoopFilterBetaOffset         ( m_loopFilterBetaOffsetDiv2  );
     m_acTEncTopList[iViewIdx]->setLoopFilterTcOffset           ( m_loopFilterTcOffsetDiv2    );
-#if DBL_CONTROL
     m_acTEncTopList[iViewIdx]->setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent);
-#endif
 
   //====== Motion search ========
@@ -198,9 +187,5 @@
 #if LOSSLESS_CODING
     Int lowestQP;
-#if H0736_AVC_STYLE_QP_RANGE
     lowestQP =  - ( (Int)(6*(g_uiBitDepth + g_uiBitIncrement - 8)) );
-#else
-    lowestQP = 0;
-#endif
     if ((m_iMaxDeltaQP == 0 ) && (m_aiQP[0] == lowestQP) && (m_useLossless == true))
     {
@@ -232,10 +217,10 @@
     m_acTEncTopList[iViewIdx]->setPdmOffset                    (       m_cCameraData.getPdmOffset        () );
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     m_acTEncTopList[iViewIdx]->setMultiviewMvPredMode          ( m_uiMultiviewMvPredMode );
     m_acTEncTopList[iViewIdx]->setMultiviewMvRegMode           ( iViewIdx ? m_uiMultiviewMvRegMode       : 0   );
     m_acTEncTopList[iViewIdx]->setMultiviewMvRegLambdaScale    ( iViewIdx ? m_dMultiviewMvRegLambdaScale : 0.0 );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
     m_acTEncTopList[iViewIdx]->setMultiviewResPredMode         ( m_uiMultiviewResPredMode );
 #endif
@@ -257,7 +242,4 @@
     m_acTEncTopList[iViewIdx]->setdQPs                         ( m_aidQP        );
     m_acTEncTopList[iViewIdx]->setUseRDOQ                      ( m_abUseRDOQ[0] );
-#if !PIC_CROPPING
-    m_acTEncTopList[iViewIdx]->setUsePAD                       ( m_bUsePAD      );
-#endif
     m_acTEncTopList[iViewIdx]->setQuadtreeTULog2MaxSize        ( m_uiQuadtreeTULog2MaxSize );
     m_acTEncTopList[iViewIdx]->setQuadtreeTULog2MinSize        ( m_uiQuadtreeTULog2MinSize );
@@ -266,7 +248,5 @@
     m_acTEncTopList[iViewIdx]->setUseFastEnc                   ( m_bUseFastEnc  );
     m_acTEncTopList[iViewIdx]->setUseEarlyCU                   ( m_bUseEarlyCU  ); 
-#if FAST_DECISION_FOR_MRG_RD_COST
     m_acTEncTopList[iViewIdx]->setUseFastDecisionForMerge      ( m_useFastDecisionForMerge  );
-#endif
     m_acTEncTopList[iViewIdx]->setUseCbfFastMode               ( m_bUseCbfFastMode  );
 #if HHI_INTERVIEW_SKIP
@@ -301,10 +281,8 @@
       m_acTEncTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument * ( iNumPartInCU >> ( m_iSliceGranularity << 1 ) ) );
     }
-#if FIXED_NUMBER_OF_TILES_SLICE_MODE
     if(m_iSliceMode==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE)
     {
       m_acTEncTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument );
     }
-#endif
     m_acTEncTopList[iViewIdx]->setSliceGranularity        ( m_iSliceGranularity         );
     if(m_iSliceMode == 0 )
@@ -315,10 +293,15 @@
     m_acTEncTopList[iViewIdx]->setUseSAO               ( m_abUseSAO[0]     );
 #if LGE_ILLUCOMP_B0045
+#if LGE_ILLUCOMP_DEPTH_C0046
+    m_acTEncTopList[iViewIdx]->setUseIC                ( m_abUseIC[0]      );
+#else
     m_acTEncTopList[iViewIdx]->setUseIC                ( m_bUseIC          );
 #endif
-#if SAO_UNIT_INTERLEAVING
+#endif
+#if INTER_VIEW_VECTOR_SCALING_C0115
+    m_acTEncTopList[iViewIdx]->setUseIVS               ( m_bUseIVS          );
+#endif
     m_acTEncTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
     m_acTEncTopList[iViewIdx]->setSaoInterleavingFlag (m_saoInterleavingFlag);
-#endif
     m_acTEncTopList[iViewIdx]->setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag); 
     m_acTEncTopList[iViewIdx]->setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag); 
@@ -328,7 +311,4 @@
     m_acTEncTopList[iViewIdx]->setColumnRowInfoPresent       ( m_iColumnRowInfoPresent );
     m_acTEncTopList[iViewIdx]->setUniformSpacingIdr          ( m_iUniformSpacingIdr );
-#if !REMOVE_TILE_DEPENDENCE
-    m_acTEncTopList[iViewIdx]->setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr );
-#endif
     m_acTEncTopList[iViewIdx]->setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
     m_acTEncTopList[iViewIdx]->setNumRowsMinus1              ( m_iNumRowsMinus1 );
@@ -347,9 +327,5 @@
     m_acTEncTopList[iViewIdx]->setMaxTileMarkerOffset         ( m_dMaxTileMarkerOffset );
     m_acTEncTopList[iViewIdx]->setTileBehaviorControlPresentFlag( m_iTileBehaviorControlPresentFlag );
-#if !REMOVE_TILE_DEPENDENCE
-    if(m_iTileBoundaryIndependenceIdr == 0 || uiTilesCount == 1)
-#else
     if(uiTilesCount == 1)
-#endif
     {
       m_bLFCrossTileBoundaryFlag = true; 
@@ -366,10 +342,7 @@
     m_acTEncTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
     m_acTEncTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
-#if MULTIBITS_DATA_HIDING
     m_acTEncTopList[iViewIdx]->setSignHideFlag(m_signHideFlag);
     m_acTEncTopList[iViewIdx]->setTSIG(m_signHidingThreshold);
-#endif
-
-#if LCU_SYNTAX_ALF
+
     if(uiTilesCount > 1)
     {
@@ -379,5 +352,4 @@
     m_acTEncTopList[iViewIdx]->setALFParamInSlice              ( m_bALFParamInSlice);
     m_acTEncTopList[iViewIdx]->setALFPicBasedEncode            ( m_bALFPicBasedEncode);
-#endif
 
     //====== Depth tools ========
@@ -435,5 +407,4 @@
       m_acTEncDepthTopList[iViewIdx]->setSourceWidth                  ( m_iSourceWidth );
       m_acTEncDepthTopList[iViewIdx]->setSourceHeight                 ( m_iSourceHeight );
-#if PIC_CROPPING
       m_acTEncDepthTopList[iViewIdx]->setCroppingMode                 ( m_croppingMode );
       m_acTEncDepthTopList[iViewIdx]->setCropLeft                     ( m_cropLeft );
@@ -441,5 +412,4 @@
       m_acTEncDepthTopList[iViewIdx]->setCropTop                      ( m_cropTop );
       m_acTEncDepthTopList[iViewIdx]->setCropBottom                   ( m_cropBottom );
-#endif
       m_acTEncDepthTopList[iViewIdx]->setFrameToBeEncoded             ( m_iFrameToBeEncoded );
       m_acTEncDepthTopList[iViewIdx]->setViewId                       ( iViewIdx );
@@ -470,5 +440,4 @@
       m_acTEncDepthTopList[iViewIdx]->setGopList                      ( m_GOPListsMvc[iViewIdx] );
       m_acTEncDepthTopList[iViewIdx]->setExtraRPSs                    ( m_extraRPSs[iViewIdx] );
-#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
       for(Int i = 0; i < MAX_TLAYER; i++)
       {
@@ -476,8 +445,4 @@
         m_acTEncDepthTopList[iViewIdx]->setMaxDecPicBuffering         ( m_maxDecPicBuffering[iViewIdx][i], i );
       }
-#else
-      m_acTEncDepthTopList[iViewIdx]->setNumReorderFrames             ( m_numReorderFrames );
-      m_acTEncDepthTopList[iViewIdx]->setMaxNumberOfReferencePictures ( m_maxNumberOfReferencePictures );
-#endif
       for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop )
       {
@@ -489,10 +454,5 @@
       m_acTEncDepthTopList[iViewIdx]->setPad                          ( m_aiPad );
 
-#if H0566_TLA
       m_acTEncDepthTopList[iViewIdx]->setMaxTempLayer                 ( m_maxTempLayer[iViewIdx] );
-#else
-      m_acTEncDepthTopList[iViewIdx]->setTLayering                    ( m_bTLayering );
-      m_acTEncDepthTopList[iViewIdx]->setTLayerSwitchingFlag          ( m_abTLayerSwitchingFlag );
-#endif
 
       m_acTEncDepthTopList[iViewIdx]->setDisInter4x4                  ( m_bDisInter4x4);
@@ -508,7 +468,5 @@
       m_acTEncDepthTopList[iViewIdx]->setLoopFilterBetaOffset         ( m_loopFilterBetaOffsetDiv2  );
       m_acTEncDepthTopList[iViewIdx]->setLoopFilterTcOffset           ( m_loopFilterTcOffsetDiv2    );
-#if DBL_CONTROL
       m_acTEncDepthTopList[iViewIdx]->setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent);
-#endif
 
       //====== Motion search ========
@@ -550,7 +508,4 @@
       m_acTEncDepthTopList[iViewIdx]->setdQPs                         ( m_aidQPdepth   );
       m_acTEncDepthTopList[iViewIdx]->setUseRDOQ                      ( m_abUseRDOQ[1] );
-#if !PIC_CROPPING
-      m_acTEncDepthTopList[iViewIdx]->setUsePAD                       ( m_bUsePAD      );
-#endif
       m_acTEncDepthTopList[iViewIdx]->setQuadtreeTULog2MaxSize        ( m_uiQuadtreeTULog2MaxSize );
       m_acTEncDepthTopList[iViewIdx]->setQuadtreeTULog2MinSize        ( m_uiQuadtreeTULog2MinSize );
@@ -559,7 +514,5 @@
       m_acTEncDepthTopList[iViewIdx]->setUseFastEnc                   ( m_bUseFastEnc  );
       m_acTEncDepthTopList[iViewIdx]->setUseEarlyCU                   ( m_bUseEarlyCU  ); 
-#if FAST_DECISION_FOR_MRG_RD_COST
       m_acTEncDepthTopList[iViewIdx]->setUseFastDecisionForMerge      ( m_useFastDecisionForMerge  );
-#endif
       m_acTEncDepthTopList[iViewIdx]->setUseCbfFastMode               ( m_bUseCbfFastMode  );
 #if HHI_INTERVIEW_SKIP
@@ -595,10 +548,10 @@
       m_acTEncDepthTopList[iViewIdx]->setPredDepthMapGeneration       ( 0 );
 #endif
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
       m_acTEncDepthTopList[iViewIdx]->setMultiviewMvPredMode          ( 0 );
       m_acTEncDepthTopList[iViewIdx]->setMultiviewMvRegMode           ( 0 );
       m_acTEncDepthTopList[iViewIdx]->setMultiviewMvRegLambdaScale    ( 0.0 );
 #endif
-#if HHI_INTER_VIEW_RESIDUAL_PRED
+#if H3D_IVRP
       m_acTEncDepthTopList[iViewIdx]->setMultiviewResPredMode         ( 0 );
 #endif
@@ -623,10 +576,8 @@
         m_acTEncDepthTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument * ( iNumPartInCU >> ( m_iSliceGranularity << 1 ) ) );
       }
-#if FIXED_NUMBER_OF_TILES_SLICE_MODE
       if(m_iSliceMode==AD_HOC_SLICES_FIXED_NUMBER_OF_TILES_IN_SLICE)
       {
         m_acTEncDepthTopList[iViewIdx]->setSliceArgument ( m_iSliceArgument );
       }
-#endif
       m_acTEncDepthTopList[iViewIdx]->setSliceGranularity        ( m_iSliceGranularity         );
       if(m_iSliceMode == 0 )
@@ -639,8 +590,9 @@
       m_acTEncDepthTopList[iViewIdx]->setUseIC                ( false     );
 #endif
-#if SAO_UNIT_INTERLEAVING
+#if INTER_VIEW_VECTOR_SCALING_C0115
+     m_acTEncDepthTopList[iViewIdx]->setUseIVS                ( m_bUseIVS );
+#endif
       m_acTEncDepthTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic);
       m_acTEncDepthTopList[iViewIdx]->setSaoInterleavingFlag (m_saoInterleavingFlag);
-#endif
       m_acTEncDepthTopList[iViewIdx]->setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag); 
       m_acTEncDepthTopList[iViewIdx]->setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag); 
@@ -650,7 +602,4 @@
       m_acTEncDepthTopList[iViewIdx]->setColumnRowInfoPresent       ( m_iColumnRowInfoPresent );
       m_acTEncDepthTopList[iViewIdx]->setUniformSpacingIdr          ( m_iUniformSpacingIdr );
-#if !REMOVE_TILE_DEPENDENCE
-      m_acTEncDepthTopList[iViewIdx]->setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr );
-#endif
       m_acTEncDepthTopList[iViewIdx]->setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
       m_acTEncDepthTopList[iViewIdx]->setNumRowsMinus1              ( m_iNumRowsMinus1 );
@@ -669,9 +618,5 @@
       m_acTEncDepthTopList[iViewIdx]->setMaxTileMarkerOffset         ( m_dMaxTileMarkerOffset );
       m_acTEncDepthTopList[iViewIdx]->setTileBehaviorControlPresentFlag( m_iTileBehaviorControlPresentFlag );
-#if !REMOVE_TILE_DEPENDENCE
-      if(m_iTileBoundaryIndependenceIdr == 0 || uiTilesCount == 1)
-#else
       if(uiTilesCount == 1)
-#endif
       {
         m_bLFCrossTileBoundaryFlag = true; 
@@ -688,10 +633,7 @@
       m_acTEncDepthTopList[iViewIdx]->setUseScalingListId           ( m_useScalingListId  );
       m_acTEncDepthTopList[iViewIdx]->setScalingListFile            ( m_scalingListFile   );
-#if MULTIBITS_DATA_HIDING
       m_acTEncDepthTopList[iViewIdx]->setSignHideFlag(m_signHideFlag);
       m_acTEncDepthTopList[iViewIdx]->setTSIG(m_signHidingThreshold);
-#endif
-
-#if LCU_SYNTAX_ALF
+
       if(uiTilesCount > 1)
       {
@@ -701,5 +643,4 @@
       m_acTEncDepthTopList[iViewIdx]->setALFParamInSlice              ( m_bALFParamInSlice);
       m_acTEncDepthTopList[iViewIdx]->setALFPicBasedEncode            ( m_bALFPicBasedEncode);
-#endif
 
   //====== Depth tools ========
@@ -728,5 +669,5 @@
   }
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   else if( m_uiMultiviewMvRegMode )
   {
@@ -815,5 +756,5 @@
       m_acTEncDepthTopList[iViewIdx]->create();
     }
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
     else if( m_uiMultiviewMvRegMode )
     {
@@ -931,5 +872,5 @@
   TComPicYuv*       pcPicYuvRec = NULL;
   TComPicYuv*       pcDepthPicYuvRec = NULL;
-  
+
   // initialize internal class & member variables
   xInitLibCfg();
@@ -962,5 +903,5 @@
   pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
   if( m_uiMultiviewMvRegMode )
   {
@@ -982,5 +923,5 @@
         m_acTVideoIOYuvInputFileList[iViewIdx]->read( pcPicYuvOrg, m_aiPad );
       
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
         if( m_uiMultiviewMvRegMode && iViewIdx )
         {
@@ -989,5 +930,5 @@
 #endif
 
-#if HHI_INTER_VIEW_MOTION_PRED
+#if H3D_IVMP
         m_acTEncTopList[iViewIdx]->initNewPic( pcPicYuvOrg, ( m_uiMultiviewMvRegMode && iViewIdx ? pcPdmDepthOrg : 0 ) );
 #else
@@ -1033,5 +974,5 @@
       if ( iNextPoc < m_iFrameToBeEncoded )
       {
-      m_cCameraData.update( iNextPoc );
+        m_cCameraData.update( iNextPoc );
       }
 #endif
@@ -1096,4 +1037,17 @@
 #endif
         iNumEncoded = 0;
+
+#if MERL_VSP_C0152
+        Int iCurPoc = m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId);
+        if( iCurPoc < m_acTEncDepthTopList[iViewIdx]->getFrameToBeEncoded() && iViewIdx!=0 )
+        {
+          TComPic* pcBaseTxtPic   = getPicFromView(  0, m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId), false ); //get base view reconstructed texture
+          TComPic* pcBaseDepthPic = getPicFromView(  0, m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId), true );  //get base view reconstructed depth
+          TEncSlice* pEncSlice = m_acTEncTopList[iViewIdx]->getSliceEncoder();
+          pEncSlice->setRefPicBaseTxt(pcBaseTxtPic);
+          pEncSlice->setRefPicBaseDepth(pcBaseDepthPic);
+        }
+        setBWVSPLUT( iViewIdx, gopId, false);
+#endif
         // call encoding function for one frame
         m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId );
@@ -1103,4 +1057,15 @@
         {
           Int  iNumDepthEncoded = 0;
+#if MERL_VSP_C0152
+        Int iCurPocDepth = m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId);
+        if( iCurPocDepth < m_acTEncDepthTopList[iViewIdx]->getFrameToBeEncoded() && iViewIdx!=0 )
+        {
+          TComPic* pcBaseDepthPic = getPicFromView(  0, m_acTEncDepthTopList[iViewIdx]->getFrameId(gopId), true );
+          TEncSlice* pcSlice = (TEncSlice*) m_acTEncDepthTopList[iViewIdx]->getSliceEncoder();
+          pcSlice->setRefPicBaseDepth(pcBaseDepthPic);
+        }
+        setBWVSPLUT( iViewIdx, gopId, true);
+#endif
+
           // call encoding function for one depth frame
           m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId );
@@ -1114,5 +1079,5 @@
 #endif
 
-#if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED
+#if HHI_INTERVIEW_SKIP || H3D_IVMP || H3D_IVRP
       for( Int iViewIdx = 0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
       {
@@ -1147,9 +1112,5 @@
   
 #if !QC_MVHEVC_B0046
-#if FIX_DEL_NULLPTR
   if ( pcPdmDepthOrg != NULL && m_uiMultiviewMvRegMode )
-#else
-  if ( pcPdmDepthOrg != NULL )
-#endif
   {
     pcPdmDepthOrg->destroy();
@@ -1292,9 +1253,5 @@
         if (m_pchReconFileList[iViewIdx])
         {
-#if PIC_CROPPING
           m_acTVideoIOYuvReconFileList[iViewIdx]->write( pcPicYuvRec, m_cropLeft, m_cropRight, m_cropTop, m_cropBottom );
-#else
-          m_acTVideoIOYuvReconFileList[iViewIdx]->write( pcPicYuvRec, m_aiPad );
-#endif
         }
       }
@@ -1303,9 +1260,5 @@
         if (m_pchDepthReconFileList[iViewIdx])
         {
-#if PIC_CROPPING
           m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPicYuvRec, m_cropLeft, m_cropRight, m_cropTop, m_cropBottom );
-#else
-          m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPicYuvRec, m_aiPad );
-#endif
         }
       }
@@ -1360,5 +1313,4 @@
     {
     case NAL_UNIT_CODED_SLICE:
-#if H0566_TLA
 #if !QC_REM_IDV_B0046
     case NAL_UNIT_CODED_SLICE_IDV:
@@ -1366,9 +1318,4 @@
     case NAL_UNIT_CODED_SLICE_TLA:
     case NAL_UNIT_CODED_SLICE_CRA:
-#else
-    case NAL_UNIT_CODED_SLICE_DATAPART_A:
-    case NAL_UNIT_CODED_SLICE_DATAPART_B:
-    case NAL_UNIT_CODED_SLICE_CDR:
-#endif
     case NAL_UNIT_CODED_SLICE_IDR:
     case NAL_UNIT_SPS:
@@ -1634,3 +1581,30 @@
 #endif
 
+#if MERL_VSP_C0152
+Void TAppEncTop::setBWVSPLUT(Int iCodedViewIdx, Int gopId, Bool isDepth)
+{
+  //first view does not have VSP 
+  if((iCodedViewIdx == 0)) return;
+
+  AOT( iCodedViewIdx <= 0);
+  AOT( iCodedViewIdx >= m_iNumberOfViews );
+
+  Int iNeighborViewId = 0;
+  //setting look-up table
+  Int* piShiftLUT = m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx][0];
+
+  if(isDepth)
+  {
+    TEncSlice* pcEncSlice = (TEncSlice*) m_acTEncDepthTopList[iCodedViewIdx]->getSliceEncoder();
+    pcEncSlice->setBWVSPLUTParam(  piShiftLUT, LOG2_DISP_PREC_LUT );
+  }
+  else
+  {
+    TEncSlice* pcEncSlice = (TEncSlice*) m_acTEncTopList[iCodedViewIdx]->getSliceEncoder();
+    pcEncSlice->setBWVSPLUTParam(  piShiftLUT, LOG2_DISP_PREC_LUT );
+  }
+
+}
+#endif
+
 //! \}
