Index: branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/baseCfg_2view.cfg
===================================================================
--- branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/baseCfg_2view.cfg	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/baseCfg_2view.cfg	(revision 1157)
@@ -94,4 +94,6 @@
 FEN                           : 1           # Fast encoder decision
 FDM                           : 1           # Fast Decision for Merge RD cost
+DispSearchRangeRestriction    : 0           # Limit Search range for vertical component of disparity vector
+VerticalDispSearchRange       : 56          # Vertical Search range in pixel
 
 #======== Quantization =============
Index: branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/baseCfg_3view.cfg
===================================================================
--- branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/baseCfg_3view.cfg	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/baseCfg_3view.cfg	(revision 1157)
@@ -120,4 +120,6 @@
 FEN                           : 1           # Fast encoder decision
 FDM                           : 1           # Fast Decision for Merge RD cost
+DispSearchRangeRestriction    : 0           # Limit Search range for vertical component of disparity vector
+VerticalDispSearchRange       : 56          # Vertical Search range in pixel
 
 #======== Quantization =============
Index: branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/fullCfg.cfg
===================================================================
--- branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/fullCfg.cfg	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/cfg/MV-HEVC/fullCfg.cfg	(revision 1157)
@@ -226,4 +226,6 @@
 FEN                           : 1           # Fast encoder decision
 FDM                           : 1           # Fast Decision for Merge RD cost
+DispSearchRangeRestriction    : 0           # Limit Search range for vertical component of disparity vector
+VerticalDispSearchRange       : 56          # Vertical Search range in pixel
 
 #======== Quantization =============
Index: branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1157)
@@ -477,4 +477,8 @@
   ("FastSearch",              m_iFastSearch,                1, "0:Full search  1:Diamond  2:PMVFAST")
   ("SearchRange,-sr",         m_iSearchRange,              96, "Motion search range")
+#ifdef SONY_MV_V_CONST_C0078
+  ("DispSearchRangeRestriction",  m_bUseDisparitySearchRangeRestriction, false, "restrict disparity search range")
+  ("VerticalDispSearchRange",     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")
@@ -1582,4 +1586,7 @@
   xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
   xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
+#ifdef SONY_MV_V_CONST_C0078
+  xConfirmPara( m_iVerticalDisparitySearchRange < 0 ,                                      "Vertical Disparity Search Range must be more than 0" );
+#endif
   xConfirmPara( m_iMaxDeltaQP > 7,                                                          "Absolute Delta QP exceeds supported range (0 to 7)" );
   xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1,                                          "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
@@ -2453,4 +2460,8 @@
   printf("Min PCM size                 : %d\n", 1 << m_uiPCMLog2MinSize);
   printf("Motion search range          : %d\n", m_iSearchRange );
+#ifdef SONY_MV_V_CONST_C0078
+  printf("Disp search range restriction: %d\n", m_bUseDisparitySearchRangeRestriction );
+  printf("Vertical disp search range   : %d\n", m_iVerticalDisparitySearchRange );
+#endif
 #if H_MV
   xPrintParaVector( "Intra period", m_iIntraPeriod );
Index: branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncCfg.h	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncCfg.h	(revision 1157)
@@ -289,4 +289,8 @@
   Int       m_iSearchRange;                                   ///< ME search range
   Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
+#ifdef SONY_MV_V_CONST_C0078
+  Bool      m_bUseDisparitySearchRangeRestriction;            ///< restrict vertical search range for inter-view prediction
+  Int       m_iVerticalDisparitySearchRange;                  ///< ME vertical search range for inter-view prediction
+#endif
   Bool      m_bUseFastEnc;                                    ///< flag for using fast encoder setting
   Bool      m_bUseEarlyCU;                                    ///< flag for using Early CU setting
Index: branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1157)
@@ -348,4 +348,8 @@
   m_cTEncTop.setBipredSearchRange            ( m_bipredSearchRange );
 
+#if SONY_MV_V_CONST_C0078
+  m_cTEncTop.setUseDisparitySearchRangeRestriction ( m_bUseDisparitySearchRangeRestriction );
+  m_cTEncTop.setVerticalDisparitySearchRange ( m_iVerticalDisparitySearchRange );
+#endif
   //====== Quality control ========
   m_cTEncTop.setMaxDeltaQP                   ( m_iMaxDeltaQP  );
Index: branches/HTM-13.1-dev2-Sony/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/Lib/TLibCommon/TypeDef.h	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/Lib/TLibCommon/TypeDef.h	(revision 1157)
@@ -64,4 +64,8 @@
 #define H_MV          ( HEVC_EXT != 0)
 #define H_3D          ( HEVC_EXT == 2)
+
+#if H_MV
+#define SONY_MV_V_CONST_C0078            1   // Control disparity vector search range via configuration file
+#endif
 
 #define NTT_BUG_FIX_TK54    1
Index: branches/HTM-13.1-dev2-Sony/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1157)
@@ -954,4 +954,19 @@
 
   xActivateParameterSets();
+
+#if SONY_MV_V_CONST_C0078
+  //Check Multiview Main profile constraint in G.11.1.1
+  //  When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 
+  //  for the layer with nuh_layer_id equal to i in subBitstream, 
+  //  inter_view_mv_vert_constraint_flag shall be equal to 1 
+  //  in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer.
+  if( m_apcSlicePilot->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN
+      &&
+      m_apcSlicePilot->getVPS()->getViewOrderIdx(m_apcSlicePilot->getVPS()->getLayerIdInNuh(getLayerId()))==1 
+     )
+  {
+    assert( m_apcSlicePilot->getSPS()->getInterViewMvVertConstraintFlag()==1 );
+  }
+#endif
 
   if (m_apcSlicePilot->isNextSlice()) 
Index: branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncCfg.h	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncCfg.h	(revision 1157)
@@ -180,5 +180,8 @@
   Int       m_iSearchRange;                     //  0:Full frame
   Int       m_bipredSearchRange;
-
+#ifdef SONY_MV_V_CONST_C0078
+  Bool      m_bUseDisparitySearchRangeRestriction;
+  Int       m_iVerticalDisparitySearchRange;
+#endif
   //====== Quality control ========
   Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
@@ -502,4 +505,8 @@
   Void      setSearchRange                  ( Int   i )      { m_iSearchRange = i; }
   Void      setBipredSearchRange            ( Int   i )      { m_bipredSearchRange = i; }
+#ifdef SONY_MV_V_CONST_C0078
+  Void      setUseDisparitySearchRangeRestriction ( Bool   b )      { m_bUseDisparitySearchRangeRestriction = b; }
+  Void      setVerticalDisparitySearchRange ( Int   i )      { m_iVerticalDisparitySearchRange = i; }
+#endif
 
   //====== Quality control ========
@@ -554,4 +561,8 @@
   Int       getFastSearch                   ()      { return  m_iFastSearch; }
   Int       getSearchRange                  ()      { return  m_iSearchRange; }
+#ifdef SONY_MV_V_CONST_C0078
+  Bool      getUseDisparitySearchRangeRestriction ()      { return  m_bUseDisparitySearchRangeRestriction; }
+  Int       getVerticalDisparitySearchRange ()            { return  m_iVerticalDisparitySearchRange; }
+#endif
 
   //==== Quality control ========
Index: branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1157)
@@ -5256,5 +5256,4 @@
   return uiCost;
 }
-
 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, UInt& ruiCost, Bool bBi  )
 {
@@ -5269,5 +5268,4 @@
   TComYuv*      pcYuv = pcYuvOrg;
   m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred];
-  
   Int           iSrchRng      = ( bBi ? m_bipredSearchRange : m_iSearchRange );
   TComPattern*  pcPatternKey  = pcCU->getPattern        ();
@@ -5311,7 +5309,20 @@
   TComMv      cMvPred = *pcMvPred;
   
+#ifdef SONY_MV_V_CONST_C0078
+  Bool bMv_VRng_Restricted = false;
+  if( m_pcEncCfg->getUseDisparitySearchRangeRestriction()
+       &&
+      pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC()
+    )
+  {
+      bMv_VRng_Restricted = true;
+  }
+  if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
+  else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB, bMv_VRng_Restricted, m_pcEncCfg->getVerticalDisparitySearchRange() );
+#else
   if ( bBi )  xSetSearchRange   ( pcCU, rcMv   , iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
   else        xSetSearchRange   ( pcCU, cMvPred, iSrchRng, cMvSrchRngLT, cMvSrchRngRB );
-  
+#endif
+
   m_pcRdCost->getMotionCost ( 1, 0 );
   
@@ -5365,5 +5376,9 @@
 
 
+#ifdef SONY_MV_V_CONST_C0078
+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;
@@ -5380,4 +5395,17 @@
   rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
   rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
+  
+#ifdef SONY_MV_V_CONST_C0078
+  if ( bMv_VRng_Restricted ) {
+    Int iRestrictMvVrange = ( iVerDispSrchRng << iMvShift ) ;
+    if ( rcMvSrchRngRB.getVer() >= iRestrictMvVrange  ){
+      rcMvSrchRngRB.setVer( iRestrictMvVrange );
+    }
+    if ( rcMvSrchRngLT.getVer() <= -iRestrictMvVrange ){
+      rcMvSrchRngLT.setVer( -iRestrictMvVrange );
+    }
+  }
+#endif
+
   pcCU->clipMv        ( rcMvSrchRngLT );
   pcCU->clipMv        ( rcMvSrchRngRB );
Index: branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncSearch.h	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncSearch.h	(revision 1157)
@@ -456,5 +456,5 @@
                                     UInt&         ruiCost,
                                     Bool          bBi = false  );
-  
+
   Void xTZSearch                  ( TComDataCU*   pcCU,
                                     TComPattern*  pcPatternKey,
@@ -466,4 +466,13 @@
                                     UInt&         ruiSAD );
   
+#ifdef SONY_MV_V_CONST_C0078
+  Void xSetSearchRange           (  TComDataCU* pcCU, 
+                                    TComMv& cMvPred, 
+                                    Int iSrchRng, 
+                                    TComMv& rcMvSrchRngLT, 
+                                    TComMv& rcMvSrchRngRB, 
+                                    Bool bMv_VRng_Restricted, 
+                                    Int iVerDispSrchRng );
+#else
   Void xSetSearchRange            ( TComDataCU*   pcCU,
                                     TComMv&       cMvPred,
@@ -471,5 +480,6 @@
                                     TComMv&       rcMvSrchRngLT,
                                     TComMv&       rcMvSrchRngRB );
-  
+#endif
+
   Void xPatternSearchFast         ( TComDataCU*   pcCU,
                                     TComPattern*  pcPatternKey,
Index: branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1154)
+++ branches/HTM-13.1-dev2-Sony/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1157)
@@ -760,4 +760,10 @@
     m_cSPS.setSpsInferScalingListFlag   ( true ); 
     m_cSPS.setSpsScalingListRefLayerId( m_cVPS->getIdRefLayer( getLayerId(), 0 ) ); 
+#if SONY_MV_V_CONST_C0078
+    if ( m_bUseDisparitySearchRangeRestriction )
+    {
+      m_cSPS.setInterViewMvVertConstraintFlag ( true ) ;
+    }
+#endif
   }
   m_cSPS.setSpsExtensionPresentFlag       ( true ); 
