Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.cpp	(revision 1100)
@@ -3658,4 +3658,37 @@
 }
 
+#if SEC_ARP_VIEW_REF_CHECK_J0037 || SEC_DBBP_VIEW_REF_CHECK_J0037
+Void TComSlice::setDefaultRefView( )
+{
+  setDefaultRefViewIdx( -1 );
+  setDefaultRefViewIdxAvailableFlag( false ); 
+
+  Int valid = 0;
+  Int DefaultRefViewIdx = -1;
+  for( UInt curViewIdx = 0; curViewIdx < getViewIndex() && valid == 0; curViewIdx++ )
+  {
+    for( Int iRefListId = 0; ( iRefListId < (isInterB() ? 2 : 1) ) && !isIntra() && valid == 0; iRefListId++ )
+    {
+      RefPicList eRefPicList = RefPicList( iRefListId );
+      Int        iNumRefPics = getNumRefIdx( eRefPicList );
+      for( Int i = 0; i < iNumRefPics; i++ )
+      { 
+        if(getPOC() == getRefPic( eRefPicList, i )->getPOC() && curViewIdx == getRefPic( eRefPicList, i )->getViewIndex())
+        {
+          valid = 1;
+          DefaultRefViewIdx = curViewIdx;
+          break;
+        }
+      }
+    }
+  }
+  if( valid )
+  {
+    setDefaultRefViewIdx( DefaultRefViewIdx );
+    setDefaultRefViewIdxAvailableFlag( true );   
+  }
+}
+#endif
+
 #if H_3D_ARP
 Void TComSlice::setARPStepNum( TComPicLists*ivPicLists )
@@ -3690,5 +3723,9 @@
       }
     }
+#if SEC_ARP_VIEW_REF_CHECK_J0037
+    tempRefPicInListsFlag = (getFirstTRefIdx(REF_PIC_LIST_0) >= 0 || getFirstTRefIdx(REF_PIC_LIST_1) >= 0) && getDefaultRefViewIdxAvailableFlag();
+#else
     tempRefPicInListsFlag = getFirstTRefIdx(REF_PIC_LIST_0) >= 0 || getFirstTRefIdx(REF_PIC_LIST_1) >= 0;
+#endif
     m_nARPStepNum = tempRefPicInListsFlag ? getVPS()->getARPStepNum(getLayerId()) : 0;
   }
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.h	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TComSlice.h	(revision 1100)
@@ -2780,4 +2780,7 @@
   Void setDefaultRefViewIdxAvailableFlag(Bool bViewIdx) { m_bDefaultRefViewIdxAvailableFlag = bViewIdx; }
 #endif
+#if SEC_ARP_VIEW_REF_CHECK_J0037 || SEC_DBBP_VIEW_REF_CHECK_J0037
+  Void setDefaultRefView( );
+#endif
 
 protected:
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TypeDef.h	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibCommon/TypeDef.h	(revision 1100)
@@ -115,4 +115,5 @@
                                               // SHARP_ARP_CHROMA_I0104     
                                               // MTK_I0072_IVARP_SCALING_FIX
+#define SEC_ARP_VIEW_REF_CHECK_J0037      1   // Signaling iv_res_pred_weight_idx when the current slice has both view and temporal reference picture(s), JCT3V-J0037 item1
 
 #define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
@@ -256,5 +257,5 @@
                                               // SHARP_DBBP_SIMPLE_FLTER_I0109     1   // Simple condition and one dimensional filter for DBBP
                                               // SEC_DBBP_DMM4_THRESHOLD_I0076     Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076
-
+#define SEC_DBBP_VIEW_REF_CHECK_J0037     1   // Signaling dbbp_flag when the current slice has view reference picture(s), JCT3V-J0037 item4
 
 #define H_3D_DDD                          1   // Disparity derived depth coding
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1100)
@@ -152,5 +152,9 @@
   
 #if H_3D_DBBP
+#if SEC_DBBP_VIEW_REF_CHECK_J0037
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
+#else
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
+#endif
   {
     decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecSlice.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecSlice.cpp	(revision 1100)
@@ -280,5 +280,5 @@
       iNumSubstreamsPerTile = 1;
     }
-#if LGE_DEFAULT_DV_J0046
+#if LGE_DEFAULT_DV_J0046 && !SEC_ARP_VIEW_REF_CHECK_J0037 && !SEC_DBBP_VIEW_REF_CHECK_J0037
     pcSlice->setDefaultRefViewIdx( -1 );
     pcSlice->setDefaultRefViewIdxAvailableFlag( false ); 
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1100)
@@ -1082,4 +1082,9 @@
     pcSlice->getTempRefPicLists( m_cListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr);
     pcSlice->setRefPicList     ( tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true ); 
+
+#if SEC_ARP_VIEW_REF_CHECK_J0037 || SEC_DBBP_VIEW_REF_CHECK_J0037
+    pcSlice->setDefaultRefView();
+#endif
+
 #if H_3D_ARP
     pcSlice->setARPStepNum(m_ivPicLists);
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1100)
@@ -605,5 +605,9 @@
       }
 #if  H_3D_FAST_TEXTURE_ENCODING
+#if SEC_ARP_VIEW_REF_CHECK_J0037 || SEC_DBBP_VIEW_REF_CHECK_J0037
+      if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
+#else
       if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth())
+#endif
       {
         PartSize ePartTemp = rpcTempCU->getPartitionSize(0);
@@ -668,5 +672,9 @@
           
 #if H_3D_DBBP
+#if SEC_DBBP_VIEW_REF_CHECK_J0037
+          if( m_pcEncCfg->getUseDBBP() && rpcTempCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
+#else
           if( m_pcEncCfg->getUseDBBP() )
+#endif
           {
             xCheckRDCostInterDBBP( rpcBestCU, rpcTempCU, false );
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1100)
@@ -268,5 +268,9 @@
   
 #if H_3D_DBBP
+#if SEC_DBBP_VIEW_REF_CHECK_J0037
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
+#else
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
+#endif
   {
     encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1100)
@@ -953,4 +953,7 @@
     pcSlice->setApplySingleDepthMode(enableSingleDepthMode);
 #endif    
+#if SEC_ARP_VIEW_REF_CHECK_J0037 || SEC_DBBP_VIEW_REF_CHECK_J0037
+    pcSlice->setDefaultRefView();
+#endif
 #if H_3D_ARP
     //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh
Index: branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1098)
+++ branches/HTM-12.2-dev2-Samsung/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1100)
@@ -1011,5 +1011,5 @@
     }
   }
-#if LGE_DEFAULT_DV_J0046
+#if LGE_DEFAULT_DV_J0046 && !SEC_ARP_VIEW_REF_CHECK_J0037 && !SEC_DBBP_VIEW_REF_CHECK_J0037
   pcSlice->setDefaultRefViewIdx( -1 );
   pcSlice->setDefaultRefViewIdxAvailableFlag( false ); 
