shithub: openh264

Download patch

ref: 7ab0386436093eaf608a6726a2cda67f2a093c7d
parent: a8262dd9e606f99e3b02f8cbc7a03d3c5ea9c977
parent: 909a508749be81afb8c2198f981123bb0243730e
author: huili2 <huili2@cisco.com>
date: Thu Jan 29 04:18:46 EST 2015

Merge pull request #1771 from mstorsjo/mc-enc-ut

Improve and fix a few details in the encoder MC test

--- a/test/encoder/EncUT_MotionCompensation.cpp
+++ b/test/encoder/EncUT_MotionCompensation.cpp
@@ -79,7 +79,7 @@
       uAnchors[2] = &uAnchor[2][4][4];
       uAnchors[3] = &uAnchor[3][4][4];
 
-      memset (uAnchor, 0, 4 * sizeof (uint8_t)*MC_BUFF_HEIGHT * MC_BUFF_DST_STRIDE);
+      memset (uAnchor, 0, 4 * sizeof (uint8_t)*MC_BUFF_HEIGHT * MC_BUFF_SRC_STRIDE);
       memset (uDstTest, 0, sizeof (uint8_t)*MC_BUFF_HEIGHT * MC_BUFF_DST_STRIDE);
       for (int32_t j = 0; j < MC_BUFF_HEIGHT; j++) {
         for (int32_t i = 0; i < MC_BUFF_SRC_STRIDE; i++) {
@@ -90,22 +90,22 @@
       uint32_t uiCpuFlag = k == 0 ? 0 : WelsCPUFeatureDetect (NULL);
       WelsInitMcFuncs (&sMcFunc, uiCpuFlag);
 
-      MCHalfPelFilterAnchor (uAnchors[1], uAnchors[2], uAnchors[3], uAnchors[0], MC_BUFF_SRC_STRIDE, width, height, pBuf + 4);
+      MCHalfPelFilterAnchor (uAnchors[1], uAnchors[2], uAnchors[3], uAnchors[0], MC_BUFF_SRC_STRIDE, width + 1, height + 1, pBuf + 4);
       sMcFunc.pfLumaHalfpelHor (&uSrcTest[4][4], MC_BUFF_SRC_STRIDE, uDstTest[0], MC_BUFF_DST_STRIDE, width + 1, height);
       for (int32_t j = 0; j < height; j++) {
-        for (int32_t i = 0; i < width; i++) {
+        for (int32_t i = 0; i < width + 1; i++) {
           ASSERT_EQ (uAnchor[1][4 + j][4 + i], uDstTest[j][i]);
         }
       }
       sMcFunc.pfLumaHalfpelVer (&uSrcTest[4][4], MC_BUFF_SRC_STRIDE, uDstTest[0], MC_BUFF_DST_STRIDE, width, height + 1);
-      for (int32_t j = 0; j < height; j++) {
+      for (int32_t j = 0; j < height + 1; j++) {
         for (int32_t i = 0; i < width; i++) {
           ASSERT_EQ (uAnchor[2][4 + j][4 + i], uDstTest[j][i]);
         }
       }
       sMcFunc.pfLumaHalfpelCen (&uSrcTest[4][4], MC_BUFF_SRC_STRIDE, uDstTest[0], MC_BUFF_DST_STRIDE, width + 1, height + 1);
-      for (int32_t j = 0; j < height; j++) {
-        for (int32_t i = 0; i < width; i++) {
+      for (int32_t j = 0; j < height + 1; j++) {
+        for (int32_t i = 0; i < width + 1; i++) {
           ASSERT_EQ (uAnchor[3][4 + j][4 + i], uDstTest[j][i]);
         }
       }