Commit b5ab8812 authored by Marco's avatar Marco
Browse files

vp9-svc unitests: Add more tests for key frame periods.

Change-Id: Iea237760b508d87dab057dd824e26d2e66fa8433
parent b9cb955c
...@@ -920,9 +920,9 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers) { ...@@ -920,9 +920,9 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers) {
} }
} }
// Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and // Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and 3
// 3 temporal layers. Run CIF clip with 1 thread. Use short key frame period. // temporal layers. Run CIF clip with 1 thread, and few short key frame periods.
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayersSmallKf_dist) { TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayersSmallKf) {
cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500; cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000; cfg_.rc_buf_sz = 1000;
...@@ -943,13 +943,13 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayersSmallKf_dist) { ...@@ -943,13 +943,13 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayersSmallKf_dist) {
svc_params_.scaling_factor_num[1] = 288; svc_params_.scaling_factor_num[1] = 288;
svc_params_.scaling_factor_den[1] = 288; svc_params_.scaling_factor_den[1] = 288;
cfg_.rc_dropframe_thresh = 10; cfg_.rc_dropframe_thresh = 10;
cfg_.kf_max_dist = 64;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288, ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 200); 30, 1, 0, 200);
// TODO(wonkap/marpan): Check that effective_datarate for each layer hits the cfg_.rc_target_bitrate = 400;
// layer target_bitrate. Also check if test can pass at lower bitrate (~200k). // For this 3 temporal layer case, pattern repeats every 4 frames, so choose
for (int i = 400; i <= 800; i += 200) { // 4 key neighboring key frame periods (so key frame will land on 0-2-1-2).
cfg_.rc_target_bitrate = i; for (int j = 64; j <= 67; j++) {
cfg_.kf_max_dist = j;
ResetModel(); ResetModel();
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers, assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
cfg_.ts_number_layers, cfg_.temporal_layering_mode); cfg_.ts_number_layers, cfg_.temporal_layering_mode);
...@@ -1040,8 +1040,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers) { ...@@ -1040,8 +1040,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers) {
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
} }
// Check basic rate targeting for 1 pass CBR SVC: 3 spatial layers and // Check basic rate targeting for 1 pass CBR SVC: 3 spatial layers and 3
// 3 temporal layers. Run CIF clip with 1 thread. Use short key frame period. // temporal layers. Run CIF clip with 1 thread, and few short key frame periods.
TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) { TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) {
cfg_.rc_buf_initial_sz = 500; cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500; cfg_.rc_buf_optimal_sz = 500;
...@@ -1065,19 +1065,23 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) { ...@@ -1065,19 +1065,23 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) {
svc_params_.scaling_factor_num[2] = 288; svc_params_.scaling_factor_num[2] = 288;
svc_params_.scaling_factor_den[2] = 288; svc_params_.scaling_factor_den[2] = 288;
cfg_.rc_dropframe_thresh = 10; cfg_.rc_dropframe_thresh = 10;
cfg_.kf_max_dist = 32;
::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720,
30, 1, 0, 300); 30, 1, 0, 300);
cfg_.rc_target_bitrate = 800; cfg_.rc_target_bitrate = 800;
ResetModel(); // For this 3 temporal layer case, pattern repeats every 4 frames, so choose
assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers, // 4 key neighboring key frame periods (so key frame will land on 0-2-1-2).
cfg_.ts_number_layers, cfg_.temporal_layering_mode); for (int j = 32; j <= 35; j++) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); cfg_.kf_max_dist = j;
ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85) ResetModel();
<< " The datarate for the file exceeds the target by too much!"; assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.30) cfg_.ts_number_layers, cfg_.temporal_layering_mode);
<< " The datarate for the file is lower than the target by too much!"; ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames()); ASSERT_GE(cfg_.rc_target_bitrate, file_datarate_ * 0.85)
<< " The datarate for the file exceeds the target by too much!";
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.30)
<< " The datarate for the file is lower than the target by too much!";
EXPECT_EQ(static_cast<unsigned int>(0), GetMismatchFrames());
}
} }
// Check basic rate targeting for 1 pass CBR SVC: 3 spatial layers and // Check basic rate targeting for 1 pass CBR SVC: 3 spatial layers and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment