#include #include #include "wels_func_ptr_def.h" #include "expand_pic.h" using namespace WelsSVCEnc; TEST(ExpandPicTest, TestExpand_picture_luma_c) { SWelsFuncPtrList sFuncList; InitExpandPictureFunc( &sFuncList, 0 ); int32_t iPicW = rand()%256 + 1; int32_t iPicH = rand()%256 + 1; int32_t iStride = iPicW + rand()%16 + 1 + PADDING_LENGTH * 2; const int32_t kiPaddingLen = PADDING_LENGTH; const int32_t kiMemSize = (iStride+kiPaddingLen*2) * (iPicH+kiPaddingLen*2); uint8_t *pRef = new uint8_t[kiMemSize]; for(int i=0; i= iPicW+kiPaddingLen) { EXPECT_EQ(pRef[k+j],pDst[iPicW-1]); } else EXPECT_EQ(pRef[k+j],pDst[j-kiPaddingLen]); } k += iStride; } k = (iPicH + kiPaddingLen - 1) * iStride; //bottom and bottom corner for (int i=iPicH+kiPaddingLen; i= iPicW+kiPaddingLen) { EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride+iPicW-1]); } else EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride+j-kiPaddingLen]); } k += iStride; } k = kiPaddingLen * iStride; int l = 0; for (int i=0; i>1); int32_t iStride = iPicW + rand()%16 + 1 + kiPaddingLen*2; const int32_t kiMemSize = (iStride+kiPaddingLen*2) * (iPicH+kiPaddingLen*2); uint8_t *pRef = new uint8_t[kiMemSize]; for (int i=0; i= iPicW+kiPaddingLen) { EXPECT_EQ(pRef[k+j],pDst[iPicW-1]); } else EXPECT_EQ(pRef[k+j],pDst[j-kiPaddingLen]); } k += iStride; } k = (iPicH + kiPaddingLen - 1) * iStride; //bottom and bottom corner for (int i=iPicH+kiPaddingLen; i= iPicW+kiPaddingLen) { EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride + iPicW - 1]); } else EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride + j - kiPaddingLen]); } k += iStride; } k = kiPaddingLen * iStride; int l=0; for (int i=0; i