Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 164)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp	(revision 167)
@@ -3513,8 +3513,13 @@
   {
 #if LGE_DVMCP
-#if LGE_IVMP_PARALLEL_MERGE_B0136 
+#if LGE_IVMP_PARALLEL_MERGE_B0136 && !QC_SIMPLE_NBDV_B0047
     getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true, REF_PIC_LIST_X, -1, true );
 #else
-    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true );
+    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo
+#if LGE_IVMP_PARALLEL_MERGE_B0136==QC_SIMPLE_NBDV_B0047
+,
+true
+#endif
+);
 #endif
 #else
@@ -4901,13 +4906,22 @@
 
 #if LGE_DVMCP
+#if QC_SIMPLE_NBDV_B0047
+Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo
+#if LGE_IVMP_PARALLEL_MERGE_B0136
+                                , Bool bParMerge
+#endif
+#else
 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0
 #if LGE_IVMP_PARALLEL_MERGE_B0136
                                 , Bool bParMerge
 #endif
+#endif
                                 )
 {
   PartSize eCUMode = getPartitionSize( uiPartAddr );
   TComDataCU* pcTmpCU = NULL;
+#if !QC_SIMPLE_NBDV_B0047
   TComDataCU* pcCULeft = NULL;
+#endif
   pDInfo->iN = 0;
 
@@ -4917,7 +4931,13 @@
   UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
 
-  Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºúÓ°¿¡¼­ »ç¿E?DV¸¦ ÀúÀE
+#if QC_SIMPLE_NBDV_B0047
+  const Int iNumofDvMCP = 7;
+  Int   aiDvMcpDvCand[2][iNumofDvMCP] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
+  Bool  abDvMcpFlag  [2][iNumofDvMCP] = {{false,},{false,}}; 
+#else
+  Int   aiDvMcpDvCand[2][7] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
   Bool  abDvMcpFlag  [2][7] = {{false,},{false,}}; 
   //Int   aiRefPOC     [2][7] = {{-1,},{-1}}; // debug
+#endif
   TComMv cTmpMvPred, cMv;
   Bool  bTmpIsSkipped = false;
@@ -4958,7 +4978,9 @@
 #endif
 
-
+#if !QC_SIMPLE_NBDV_B0047
   pcCULeft = pcTmpCU;
   UInt uiLeftPartIdx = uiIdx;
+#endif
+
   if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
   {
@@ -5212,4 +5234,5 @@
   if ( getSlice()->getPPS()->getEnableTMVPFlag() )
   {
+#if !QC_SIMPLE_NBDV_B0047
     UInt uiPUIdx = uiPartIdx;
     UInt uiAbsPartAddr = uiPartAddr;
@@ -5369,9 +5392,105 @@
       }
     }
+#else
+    TComMv cColMv;
+    Int iTargetViewIdx = 0;
+    Int iTStartViewIdx = 0;
+    UInt uiPartIdxRB, uiBRIdx;
+    Int uiViewIdxCurr= getSlice()->getViewId();
+    UInt uiPartIdxCenter;
+    xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter );
+
+    Int uiLCUIdx = getAddr();
+    Int uiLCUnew = uiLCUIdx;
+    eCUMode = getPartitionSize( 0 );
+    deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB );  
+    uiBRIdx = uiPartIdxLT;
+    UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
+    if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ))  // image boundary check
+    {
+      if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU 
+      ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row    of LCU
+      {
+        uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];
+      }
+      else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
+      {
+        uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];
+        uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU();
+      }
+      else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
+      {
+        uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];
+        uiLCUnew = uiLCUIdx + 1;
+      }
+      else //is the right bottom corner of LCU                       
+      {
+        uiBRIdx = 0;
+        uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1;
+      }
+    }
+    const Int iNumofCandPic = 2;
+    for(Int i =0; i < iNumofCandPic; i++)
+    {
+      Int lpRef=0;
+      if(i == 0)
+      {   //check the col-located picture
+        eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0);
+#if COLLOCATED_REF_IDX
+        lpRef = getSlice()->getColRefIdx();
+#else
+        Int lpRef = 0;
+#endif
+      }
+      else
+      {
+        if(!(getPic()->getRapbCheck()))
+          break;
+        eRefPicList=getPic()->getRapRefList();
+        lpRef=getPic()->getRapRefIdx();
+      }
+
+      if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() ) 
+      {
+        if (uiViewIdxCurr > 1)  
+        {
+          if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
+          {
+            clipMv(cColMv);
+            pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
+            pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
+            return ;
+          }
+        }
+
+        if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx ))
+        {
+          clipMv(cColMv);
+          pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
+          pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
+          return ;
+        }
+        if(uiViewIdxCurr == 1)  
+        {
+          if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 
+          {
+            clipMv(cColMv);
+            pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
+            pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
+            return ;
+          }
+        }
+      }
+    }
+#endif
   } // if TMVP Flag
 
   if( bDvMcpIsFound ) // skip dvmcp
   {
+#if QC_SIMPLE_NBDV_B0047 
+    for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial
+#else
     for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal
+#endif
     {
       for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
@@ -5389,10 +5508,7 @@
     }
   }
-
   return;
-
-}
-#endif
-
+}
+#endif
 #endif
 
@@ -5434,5 +5550,9 @@
       cDisInfo.iN = 0;
 #if LGE_DVMCP
+#if QC_SIMPLE_NBDV_B0047
+      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo); 
+#else
       getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx );
+#endif
 #else
       getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo );
@@ -5486,5 +5606,9 @@
   {
 #if LGE_DVMCP
+#if QC_SIMPLE_NBDV_B0047 
+    getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo);
+#else
     getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx );
+#endif
 #else
     getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo );
@@ -6172,5 +6296,5 @@
 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx )
 {
-#if LGE_DVMCP
+#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
   Int  iDvMcpDispX[2] = {-1,};
   Bool bDvMcpFlag [2] = { false, }; 
@@ -6191,5 +6315,5 @@
     return false;
   }
-#if LGE_DVMCP
+#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
   Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr );
 #endif
@@ -6215,5 +6339,5 @@
     if ( iColViewIdx    == iColRefViewIdx ) // temporal vector
     {
-#if LGE_DVMCP
+#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
       if( iColViewIdx >0 )
       {
@@ -6242,5 +6366,5 @@
   }
 
-#if LGE_DVMCP
+#if LGE_DVMCP && !QC_SIMPLE_NBDV_B0047
   for( Int ilist=0 ; ilist<2 ; ilist++ )
   {
@@ -7360,5 +7484,9 @@
   m_pePartSize[0] =  SIZE_2Nx2N;
 #if LGE_DVMCP
+#if QC_SIMPLE_NBDV_B0047
+  getDisMvpCand2( 0, 0,  &cDisInfo);
+#else
   getDisMvpCand2( 0, 0,  &cDisInfo, true );
+#endif
 #else
   getDisMvpCand        ( 0, 0,  &cDisInfo );
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 164)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComDataCU.h	(revision 167)
@@ -538,4 +538,11 @@
   Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
 #if LGE_DVMCP
+#if QC_SIMPLE_NBDV_B0047
+  Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo
+#if LGE_IVMP_PARALLEL_MERGE_B0136
+    , Bool bParMerg = false
+#endif
+    );
+#else
   Void          getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1
 #if LGE_IVMP_PARALLEL_MERGE_B0136
@@ -543,4 +550,5 @@
 #endif
     );
+#endif
 #endif
 
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.cpp
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.cpp	(revision 164)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.cpp	(revision 167)
@@ -81,4 +81,10 @@
   m_aaiCodedScale     = 0;
   m_aaiCodedOffset    = 0;
+#if QC_SIMPLE_NBDV_B0047
+  m_bRapCheck = false;
+  m_eRapRefList = REF_PIC_LIST_0;
+  m_uiRapRefIdx = 0;
+#endif
+
 }
 
@@ -480,4 +486,70 @@
   }
 }
+#if QC_SIMPLE_NBDV_B0047
+Bool TComPic::getDisCandRefPictures(Int iColPOC)
+{
+  UInt uiTempLayerCurr=7;
+  TComSlice* currSlice = getCurrSlice();
+  UInt iPOCCurr=currSlice->getPOC();
+  UInt iPOCDiff = 255;
+  Bool  bRAP=false;
+  Bool bCheck = false;
+  Int MaxRef = currSlice->getNumRefIdx(RefPicList(0));
+  RefPicList eRefPicList = REF_PIC_LIST_0 ;
+  if(currSlice->isInterB())
+  {
+    if(currSlice->getNumRefIdx(RefPicList(0))< currSlice->getNumRefIdx(RefPicList(1)))
+      MaxRef = currSlice->getNumRefIdx(RefPicList(1));
+  }
+  for(Int lpRef = 0; lpRef < MaxRef; lpRef++)
+  {
+    for(Int lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++)
+    {
+      eRefPicList = RefPicList(0);
+      if(currSlice->isInterB())
+        eRefPicList = RefPicList(lpNr==0 ? (currSlice->getColDir()): (1-currSlice->getColDir()));
+      if(iColPOC == currSlice->getRefPOC(eRefPicList, lpRef))
+        continue;
+      if(lpRef >= currSlice->getNumRefIdx(eRefPicList)||(currSlice->getViewId() != currSlice->getRefPic( eRefPicList, lpRef)->getViewId()))
+        continue;
+      Int iTempPoc = currSlice->getRefPic(eRefPicList, lpRef)->getPOC();
+      UInt uiTempLayer = currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getTLayer(); 
+      Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc);
+      bRAP = (currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV? 1:0);
+      if( bRAP)
+      {
+         bCheck = true;
+         this->setRapRefIdx(lpRef);
+         this->setRapRefList(eRefPicList);
+         return bCheck;
+      }
+      if(uiTempLayerCurr > uiTempLayer)
+      {
+        bCheck = true;
+        if(uiTempLayerCurr == uiTempLayer)
+        {
+          if(iPOCDiff > iTempDiff)
+          {
+            iPOCDiff=iTempDiff;
+            if(iPOCDiff < 255)
+            {
+              this->setRapRefIdx(lpRef);
+              this->setRapRefList(eRefPicList);
+            }
+          }
+        }
+        else
+        {
+          iPOCDiff=iTempDiff;
+          uiTempLayerCurr = uiTempLayer;
+          this->setRapRefIdx(lpRef);
+          this->setRapRefList(eRefPicList);
+        } 
+      }
+    }
+  }
+  return bCheck;
+}
+#endif
 
 #if HHI_INTERVIEW_SKIP
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.h	(revision 164)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TComPic.h	(revision 167)
@@ -82,4 +82,9 @@
   Bool          m_checked;
 #endif
+#if QC_SIMPLE_NBDV_B0047
+  UInt        m_uiRapRefIdx;
+  RefPicList  m_eRapRefList;
+  Bool        m_bRapCheck;
+#endif
 #endif
 #if HHI_INTER_VIEW_RESIDUAL_PRED
@@ -173,4 +178,13 @@
 #if HHI_INTER_VIEW_RESIDUAL_PRED
   TComPicYuv*   getResidual()         { return  m_pcResidual; }
+#endif
+#if QC_SIMPLE_NBDV_B0047
+  UInt          getRapRefIdx()                         {return m_uiRapRefIdx;}
+  RefPicList    getRapRefList()                        {return m_eRapRefList;}
+  Void          setRapRefIdx(UInt uiRapRefIdx)         {m_uiRapRefIdx = uiRapRefIdx;}
+  Void          setRapRefList(RefPicList eRefPicList)  {m_eRapRefList = eRefPicList;}
+  Bool          getRapbCheck()                         {return m_bRapCheck;}
+  Void          setRapbCheck(Bool bCheck)              {m_bRapCheck = bCheck;}
+  Bool          getDisCandRefPictures(Int iColPOC);
 #endif
 
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 164)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibCommon/TypeDef.h	(revision 167)
@@ -77,5 +77,5 @@
     #define DIS_CANS                      1
 #endif                                  
-                                        
+#define QC_SIMPLE_NBDV_B0047              1   //JCT2-B0047
 #define MTK_INTERVIEW_MERGE_A0049         1   //  JCT2-A0049 second part
 #define SHARP_INTERVIEW_DECOUPLE_B0111    1   //  JCT3V-B0111 decoupling inter-view candidate
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp	(revision 164)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibDecoder/TDecGop.cpp	(revision 167)
@@ -312,4 +312,11 @@
 #endif
 
+#if QC_SIMPLE_NBDV_B0047
+    if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode())
+    {
+      Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx());
+      rpcPic->setRapbCheck(rpcPic->getDisCandRefPictures(iColPoc));
+    }
+#endif
 
     m_pcSbacDecoders[0].load(m_pcSbacDecoder);
Index: branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 164)
+++ branches/HTM-4.1-dev1-Qualcomm/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 167)
@@ -719,4 +719,11 @@
 #endif
 
+#if QC_SIMPLE_NBDV_B0047
+      if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode())
+      {
+        Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx());
+        pcPic->setRapbCheck(pcPic->getDisCandRefPictures(iColPoc));
+      }
+#endif
       while(uiNextCUAddr<uiRealEndAddress) // determine slice boundaries
       {
