| @@ -954,8 +954,13 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) { · 953 unmodified lines |
| 954 | } | 954 | } |
| 955 | | 955 | |
| 956 | #if CONFIG_VP9_TEMPORAL_DENOISING | 956 | #if CONFIG_VP9_TEMPORAL_DENOISING |
| | 957 | class DatarateTestVP9LargeDenoiser : public DatarateTestVP9Large { |
| | 958 | public: |
| | 959 | virtual ~DatarateTestVP9LargeDenoiser() {} |
| | 960 | }; |
| | 961 | |
| 957 | // Check basic datarate targeting, for a single bitrate, when denoiser is on. | 962 | // Check basic datarate targeting, for a single bitrate, when denoiser is on. |
| 958 | TEST_P(DatarateTestVP9Large, DenoiserLevels) { | 963 | TEST_P(DatarateTestVP9LargeDenoiser, LowNoise) { |
| 959 | cfg_.rc_buf_initial_sz = 500; | 964 | cfg_.rc_buf_initial_sz = 500; |
| 960 | cfg_.rc_buf_optimal_sz = 500; | 965 | cfg_.rc_buf_optimal_sz = 500; |
| 961 | cfg_.rc_buf_sz = 1000; | 966 | cfg_.rc_buf_sz = 1000; |
| @@ -982,9 +987,38 @@ TEST_P(DatarateTestVP9Large, DenoiserLevels) { · 20 unmodified lines |
| 982 | << " The datarate for the file is greater than target by too much!"; | 987 | << " The datarate for the file is greater than target by too much!"; |
| 983 | } | 988 | } |
| 984 | | 989 | |
| | 990 | // Check basic datarate targeting, for a single bitrate, when denoiser is on, |
| | 991 | // for HD clip with high noise level. |
| | 992 | TEST_P(DatarateTestVP9LargeDenoiser, HighNoise) { |
| | 993 | cfg_.rc_buf_initial_sz = 500; |
| | 994 | cfg_.rc_buf_optimal_sz = 500; |
| | 995 | cfg_.rc_buf_sz = 1000; |
| | 996 | cfg_.rc_dropframe_thresh = 1; |
| | 997 | cfg_.rc_min_quantizer = 2; |
| | 998 | cfg_.rc_max_quantizer = 56; |
| | 999 | cfg_.rc_end_usage = VPX_CBR; |
| | 1000 | cfg_.g_lag_in_frames = 0; |
| | 1001 | |
| | 1002 | ::libvpx_test::I420VideoSource video("noisy_clip_640_360.y4m", 640, 360, 30, |
| | 1003 | 1, 0, 200); |
| | 1004 | |
| | 1005 | // For the temporal denoiser (#if CONFIG_VP9_TEMPORAL_DENOISING), |
| | 1006 | // there is only one denoiser mode: denoiserYonly(which is 1), |
| | 1007 | // but may add more modes in the future. |
| | 1008 | cfg_.rc_target_bitrate = 1000; |
| | 1009 | ResetModel(); |
| | 1010 | // Turn on the denoiser. |
| | 1011 | denoiser_on_ = 1; |
| | 1012 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| | 1013 | ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.85) |
| | 1014 | << " The datarate for the file is lower than target by too much!"; |
| | 1015 | ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.15) |
| | 1016 | << " The datarate for the file is greater than target by too much!"; |
| | 1017 | } |
| | 1018 | |
| 985 | // Check basic datarate targeting, for a single bitrate, when denoiser is off | 1019 | // Check basic datarate targeting, for a single bitrate, when denoiser is off |
| 986 | // and on. | 1020 | // and on. |
| 987 | TEST_P(DatarateTestVP9Large, DenoiserOffOn) { | 1021 | TEST_P(DatarateTestVP9LargeDenoiser, DenoiserOffOn) { |
| 988 | cfg_.rc_buf_initial_sz = 500; | 1022 | cfg_.rc_buf_initial_sz = 500; |
| 989 | cfg_.rc_buf_optimal_sz = 500; | 1023 | cfg_.rc_buf_optimal_sz = 500; |
| 990 | cfg_.rc_buf_sz = 1000; | 1024 | cfg_.rc_buf_sz = 1000; |
| @@ -1435,6 +1469,11 @@ VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9Large, · 444 unmodified lines |
| 1435 | ::testing::Values(::libvpx_test::kOnePassGood, | 1469 | ::testing::Values(::libvpx_test::kOnePassGood, |
| 1436 | ::libvpx_test::kRealTime), | 1470 | ::libvpx_test::kRealTime), |
| 1437 | ::testing::Range(2, 9)); | 1471 | ::testing::Range(2, 9)); |
| | 1472 | #if CONFIG_VP9_TEMPORAL_DENOISING |
| | 1473 | VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9LargeDenoiser, |
| | 1474 | ::testing::Values(::libvpx_test::kRealTime), |
| | 1475 | ::testing::Range(5, 9)); |
| | 1476 | #endif |
| 1438 | VP9_INSTANTIATE_TEST_CASE(DatarateOnePassCbrSvc, | 1477 | VP9_INSTANTIATE_TEST_CASE(DatarateOnePassCbrSvc, |
| 1439 | ::testing::Values(::libvpx_test::kRealTime), | 1478 | ::testing::Values(::libvpx_test::kRealTime), |
| 1440 | ::testing::Range(5, 9)); | 1479 | ::testing::Range(5, 9)); |