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

Improve and fix a few details in the encoder MC test
This commit is contained in:
huili2 2015-01-29 09:18:46 +08:00
commit 7ab0386436

View File

@ -79,7 +79,7 @@ TEST (EncMcHalfpel, LumaHalfpel) {
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 @@ TEST (EncMcHalfpel, LumaHalfpel) {
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]);
}
}