Denoise 2 spatial layes at most. Add noise sensitivity level 2 for vp9 such that applications can control whether to denoise the second highest spatial layer. Add tests to cover this case.
Showing the changes to test (1 of 10 files). Show all
Unified · Split
| @@ -1449,24 +1449,29 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SL3TLDenoiserOn) { · 1448 unmodified lines | |||
| 1449 | ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300); | 1449 | ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300); |
| 1450 | // TODO(marpan): Check that effective_datarate for each layer hits the | 1450 | // TODO(marpan): Check that effective_datarate for each layer hits the |
| 1451 | // layer target_bitrate. | 1451 | // layer target_bitrate. |
| 1452 | for (int i = 600; i <= 1000; i += 200) { | 1452 | // For SVC, noise_sen = 1 means denoising only the top spatial layer |
| 1453 | cfg_.rc_target_bitrate = i; | 1453 | // noise_sen = 2 means denoising the two top spatial layers. |
| 1454 | ResetModel(); | 1454 | for (int noise_sen = 1; noise_sen <= 2; noise_sen++) { |
| 1455 | denoiser_on_ = 1; | 1455 | for (int i = 600; i <= 1000; i += 200) { |
| 1456 | assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers, | 1456 | cfg_.rc_target_bitrate = i; |
| 1457 | cfg_.ts_number_layers, cfg_.temporal_layering_mode); | 1457 | ResetModel(); |
| 1458 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); | 1458 | denoiser_on_ = noise_sen; |
| 1459 | ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.78) | 1459 | assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers, |
| 1460 | << " The datarate for the file exceeds the target by too much!"; | 1460 | cfg_.ts_number_layers, cfg_.temporal_layering_mode); |
| 1461 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15) | 1461 | ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); |
| 1462 | << " The datarate for the file is lower than the target by too much!"; | 1462 | ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.78) |
| 1463 | << " The datarate for the file exceeds the target by too much!"; | ||
| 1464 | ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.15) | ||
| 1465 | << " The datarate for the file is lower than the target by too much!"; | ||
| 1463 | #if CONFIG_VP9_DECODER | 1466 | #if CONFIG_VP9_DECODER |
| 1464 | // Number of temporal layers > 1, so half of the frames in this SVC pattern | 1467 | // Number of temporal layers > 1, so half of the frames in this SVC |
| 1465 | // will be non-reference frame and hence encoder will avoid loopfilter. | 1468 | // pattern |
| 1466 | // Since frame dropper is off, we can expcet 150 (half of the sequence) | 1469 | // will be non-reference frame and hence encoder will avoid loopfilter. |
| 1467 | // mismatched frames. | 1470 | // Since frame dropper is off, we can expcet 150 (half of the sequence) |
| 1468 | EXPECT_EQ(static_cast<unsigned int>(150), GetMismatchFrames()); | 1471 | // mismatched frames. |
| 1472 | EXPECT_EQ(static_cast<unsigned int>(150), GetMismatchFrames()); | ||
| 1469 | #endif | 1473 | #endif |
| 1474 | } | ||
| 1470 | } | 1475 | } |
| 1471 | } | 1476 | } |
| 1472 | 1477 | ||