Index: /branches/HTM-5.0-Qualcomm-Fix/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-5.0-Qualcomm-Fix/source/Lib/TLibCommon/TComDataCU.cpp	(revision 203)
+++ /branches/HTM-5.0-Qualcomm-Fix/source/Lib/TLibCommon/TComDataCU.cpp	(revision 204)
@@ -3831,4 +3831,12 @@
         bRemoveSpa                      = true;
         abCandIsInter        [ iCount ] = false;
+#if FIX_MISUSE_REFINDEX
+        //reset to the default value for IC, MC
+        puhInterDirNeighbours[iCount]   = 0;
+        TComMv  cZeroMv;
+        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
+        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
+        break;
+#endif
       }
     }
@@ -3950,4 +3958,12 @@
         bRemoveSpa                      = true;
         abCandIsInter        [ iCount ] = false;
+#if FIX_MISUSE_REFINDEX
+        //reset to the default value for IC, MC
+        puhInterDirNeighbours[iCount]   = 0;
+        TComMv  cZeroMv;
+        pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
+        pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
+        break;
+#endif
       }
     }
@@ -4132,4 +4148,12 @@
           bRemoveSpa                      = true;
           abCandIsInter        [ iCount ] = false;
+#if FIX_MISUSE_REFINDEX
+          //reset to the default value for IC, MC
+          puhInterDirNeighbours[iCount]   = 0;
+          TComMv  cZeroMv;
+          pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID );
+          pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID );
+          break;
+#endif
         }
       }
@@ -6092,4 +6116,7 @@
     {
       pInfo->iN = 1;
+#if FIX_MISUSE_REFINDEX
+      pInfo->m_acMvCand[ 1 ].set(0, 0);
+#endif
     }
   }
@@ -6863,5 +6890,24 @@
       }
     }else
+#if QC_MVHEVC_B0046
       rcMv = cColMv; //inter-view
+#else
+    {
+#if SONY_COLPIC_AVAILABILITY
+      Int iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();
+      iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx);
+      if ( iScale == 4096 )
+      {
+        rcMv = cColMv;
+      }
+      else
+      {
+        rcMv = cColMv.scaleMv( iScale );
+      }
+#else
+      return false;
+#endif
+    }
+#endif
   }
 #else
Index: /branches/HTM-5.0-Qualcomm-Fix/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-5.0-Qualcomm-Fix/source/Lib/TLibCommon/TypeDef.h	(revision 203)
+++ /branches/HTM-5.0-Qualcomm-Fix/source/Lib/TLibCommon/TypeDef.h	(revision 204)
@@ -42,9 +42,9 @@
 //! \{
 #define QC_MVHEVC_B0046                   0   //JCT3V-B0046: disable 3DHEVC tools
-#define QC_IV_AS_LT_B0046                 0   //JCT3V-B0046: inter-view reference pictures are treated as long-term pictures, scaling of motion vectors for DCP based on ViewId/ViewOrderIdx is disabled  
-#define QC_TMVP_IDX_MOD_B0046             0   //JCT3V-B0046: the reference index for temporal merging candidate is set to 0, as defined in HEVC
-#define QC_REM_IDV_B0046                  0   //JCT3V-B0046: removal of IDV NAL unit type
-#define FIX_DEL_NULLPTR                   0
-
+#define QC_IV_AS_LT_B0046                 1   //JCT3V-B0046: inter-view reference pictures are treated as long-term pictures, scaling of motion vectors for DCP based on ViewId/ViewOrderIdx is disabled  
+#define QC_TMVP_IDX_MOD_B0046             1   //JCT3V-B0046: the reference index for temporal merging candidate is set to 0, as defined in HEVC
+#define QC_REM_IDV_B0046                  1   //JCT3V-B0046: removal of IDV NAL unit type
+#define FIX_DEL_NULLPTR                   1
+#define FIX_MISUSE_REFINDEX               1
 #define DV_V_RESTRICTION_B0037            1   // JCT3V-B0037 disparity vector vertical range restriction
 
@@ -63,5 +63,5 @@
 
 // FCO 
-#define FLEX_CODING_ORDER_M23723          1
+#define FLEX_CODING_ORDER_M23723          0
 #if FLEX_CODING_ORDER_M23723
   #define DISABLE_FCO_FOR_VSO             0 // Optional compile settings to disable VSO with FCO.
