Index: branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1088)
+++ branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1094)
@@ -1869,9 +1869,10 @@
 
 #endif
-
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
     Int iDDDCand = rpcTempCU->getUseDDDCandIdx(); 
     UChar ucDDDepth = rpcTempCU->getDDTmpDepth();
     rpcTempCU->setUseDDD( false, 0, uhDepth );
+#endif
 #endif
 
@@ -1908,4 +1909,5 @@
           rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
 #endif
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
           if( rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewIndex() != 0 && iDDDCand == uiMergeCand )
@@ -1918,4 +1920,5 @@
               rpcTempCU->setUseDDD( false, 0, 0, uhDepth );
           }
+#endif
 #endif
 #if H_3D_SPIVMP
@@ -2204,6 +2207,8 @@
   rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
   rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
   rpcTempCU->setUseDDD( false, 0, uhDepth );
+#endif
 #endif
 
Index: branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1088)
+++ branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1094)
@@ -4143,5 +4143,5 @@
       }
 #endif
-
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
       if( uiMergeCand == pcCU->getUseDDDCandIdx() )
@@ -4154,4 +4154,5 @@
         pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
       }
+#endif
 #endif
 
@@ -4841,4 +4842,5 @@
         pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
 #endif
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
         if( uiMRGIndex == pcCU->getUseDDDCandIdx() )
@@ -4853,4 +4855,5 @@
             pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
         }
+#endif
 #endif
 #if H_3D_SPIVMP
@@ -4930,6 +4933,8 @@
         pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 
 #endif
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
         pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
+#endif
 #endif
         // set ME result
Index: branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1088)
+++ branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1094)
@@ -1011,4 +1011,37 @@
     }
   }
+#if LGE_DEFAULT_DV_J0046
+  pcSlice->setDefaultRefViewIdx( -1 );
+  pcSlice->setDefaultRefViewIdxAvailableFlag( false ); 
+
+  Int valid = 0;
+  Int viewIndex = 0;
+  for( UInt uiBId = 0; uiBId < pcSlice->getViewIndex() && valid==0; uiBId++ )
+  {
+      UInt        uiBaseId    = uiBId;
+      TComPic*    pcBasePic   = pcSlice->getIvPic( false, uiBaseId );
+      for( Int iRefListId = 0; ( iRefListId < (pcSlice->isInterB()? 2:1) ) && !pcSlice->isIntra() && valid==0; iRefListId++ )
+      {
+          RefPicList  eRefPicListTest = RefPicList( iRefListId );
+          Int         iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ;
+          for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ )
+          { 
+              if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC() 
+                  && pcBasePic->getViewIndex() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewIndex())
+              {
+                  valid=1;
+                  viewIndex = uiBaseId;
+                  break;
+              }
+          }
+      }
+  }
+  if( valid )
+  {
+      pcSlice->setDefaultRefViewIdx( viewIndex );
+      pcSlice->setDefaultRefViewIdxAvailableFlag( true );   
+  }
+#endif
+
   // for every CU in slice
 #if H_3D
@@ -1169,5 +1202,4 @@
 #endif
       }
-
       // run CU encoder
       m_pcCuEncoder->compressCU( pcCU );
Index: branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSlice.h
===================================================================
--- branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSlice.h	(revision 1088)
+++ branches/HTM-12.2-dev2-LGE/source/Lib/TLibEncoder/TEncSlice.h	(revision 1094)
@@ -107,8 +107,10 @@
   UInt                    m_uiSliceIdx;
   std::vector<TEncSbac*> CTXMem;
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
   Int          m_iDDDScale;
   Int          m_iDDDOffset;
   UInt         m_uiDDDPrecision;
+#endif
 #endif
 public:
@@ -145,7 +147,8 @@
   Void      initCtxMem( UInt i );
   Void      setCtxMem( TEncSbac* sb, Int b )   { CTXMem[b] = sb; }
-
+#if !LGE_DDD_REMOVAL_J0042_J0030
 #if H_3D_DDD
   Void setDDDPar( Int iScale, Int iOffset, UInt uiPrecision ){ m_iDDDScale = iScale; m_iDDDOffset = iOffset; m_uiDDDPrecision = uiPrecision; }
+#endif
 #endif
 
