Showing the changes to test/api/encode_decode_api_test.cpp (1 of 1 file). Show all
Unified · Split
| @@ -90,7 +90,6 @@ class EncodeDecodeTestBase : public ::testing::TestWithParam<EncodeDecodeFilePar · 89 unmodified lines | |||
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | virtual void prepareParam (int iLayers, int iSlices, int width, int height, float framerate, SEncParamExt* pParam) { | 92 | virtual void prepareParam (int iLayers, int iSlices, int width, int height, float framerate, SEncParamExt* pParam) { |
| 93 | memset (pParam, 0, sizeof (SEncParamExt)); | ||
| 94 | pParam->iUsageType = CAMERA_VIDEO_REAL_TIME; | 93 | pParam->iUsageType = CAMERA_VIDEO_REAL_TIME; |
| 95 | pParam->iPicWidth = width; | 94 | pParam->iPicWidth = width; |
| 96 | pParam->iPicHeight = height; | 95 | pParam->iPicHeight = height; |
| @@ -180,7 +179,14 @@ class EncodeDecodeTestAPI : public EncodeDecodeTestBase { · 83 unmodified lines | |||
| 180 | EncodeDecodeTestBase::TearDown(); | 179 | EncodeDecodeTestBase::TearDown(); |
| 181 | } | 180 | } |
| 182 | 181 | ||
| 183 | void prepareParam (int iLayers, int iSlices, int width, int height, float framerate, SEncParamExt* pParam) { | 182 | void prepareParam0 (int iLayers, int iSlices, int width, int height, float framerate, SEncParamExt* pParam) { |
| 183 | memset (pParam, 0, sizeof (SEncParamExt)); | ||
| 184 | EncodeDecodeTestBase::prepareParam (iLayers, iSlices, width, height, framerate, pParam); | ||
| 185 | } | ||
| 186 | |||
| 187 | void prepareParamDefault (int iLayers, int iSlices, int width, int height, float framerate, SEncParamExt* pParam) { | ||
| 188 | memset (pParam, 0, sizeof (SEncParamExt)); | ||
| 189 | encoder_->GetDefaultParams (pParam); | ||
| 184 | EncodeDecodeTestBase::prepareParam (iLayers, iSlices, width, height, framerate, pParam); | 190 | EncodeDecodeTestBase::prepareParam (iLayers, iSlices, width, height, framerate, pParam); |
| 185 | } | 191 | } |
| 186 | 192 | ||
| @@ -509,7 +515,7 @@ static const EncodeDecodeFileParamBase kFileParamArray[] = { · 322 unmodified lines | |||
| 509 | 515 | ||
| 510 | TEST_P (EncodeDecodeTestAPI, DecoderVclNal) { | 516 | TEST_P (EncodeDecodeTestAPI, DecoderVclNal) { |
| 511 | EncodeDecodeFileParamBase p = GetParam(); | 517 | EncodeDecodeFileParamBase p = GetParam(); |
| 512 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 518 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 513 | encoder_->Uninitialize(); | 519 | encoder_->Uninitialize(); |
| 514 | int rv = encoder_->InitializeExt (¶m_); | 520 | int rv = encoder_->InitializeExt (¶m_); |
| 515 | ASSERT_TRUE (rv == cmResultSuccess); | 521 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -545,7 +551,7 @@ TEST_P (EncodeDecodeTestAPI, DecoderVclNal) { · 29 unmodified lines | |||
| 545 | 551 | ||
| 546 | TEST_P (EncodeDecodeTestAPI, GetOptionFramenum) { | 552 | TEST_P (EncodeDecodeTestAPI, GetOptionFramenum) { |
| 547 | EncodeDecodeFileParamBase p = GetParam(); | 553 | EncodeDecodeFileParamBase p = GetParam(); |
| 548 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 554 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 549 | encoder_->Uninitialize(); | 555 | encoder_->Uninitialize(); |
| 550 | int rv = encoder_->InitializeExt (¶m_); | 556 | int rv = encoder_->InitializeExt (¶m_); |
| 551 | ASSERT_TRUE (rv == cmResultSuccess); | 557 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -582,7 +588,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionFramenum) { · 30 unmodified lines | |||
| 582 | 588 | ||
| 583 | TEST_P (EncodeDecodeTestAPI, GetOptionIDR) { | 589 | TEST_P (EncodeDecodeTestAPI, GetOptionIDR) { |
| 584 | EncodeDecodeFileParamBase p = GetParam(); | 590 | EncodeDecodeFileParamBase p = GetParam(); |
| 585 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 591 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 586 | encoder_->Uninitialize(); | 592 | encoder_->Uninitialize(); |
| 587 | int rv = encoder_->InitializeExt (¶m_); | 593 | int rv = encoder_->InitializeExt (¶m_); |
| 588 | ASSERT_TRUE (rv == cmResultSuccess); | 594 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -824,7 +830,7 @@ int SimulateNALLoss (const unsigned char* pSrc, int& iSrcLen, std::vector<SLost · 235 unmodified lines | |||
| 824 | 830 | ||
| 825 | TEST_P (EncodeDecodeTestAPI, GetOptionLTR_ALLIDR) { | 831 | TEST_P (EncodeDecodeTestAPI, GetOptionLTR_ALLIDR) { |
| 826 | EncodeDecodeFileParamBase p = GetParam(); | 832 | EncodeDecodeFileParamBase p = GetParam(); |
| 827 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 833 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 828 | encoder_->Uninitialize(); | 834 | encoder_->Uninitialize(); |
| 829 | int rv = encoder_->InitializeExt (¶m_); | 835 | int rv = encoder_->InitializeExt (¶m_); |
| 830 | ASSERT_TRUE (rv == cmResultSuccess); | 836 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -857,7 +863,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionLTR_ALLLTR) { · 26 unmodified lines | |||
| 857 | SLTRMarkingFeedback m_LTR_Marking_Feedback; | 863 | SLTRMarkingFeedback m_LTR_Marking_Feedback; |
| 858 | SLTRRecoverRequest m_LTR_Recover_Request; | 864 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 859 | EncodeDecodeFileParamBase p = GetParam(); | 865 | EncodeDecodeFileParamBase p = GetParam(); |
| 860 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 866 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 861 | encoder_->Uninitialize(); | 867 | encoder_->Uninitialize(); |
| 862 | int rv = encoder_->InitializeExt (¶m_); | 868 | int rv = encoder_->InitializeExt (¶m_); |
| 863 | ASSERT_TRUE (rv == cmResultSuccess); | 869 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -916,7 +922,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionLTR_Engine) { · 52 unmodified lines | |||
| 916 | SLTRRecoverRequest m_LTR_Recover_Request; | 922 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 917 | m_LTR_Recover_Request.uiIDRPicId = 0; | 923 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 918 | EncodeDecodeFileParamBase p = GetParam(); | 924 | EncodeDecodeFileParamBase p = GetParam(); |
| 919 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 925 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 920 | encoder_->Uninitialize(); | 926 | encoder_->Uninitialize(); |
| 921 | int rv = encoder_->InitializeExt (¶m_); | 927 | int rv = encoder_->InitializeExt (¶m_); |
| 922 | ASSERT_TRUE (rv == cmResultSuccess); | 928 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -966,7 +972,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECFlag_ERROR_CON_DISABLE) { · 43 unmodified lines | |||
| 966 | SLTRRecoverRequest m_LTR_Recover_Request; | 972 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 967 | m_LTR_Recover_Request.uiIDRPicId = 0; | 973 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 968 | EncodeDecodeFileParamBase p = GetParam(); | 974 | EncodeDecodeFileParamBase p = GetParam(); |
| 969 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 975 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 970 | param_.bEnableLongTermReference = true; | 976 | param_.bEnableLongTermReference = true; |
| 971 | param_.iLTRRefNum = 1; | 977 | param_.iLTRRefNum = 1; |
| 972 | encoder_->Uninitialize(); | 978 | encoder_->Uninitialize(); |
| @@ -1033,7 +1039,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECFlag_ERROR_CON_SLICE_COPY) { · 60 unmodified lines | |||
| 1033 | SLTRRecoverRequest m_LTR_Recover_Request; | 1039 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 1034 | m_LTR_Recover_Request.uiIDRPicId = 0; | 1040 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 1035 | EncodeDecodeFileParamBase p = GetParam(); | 1041 | EncodeDecodeFileParamBase p = GetParam(); |
| 1036 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1042 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1037 | encoder_->Uninitialize(); | 1043 | encoder_->Uninitialize(); |
| 1038 | int rv = encoder_->InitializeExt (¶m_); | 1044 | int rv = encoder_->InitializeExt (¶m_); |
| 1039 | ASSERT_TRUE (rv == cmResultSuccess); | 1045 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -1084,7 +1090,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECFlag_ERROR_CON_SLICE_COPY) { · 44 unmodified lines | |||
| 1084 | 1090 | ||
| 1085 | TEST_P (EncodeDecodeTestAPI, InOutTimeStamp) { | 1091 | TEST_P (EncodeDecodeTestAPI, InOutTimeStamp) { |
| 1086 | EncodeDecodeFileParamBase p = GetParam(); | 1092 | EncodeDecodeFileParamBase p = GetParam(); |
| 1087 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1093 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1088 | encoder_->Uninitialize(); | 1094 | encoder_->Uninitialize(); |
| 1089 | int rv = encoder_->InitializeExt (¶m_); | 1095 | int rv = encoder_->InitializeExt (¶m_); |
| 1090 | ASSERT_TRUE (rv == cmResultSuccess); | 1096 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -1134,7 +1140,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionTid_AVC_NOPREFIX) { · 43 unmodified lines | |||
| 1134 | SLTRRecoverRequest m_LTR_Recover_Request; | 1140 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 1135 | m_LTR_Recover_Request.uiIDRPicId = 0; | 1141 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 1136 | EncodeDecodeFileParamBase p = GetParam(); | 1142 | EncodeDecodeFileParamBase p = GetParam(); |
| 1137 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1143 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1138 | param_.bPrefixNalAddingCtrl = false; | 1144 | param_.bPrefixNalAddingCtrl = false; |
| 1139 | param_.iTemporalLayerNum = (rand() % 4) + 1; | 1145 | param_.iTemporalLayerNum = (rand() % 4) + 1; |
| 1140 | encoder_->Uninitialize(); | 1146 | encoder_->Uninitialize(); |
| @@ -1203,7 +1209,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionTid_AVC_WITH_PREFIX_NOLOSS) { · 62 unmodified lines | |||
| 1203 | SLTRRecoverRequest m_LTR_Recover_Request; | 1209 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 1204 | m_LTR_Recover_Request.uiIDRPicId = 0; | 1210 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 1205 | EncodeDecodeFileParamBase p = GetParam(); | 1211 | EncodeDecodeFileParamBase p = GetParam(); |
| 1206 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1212 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1207 | param_.bPrefixNalAddingCtrl = true; | 1213 | param_.bPrefixNalAddingCtrl = true; |
| 1208 | param_.iTemporalLayerNum = (rand() % 4) + 1; | 1214 | param_.iTemporalLayerNum = (rand() % 4) + 1; |
| 1209 | param_.iSpatialLayerNum = 1; | 1215 | param_.iSpatialLayerNum = 1; |
| @@ -1258,7 +1264,7 @@ TEST_P (EncodeDecodeTestAPI, GetOptionTid_SVC_L1_NOLOSS) { · 48 unmodified lines | |||
| 1258 | SLTRRecoverRequest m_LTR_Recover_Request; | 1264 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 1259 | m_LTR_Recover_Request.uiIDRPicId = 0; | 1265 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 1260 | EncodeDecodeFileParamBase p = GetParam(); | 1266 | EncodeDecodeFileParamBase p = GetParam(); |
| 1261 | prepareParam (2, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1267 | prepareParamDefault (2, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1262 | param_.iTemporalLayerNum = (rand() % 4) + 1; | 1268 | param_.iTemporalLayerNum = (rand() % 4) + 1; |
| 1263 | param_.iSpatialLayerNum = 2; | 1269 | param_.iSpatialLayerNum = 2; |
| 1264 | encoder_->Uninitialize(); | 1270 | encoder_->Uninitialize(); |
| @@ -1314,7 +1320,7 @@ TEST_P (EncodeDecodeTestAPI, SetOption_Trace) { · 49 unmodified lines | |||
| 1314 | SLTRRecoverRequest m_LTR_Recover_Request; | 1320 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 1315 | m_LTR_Recover_Request.uiIDRPicId = 0; | 1321 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 1316 | EncodeDecodeFileParamBase p = GetParam(); | 1322 | EncodeDecodeFileParamBase p = GetParam(); |
| 1317 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1323 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1318 | param_.iSpatialLayerNum = 1; | 1324 | param_.iSpatialLayerNum = 1; |
| 1319 | 1325 | ||
| 1320 | int rv = encoder_->InitializeExt (¶m_); | 1326 | int rv = encoder_->InitializeExt (¶m_); |
| @@ -1378,7 +1384,7 @@ TEST_P (EncodeDecodeTestAPI, SetOption_Trace_NULL) { · 57 unmodified lines | |||
| 1378 | SLTRRecoverRequest m_LTR_Recover_Request; | 1384 | SLTRRecoverRequest m_LTR_Recover_Request; |
| 1379 | m_LTR_Recover_Request.uiIDRPicId = 0; | 1385 | m_LTR_Recover_Request.uiIDRPicId = 0; |
| 1380 | EncodeDecodeFileParamBase p = GetParam(); | 1386 | EncodeDecodeFileParamBase p = GetParam(); |
| 1381 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1387 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1382 | param_.iSpatialLayerNum = 1; | 1388 | param_.iSpatialLayerNum = 1; |
| 1383 | int rv = encoder_->InitializeExt (¶m_); | 1389 | int rv = encoder_->InitializeExt (¶m_); |
| 1384 | ASSERT_TRUE (rv == cmResultSuccess); | 1390 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -1441,7 +1447,7 @@ TEST_P (EncodeDecodeTestAPI, SetOptionECIDC_GeneralSliceChange) { · 56 unmodified lines | |||
| 1441 | uint32_t uiEcIdc; | 1447 | uint32_t uiEcIdc; |
| 1442 | uint32_t uiGet; | 1448 | uint32_t uiGet; |
| 1443 | EncodeDecodeFileParamBase p = GetParam(); | 1449 | EncodeDecodeFileParamBase p = GetParam(); |
| 1444 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1450 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1445 | param_.iSpatialLayerNum = 1; | 1451 | param_.iSpatialLayerNum = 1; |
| 1446 | encoder_->Uninitialize(); | 1452 | encoder_->Uninitialize(); |
| 1447 | int rv = encoder_->InitializeExt (¶m_); | 1453 | int rv = encoder_->InitializeExt (¶m_); |
| @@ -1521,7 +1527,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) { · 73 unmodified lines | |||
| 1521 | uint32_t uiEcIdc; | 1527 | uint32_t uiEcIdc; |
| 1522 | uint32_t uiGet; | 1528 | uint32_t uiGet; |
| 1523 | EncodeDecodeFileParamBase p = kFileParamArray[0]; | 1529 | EncodeDecodeFileParamBase p = kFileParamArray[0]; |
| 1524 | prepareParam (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1530 | prepareParamDefault (1, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1525 | param_.iSpatialLayerNum = 1; | 1531 | param_.iSpatialLayerNum = 1; |
| 1526 | encoder_->Uninitialize(); | 1532 | encoder_->Uninitialize(); |
| 1527 | int rv = encoder_->InitializeExt (¶m_); | 1533 | int rv = encoder_->InitializeExt (¶m_); |
| @@ -1660,7 +1666,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) { · 132 unmodified lines | |||
| 1660 | uint32_t uiEcIdc = 2; //default set as SLICE_COPY | 1666 | uint32_t uiEcIdc = 2; //default set as SLICE_COPY |
| 1661 | uint32_t uiGet; | 1667 | uint32_t uiGet; |
| 1662 | EncodeDecodeFileParamBase p = kFileParamArray[0]; | 1668 | EncodeDecodeFileParamBase p = kFileParamArray[0]; |
| 1663 | prepareParam (1, 2, p.width, p.height, p.frameRate, ¶m_); | 1669 | prepareParamDefault (1, 2, p.width, p.height, p.frameRate, ¶m_); |
| 1664 | param_.iSpatialLayerNum = 1; | 1670 | param_.iSpatialLayerNum = 1; |
| 1665 | encoder_->Uninitialize(); | 1671 | encoder_->Uninitialize(); |
| 1666 | int rv = encoder_->InitializeExt (¶m_); | 1672 | int rv = encoder_->InitializeExt (¶m_); |
| @@ -1793,7 +1799,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) { · 126 unmodified lines | |||
| 1793 | uint32_t uiEcIdc; | 1799 | uint32_t uiEcIdc; |
| 1794 | uint32_t uiGet; | 1800 | uint32_t uiGet; |
| 1795 | EncodeDecodeFileParamBase p = kFileParamArray[0]; | 1801 | EncodeDecodeFileParamBase p = kFileParamArray[0]; |
| 1796 | prepareParam (1, 2, p.width, p.height, p.frameRate, ¶m_); | 1802 | prepareParamDefault (1, 2, p.width, p.height, p.frameRate, ¶m_); |
| 1797 | param_.iSpatialLayerNum = 1; | 1803 | param_.iSpatialLayerNum = 1; |
| 1798 | encoder_->Uninitialize(); | 1804 | encoder_->Uninitialize(); |
| 1799 | int rv = encoder_->InitializeExt (¶m_); | 1805 | int rv = encoder_->InitializeExt (¶m_); |
| @@ -1962,7 +1968,7 @@ TEST_F (EncodeDecodeTestAPI, Engine_SVC_Switch_I) { · 162 unmodified lines | |||
| 1962 | EncodeDecodeFileParamBase p = kSVCSwitch[0]; | 1968 | EncodeDecodeFileParamBase p = kSVCSwitch[0]; |
| 1963 | p.width = p.width << 2; | 1969 | p.width = p.width << 2; |
| 1964 | p.height = p.height << 2; | 1970 | p.height = p.height << 2; |
| 1965 | prepareParam (4, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 1971 | prepareParamDefault (4, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 1966 | param_.iTemporalLayerNum = (rand() % 4) + 1; | 1972 | param_.iTemporalLayerNum = (rand() % 4) + 1; |
| 1967 | param_.iSpatialLayerNum = 4; | 1973 | param_.iSpatialLayerNum = 4; |
| 1968 | encoder_->Uninitialize(); | 1974 | encoder_->Uninitialize(); |
| @@ -2027,7 +2033,7 @@ TEST_F (EncodeDecodeTestAPI, Engine_SVC_Switch_P) { · 58 unmodified lines | |||
| 2027 | int iLastDid = 0; | 2033 | int iLastDid = 0; |
| 2028 | p.width = p.width << 2; | 2034 | p.width = p.width << 2; |
| 2029 | p.height = p.height << 2; | 2035 | p.height = p.height << 2; |
| 2030 | prepareParam (4, p.slicenum, p.width, p.height, p.frameRate, ¶m_); | 2036 | prepareParamDefault (4, p.slicenum, p.width, p.height, p.frameRate, ¶m_); |
| 2031 | param_.iTemporalLayerNum = (rand() % 4) + 1; | 2037 | param_.iTemporalLayerNum = (rand() % 4) + 1; |
| 2032 | param_.iSpatialLayerNum = 4; | 2038 | param_.iSpatialLayerNum = 4; |
| 2033 | encoder_->Uninitialize(); | 2039 | encoder_->Uninitialize(); |
| @@ -2113,7 +2119,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionEncParamExt) { · 79 unmodified lines | |||
| 2113 | int iEncFrameNum = WelsClip3 ((rand() % ENCODE_FRAME_NUM) + 1, 1, ENCODE_FRAME_NUM); | 2119 | int iEncFrameNum = WelsClip3 ((rand() % ENCODE_FRAME_NUM) + 1, 1, ENCODE_FRAME_NUM); |
| 2114 | int iSliceNum = 1; | 2120 | int iSliceNum = 1; |
| 2115 | encoder_->GetDefaultParams (¶m_); | 2121 | encoder_->GetDefaultParams (¶m_); |
| 2116 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, ¶m_); | 2122 | prepareParamDefault (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, ¶m_); |
| 2117 | 2123 | ||
| 2118 | int rv = encoder_->InitializeExt (¶m_); | 2124 | int rv = encoder_->InitializeExt (¶m_); |
| 2119 | ASSERT_TRUE (rv == cmResultSuccess); | 2125 | ASSERT_TRUE (rv == cmResultSuccess); |
| @@ -2177,6 +2183,7 @@ class DecodeCrashTestAPI : public EncodeDecodeTestBase { · 57 unmodified lines | |||
| 2177 | } | 2183 | } |
| 2178 | 2184 | ||
| 2179 | void prepareParam (int iLayerNum, int iSliceNum, int width, int height, float framerate, SEncParamExt* pParam) { | 2185 | void prepareParam (int iLayerNum, int iSliceNum, int width, int height, float framerate, SEncParamExt* pParam) { |
| 2186 | memset (pParam, 0, sizeof (SEncParamExt)); | ||
| 2180 | EncodeDecodeTestBase::prepareParam (iLayerNum, iSliceNum, width, height, framerate, pParam); | 2187 | EncodeDecodeTestBase::prepareParam (iLayerNum, iSliceNum, width, height, framerate, pParam); |
| 2181 | } | 2188 | } |
| 2182 | 2189 | ||
| @@ -2431,6 +2438,11 @@ class DecodeParseAPI : public EncodeDecodeTestBase { · 248 unmodified lines | |||
| 2431 | ASSERT_TRUE (rv == cmResultSuccess || rv == cmUnkonwReason); | 2438 | ASSERT_TRUE (rv == cmResultSuccess || rv == cmUnkonwReason); |
| 2432 | } | 2439 | } |
| 2433 | 2440 | ||
| 2441 | void prepareParam (int iLayerNum, int iSliceNum, int width, int height, float framerate, SEncParamExt* pParam) { | ||
| 2442 | memset (pParam, 0, sizeof (SEncParamExt)); | ||
| 2443 | EncodeDecodeTestBase::prepareParam (iLayerNum, iSliceNum, width, height, framerate, pParam); | ||
| 2444 | } | ||
| 2445 | |||
| 2434 | protected: | 2446 | protected: |
| 2435 | SParserBsInfo BsInfo_; | 2447 | SParserBsInfo BsInfo_; |
| 2436 | FILE* fYuv_; | 2448 | FILE* fYuv_; |
| @@ -2588,21 +2600,21 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 151 unmodified lines | |||
| 2588 | SEncParamExt sParam2; | 2600 | SEncParamExt sParam2; |
| 2589 | SEncParamExt sParam3; | 2601 | SEncParamExt sParam3; |
| 2590 | encoder_->GetDefaultParams (&sParam1); | 2602 | encoder_->GetDefaultParams (&sParam1); |
| 2591 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); | 2603 | prepareParamDefault (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2592 | sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | 2604 | sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; |
| 2593 | //prepare param2 | 2605 | //prepare param2 |
| 2594 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); | 2606 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2595 | while (GET_MB_WIDTH (sParam2.iPicWidth) == GET_MB_WIDTH (sParam1.iPicWidth)) { | 2607 | while (GET_MB_WIDTH (sParam2.iPicWidth) == GET_MB_WIDTH (sParam1.iPicWidth)) { |
| 2596 | sParam2.iPicWidth = GetRandWidth(); | 2608 | sParam2.iPicWidth = GetRandWidth(); |
| 2597 | } | 2609 | } |
| 2598 | prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); | 2610 | prepareParamDefault (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); |
| 2599 | sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | 2611 | sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; |
| 2600 | //prepare param3 | 2612 | //prepare param3 |
| 2601 | memcpy (&sParam3, &sParam1, sizeof (SEncParamExt)); | 2613 | memcpy (&sParam3, &sParam1, sizeof (SEncParamExt)); |
| 2602 | while (GET_MB_WIDTH (sParam3.iPicHeight) == GET_MB_WIDTH (sParam1.iPicHeight)) { | 2614 | while (GET_MB_WIDTH (sParam3.iPicHeight) == GET_MB_WIDTH (sParam1.iPicHeight)) { |
| 2603 | sParam3.iPicHeight = GetRandHeight(); | 2615 | sParam3.iPicHeight = GetRandHeight(); |
| 2604 | } | 2616 | } |
| 2605 | prepareParam (iSpatialLayerNum, iSliceNum, sParam3.iPicWidth, sParam3.iPicHeight, fFrameRate, &sParam3); | 2617 | prepareParamDefault (iSpatialLayerNum, iSliceNum, sParam3.iPicWidth, sParam3.iPicHeight, fFrameRate, &sParam3); |
| 2606 | sParam3.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | 2618 | sParam3.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; |
| 2607 | 2619 | ||
| 2608 | //prepare output if needed | 2620 | //prepare output if needed |
| @@ -2699,12 +2711,12 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 90 unmodified lines | |||
| 2699 | SEncParamExt sParam1; | 2711 | SEncParamExt sParam1; |
| 2700 | SEncParamExt sParam2; | 2712 | SEncParamExt sParam2; |
| 2701 | encoder_->GetDefaultParams (&sParam1); | 2713 | encoder_->GetDefaultParams (&sParam1); |
| 2702 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); | 2714 | prepareParamDefault (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2703 | sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | 2715 | sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; |
| 2704 | sParam1.iTemporalLayerNum = 1; | 2716 | sParam1.iTemporalLayerNum = 1; |
| 2705 | //prepare param2 | 2717 | //prepare param2 |
| 2706 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); | 2718 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2707 | prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); | 2719 | prepareParamDefault (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); |
| 2708 | sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | 2720 | sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; |
| 2709 | sParam2.iTemporalLayerNum = 3; | 2721 | sParam2.iTemporalLayerNum = 3; |
| 2710 | 2722 | ||
| @@ -2754,7 +2766,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 43 unmodified lines | |||
| 2754 | SEncParamExt sParam1; | 2766 | SEncParamExt sParam1; |
| 2755 | SEncParamExt sParam2; | 2767 | SEncParamExt sParam2; |
| 2756 | encoder_->GetDefaultParams (&sParam1); | 2768 | encoder_->GetDefaultParams (&sParam1); |
| 2757 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); | 2769 | prepareParamDefault (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2758 | sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | 2770 | sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; |
| 2759 | 2771 | ||
| 2760 | //prepare output if needed | 2772 | //prepare output if needed |
| @@ -2780,7 +2792,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 19 unmodified lines | |||
| 2780 | vWidthTableIt = std::find (vWidthTable.begin(), vWidthTable.end(), GET_MB_WIDTH (sParam2.iPicWidth)); | 2792 | vWidthTableIt = std::find (vWidthTable.begin(), vWidthTable.end(), GET_MB_WIDTH (sParam2.iPicWidth)); |
| 2781 | } while (vWidthTableIt != vWidthTable.end()); | 2793 | } while (vWidthTableIt != vWidthTable.end()); |
| 2782 | vWidthTable.push_back (GET_MB_WIDTH (sParam2.iPicWidth)); | 2794 | vWidthTable.push_back (GET_MB_WIDTH (sParam2.iPicWidth)); |
| 2783 | prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); | 2795 | prepareParamDefault (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); |
| 2784 | sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | 2796 | sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; |
| 2785 | 2797 | ||
| 2786 | rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2); | 2798 | rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2); |
| @@ -2821,7 +2833,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING1) { · 34 unmodified lines | |||
| 2821 | // prepare params | 2833 | // prepare params |
| 2822 | SEncParamExt sParam1; | 2834 | SEncParamExt sParam1; |
| 2823 | encoder_->GetDefaultParams (&sParam1); | 2835 | encoder_->GetDefaultParams (&sParam1); |
| 2824 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); | 2836 | prepareParamDefault (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2825 | sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; | 2837 | sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; |
| 2826 | 2838 | ||
| 2827 | //prepare output if needed | 2839 | //prepare output if needed |
| @@ -2886,14 +2898,14 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING2) { · 58 unmodified lines | |||
| 2886 | SEncParamExt sParam1; | 2898 | SEncParamExt sParam1; |
| 2887 | SEncParamExt sParam2; | 2899 | SEncParamExt sParam2; |
| 2888 | encoder_->GetDefaultParams (&sParam1); | 2900 | encoder_->GetDefaultParams (&sParam1); |
| 2889 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); | 2901 | prepareParamDefault (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2890 | sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; | 2902 | sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; |
| 2891 | //prepare param2 | 2903 | //prepare param2 |
| 2892 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); | 2904 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2893 | while (GET_MB_WIDTH (sParam2.iPicWidth) == GET_MB_WIDTH (sParam1.iPicWidth)) { | 2905 | while (GET_MB_WIDTH (sParam2.iPicWidth) == GET_MB_WIDTH (sParam1.iPicWidth)) { |
| 2894 | sParam2.iPicWidth = GetRandWidth(); | 2906 | sParam2.iPicWidth = GetRandWidth(); |
| 2895 | } | 2907 | } |
| 2896 | prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); | 2908 | prepareParamDefault (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); |
| 2897 | sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING; | 2909 | sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING; |
| 2898 | 2910 | ||
| 2899 | //prepare output if needed | 2911 | //prepare output if needed |
| @@ -2945,14 +2957,14 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING3) { · 45 unmodified lines | |||
| 2945 | SEncParamExt sParam2; | 2957 | SEncParamExt sParam2; |
| 2946 | SEncParamExt sParam3; | 2958 | SEncParamExt sParam3; |
| 2947 | encoder_->GetDefaultParams (&sParam1); | 2959 | encoder_->GetDefaultParams (&sParam1); |
| 2948 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); | 2960 | prepareParamDefault (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2949 | sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; | 2961 | sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; |
| 2950 | //prepare param2 | 2962 | //prepare param2 |
| 2951 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); | 2963 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2952 | while (GET_MB_WIDTH (sParam2.iPicWidth) == GET_MB_WIDTH (sParam1.iPicWidth)) { | 2964 | while (GET_MB_WIDTH (sParam2.iPicWidth) == GET_MB_WIDTH (sParam1.iPicWidth)) { |
| 2953 | sParam2.iPicWidth = GetRandWidth(); | 2965 | sParam2.iPicWidth = GetRandWidth(); |
| 2954 | } | 2966 | } |
| 2955 | prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); | 2967 | prepareParamDefault (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); |
| 2956 | sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING; | 2968 | sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING; |
| 2957 | //prepare param3 | 2969 | //prepare param3 |
| 2958 | memcpy (&sParam3, &sParam1, sizeof (SEncParamExt)); | 2970 | memcpy (&sParam3, &sParam1, sizeof (SEncParamExt)); |
| @@ -2960,7 +2972,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING3) { · 1 unmodified line | |||
| 2960 | GET_MB_WIDTH (sParam3.iPicWidth) == GET_MB_WIDTH (sParam2.iPicWidth)) { | 2972 | GET_MB_WIDTH (sParam3.iPicWidth) == GET_MB_WIDTH (sParam2.iPicWidth)) { |
| 2961 | sParam3.iPicWidth = GetRandWidth(); | 2973 | sParam3.iPicWidth = GetRandWidth(); |
| 2962 | } | 2974 | } |
| 2963 | prepareParam (iSpatialLayerNum, iSliceNum, sParam3.iPicWidth, sParam3.iPicHeight, fFrameRate, &sParam3); | 2975 | prepareParamDefault (iSpatialLayerNum, iSliceNum, sParam3.iPicWidth, sParam3.iPicHeight, fFrameRate, &sParam3); |
| 2964 | sParam3.eSpsPpsIdStrategy = SPS_PPS_LISTING; | 2976 | sParam3.eSpsPpsIdStrategy = SPS_PPS_LISTING; |
| 2965 | 2977 | ||
| 2966 | //prepare output if needed | 2978 | //prepare output if needed |