History

rename the strategy to enum

Sijia Chen committed 11 years ago

Commit d9502aa1 parent 7d1d2d69 files · +166 −74Browse 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+35−15
@@ -260,7 +260,27 @@ void EncodeDecodeTestAPI::RandomParamExtCombination() { · 259 unmodified lines
260260 param_.iNumRefFrame = AUTO_REF_PIC_COUNT;
261261 param_.iMultipleThreadIdc = rand();
262262
263− param_.iSpsPpsIdStrategy = rand() % 3;
263+ int iValue = rand() % 7;
264+ switch (iValue) {
265+ case 0:
266+ param_.eSpsPpsIdStrategy = CONSTANT_ID;
267+ break;
268+ case 0x01:
269+ param_.eSpsPpsIdStrategy = INCREASING_ID;
270+ break;
271+ case 0x02:
272+ param_.eSpsPpsIdStrategy = SPS_LISTING;
273+ break;
274+ case 0x03:
275+ param_.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
276+ break;
277+ case 0x06:
278+ param_.eSpsPpsIdStrategy = SPS_PPS_LISTING;
279+ break;
280+ default:
281+ param_.eSpsPpsIdStrategy = CONSTANT_ID;
282+ break;
283+ }
264284 param_.bPrefixNalAddingCtrl = (rand() % 2 == 0) ? false : true;
265285 param_.bEnableSSEI = (rand() % 2 == 0) ? false : true;
266286 param_.iPaddingFlag = rand() % 2;
@@ -2234,7 +2254,7 @@ TEST_F (DecodeCrashTestAPI, DecoderCrashTest) { · 1967 unmodified lines
22342254 param_.iRCMode = RC_BITRATE_MODE;
22352255 param_.iTargetBitrate = p.iTarBitrate;
22362256 param_.uiIntraPeriod = 0;
2237− param_.iSpsPpsIdStrategy = INCREASING_ID;
2257+ param_.eSpsPpsIdStrategy = INCREASING_ID;
22382258 param_.bEnableBackgroundDetection = true;
22392259 param_.bEnableSceneChangeDetect = true;
22402260 param_.bPrefixNalAddingCtrl = true;
@@ -2568,21 +2588,21 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 327 unmodified lines
25682588 SEncParamExt sParam3;
25692589 encoder_->GetDefaultParams (&sParam1);
25702590 prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1);
2571− sParam1.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
2591+ sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
25722592 //prepare param2
25732593 memcpy (&sParam2, &sParam1, sizeof (SEncParamExt));
25742594 while (sParam2.iPicWidth == sParam1.iPicWidth) {
25752595 sParam2.iPicWidth = GetRandWidth();
25762596 }
25772597 prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2);
2578− sParam2.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
2598+ sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
25792599 //prepare param3
25802600 memcpy (&sParam3, &sParam1, sizeof (SEncParamExt));
25812601 while (sParam3.iPicHeight == sParam1.iPicHeight) {
25822602 sParam3.iPicHeight = GetRandHeight();
25832603 }
25842604 prepareParam (iSpatialLayerNum, iSliceNum, sParam3.iPicWidth, sParam3.iPicHeight, fFrameRate, &sParam3);
2585− sParam3.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
2605+ sParam3.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
25862606
25872607 //prepare output if needed
25882608 FILE* fEnc = NULL;
@@ -2679,12 +2699,12 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 90 unmodified lines
26792699 SEncParamExt sParam2;
26802700 encoder_->GetDefaultParams (&sParam1);
26812701 prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1);
2682− sParam1.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
2702+ sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
26832703 sParam1.iTemporalLayerNum = 1;
26842704 //prepare param2
26852705 memcpy (&sParam2, &sParam1, sizeof (SEncParamExt));
26862706 prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2);
2687− sParam2.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
2707+ sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
26882708 sParam2.iTemporalLayerNum = 3;
26892709
26902710 //prepare output if needed
@@ -2734,7 +2754,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 43 unmodified lines
27342754 SEncParamExt sParam2;
27352755 encoder_->GetDefaultParams (&sParam1);
27362756 prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1);
2737− sParam1.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
2757+ sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
27382758
27392759 //prepare output if needed
27402760 FILE* fEnc = NULL;
@@ -2760,7 +2780,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 19 unmodified lines
27602780 } while (vWidthTableIt == vWidthTable.end());
27612781 vWidthTable.push_back (sParam2.iPicWidth);
27622782 prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2);
2763− sParam2.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
2783+ sParam2.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING;
27642784
27652785 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
27662786 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv << ", sParam2.iPicWidth=" <<
@@ -2801,7 +2821,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING1) { · 34 unmodified lines
28012821 SEncParamExt sParam1;
28022822 encoder_->GetDefaultParams (&sParam1);
28032823 prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1);
2804− sParam1.iSpsPpsIdStrategy = SPS_PPS_LISTING;
2824+ sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING;
28052825
28062826 //prepare output if needed
28072827 FILE* fEnc = NULL;
@@ -2866,14 +2886,14 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING2) { · 58 unmodified lines
28662886 SEncParamExt sParam2;
28672887 encoder_->GetDefaultParams (&sParam1);
28682888 prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1);
2869− sParam1.iSpsPpsIdStrategy = SPS_PPS_LISTING;
2889+ sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING;
28702890 //prepare param2
28712891 memcpy (&sParam2, &sParam1, sizeof (SEncParamExt));
28722892 while (sParam2.iPicWidth == sParam1.iPicWidth) {
28732893 sParam2.iPicWidth = GetRandWidth();
28742894 }
28752895 prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2);
2876− sParam2.iSpsPpsIdStrategy = SPS_PPS_LISTING;
2896+ sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING;
28772897
28782898 //prepare output if needed
28792899 FILE* fEnc = NULL;
@@ -2925,21 +2945,21 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING3) { · 45 unmodified lines
29252945 SEncParamExt sParam3;
29262946 encoder_->GetDefaultParams (&sParam1);
29272947 prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1);
2928− sParam1.iSpsPpsIdStrategy = SPS_PPS_LISTING;
2948+ sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING;
29292949 //prepare param2
29302950 memcpy (&sParam2, &sParam1, sizeof (SEncParamExt));
29312951 while (sParam2.iPicWidth == sParam1.iPicWidth) {
29322952 sParam2.iPicWidth = GetRandWidth();
29332953 }
29342954 prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2);
2935− sParam2.iSpsPpsIdStrategy = SPS_PPS_LISTING;
2955+ sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING;
29362956 //prepare param3
29372957 memcpy (&sParam3, &sParam1, sizeof (SEncParamExt));
29382958 while (sParam3.iPicWidth == sParam1.iPicWidth || sParam3.iPicWidth == sParam2.iPicWidth) {
29392959 sParam3.iPicWidth = GetRandWidth();
29402960 }
29412961 prepareParam (iSpatialLayerNum, iSliceNum, sParam3.iPicWidth, sParam3.iPicHeight, fFrameRate, &sParam3);
2942− sParam3.iSpsPpsIdStrategy = SPS_PPS_LISTING;
2962+ sParam3.eSpsPpsIdStrategy = SPS_PPS_LISTING;
29432963
29442964 //prepare output if needed
29452965 FILE* fEnc = NULL;

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