Index: /branches/HTM-5.1-dev2-Sony/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-5.1-dev2-Sony/source/Lib/TLibCommon/TComDataCU.cpp	(revision 262)
+++ /branches/HTM-5.1-dev2-Sony/source/Lib/TLibCommon/TComDataCU.cpp	(revision 263)
@@ -6693,5 +6693,10 @@
   Int iNeibPOC = iCurrPOC;
   Int iNeibRefPOC;
-
+#if INTER_VIEW_VECTOR_SCALING_C0116
+  Int iCurrViewId = m_pcSlice->getViewOrderIdx(); // will be changed to view_id
+  Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewOrderIdx(); // will be changed to view_id
+  Int iNeibViewId = iCurrViewId;
+  Int iNeibRefViewId;
+#endif
 #if QC_IV_AS_LT_B0046
   Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm();
@@ -6701,7 +6706,14 @@
   {
     iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
+#if INTER_VIEW_VECTOR_SCALING_C0116
+    iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id
+#endif
 #if QC_IV_AS_LT_B0046
     bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm() ;
+#if INTER_VIEW_VECTOR_SCALING_C0116
+    if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && ((iNeibRefPOC == iCurrRefPOC) && (iNeibRefViewId == iCurrRefViewId)))
+#else
     if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && (iNeibRefPOC == iCurrRefPOC) )
+#endif
 #else
     if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) )
@@ -6724,4 +6736,7 @@
   {
     iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) );
+#if INTER_VIEW_VECTOR_SCALING_C0116
+    iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id
+#endif
     TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     TComMv rcMv;
@@ -6736,5 +6751,13 @@
     }
 #endif
+#if INTER_VIEW_VECTOR_SCALING_C0116
+    Int iScale = 4096;
+    if((iCurrRefPOC != iNeibRefPOC)  )    // inter & inter
+        iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
+    else if(m_pcSlice->getIVScalingFlag())    // inter-view & inter-view
+        iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iNeibViewId, iNeibRefViewId );
+#else
     Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
+#endif
     if ( iScale == 4096 )
     {
@@ -6758,4 +6781,7 @@
   {
     iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) );
+#if INTER_VIEW_VECTOR_SCALING_C0116
+    iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id
+#endif
     TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx);
     TComMv rcMv;
@@ -6770,5 +6796,13 @@
     }
 #endif
+#if INTER_VIEW_VECTOR_SCALING_C0116
+    Int iScale = 4096;
+    if((iCurrRefPOC != iNeibRefPOC))    // inter & inter
+        iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
+    else if(m_pcSlice->getIVScalingFlag())    // inter-view & inter-view
+        iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iNeibViewId, iNeibRefViewId );
+#else
     Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC );
+#endif
     if ( iScale == 4096 )
     {
Index: /branches/HTM-5.1-dev2-Sony/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-5.1-dev2-Sony/source/Lib/TLibCommon/TypeDef.h	(revision 262)
+++ /branches/HTM-5.1-dev2-Sony/source/Lib/TLibCommon/TypeDef.h	(revision 263)
@@ -149,4 +149,5 @@
 #define LG_ZEROINTRADEPTHRESI_A0087       1   // JCT2-A0087
 #define INTER_VIEW_VECTOR_SCALING_C0115   1   // JCT2-C0115 Inter-view vector scaling for TMVP & flag
+#define INTER_VIEW_VECTOR_SCALING_C0116   1   // JCT2-C0116 Inter-view vector scaling for AMVP
 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC     1   // full-pel mv accuracy for depth maps
 #define VIDYO_VPS_INTEGRATION             1
