History

Add picture bIsComplete flag to reflect the status of decoder Modify the output error status and add some some judgement

Haibo Zhu committed 12 years ago

Commit 9d182ee1 parent 614e8989 files · +113 −59Browse files

Showing the changes to test/api/encode_decode_api_test.cpp (1 of 9 files). Show all

Unified · Split

test/api/encode_decode_api_test.cpp+45−44
@@ -102,6 +102,8 @@ class EncodeDecodeTestBase : public ::testing::TestWithParam<EncodeDecodeFilePar · 101 unmodified lines
102};102};
103 103
104class EncodeDecodeTestAPI : public EncodeDecodeTestBase {104class EncodeDecodeTestAPI : public EncodeDecodeTestBase {
105 public:
106 uint8_t iRandValue;
105 public:107 public:
106 void SetUp() {108 void SetUp() {
107 EncodeDecodeTestBase::SetUp();109 EncodeDecodeTestBase::SetUp();
@@ -115,17 +117,17 @@ class EncodeDecodeTestAPI : public EncodeDecodeTestBase { · 7 unmodified lines
115 EncodeDecodeTestBase::prepareParam (width, height, framerate);117 EncodeDecodeTestBase::prepareParam (width, height, framerate);
116 }118 }
117 119
118 void prepareEncDecParam(const EncodeDecodeFileParamBase EncDecFileParam);120 void prepareEncDecParam (const EncodeDecodeFileParamBase EncDecFileParam);
119 void EncodeOneFrame() {121 void EncodeOneFrame() {
120 int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;122 int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;
121 memset (buf_.data(), rand() % 256, frameSize);123 memset (buf_.data(), iRandValue, (frameSize >> 2));
124 memset (buf_.data() + (frameSize >> 2), rand() % 256, (frameSize - (frameSize >> 2)));
122 int rv = encoder_->EncodeFrame (&EncPic, &info);125 int rv = encoder_->EncodeFrame (&EncPic, &info);
123 ASSERT_TRUE (rv == cmResultSuccess || rv == cmUnkonwReason);126 ASSERT_TRUE (rv == cmResultSuccess || rv == cmUnkonwReason);
124 }127 }
125};128};
126 129
127void EncodeDecodeTestAPI::prepareEncDecParam(const EncodeDecodeFileParamBase EncDecFileParam)130void EncodeDecodeTestAPI::prepareEncDecParam (const EncodeDecodeFileParamBase EncDecFileParam) {
128{
129 // for encoder131 // for encoder
130 // I420: 1(Y) + 1/4(U) + 1/4(V)132 // I420: 1(Y) + 1/4(U) + 1/4(V)
131 int frameSize = EncDecFileParam.width * EncDecFileParam.height * 3 / 2;133 int frameSize = EncDecFileParam.width * EncDecFileParam.height * 3 / 2;
@@ -145,6 +147,9 @@ void EncodeDecodeTestAPI::prepareEncDecParam(const EncodeDecodeFileParamBase Enc · 13 unmodified lines
145 147
146 //for decoder148 //for decoder
147 memset (&info, 0, sizeof (SFrameBSInfo));149 memset (&info, 0, sizeof (SFrameBSInfo));
150
151 //set a fixed random value
152 iRandValue = rand() % 256;
148}153}
149 154
150 155
@@ -165,7 +170,7 @@ TEST_P (EncodeDecodeTestAPI, DecoderVclNal) { · 14 unmodified lines
165 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);170 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
166 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);171 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
167 172
168 prepareEncDecParam(p);173 prepareEncDecParam (p);
169 174
170 int iIdx = 0;175 int iIdx = 0;
171 while (iIdx <= p.numframes) {176 while (iIdx <= p.numframes) {
@@ -201,7 +206,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionFramenum) { · 29 unmodified lines
201 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);206 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
202 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);207 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
203 208
204 prepareEncDecParam(p);209 prepareEncDecParam (p);
205 210
206 int32_t iEncFrameNum = -1;211 int32_t iEncFrameNum = -1;
207 int32_t iDecFrameNum;212 int32_t iDecFrameNum;
@@ -240,7 +245,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionIDR) { · 32 unmodified lines
240 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);245 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
241 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);246 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
242 247
243 prepareEncDecParam(p);248 prepareEncDecParam (p);
244 249
245 int32_t iEncCurIdrPicId = 0;250 int32_t iEncCurIdrPicId = 0;
246 int32_t iDecCurIdrPicId;251 int32_t iDecCurIdrPicId;
@@ -479,7 +484,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionLTR_ALLIDR) { · 232 unmodified lines
479 int rv = encoder_->InitializeExt (&param_);484 int rv = encoder_->InitializeExt (&param_);
480 ASSERT_TRUE (rv == cmResultSuccess);485 ASSERT_TRUE (rv == cmResultSuccess);
481 486
482 prepareEncDecParam(p);487 prepareEncDecParam (p);
483 488
484 int32_t iTraceLevel = WELS_LOG_QUIET;489 int32_t iTraceLevel = WELS_LOG_QUIET;
485 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);490 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -574,7 +579,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionLTR_Engine) { · 88 unmodified lines
574 ASSERT_TRUE (rv == cmResultSuccess);579 ASSERT_TRUE (rv == cmResultSuccess);
575 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;580 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
576 581
577 prepareEncDecParam(p);582 prepareEncDecParam (p);
578 583
579 int32_t iTraceLevel = WELS_LOG_QUIET;584 int32_t iTraceLevel = WELS_LOG_QUIET;
580 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);585 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -593,7 +598,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionLTR_Engine) { · 12 unmodified lines
593 int iLossIdx = 0;598 int iLossIdx = 0;
594 bool bVCLLoss = false;599 bool bVCLLoss = false;
595 while (iIdx <= p.numframes) {600 while (iIdx <= p.numframes) {
596 EncodeOneFrame();601 EncodeOneFrame();
597 if (m_LTR_Recover_Request.uiFeedbackType == IDR_RECOVERY_REQUEST) {602 if (m_LTR_Recover_Request.uiFeedbackType == IDR_RECOVERY_REQUEST) {
598 ASSERT_TRUE (info.eFrameType == videoFrameTypeIDR);603 ASSERT_TRUE (info.eFrameType == videoFrameTypeIDR);
599 }604 }
@@ -639,7 +644,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECFlag_ERROR_CON_DISABLE) { · 39 unmodified lines
639 ASSERT_EQ (0, rv);644 ASSERT_EQ (0, rv);
640 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;645 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
641 646
642 prepareEncDecParam(p);647 prepareEncDecParam (p);
643 int32_t iTraceLevel = WELS_LOG_QUIET;648 int32_t iTraceLevel = WELS_LOG_QUIET;
644 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);649 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
645 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);650 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -695,7 +700,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECFlag_ERROR_CON_SLICE_COPY) { · 49 unmodified lines
695 ASSERT_TRUE (rv == cmResultSuccess);700 ASSERT_TRUE (rv == cmResultSuccess);
696 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;701 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
697 702
698 prepareEncDecParam(p);703 prepareEncDecParam (p);
699 int32_t iTraceLevel = WELS_LOG_QUIET;704 int32_t iTraceLevel = WELS_LOG_QUIET;
700 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);705 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
701 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);706 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -752,7 +757,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionTid_AVC_NOPREFIX) { · 50 unmodified lines
752 int rv = encoder_->InitializeExt (&param_);757 int rv = encoder_->InitializeExt (&param_);
753 ASSERT_TRUE (rv == cmResultSuccess);758 ASSERT_TRUE (rv == cmResultSuccess);
754 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;759 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
755 prepareEncDecParam(p);760 prepareEncDecParam (p);
756 int32_t iTraceLevel = WELS_LOG_QUIET;761 int32_t iTraceLevel = WELS_LOG_QUIET;
757 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);762 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
758 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);763 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -825,7 +830,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionTid_AVC_WITH_PREFIX_NOLOSS) { · 66 unmodified lines
825 ASSERT_TRUE (rv == cmResultSuccess);830 ASSERT_TRUE (rv == cmResultSuccess);
826 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;831 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
827 832
828 prepareEncDecParam(p);833 prepareEncDecParam (p);
829 int32_t iTraceLevel = WELS_LOG_QUIET;834 int32_t iTraceLevel = WELS_LOG_QUIET;
830 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);835 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
831 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);836 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -887,7 +892,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionTid_SVC_L1_NOLOSS) { · 55 unmodified lines
887 ASSERT_TRUE (rv == cmResultSuccess);892 ASSERT_TRUE (rv == cmResultSuccess);
888 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;893 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
889 894
890 prepareEncDecParam(p);895 prepareEncDecParam (p);
891 int32_t iTraceLevel = WELS_LOG_QUIET;896 int32_t iTraceLevel = WELS_LOG_QUIET;
892 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);897 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
893 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);898 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -944,7 +949,7 @@ TEST_P (EncodeDecodeTestAPI, SetOption_Trace) { · 50 unmodified lines
944 ASSERT_TRUE (rv == cmResultSuccess);949 ASSERT_TRUE (rv == cmResultSuccess);
945 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;950 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
946 951
947 prepareEncDecParam(p);952 prepareEncDecParam (p);
948 int32_t iTraceLevel = WELS_LOG_QUIET;953 int32_t iTraceLevel = WELS_LOG_QUIET;
949 pFunc = TestOutPutTrace;954 pFunc = TestOutPutTrace;
950 pTraceInfo = &sTrace;955 pTraceInfo = &sTrace;
@@ -1009,7 +1014,7 @@ TEST_P (EncodeDecodeTestAPI, SetOption_Trace_NULL) { · 58 unmodified lines
1009 ASSERT_TRUE (rv == cmResultSuccess);1014 ASSERT_TRUE (rv == cmResultSuccess);
1010 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;1015 m_LTR_Recover_Request.uiFeedbackType = NO_RECOVERY_REQUSET;
1011 1016
1012 prepareEncDecParam(p);1017 prepareEncDecParam (p);
1013 1018
1014 int32_t iTraceLevel = WELS_LOG_QUIET;1019 int32_t iTraceLevel = WELS_LOG_QUIET;
1015 pFunc = NULL;1020 pFunc = NULL;
@@ -1082,7 +1087,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECIDC_GeneralSliceChange) { · 66 unmodified lines
1082 1087
1083 //Start for enc/dec1088 //Start for enc/dec
1084 1089
1085 prepareEncDecParam(p);1090 prepareEncDecParam (p);
1086 int32_t iTraceLevel = WELS_LOG_QUIET;1091 int32_t iTraceLevel = WELS_LOG_QUIET;
1087 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);1092 encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &iTraceLevel);
1088 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);1093 decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
@@ -1113,7 +1118,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECIDC_GeneralSliceChange) { · 24 unmodified lines
1113 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf + iTotalSliceSize,1118 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf + iTotalSliceSize,
1114 info.sLayerInfo[0].pNalLengthInByte[iPacketNum], pData, &dstBufInfo_);1119 info.sLayerInfo[0].pNalLengthInByte[iPacketNum], pData, &dstBufInfo_);
1115 if (uiEcIdc == ERROR_CON_DISABLE)1120 if (uiEcIdc == ERROR_CON_DISABLE)
1116 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);1121 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
1117 }1122 }
1118 //EC_IDC should not change till now1123 //EC_IDC should not change till now
1119 decoder_->GetOption (DECODER_OPTION_ERROR_CON_IDC, &uiGet);1124 decoder_->GetOption (DECODER_OPTION_ERROR_CON_IDC, &uiGet);
@@ -1170,7 +1175,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) { · 50 unmodified lines
1170 int len = 0;1175 int len = 0;
1171 unsigned char* pData[3] = { NULL };1176 unsigned char* pData[3] = { NULL };
1172 1177
1173 prepareEncDecParam(p);1178 prepareEncDecParam (p);
1174 //Frame 0: IDR, EC_IDC=DISABLE, loss = 01179 //Frame 0: IDR, EC_IDC=DISABLE, loss = 0
1175 EncodeOneFrame();1180 EncodeOneFrame();
1176 encToDecData (info, len);1181 encToDecData (info, len);
@@ -1241,10 +1246,9 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) { · 64 unmodified lines
1241 EXPECT_EQ (rv, 0); //parse correct1246 EXPECT_EQ (rv, 0); //parse correct
1242 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //no output1247 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //no output
1243 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction1248 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
1244 if (rv == 0) //TODO: should depend on if ref-frame is OK.1249 //Ref picture is ECed, so current status is ECed, when EC disable, NO output
1245 EXPECT_EQ (dstBufInfo_.iBufferStatus, 1);1250 EXPECT_TRUE (rv & 32);
1246 else1251 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
1247 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
1248 iIdx++;1252 iIdx++;
1249 1253
1250 //Frame 5: P, EC_IDC=DISABLE, loss = 11254 //Frame 5: P, EC_IDC=DISABLE, loss = 1
@@ -1269,7 +1273,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) { · 18 unmodified lines
1269 pData[0] = pData[1] = pData[2] = 0;1273 pData[0] = pData[1] = pData[2] = 0;
1270 memset (&dstBufInfo_, 0, sizeof (SBufferInfo));1274 memset (&dstBufInfo_, 0, sizeof (SBufferInfo));
1271 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);1275 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);
1272 EXPECT_TRUE (rv != 0); //parse correct, but previous decoding error, ECed1276 EXPECT_TRUE (rv == 0); // Now the parse process is Error_None, and the reconstruction will has error return
1273 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //no output1277 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //no output
1274 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction1278 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
1275 EXPECT_TRUE (rv != 0); //not sure if previous data drop would be detected in construction1279 EXPECT_TRUE (rv != 0); //not sure if previous data drop would be detected in construction
@@ -1306,7 +1310,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { · 30 unmodified lines
1306 unsigned char* pData[3] = { NULL };1310 unsigned char* pData[3] = { NULL };
1307 int iTotalSliceSize = 0;1311 int iTotalSliceSize = 0;
1308 1312
1309 prepareEncDecParam(p);1313 prepareEncDecParam (p);
1310 1314
1311 //Frame 0: IDR, EC_IDC=2, loss = 21315 //Frame 0: IDR, EC_IDC=2, loss = 2
1312 EncodeOneFrame();1316 EncodeOneFrame();
@@ -1325,7 +1329,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { · 12 unmodified lines
1325 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, iTotalSliceSize, pData, &dstBufInfo_);1329 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, iTotalSliceSize, pData, &dstBufInfo_);
1326 EXPECT_EQ (rv, 0); //parse correct1330 EXPECT_EQ (rv, 0); //parse correct
1327 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction1331 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
1328 EXPECT_EQ (rv, 0); //parse correct1332 EXPECT_EQ (rv, 0); // Reconstruct first slice OK
1329 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //slice incomplete, no output1333 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //slice incomplete, no output
1330 iIdx++;1334 iIdx++;
1331 1335
@@ -1361,10 +1365,9 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { · 29 unmodified lines
1361 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);1365 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);
1362 EXPECT_EQ (rv, 0); //parse correct1366 EXPECT_EQ (rv, 0); //parse correct
1363 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction1367 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
1364 if (rv == 0) //TODO: should depend on if ref-frame is OK.1368 // Ref picture is ECed, so reconstructed picture is ECed
1365 EXPECT_EQ (dstBufInfo_.iBufferStatus, 1);1369 EXPECT_TRUE (rv & 32);
1366 else1370 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
1367 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
1368 iIdx++;1371 iIdx++;
1369 1372
1370 //set EC=SLICE_COPY1373 //set EC=SLICE_COPY
@@ -1381,7 +1384,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { · 10 unmodified lines
1381 decoder_->GetOption (DECODER_OPTION_ERROR_CON_IDC, &uiGet);1384 decoder_->GetOption (DECODER_OPTION_ERROR_CON_IDC, &uiGet);
1382 EXPECT_EQ (uiGet, (uint32_t) ERROR_CON_FRAME_COPY);1385 EXPECT_EQ (uiGet, (uint32_t) ERROR_CON_FRAME_COPY);
1383 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf + iTotalSliceSize, len, pData, &dstBufInfo_);1386 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf + iTotalSliceSize, len, pData, &dstBufInfo_);
1384 EXPECT_TRUE (rv & 32);1387 EXPECT_EQ (rv, 0); //parse correct
1385 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);1388 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
1386 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction1389 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
1387 EXPECT_TRUE (rv & 32);1390 EXPECT_TRUE (rv & 32);
@@ -1402,10 +1405,10 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { · 14 unmodified lines
1402 EXPECT_EQ (uiGet, (uint32_t) ERROR_CON_DISABLE);1405 EXPECT_EQ (uiGet, (uint32_t) ERROR_CON_DISABLE);
1403 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);1406 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);
1404 EXPECT_TRUE (rv != 0);1407 EXPECT_TRUE (rv != 0);
1405 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic1408 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); // EC_IDC=0, previous picture slice lost, no output
1406 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction1409 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
1407 EXPECT_TRUE (rv != 0);1410 EXPECT_TRUE (rv != 0);
1408 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic1411 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); // No ref picture, no output
1409 iIdx++;1412 iIdx++;
1410 1413
1411}1414}
@@ -1440,7 +1443,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) { · 28 unmodified lines
1440 unsigned char* pData[3] = { NULL };1443 unsigned char* pData[3] = { NULL };
1441 int iTotalSliceSize = 0;1444 int iTotalSliceSize = 0;
1442 1445
1443 prepareEncDecParam(p);1446 prepareEncDecParam (p);
1444 1447
1445 //set EC=DISABLE1448 //set EC=DISABLE
1446 uiEcIdc = (uint32_t) (ERROR_CON_DISABLE);1449 uiEcIdc = (uint32_t) (ERROR_CON_DISABLE);
@@ -1509,7 +1512,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) { · 62 unmodified lines
1509 decoder_->GetOption (DECODER_OPTION_ERROR_CON_IDC, &uiGet);1512 decoder_->GetOption (DECODER_OPTION_ERROR_CON_IDC, &uiGet);
1510 EXPECT_EQ (uiGet, (uint32_t) ERROR_CON_SLICE_COPY);1513 EXPECT_EQ (uiGet, (uint32_t) ERROR_CON_SLICE_COPY);
1511 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);1514 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, len, pData, &dstBufInfo_);
1512 EXPECT_TRUE (rv & 32); //ECed1515 EXPECT_TRUE (rv & 32); //parse OK but frame 2 ECed
1513 EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //slice loss but ECed output Frame 21516 EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //slice loss but ECed output Frame 2
1514 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction1517 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
1515 EXPECT_TRUE (rv & 32);1518 EXPECT_TRUE (rv & 32);
@@ -1533,11 +1536,9 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) { · 17 unmodified lines
1533 EXPECT_TRUE (rv != 0); //previous slice not outputted, will return error due to incomplete frame1536 EXPECT_TRUE (rv != 0); //previous slice not outputted, will return error due to incomplete frame
1534 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic1537 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic
1535 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction,1538 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction,
1536 //not sure if current frame can be correctly decoded1539 // previous frame NOT output, no ref
1537 if (rv == 0)1540 EXPECT_TRUE (rv != 0);
1538 EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //output previous pic1541 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic
1539 else
1540 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic
1541 iIdx++;1542 iIdx++;
1542 1543
1543 //Frame 5: IDR, EC_IDC=2->0, loss = 01544 //Frame 5: IDR, EC_IDC=2->0, loss = 0
@@ -1560,10 +1561,10 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) { · 16 unmodified lines
1560 pData[0] = pData[1] = pData[2] = 0;1561 pData[0] = pData[1] = pData[2] = 0;
1561 memset (&dstBufInfo_, 0, sizeof (SBufferInfo));1562 memset (&dstBufInfo_, 0, sizeof (SBufferInfo));
1562 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, iTotalSliceSize, pData, &dstBufInfo_);1563 rv = decoder_->DecodeFrame2 (info.sLayerInfo[0].pBsBuf, iTotalSliceSize, pData, &dstBufInfo_);
1563 EXPECT_TRUE (rv != 0); //TODO: should be correct, now ECed status will return error1564 EXPECT_TRUE (rv == 0); // IDR status return error_free
1564 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //frame incomplete1565 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //frame incomplete
1565 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction,1566 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction,
1566 EXPECT_TRUE (rv != 0); //TODO: as above1567 EXPECT_TRUE (rv == 0);
1567 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic1568 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic
1568 //set EC=DISABLE for slice 21569 //set EC=DISABLE for slice 2
1569 encToDecSliceData (1, 1, info, len); //slice 11570 encToDecSliceData (1, 1, info, len); //slice 1
@@ -1577,7 +1578,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) { · 7 unmodified lines
1577 EXPECT_EQ (rv, 0); //Parse correct under no EC1578 EXPECT_EQ (rv, 0); //Parse correct under no EC
1578 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //frame incomplete1579 EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //frame incomplete
1579 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction,1580 rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction,
1580 EXPECT_EQ (rv, 0); //Parse correct under no EC1581 EXPECT_EQ (rv, 0);
1581 EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //output previous pic1582 EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //output previous pic
1582 iIdx++;1583 iIdx++;
1583 1584

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t