refine the UT case for checking IDR request
Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -125,7 +125,7 @@ void EncoderInterfaceTest::EncodeOneIDRandP (ISVCEncoder* pPtrEnc) { · 124 unmodified lines | ||
| 125 | 125 | int iResult; |
| 126 | 126 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); |
| 127 | 127 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 128 | − //EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); | |
| 128 | + EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); | |
| 129 | 129 | |
| 130 | 130 | pSrcPic->uiTimeStamp += 30; |
| 131 | 131 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); |
| @@ -622,7 +622,13 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrame) { · 490 unmodified lines | ||
| 622 | 622 | |
| 623 | 623 | //call next frame to be IDR |
| 624 | 624 | pPtrEnc->ForceIntraFrame (bIDR); |
| 625 | − EncodeOneIDRandP (pPtrEnc); | |
| 625 | + int iCount = 0; | |
| 626 | + do { | |
| 627 | + iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); | |
| 628 | + EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | |
| 629 | + pSrcPic->uiTimeStamp += 30; | |
| 630 | + } while ((sFbi.eFrameType == static_cast<int> (videoFrameTypeSkip)) && (iCount ++ < 100)); | |
| 631 | + EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); | |
| 626 | 632 | |
| 627 | 633 | pPtrEnc->Uninitialize(); |
| 628 | 634 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| @@ -662,7 +668,13 @@ TEST_F (EncoderInterfaceTest, ForceIntraFrameWithTemporal) { · 33 unmodified lines | ||
| 662 | 668 | |
| 663 | 669 | //call next frame to be IDR |
| 664 | 670 | pPtrEnc->ForceIntraFrame (bIDR); |
| 665 | − EncodeOneIDRandP (pPtrEnc); | |
| 671 | + int iCount = 0; | |
| 672 | + do { | |
| 673 | + iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); | |
| 674 | + EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | |
| 675 | + pSrcPic->uiTimeStamp += 30; | |
| 676 | + } while ((sFbi.eFrameType == static_cast<int> (videoFrameTypeSkip)) && (iCount ++ < 100)); | |
| 677 | + EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); | |
| 666 | 678 | |
| 667 | 679 | pPtrEnc->Uninitialize(); |
| 668 | 680 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |