Index: branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg
===================================================================
--- branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg	(revision 196)
+++ branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg	(revision 197)
@@ -195,4 +195,6 @@
 InterViewSkip             : 0                                      # interview SKIP mode
 InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
+DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
+VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
 
 
Index: branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_2view.cfg
===================================================================
--- branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_2view.cfg	(revision 196)
+++ branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_2view.cfg	(revision 197)
@@ -189,5 +189,6 @@
 InterViewSkip             : 0                                      # interview SKIP mode
 InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
-
+DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
+VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
 
 #========== depth coding tools ==========
Index: branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg
===================================================================
--- branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg	(revision 196)
+++ branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg	(revision 197)
@@ -199,4 +199,6 @@
 InterViewSkip             : 0                                      # interview SKIP mode
 InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
+DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
+VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
 
 
Index: branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_3view.cfg
===================================================================
--- branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_3view.cfg	(revision 196)
+++ branches/HTM-5.0-Sony/CommonTestConditionsCfgs/baseCfg_3view.cfg	(revision 197)
@@ -191,4 +191,6 @@
 InterViewSkip             : 0                                      # interview SKIP mode
 InterViewSkipLambdaScale  : 8                                      # lambda scale for inter-view skip mode
+DisparitySearchRangeRestriction : 0                                # 0: No disparity restriction 1: Use disparity restriction
+VerticalDisparitySearchRange    : 56                               # vertical disparity search range (in luma samples)
 
 
Index: branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 196)
+++ branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 197)
@@ -276,4 +276,8 @@
   ("FastSearch", m_iFastSearch, 1, "0:Full search  1:Diamond  2:PMVFAST")
   ("SearchRange,-sr",m_iSearchRange, 96, "motion search range")
+#if DV_V_RESTRICTION_B0037
+  ("DisparitySearchRangeRestriction",m_bUseDisparitySearchRangeRestriction, false, "restrict disparity search range")
+  ("VerticalDisparitySearchRange",m_iVerticalDisparitySearchRange, 56, "vertical disparity search range")
+#endif
   ("BipredSearchRange", m_bipredSearchRange, 4, "motion search range for bipred refinement")
   ("HadamardME", m_bUseHADME, true, "hadamard ME for fractional-pel")
@@ -856,4 +860,7 @@
   xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2,                                     "Fast Search Mode is not supported value (0:Full search  1:Diamond  2:PMVFAST)" );
   xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
+#if DV_V_RESTRICTION_B0037
+  xConfirmPara( m_iVerticalDisparitySearchRange <= 0 ,                                      "Vertical Disparity Search Range must be more than 0" );
+#endif
   xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
   xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
@@ -1601,4 +1608,8 @@
   printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
   printf("Motion search range          : %d\n", m_iSearchRange );
+#if DV_V_RESTRICTION_B0037
+  printf("Disp search range restriction: %d\n", m_bUseDisparitySearchRangeRestriction );
+  printf("Vertical disp search range   : %d\n", m_iVerticalDisparitySearchRange );
+#endif
   printf("Intra period                 : %d\n", m_iIntraPeriod );
   printf("Decoding refresh type        : %d\n", m_iDecodingRefreshType );
Index: branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncCfg.h	(revision 196)
+++ branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncCfg.h	(revision 197)
@@ -203,4 +203,8 @@
   Int       m_iFastSearch;                                    ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST
   Int       m_iSearchRange;                                   ///< ME search range
+#if DV_V_RESTRICTION_B0037
+  Bool      m_bUseDisparitySearchRangeRestriction;            ///< restrict vertical search range for inter-view prediction
+  Int       m_iVerticalDisparitySearchRange;                  ///< ME vertical search range for inter-view prediction 
+#endif
   Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
   Bool      m_bUseFastEnc;                                    ///< flag for using fast encoder setting
Index: branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncTop.cpp	(revision 196)
+++ branches/HTM-5.0-Sony/source/App/TAppEncoder/TAppEncTop.cpp	(revision 197)
@@ -181,5 +181,8 @@
     m_acTEncTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
     m_acTEncTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
-
+#if DV_V_RESTRICTION_B0037
+    m_acTEncTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
+    m_acTEncTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
+#endif
   //====== Quality control ========
     m_acTEncTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
@@ -488,5 +491,8 @@
       m_acTEncDepthTopList[iViewIdx]->setSearchRange                  ( m_iSearchRange );
       m_acTEncDepthTopList[iViewIdx]->setBipredSearchRange            ( m_bipredSearchRange );
-
+#if DV_V_RESTRICTION_B0037
+      m_acTEncDepthTopList[iViewIdx]->setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
+      m_acTEncDepthTopList[iViewIdx]->setVerticalDisparitySearchRange( m_iVerticalDisparitySearchRange );
+#endif
       //====== Quality control ========
       m_acTEncDepthTopList[iViewIdx]->setMaxDeltaQP                   ( m_iMaxDeltaQP  );
Index: branches/HTM-5.0-Sony/source/App/TAppRenderer/TAppRendererTop.h
===================================================================
--- branches/HTM-5.0-Sony/source/App/TAppRenderer/TAppRendererTop.h	(revision 196)
+++ branches/HTM-5.0-Sony/source/App/TAppRenderer/TAppRendererTop.h	(revision 197)
Index: branches/HTM-5.0-Sony/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-5.0-Sony/source/Lib/TLibCommon/TypeDef.h	(revision 196)
+++ branches/HTM-5.0-Sony/source/Lib/TLibCommon/TypeDef.h	(revision 197)
@@ -46,4 +46,7 @@
 #define QC_REM_IDV_B0046                  1   //JCT3V-B0046: the reference index for temporal merging candidate is set to 0, as defined in HEVC
 #define FIX_DEL_NULLPTR                   1
+
+#define DV_V_RESTRICTION_B0037            1   // JCT3V-B0037 disparity vector vertical range restriction
+
 #if !QC_MVHEVC_B0046
 ///// ***** FIXES *********
Index: branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncCfg.h	(revision 196)
+++ branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncCfg.h	(revision 197)
@@ -183,5 +183,8 @@
   Int       m_iSearchRange;                     //  0:Full frame
   Int       m_bipredSearchRange;
-
+#if DV_V_RESTRICTION_B0037
+  Bool      m_bUseDisparitySearchRangeRestriction;
+  Int       m_iVerticalDisparitySearchRange;
+#endif
   //====== Quality control ========
   Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
@@ -468,5 +471,8 @@
   Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
   Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
-
+#if DV_V_RESTRICTION_B0037
+  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
+  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
+#endif
 #if HHI_INTER_VIEW_MOTION_PRED
   UInt      getMultiviewMvRegMode           ()      { return  m_uiMultiviewMvRegMode; }
@@ -559,5 +565,8 @@
   Int       getFastSearch                   ()      { return  m_iFastSearch; }
   Int       getSearchRange                  ()      { return  m_iSearchRange; }
-
+#if DV_V_RESTRICTION_B0037
+  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
+  Int       getVerticalDisparitySearchRange ()      { return  m_iVerticalDisparitySearchRange; }
+#endif
 #if HHI_VSO
   //==== VSO  ==========
Index: branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 196)
+++ branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 197)
@@ -160,4 +160,8 @@
                       Int           iSearchRange,
                       Int           bipredSearchRange,
+#if DV_V_RESTRICTION_B0037
+                      Bool          bUseDisparitySearchRangeRestriction,
+                      Int           iVerticalDisparitySearchRange,
+#endif
                       Int           iFastSearch,
                       Int           iMaxDeltaQP,
@@ -172,4 +176,8 @@
   m_iSearchRange         = iSearchRange;
   m_bipredSearchRange    = bipredSearchRange;
+#if DV_V_RESTRICTION_B0037
+  m_bUseDisparitySearchRangeRestriction = bUseDisparitySearchRangeRestriction;
+  m_iVerticalDisparitySearchRange = iVerticalDisparitySearchRange;
+#endif
   m_iFastSearch          = iFastSearch;
   m_iMaxDeltaQP          = iMaxDeltaQP;
@@ -4214,6 +4222,9 @@
   TComYuv*      pcYuv = pcYuvOrg;
   m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred];
-  
+
   Int           iSrchRng      = ( bBi ? m_bipredSearchRange : m_iSearchRange );
+#if DV_V_RESTRICTION_B0037
+  Int           iVerDispSrchRng = m_iVerticalDisparitySearchRange;  
+#endif
   TComPattern*  pcPatternKey  = pcCU->getPattern        ();
   
@@ -4252,8 +4263,26 @@
   
   TComMv      cMvPred = *pcMvPred;
-  
+
+#if DV_V_RESTRICTION_B0037
+  Bool bMv_VRng_Restricted = false;
+  if( pcCU->getSlice()->getViewId() > 0 
+      &&
+      pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC()
+      &&
+      m_bUseDisparitySearchRangeRestriction
+     )
+  {
+      bMv_VRng_Restricted = true;
+  }
+#endif
+
+#if DV_V_RESTRICTION_B0037
+  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng );
+  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng );
+#else
   if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
   else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
-  
+#endif
+
   m_pcRdCost->getMotionCost ( 1, 0 );
   
@@ -4280,5 +4309,9 @@
     if( bMultiviewReg && !bBi )
     {
+#if DV_V_RESTRICTION_B0037
+      xSetSearchRange( pcCU, cOrgDepthMapMv, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, iVerDispSrchRng  );
+#else
       xSetSearchRange( pcCU, cOrgDepthMapMv, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
+#endif
     }
   }
@@ -4332,6 +4365,9 @@
 }
 
-
+#if DV_V_RESTRICTION_B0037
+Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB, Bool bMv_VRng_Restricted, Int iVerDispSrchRng )
+#else
 Void TEncSearch::xSetSearchRange ( TComDataCU* pcCU, TComMv& cMvPred, Int iSrchRng, TComMv& rcMvSrchRngLT, TComMv& rcMvSrchRngRB )
+#endif
 {
   Int  iMvShift = 2;
@@ -4348,4 +4384,17 @@
   rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
   rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
+
+#if DV_V_RESTRICTION_B0037
+  if ( bMv_VRng_Restricted ) {
+    Int iRestrictMvVrange = ( iVerDispSrchRng ) << iMvShift;    
+    if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange  ){
+      rcMvSrchRngRB.setVer( iRestrictMvVrange );
+    }
+    //restrict minus vector too
+    if ( rcMvSrchRngLT.getVer() <= -iRestrictMvVrange ){
+      rcMvSrchRngLT.setVer( -iRestrictMvVrange );
+    }
+  }
+#endif
   pcCU->clipMv        ( rcMvSrchRngLT );
   pcCU->clipMv        ( rcMvSrchRngRB );
Index: branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncSearch.h	(revision 196)
+++ branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncSearch.h	(revision 197)
@@ -94,4 +94,8 @@
   Int             m_iSearchRange;
   Int             m_bipredSearchRange; // Search range for bi-prediction
+#if DV_V_RESTRICTION_B0037
+  Bool            m_bUseDisparitySearchRangeRestriction;
+  Int             m_iVerticalDisparitySearchRange;
+#endif
   Int             m_iFastSearch;
   Int             m_aaiAdaptSR[2][33];
@@ -132,4 +136,8 @@
             Int           iSearchRange,
             Int           bipredSearchRange,
+#if DV_V_RESTRICTION_B0037
+            Bool          bUseDisparitySearchRangeRestriction,
+            Int           iVerticalDisparitySearchRange,
+#endif
             Int           iFastSearch,
             Int           iMaxDeltaQP,
@@ -523,4 +531,13 @@
                                     UInt&         ruiSAD );
   
+#if DV_V_RESTRICTION_B0037
+  Void xSetSearchRange            ( TComDataCU*   pcCU,
+                                    TComMv&       cMvPred,
+                                    Int           iSrchRng,
+                                    TComMv&       rcMvSrchRngLT,
+                                    TComMv&       rcMvSrchRngRB,
+                                    Bool          bDispSrchRngRst,
+                                    Int           iDispVerSrchRng );
+#else
   Void xSetSearchRange            ( TComDataCU*   pcCU,
                                     TComMv&       cMvPred,
@@ -528,4 +545,5 @@
                                     TComMv&       rcMvSrchRngLT,
                                     TComMv&       rcMvSrchRngRB );
+#endif
   
   Void xPatternSearchFast         ( TComDataCU*   pcCU,
Index: branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncTop.cpp	(revision 196)
+++ branches/HTM-5.0-Sony/source/Lib/TLibEncoder/TEncTop.cpp	(revision 197)
@@ -375,6 +375,9 @@
   
   // initialize encoder search class
+#if DV_V_RESTRICTION_B0037
+  m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_bUseDisparitySearchRangeRestriction, m_iVerticalDisparitySearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
+#else
   m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() );
-
+#endif
   if(m_bUseALF)
   {
