vp9 svc: add test for scaling partition on 1080p crash.

BUG=webm:1578
Change-Id: Ie03ed454394933fa89f751edc6928651393f3f12
This commit is contained in:
Jerome Jiang
2018-12-06 18:24:13 -08:00
parent 4fa9f733f5
commit bb3a82ec36
4 changed files with 83 additions and 1 deletions

View File

@@ -20,6 +20,82 @@
namespace { namespace {
class ScalePartitionOnePassCbrSvc
: public ::svc_test::OnePassCbrSvc,
public ::testing::TestWithParam<const ::libvpx_test::CodecFactory *> {
public:
ScalePartitionOnePassCbrSvc()
: OnePassCbrSvc(GetParam()), mismatch_nframes_(0), num_nonref_frames_(0) {
SetMode(::libvpx_test::kRealTime);
}
protected:
virtual ~ScalePartitionOnePassCbrSvc() {}
virtual void SetUp() {
InitializeConfig();
speed_setting_ = 7;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
PreEncodeFrameHookSetup(video, encoder);
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
// Keep track of number of non-reference frames, needed for mismatch check.
// Non-reference frames are top spatial and temporal layer frames,
// for TL > 0.
if (temporal_layer_id_ == number_temporal_layers_ - 1 &&
temporal_layer_id_ > 0 &&
pkt->data.frame.spatial_layer_encoded[number_spatial_layers_ - 1])
num_nonref_frames_++;
}
virtual void MismatchHook(const vpx_image_t * /*img1*/,
const vpx_image_t * /*img2*/) {
++mismatch_nframes_;
}
virtual void SetConfig(int /* num_temporal_layer*/) {}
unsigned int GetMismatchFrames() const { return mismatch_nframes_; }
unsigned int mismatch_nframes_;
unsigned int num_nonref_frames_;
};
TEST_P(ScalePartitionOnePassCbrSvc, OnePassCbrSvc3SL3TL1080P) {
SetSvcConfig(3, 3);
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.g_threads = 1;
cfg_.rc_dropframe_thresh = 10;
cfg_.rc_target_bitrate = 800;
cfg_.kf_max_dist = 9999;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
cfg_.g_error_resilient = 1;
cfg_.ts_rate_decimator[0] = 4;
cfg_.ts_rate_decimator[1] = 2;
cfg_.ts_rate_decimator[2] = 1;
cfg_.temporal_layering_mode = 3;
::libvpx_test::I420VideoSource video(
"slides_code_term_web_plot.1920_1080.yuv", 1920, 1080, 30, 1, 0, 100);
// 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).
AssignLayerBitrates();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
#if CONFIG_VP9_DECODER
// The non-reference frames are expected to be mismatched frames as the
// encoder will avoid loopfilter on these frames.
EXPECT_EQ(num_nonref_frames_, GetMismatchFrames());
#endif
}
// Params: Inter layer prediction modes. // Params: Inter layer prediction modes.
class SyncFrameOnePassCbrSvc : public ::svc_test::OnePassCbrSvc, class SyncFrameOnePassCbrSvc : public ::svc_test::OnePassCbrSvc,
public ::libvpx_test::CodecTestWithParam<int> { public ::libvpx_test::CodecTestWithParam<int> {
@@ -375,4 +451,9 @@ TEST_P(SyncFrameOnePassCbrSvc, OnePassCbrSvc1SL3TLSyncFrameIntraOnlyQVGA) {
VP9_INSTANTIATE_TEST_CASE(SyncFrameOnePassCbrSvc, ::testing::Range(0, 3)); VP9_INSTANTIATE_TEST_CASE(SyncFrameOnePassCbrSvc, ::testing::Range(0, 3));
INSTANTIATE_TEST_CASE_P(
VP9, ScalePartitionOnePassCbrSvc,
::testing::Values(
static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)));
} // namespace } // namespace

View File

@@ -4,6 +4,7 @@ LIBVPX_TEST_SRCS-yes += test-data.mk
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_collage_w352h288.yuv LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_collage_w352h288.yuv
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_odd.yuv LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_odd.yuv
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += desktop_office1.1280_720-020.yuv LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += desktop_office1.1280_720-020.yuv
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += slides_code_term_web_plot.1920_1080.yuv
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_420.y4m LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_420.y4m
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_422.y4m LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += park_joy_90p_10_422.y4m

View File

@@ -864,3 +864,4 @@ eb198c25f861c3fe2cbd310de11eb96843019345 *invalid-crbug-1558.ivf.res
c62b005a9fd32c36a1b3f67de6840330f9915e34 *invalid-crbug-1562.ivf c62b005a9fd32c36a1b3f67de6840330f9915e34 *invalid-crbug-1562.ivf
f0cd8389948ad16085714d96567612136f6a46c5 *invalid-crbug-1562.ivf.res f0cd8389948ad16085714d96567612136f6a46c5 *invalid-crbug-1562.ivf.res
bac455906360b45338a16dd626ac5f19bc36a307 *desktop_office1.1280_720-020.yuv bac455906360b45338a16dd626ac5f19bc36a307 *desktop_office1.1280_720-020.yuv
094be4b80fa30bd227149ea16ab6476d549ea092 *slides_code_term_web_plot.1920_1080.yuv

View File

@@ -710,7 +710,6 @@ static void set_rt_speed_feature_framesize_independent(
// For SVC: enable use of lower resolution partition for higher resolution, // For SVC: enable use of lower resolution partition for higher resolution,
// only for 3 spatial layers and when config/top resolution is above VGA. // only for 3 spatial layers and when config/top resolution is above VGA.
// Enable only for non-base temporal layer frames. // Enable only for non-base temporal layer frames.
// TODO(jianj): Investigate webm:1578
if (cpi->use_svc && cpi->svc.use_partition_reuse && if (cpi->use_svc && cpi->svc.use_partition_reuse &&
cpi->svc.number_spatial_layers == 3 && cpi->svc.temporal_layer_id > 0 && cpi->svc.number_spatial_layers == 3 && cpi->svc.temporal_layer_id > 0 &&
cpi->oxcf.width * cpi->oxcf.height > 640 * 480) cpi->oxcf.width * cpi->oxcf.height > 640 * 480)