Index: branches/HTM-DEV-0.3-dev2/source/App/TAppDecoder/TAppDecCfg.h
===================================================================
--- branches/HTM-DEV-0.3-dev2/source/App/TAppDecoder/TAppDecCfg.h	(revision 455)
+++ branches/HTM-DEV-0.3-dev2/source/App/TAppDecoder/TAppDecCfg.h	(revision 456)
@@ -84,5 +84,4 @@
 #if H_MV
   , m_maxLayerId(0)
-  , m_pchReconFiles(NULL) 
 #endif
   , m_pchReconFile(NULL)
Index: branches/HTM-DEV-0.3-dev2/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev2/source/App/TAppDecoder/TAppDecTop.cpp	(revision 455)
+++ branches/HTM-DEV-0.3-dev2/source/App/TAppDecoder/TAppDecTop.cpp	(revision 456)
@@ -145,6 +145,5 @@
   Int  pocCurrPic        = -MAX_INT;     
   Int  pocLastPic        = -MAX_INT;   
-  
-  Int  layerIdLastPic    = 0; 
+
   Int  layerIdCurrPic    = 0; 
 
@@ -223,5 +222,4 @@
         if ( bNewPicture || !bitstreamFile )
         { 
-          layerIdLastPic    = layerIdCurrPic;  
           layerIdCurrPic    = nalu.m_layerId; 
           
Index: branches/HTM-DEV-0.3-dev2/source/Lib/TAppCommon/TAppComCamPara.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev2/source/Lib/TAppCommon/TAppComCamPara.cpp	(revision 455)
+++ branches/HTM-DEV-0.3-dev2/source/Lib/TAppCommon/TAppComCamPara.cpp	(revision 456)
@@ -965,5 +965,7 @@
   //--- determine (virtual) camera parameter shift between view order index 1 and base view (view order index 0) ---
   Double        dCamPosShift, dPicPosShift;
+#if H_3D_PDM_CAM_PARAS
   Int           iMinVOI       = (1<<30);
+#endif
   Int           iMinAbsVOI    = (1<<30);
   Int           iMinAbsVOIId  = 0;
@@ -973,5 +975,7 @@
     if( iAbsVOI < iMinAbsVOI )
     {
+#if H_3D_PDM_CAM_PARAS
       iMinVOI      = m_aiViewOrderIndex[ iBaseId ];
+#endif
       iMinAbsVOI   = iAbsVOI;
       iMinAbsVOIId = iBaseId;
Index: branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp	(revision 455)
+++ branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComDataCU.cpp	(revision 456)
@@ -3985,5 +3985,4 @@
           pDInfo->m_acNBDV = cColMv;
           pDInfo->m_aVIdxCan  = iTargetViewIdx;
-          TComPic* picDepth = NULL;
 
 #if H_3D_NBDV_REF
@@ -4090,5 +4089,4 @@
   }
 
-  TComPic* picDepth = NULL;
   TComMv defaultDV(0, 0);
   pDInfo->m_acNBDV = defaultDV;
@@ -4125,5 +4123,4 @@
           pNbDvInfo->m_acNBDV = cMvPred;
           pNbDvInfo->m_aVIdxCan = refViewIdx;
-          TComPic* picDepth = NULL;
 #if H_3D_NBDV_REF
           /*Place DoNBDV*/
Index: branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp	(revision 455)
+++ branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TComPic.cpp	(revision 456)
@@ -558,69 +558,79 @@
 #endif // H_3D
 #endif // H_MV
+
 #if H_3D_NBDV 
-Int TComPic::getDisCandRefPictures(Int iColPOC)
-{
-  UInt uiTempLayerCurr=7;
-  TComSlice* currSlice = getSlice(getCurrSliceIdx());
-  UInt NumDdvCandPics = 0;
+Int TComPic::getDisCandRefPictures( Int iColPOC )
+{
+  UInt       uiTempLayerCurr = 7;
+  TComSlice* currSlice       = getSlice(getCurrSliceIdx());
+  UInt       numDdvCandPics  = 0;
+
   if ( !currSlice->getEnableTMVPFlag() )
-    return NumDdvCandPics;
-  NumDdvCandPics +=1;
-
-  UInt iPOCCurr=currSlice->getPOC();
-  UInt iPOCDiff = 255;
-  Bool bCheck = false;
+    return numDdvCandPics;
+
+  numDdvCandPics += 1;
+
+  UInt pocCurr = currSlice->getPOC();
+  UInt pocDiff = 255;
 
   for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
   {
-    UInt X = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();
-    for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(X)); i++)
-    {
-      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)X, i)->getViewIndex() 
-        && (X == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)X, i)!= iColPOC) && NumDdvCandPics!=2)
-      {
-        TComSlice* refSlice = currSlice->getRefPic((RefPicList)X, i)->getSlice(getCurrSliceIdx());
-        Bool bRAP = (refSlice->getViewIndex() && refSlice->isIRAP())? 1: 0; 
-        UInt uiTempLayer = currSlice->getRefPic((RefPicList)X, i)->getSlice(getCurrSliceIdx())->getTLayer(); 
-        Int iTempPoc = currSlice->getRefPic((RefPicList)X, i)->getPOC();
-        Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc);
-        if(bRAP)
+    UInt x = lpNr ? currSlice->getColFromL0Flag() : 1 - currSlice->getColFromL0Flag();
+
+    for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
+    {
+      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() 
+        && (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) && numDdvCandPics!=2)
+      {
+        TComSlice* refSlice    = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx());
+        Bool       bRAP        = (refSlice->getViewIndex() && refSlice->isIRAP())? 1: 0; 
+        UInt       uiTempLayer = currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer(); 
+        
+        if( bRAP )
         {
           this->setRapRefIdx(i);
-          this->setRapRefList((RefPicList)X);
-          NumDdvCandPics = 2;
-          return NumDdvCandPics;
+          this->setRapRefList((RefPicList)x);
+          numDdvCandPics = 2;
+
+          return numDdvCandPics;
         }
         else if (uiTempLayerCurr > uiTempLayer) 
+        {
            uiTempLayerCurr = uiTempLayer; 
-      }
-    }
-  }
-  UInt Z;
-  UInt idx=0;
+        }
+      }
+    }
+  }
+
+  UInt z   = -1; // GT: Added to make code compile needs to be checked!
+  UInt idx = 0;
+  
   for(UInt lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
   {
-    UInt X = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();
-    for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(X)); i++)
-    {
-      Int iTempPoc = currSlice->getRefPic((RefPicList)X, i)->getPOC();
-      Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc);
-      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)X, i)->getViewIndex() &&  (X == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)X, i)!= iColPOC) 
-        && currSlice->getRefPic((RefPicList)X, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && iPOCDiff > iTempDiff)
-      {
-        iPOCDiff=iTempDiff;
-        Z=X;
-        idx = i;
-      }
-    }
-  }
-  if(iPOCDiff<255)
+    UInt x = lpNr? currSlice->getColFromL0Flag() : 1-currSlice->getColFromL0Flag();
+    
+    for (UInt i = 0; i < currSlice->getNumRefIdx(RefPicList(x)); i++)
+    {
+      Int iTempPoc = currSlice->getRefPic((RefPicList)x, i)->getPOC();
+      Int iTempDiff = (iTempPoc > pocCurr) ? (iTempPoc - pocCurr): (pocCurr - iTempPoc);
+      
+      if(currSlice->getViewIndex() == currSlice->getRefPic((RefPicList)x, i)->getViewIndex() &&  (x == currSlice->getColFromL0Flag()||currSlice->getRefPOC((RefPicList)x, i)!= iColPOC) 
+        && currSlice->getRefPic((RefPicList)x, i)->getSlice(getCurrSliceIdx())->getTLayer() == uiTempLayerCurr && pocDiff > iTempDiff)
+      {
+        pocDiff = iTempDiff;
+        z       = x;
+        idx     = i;
+      }
+    }
+  }
+
+  if( pocDiff < 255 )
   {
     this->setRapRefIdx(idx);
-    this->setRapRefList((RefPicList)Z);
-    NumDdvCandPics = 2;
-  }
-
-  return NumDdvCandPics;
+    this->setRapRefList((RefPicList) z );
+    numDdvCandPics = 2;
+  }
+
+  return numDdvCandPics;
 }
 #endif
Index: branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h	(revision 455)
+++ branches/HTM-DEV-0.3-dev2/source/Lib/TLibCommon/TypeDef.h	(revision 456)
@@ -102,4 +102,7 @@
 #define H_3D_VSO_RM_ASSERTIONS            0   // Output VSO assertions
 #define H_3D_VSO_SYNTH_DIST_OUT           0   // Output of synthesized view distortion instead of depth distortion in encoder output
+
+#define H_3D_VSO_FIX                      0   // This fix should be enabled after verification 
+
 #endif
 ////   ****** Neighbouring block-based Disparity Vector  *********
Index: branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 455)
+++ branches/HTM-DEV-0.3-dev2/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 456)
@@ -2576,4 +2576,5 @@
       
 #if H_3D_VSO // M35
+#if H_3D_VSO_FIX // This fix should be enabled after verification 
         Double dLambda;
         if ( m_pcRdCost->getUseLambdaScaleVSO() )
@@ -2583,4 +2584,7 @@
 
         Double cost      = (Double)uiSad + (Double)iModeBits * m_pcRdCost->getSqrtLambda();
+#else
+        Double cost      = (Double)uiSad + (Double)iModeBits * m_pcRdCost->getSqrtLambda();
+#endif
 #else
         Double cost      = (Double)uiSad + (Double)iModeBits * m_pcRdCost->getSqrtLambda();
