TEST cases followed
| 230 | |
| 231 | //TEST cases followed |
| 232 | TEST (ErrorConTest, DoErrorConFrameCopy) { |
| 233 | bool bOK = true; |
| 234 | PECInputCtx pECCtx = NULL; |
| 235 | if (InitAndAllocInputData (pECCtx)) { |
| 236 | FreeInputData (pECCtx); |
| 237 | return; |
| 238 | } |
| 239 | |
| 240 | for (int iEC = 0; iEC < 2; ++ iEC) { //ERROR_CON_FRAME_COPY, ERROR_CON_FRAME_COPY_CROSS_IDR |
| 241 | pECCtx->pCtx->pParam->eEcActiveIdc = iEC > 0 ? ERROR_CON_FRAME_COPY_CROSS_IDR : ERROR_CON_FRAME_COPY; |
| 242 | InitECCopyData (pECCtx); |
| 243 | int32_t iLumaSize = pECCtx->iMbWidth * pECCtx->iMbHeight * 256; |
| 244 | |
| 245 | for (int iRef = 0; iRef < 2; ++ iRef) { //no ref, with ref |
| 246 | pECCtx->pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb = iRef ? &pECCtx->sSrcPic : NULL; |
| 247 | for (int iIDR = 0; iIDR < 2; ++ iIDR) { //non IDR, IDR |
| 248 | pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag = (iIDR > 0); |
| 249 | //Do reference code method |
| 250 | DoErrorConFrameCopy (pECCtx->pCtx); |
| 251 | //Do anchor method |
| 252 | if (iRef && ! ((pECCtx->pCtx->pParam->eEcActiveIdc == ERROR_CON_FRAME_COPY) |
| 253 | && (pECCtx->pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag))) |
| 254 | memcpy (pECCtx->sAncPic.pData[0], pECCtx->sSrcPic.pData[0], iLumaSize * 3 / 2); |
| 255 | else |
| 256 | memset (pECCtx->sAncPic.pData[0], 128, iLumaSize * 3 / 2); //should be the same as known EC method, here all 128 |
| 257 | //Compare results |
| 258 | bOK = ComparePictureDataI420 (pECCtx->sAncPic.pData[0], pECCtx->sWelsPic.pData[0], pECCtx->iLinesize[0], |
| 259 | pECCtx->iMbHeight * 16); |
| 260 | EXPECT_EQ (bOK, true); |
| 261 | } //non IDR, IDR |
| 262 | } // no ref, with ref |
| 263 | } //FRAME_COPY methods |
| 264 | |
| 265 | FreeInputData (pECCtx); |
| 266 | } |
| 267 | |
| 268 | //TEST cases followed |
| 269 | TEST (ErrorConTest, DoErrorConSliceCopy) { |
nothing calls this directly
no test coverage detected