Index: branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 448)
+++ branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 449)
@@ -227,7 +227,5 @@
     Int topStartL  = scalEL.getWindowTopOffset();
     Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
-#if BUGFIX_RESAMPLE
     Int leftOffset = leftStartL > 0 ? leftStartL : 0;
-#endif
 
 #if  N0214_INTERMEDIATE_BUFFER_16BITS
@@ -281,5 +279,4 @@
 
       piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
-#if BUGFIX_RESAMPLE
       Pel* piDstY0 = piDstBufY + j * strideEL;            
       piDstY = piDstY0 + leftOffset;
@@ -305,45 +302,5 @@
         piDstY++;
       }
-#else
-#if 1 // it should provide identical result
-      Pel* piDstY0 = piDstBufY + j * strideEL;            
-      piDstY = piDstY0 + ( leftStartL > 0 ? leftStartL : 0 );
-
-      for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- )
-      {
-        *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
-        piSrcY++;
-        piDstY++;
-      }
-
-      for( i = rightEndL; i < pcTempPic->getWidth(); i++ )
-      {
-        *piDstY = piDstY0[rightEndL-1];
-        piDstY++;
-      }
-
-      piDstY = piDstY0;
-      for( i = 0; i < leftStartL; i++ )
-      {
-        *piDstY = piDstY0[leftStartL];
-        piDstY++;
-      }
-#else
-      piDstY = piDstBufY + j * strideEL;
-
-      for( i = 0; i < pcTempPic->getWidth(); i++ )
-      {
-        *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
-
-        // Only increase the x position of reference upsample picture when within the window
-        // "-2" to ensure that pointer doesn't go beyond the boundary rightEndL-1
-        if( (i >= leftStartL) && (i <= rightEndL-2) )
-        {
-          piSrcY++;
-        }
-        piDstY++;
-      }
-#endif
-#endif
+
     }
 
@@ -369,7 +326,5 @@
     Int topStartC  = scalEL.getWindowTopOffset() >> 1;
     Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
-#if BUGFIX_RESAMPLE
     leftOffset = leftStartC > 0 ? leftStartC : 0;
-#endif
 
     shiftX = 16;
@@ -452,9 +407,8 @@
       refPos   = refPos16 >> 4; 
       coeff = m_chromaFilter[phase];
-      
+
       piSrcU = piTempBufU  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
       piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
 
-#if BUGFIX_RESAMPLE
       Pel* piDstU0 = piDstBufU + j*strideEL;
       Pel* piDstV0 = piDstBufV + j*strideEL;
@@ -491,69 +445,14 @@
         piDstV++;
       }
-#else
-#if 1 // it should provide identical result
-      Pel* piDstU0 = piDstBufU + j*strideEL;
-      Pel* piDstV0 = piDstBufV + j*strideEL;
-      piDstU = piDstU0 + ( leftStartC > 0 ? leftStartC : 0 );
-      piDstV = piDstV0 + ( leftStartC > 0 ? leftStartC : 0 );
-
-      for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )
-      {
-        *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
-        *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
-        piSrcU++;
-        piSrcV++;
-        piDstU++;
-        piDstV++;
-      }
-
-      for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ )
-      {
-        *piDstU = piDstU0[rightEndC-1];
-        *piDstV = piDstV0[rightEndC-1];
-        piDstU++;
-        piDstV++;
-      }
-
-      piDstU = piDstU0;
-      piDstV = piDstV0;
-      for( i = 0; i < leftStartC; i++ )
-      {
-        *piDstU = piDstU0[leftStartC];
-        *piDstV = piDstV0[leftStartC];
-        piDstU++;
-        piDstV++;
-      }
-#else
-      piDstU = piDstBufU + j*strideEL;
-      piDstV = piDstBufV + j*strideEL;
-
-      for( i = 0; i < pcTempPic->getWidth() >> 1; i++ )
-      {
-        *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
-        *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
-
-        // Only increase the x position of reference upsample picture when within the window
-        // "-2" to ensure that pointer doesn't go beyond the boundary rightEndC-1
-        if( (i >= leftStartC) && (i <= rightEndC-2) )
-        {
-          piSrcU++;
-          piSrcV++;
-        }
-
-        piDstU++;
-        piDstV++;
-      }
-#endif
-#endif
+
     }
   }
-    pcUsPic->setBorderExtension(false);
-    pcUsPic->extendPicBorder   (); // extend the border.
-
-    //Reset the Border extension flag
-    pcUsPic->setBorderExtension(false);
-    pcTempPic->setBorderExtension(false);
-    pcBasePic->setBorderExtension(false);
+  pcUsPic->setBorderExtension(false);
+  pcUsPic->extendPicBorder   (); // extend the border.
+
+  //Reset the Border extension flag
+  pcUsPic->setBorderExtension(false);
+  pcTempPic->setBorderExtension(false);
+  pcBasePic->setBorderExtension(false);
 }
 #endif //SVC_EXTENSION
Index: branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 448)
+++ branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 449)
@@ -102,5 +102,4 @@
 #define N0214_INTERMEDIATE_BUFFER_16BITS 1      ///< JCTVC-N0214: support base layer input more than 8 bits
 #define ARBITRARY_SPATIAL_RATIO          0      ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio
-#define BUGFIX_RESAMPLE                  1      ///< JCTVC-N0055: resampling bug fix for positive left scalled offset
 
 #define JCTVC_M0259_LAMBDAREFINEMENT     1      ///< JCTVC-M0259: lambda refinement (encoder only optimization)
