From 78a24171a63d7d43e2263543aa2d0435127645ee Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 23 Dec 2016 14:10:13 -0800 Subject: [PATCH] Revert "vp9: SVC unittests: fix to use y4m source." This reverts commit f0b491a52405abb1b3dbb6b2c74dd6a4c7a7ddb1. This change results in unsigned integer overflows (as reported by -fsanitize=integer) in datarate_test.cc, for many of --gtest_filter=VP9/DatarateOnePassCbrSvc.OnePassCbrSvc*: unsigned integer overflow: 167198 - 185560 cannot be represented in type 'unsigned long' As the encoder didn't change, but the input with the change to (correctly) use Y4mVideoSource, this revert is merely masking the issue. BUG=webm:1352 Change-Id: Iecd9a6c83b3fca67c566732a5c92d36193cc2060 --- test/datarate_test.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/datarate_test.cc b/test/datarate_test.cc index 36d32dfd8..7d4e6a8c2 100644 --- a/test/datarate_test.cc +++ b/test/datarate_test.cc @@ -1107,10 +1107,8 @@ class DatarateOnePassCbrSvc const bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) ? true : false; if (!key_frame) { - // TODO(marpan): This check currently fails for some of the SVC tests, - // re-enable when issue (webm:1350) is resolved. - // ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame " - // << pkt->data.frame.pts; + ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame " + << pkt->data.frame.pts; } const size_t frame_size_in_bits = pkt->data.frame.sz * 8; bits_in_buffer_model_ -= frame_size_in_bits; @@ -1288,7 +1286,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers4threads) { svc_params_.scaling_factor_den[1] = 288; cfg_.rc_dropframe_thresh = 10; cfg_.kf_max_dist = 9999; - ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300); + ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30, + 1, 0, 300); cfg_.rc_target_bitrate = 800; ResetModel(); assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers, @@ -1327,7 +1326,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers) { svc_params_.scaling_factor_den[2] = 288; cfg_.rc_dropframe_thresh = 10; cfg_.kf_max_dist = 9999; - ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300); + ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30, + 1, 0, 300); cfg_.rc_target_bitrate = 800; ResetModel(); assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers, @@ -1365,7 +1365,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayersSmallKf) { svc_params_.scaling_factor_num[2] = 288; svc_params_.scaling_factor_den[2] = 288; cfg_.rc_dropframe_thresh = 10; - ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300); + ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30, + 1, 0, 300); cfg_.rc_target_bitrate = 800; // For this 3 temporal layer case, pattern repeats every 4 frames, so choose // 4 key neighboring key frame periods (so key frame will land on 0-2-1-2). @@ -1409,7 +1410,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SpatialLayers4threads) { svc_params_.scaling_factor_den[2] = 288; cfg_.rc_dropframe_thresh = 10; cfg_.kf_max_dist = 9999; - ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300); + ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30, + 1, 0, 300); cfg_.rc_target_bitrate = 800; ResetModel(); assign_layer_bitrates(&cfg_, &svc_params_, cfg_.ss_number_layers, @@ -1450,7 +1452,8 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SpatialLayers5x5MultipleRuns) { cfg_.layer_target_bitrate[0] = 300; cfg_.layer_target_bitrate[1] = 1400; cfg_.rc_target_bitrate = 1700; - ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 300); + ::libvpx_test::I420VideoSource video("niklas_1280_720_30.y4m", 1280, 720, 30, + 1, 0, 30); ResetModel(); ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); EXPECT_EQ(static_cast(0), GetMismatchFrames()); -- 2.40.0