Showing the changes to test/api/encode_decode_api_test.cpp (1 of 9 files). Show all
Unified · Split
| @@ -260,7 +260,27 @@ void EncodeDecodeTestAPI::RandomParamExtCombination() { · 259 unmodified lines | ||
| 260 | 260 | param_.iNumRefFrame = AUTO_REF_PIC_COUNT; |
| 261 | 261 | param_.iMultipleThreadIdc = rand(); |
| 262 | 262 | |
| 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 | + } | |
| 264 | 284 | param_.bPrefixNalAddingCtrl = (rand() % 2 == 0) ? false : true; |
| 265 | 285 | param_.bEnableSSEI = (rand() % 2 == 0) ? false : true; |
| 266 | 286 | param_.iPaddingFlag = rand() % 2; |
| @@ -2234,7 +2254,7 @@ TEST_F (DecodeCrashTestAPI, DecoderCrashTest) { · 1967 unmodified lines | ||
| 2234 | 2254 | param_.iRCMode = RC_BITRATE_MODE; |
| 2235 | 2255 | param_.iTargetBitrate = p.iTarBitrate; |
| 2236 | 2256 | param_.uiIntraPeriod = 0; |
| 2237 | − param_.iSpsPpsIdStrategy = INCREASING_ID; | |
| 2257 | + param_.eSpsPpsIdStrategy = INCREASING_ID; | |
| 2238 | 2258 | param_.bEnableBackgroundDetection = true; |
| 2239 | 2259 | param_.bEnableSceneChangeDetect = true; |
| 2240 | 2260 | param_.bPrefixNalAddingCtrl = true; |
| @@ -2568,21 +2588,21 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 327 unmodified lines | ||
| 2568 | 2588 | SEncParamExt sParam3; |
| 2569 | 2589 | encoder_->GetDefaultParams (&sParam1); |
| 2570 | 2590 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2571 | − sParam1.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | |
| 2591 | + sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | |
| 2572 | 2592 | //prepare param2 |
| 2573 | 2593 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2574 | 2594 | while (sParam2.iPicWidth == sParam1.iPicWidth) { |
| 2575 | 2595 | sParam2.iPicWidth = GetRandWidth(); |
| 2576 | 2596 | } |
| 2577 | 2597 | 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; | |
| 2579 | 2599 | //prepare param3 |
| 2580 | 2600 | memcpy (&sParam3, &sParam1, sizeof (SEncParamExt)); |
| 2581 | 2601 | while (sParam3.iPicHeight == sParam1.iPicHeight) { |
| 2582 | 2602 | sParam3.iPicHeight = GetRandHeight(); |
| 2583 | 2603 | } |
| 2584 | 2604 | 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; | |
| 2586 | 2606 | |
| 2587 | 2607 | //prepare output if needed |
| 2588 | 2608 | FILE* fEnc = NULL; |
| @@ -2679,12 +2699,12 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 90 unmodified lines | ||
| 2679 | 2699 | SEncParamExt sParam2; |
| 2680 | 2700 | encoder_->GetDefaultParams (&sParam1); |
| 2681 | 2701 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2682 | − sParam1.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | |
| 2702 | + sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | |
| 2683 | 2703 | sParam1.iTemporalLayerNum = 1; |
| 2684 | 2704 | //prepare param2 |
| 2685 | 2705 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2686 | 2706 | 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; | |
| 2688 | 2708 | sParam2.iTemporalLayerNum = 3; |
| 2689 | 2709 | |
| 2690 | 2710 | //prepare output if needed |
| @@ -2734,7 +2754,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 43 unmodified lines | ||
| 2734 | 2754 | SEncParamExt sParam2; |
| 2735 | 2755 | encoder_->GetDefaultParams (&sParam1); |
| 2736 | 2756 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2737 | − sParam1.iSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | |
| 2757 | + sParam1.eSpsPpsIdStrategy = SPS_LISTING_AND_PPS_INCREASING; | |
| 2738 | 2758 | |
| 2739 | 2759 | //prepare output if needed |
| 2740 | 2760 | FILE* fEnc = NULL; |
| @@ -2760,7 +2780,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 19 unmodified lines | ||
| 2760 | 2780 | } while (vWidthTableIt == vWidthTable.end()); |
| 2761 | 2781 | vWidthTable.push_back (sParam2.iPicWidth); |
| 2762 | 2782 | 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; | |
| 2764 | 2784 | |
| 2765 | 2785 | rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2); |
| 2766 | 2786 | 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 | ||
| 2801 | 2821 | SEncParamExt sParam1; |
| 2802 | 2822 | encoder_->GetDefaultParams (&sParam1); |
| 2803 | 2823 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2804 | − sParam1.iSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2824 | + sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2805 | 2825 | |
| 2806 | 2826 | //prepare output if needed |
| 2807 | 2827 | FILE* fEnc = NULL; |
| @@ -2866,14 +2886,14 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING2) { · 58 unmodified lines | ||
| 2866 | 2886 | SEncParamExt sParam2; |
| 2867 | 2887 | encoder_->GetDefaultParams (&sParam1); |
| 2868 | 2888 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2869 | − sParam1.iSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2889 | + sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2870 | 2890 | //prepare param2 |
| 2871 | 2891 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2872 | 2892 | while (sParam2.iPicWidth == sParam1.iPicWidth) { |
| 2873 | 2893 | sParam2.iPicWidth = GetRandWidth(); |
| 2874 | 2894 | } |
| 2875 | 2895 | prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); |
| 2876 | − sParam2.iSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2896 | + sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2877 | 2897 | |
| 2878 | 2898 | //prepare output if needed |
| 2879 | 2899 | FILE* fEnc = NULL; |
| @@ -2925,21 +2945,21 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING3) { · 45 unmodified lines | ||
| 2925 | 2945 | SEncParamExt sParam3; |
| 2926 | 2946 | encoder_->GetDefaultParams (&sParam1); |
| 2927 | 2947 | prepareParam (iSpatialLayerNum, iSliceNum, iWidth, iHeight, fFrameRate, &sParam1); |
| 2928 | − sParam1.iSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2948 | + sParam1.eSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2929 | 2949 | //prepare param2 |
| 2930 | 2950 | memcpy (&sParam2, &sParam1, sizeof (SEncParamExt)); |
| 2931 | 2951 | while (sParam2.iPicWidth == sParam1.iPicWidth) { |
| 2932 | 2952 | sParam2.iPicWidth = GetRandWidth(); |
| 2933 | 2953 | } |
| 2934 | 2954 | prepareParam (iSpatialLayerNum, iSliceNum, sParam2.iPicWidth, sParam2.iPicHeight, fFrameRate, &sParam2); |
| 2935 | − sParam2.iSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2955 | + sParam2.eSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2936 | 2956 | //prepare param3 |
| 2937 | 2957 | memcpy (&sParam3, &sParam1, sizeof (SEncParamExt)); |
| 2938 | 2958 | while (sParam3.iPicWidth == sParam1.iPicWidth || sParam3.iPicWidth == sParam2.iPicWidth) { |
| 2939 | 2959 | sParam3.iPicWidth = GetRandWidth(); |
| 2940 | 2960 | } |
| 2941 | 2961 | prepareParam (iSpatialLayerNum, iSliceNum, sParam3.iPicWidth, sParam3.iPicHeight, fFrameRate, &sParam3); |
| 2942 | − sParam3.iSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2962 | + sParam3.eSpsPpsIdStrategy = SPS_PPS_LISTING; | |
| 2943 | 2963 | |
| 2944 | 2964 | //prepare output if needed |
| 2945 | 2965 | FILE* fEnc = NULL; |