Index: /branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp	(revision 1386)
+++ /branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp	(revision 1387)
@@ -179,4 +179,6 @@
   PRINT_CONSTANT(O0043_BEST_EFFORT_DECODING,                                        settingNameWidth, settingValueWidth);
 
+  PRINT_CONSTANT(ME_ENABLE_ROUNDING_OF_MVS,                                         settingNameWidth, settingValueWidth);
+
   //------------------------------------------------
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComMv.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComMv.h	(revision 1386)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComMv.h	(revision 1387)
@@ -116,4 +116,17 @@
   }
 
+#if ME_ENABLE_ROUNDING_OF_MVS
+  //! shift right with rounding
+  Void divideByPowerOf2 (const Int i)
+  {
+    int offset = (i == 0) ? 0 : 1 << (i - 1); 
+    m_iHor += offset;
+    m_iVer += offset;
+
+    m_iHor >>= i;
+    m_iVer >>= i;
+  }
+#endif
+
   const TComMv& operator<<= (const Int i)
   {
Index: /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1386)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1387)
@@ -190,4 +190,6 @@
 #define O0043_BEST_EFFORT_DECODING                        0 ///< 0 (default) = disable code related to best effort decoding, 1 = enable code relating to best effort decoding [ decode-side only ].
 
+#define ME_ENABLE_ROUNDING_OF_MVS                         1 ///< 0 (default) = disables rounding of motion vectors when right shifted,  1 = enables rounding
+
 #define RDOQ_CHROMA_LAMBDA                                1 ///< F386: weighting of chroma for RDOQ
 
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1386)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1387)
@@ -4004,6 +4004,11 @@
   pcCU->clipMv        ( rcMvSrchRngRB );
 
+#if ME_ENABLE_ROUNDING_OF_MVS
+  rcMvSrchRngLT.divideByPowerOf2(iMvShift);
+  rcMvSrchRngRB.divideByPowerOf2(iMvShift);
+#else
   rcMvSrchRngLT >>= iMvShift;
   rcMvSrchRngRB >>= iMvShift;
+#endif
 }
 
@@ -4125,5 +4130,9 @@
   UInt uiSearchRange = m_iSearchRange;
   pcCU->clipMv( rcMv );
+#if ME_ENABLE_ROUNDING_OF_MVS
+  rcMv.divideByPowerOf2(2);
+#else
   rcMv >>= 2;
+#endif
   // init TZSearchStruct
   IntTZSearchStruct cStruct;
@@ -4142,5 +4151,9 @@
       TComMv cMv = m_acMvPredictors[index];
       pcCU->clipMv( cMv );
+#if ME_ENABLE_ROUNDING_OF_MVS
+      cMv.divideByPowerOf2(2);
+#else
       cMv >>= 2;
+#endif
       xTZSearchHelp( pcPatternKey, cStruct, cMv.getHor(), cMv.getVer(), 0, 0 );
     }
@@ -4158,5 +4171,9 @@
     integerMv2Nx2NPred <<= 2;
     pcCU->clipMv( integerMv2Nx2NPred );
+#if ME_ENABLE_ROUNDING_OF_MVS
+    integerMv2Nx2NPred.divideByPowerOf2(2);
+#else
     integerMv2Nx2NPred >>= 2;
+#endif
     xTZSearchHelp(pcPatternKey, cStruct, integerMv2Nx2NPred.getHor(), integerMv2Nx2NPred.getVer(), 0, 0);
 
@@ -4337,5 +4354,9 @@
 
   pcCU->clipMv( rcMv );
+#if ME_ENABLE_ROUNDING_OF_MVS
+  rcMv.divideByPowerOf2(2);
+#else
   rcMv >>= 2;
+#endif
   // init TZSearchStruct
   IntTZSearchStruct cStruct;
@@ -4357,5 +4378,9 @@
       TComMv cMv = m_acMvPredictors[index];
       pcCU->clipMv( cMv );
+#if ME_ENABLE_ROUNDING_OF_MVS
+      cMv.divideByPowerOf2(2);
+#else
       cMv >>= 2;
+#endif
       xTZSearchHelp( pcPatternKey, cStruct, cMv.getHor(), cMv.getVer(), 0, 0 );
     }
@@ -4373,5 +4398,9 @@
     integerMv2Nx2NPred <<= 2;
     pcCU->clipMv( integerMv2Nx2NPred );
+#if ME_ENABLE_ROUNDING_OF_MVS
+    integerMv2Nx2NPred.divideByPowerOf2(2);
+#else
     integerMv2Nx2NPred >>= 2;
+#endif
     xTZSearchHelp(pcPatternKey, cStruct, integerMv2Nx2NPred.getHor(), integerMv2Nx2NPred.getVer(), 0, 0);
 
@@ -5925,5 +5954,8 @@
     { 
       uiBitsTemp += iRefIdxTemp+1; 
-      if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 
+      if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 )
+      {
+        uiBitsTemp--;
+      }
     }
 
