shithub: openh264

Download patch

ref: 76b0f8c17a38ddafefad58857ac9bcde0d3b3624
parent: 4f4adcec4940dd2f96ed4e7d9804f8fd3118e9f8
author: Martin Storsjö <[email protected]>
date: Wed Jan 28 06:08:05 EST 2015

Avoid writing outside of the target rect in MCHalfPelFilterAnchor

This simplifies comparison between the output of MCHalfPelFilterAnchor
and the actual MC function implementations.

--- a/test/encoder/EncUT_MotionCompensation.cpp
+++ b/test/encoder/EncUT_MotionCompensation.cpp
@@ -49,7 +49,8 @@
       pDstH[x] = Clip255 ((FILTER6TAP (pSrc, x, 1) + 16) >> 5);
     for (int32_t x = -2; x < iWidth + 3; x++) {
       int32_t v = FILTER6TAP (pSrc, x, iStride);
-      pDstV[x] = Clip255 ((v + 16) >> 5);
+      if (x >= 0 && x < iWidth)
+        pDstV[x] = Clip255 ((v + 16) >> 5);
       pBuf[x + 2] = v;
     }
     for (int32_t x = 0; x < iWidth; x++)