/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
// Params: test mode, speed, aq mode and index for bitrate array. class DatarateTestLarge
: public ::libaom_test::CodecTestWith4Params<libaom_test::TestMode, int, unsignedint, int>, public DatarateTest { public:
DatarateTestLarge() : DatarateTest(GET_PARAM(0)) {
set_cpu_used_ = GET_PARAM(2);
aq_mode_ = GET_PARAM(3);
}
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352,
288, 30, 1, 0, 140); constint bitrate_array[2] = { 400, 800 };
cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)];
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.7)
<< " The datarate for the file is lower than target by too much!"; // FIXME(jingning): Lower this test threshold after vbr mode can render // sufficiently accurate bit rate.
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.45)
<< " The datarate for the file is greater than target by too much!";
}
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352,
288, 30, 1, 0, 140); constint bitrate_array[2] = { 150, 550 };
cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)];
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.19)
<< " The datarate for the file is greater than target by too much!";
}
::libaom_test::I420VideoSource video("desktopqvga2.320_240.yuv", 320, 240,
30, 1, 0, 800); constint bitrate_array[2] = { 100, 200 };
cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)];
ResetModel();
max_perc_spike_ = 3.0;
max_perc_spike_high_ = 8.0;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.19)
<< " The datarate for the file is greater than target by too much!";
ASSERT_LE(num_spikes_, 10);
ASSERT_LT(num_spikes_high_, 1);
}
::libaom_test::I420VideoSource video("desktop1.320_180.yuv", 320, 180, 30,
1, 0, 800); constint bitrate_array[2] = { 100, 200 };
cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)];
ResetModel();
target_bitrate_update_[0] = cfg_.rc_target_bitrate;
target_bitrate_update_[1] = static_cast<int>(1.3 * cfg_.rc_target_bitrate);
target_bitrate_update_[2] = static_cast<int>(0.7 * cfg_.rc_target_bitrate);
frame_update_bitrate_ = 250;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); for (int i = 0; i < 3; i++) {
ASSERT_GE(effective_datarate_dynamic_[i],
target_bitrate_update_[i] * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_dynamic_[i],
target_bitrate_update_[i] * 1.20)
<< " The datarate for the file is greater than target by too much!";
}
}
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352,
288, 30, 1, 0, 300);
cfg_.rc_target_bitrate = 500;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
}
::libaom_test::I420VideoSource video("pixel_capture_w320h240.yuv", 320, 240,
30, 1, 0, 310); constint bitrate_array[2] = { 150, 550 };
cfg_.rc_target_bitrate = bitrate_array[GET_PARAM(4)];
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
}
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352,
288, 30, 1, 0, 300);
cfg_.rc_target_bitrate = 500;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.3)
<< " The datarate for the file is greater than target by too much!";
}
::libaom_test::I420VideoSource video("pixel_capture_w320h240.yuv", 320, 240,
30, 1, 0, 310);
cfg_.rc_target_bitrate = 60;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
}
constint kDropFrameThreshTestStep = 30;
aom_codec_pts_t last_drop = 140; int last_num_drops = 0; for (int i = 40; i < 100; i += kDropFrameThreshTestStep) {
cfg_.rc_dropframe_thresh = i;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.40)
<< " The datarate for the file is greater than target by too much!"; if (last_drop > 0) {
ASSERT_LE(first_drop_, last_drop)
<< " The first dropped frame for drop_thresh " << i
<< " > first dropped frame for drop_thresh "
<< i - kDropFrameThreshTestStep;
}
ASSERT_GE(num_drops_, last_num_drops * 0.7)
<< " The number of dropped frames for drop_thresh " << i
<< " < number of dropped frames for drop_thresh "
<< i - kDropFrameThreshTestStep;
last_drop = first_drop_;
last_num_drops = num_drops_;
}
}
};
// Check basic rate targeting for periodic key frame, aligned with scene change.
TEST_P(DatarateTestLarge, PeriodicKeyFrameCBROnSceneCuts) {
CBRPeriodicKeyFrameOnSceneCuts();
}
// Check basic rate targeting with error resilience on for scene cuts.
TEST_P(DatarateTestLarge, ErrorResilienceOnSceneCuts) {
ErrorResilienceOnSceneCuts();
}
// Check basic rate targeting for Superres mode with CBR.
TEST_P(DatarateTestLarge, BasicRateTargetingSuperresCBR) {
BasicRateTargetingSuperresCBR();
}
// Check basic rate targeting for Superres mode with CBR and multi-threads.
TEST_P(DatarateTestLarge, BasicRateTargetingSuperresCBRMultiThreads) {
BasicRateTargetingSuperresCBRMultiThreads();
}
// Check that (1) the first dropped frame gets earlier and earlier // as the drop frame threshold is increased, and (2) that the total number of // frame drops does not decrease as we increase frame drop threshold. // Use a lower qp-max to force some frame drops.
TEST_P(DatarateTestFrameDropLarge, ChangingDropFrameThresh) {
ChangingDropFrameThreshTest();
}
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.83)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.35)
<< " The datarate for the file is greater than target by too much!";
}
};
// Check basic rate targeting for CBR. Use a longer clip, // and verify #encode size spikes above threshold.
TEST_P(DatarateTestRealtime, BasicRateTargetingCBRSpike) {
BasicRateTargetingCBRSpikeTest();
}
// Check basic rate targeting for CBR. Use a longer clip, // and verify encoder can respnd and hit new bitrates updated // within the stream.
TEST_P(DatarateTestRealtime, BasicRateTargetingCBRDynamicBitrate) {
BasicRateTargetingCBRDynamicBitrateTest();
}
// Check basic rate targeting for CBR, with 4 threads
TEST_P(DatarateTestRealtime, BasicRateTargetingMultiThreadCBR) {
BasicRateTargetingMultiThreadCBRTest();
}
// Check basic rate targeting for periodic key frame, aligned with scene change.
TEST_P(DatarateTestRealtime, PeriodicKeyFrameCBROnSceneCuts) {
CBRPeriodicKeyFrameOnSceneCuts();
}
// Check basic rate targeting with error resilience on for scene cuts.
TEST_P(DatarateTestRealtime, ErrorResilienceOnSceneCuts) {
ErrorResilienceOnSceneCuts();
}
// Check basic rate targeting for Superres mode with CBR.
TEST_P(DatarateTestRealtime, BasicRateTargetingSuperresCBR) {
BasicRateTargetingSuperresCBR();
}
// Check basic rate targeting for Superres mode with CBR and multi-threads.
TEST_P(DatarateTestRealtime, BasicRateTargetingSuperresCBRMultiThreads) {
BasicRateTargetingSuperresCBRMultiThreads();
}
// Check that (1) the first dropped frame gets earlier and earlier // as the drop frame threshold is increased, and (2) that the total number of // frame drops does not decrease as we increase frame drop threshold. // Use a lower qp-max to force some frame drops.
TEST_P(DatarateTestFrameDropRealtime, ChangingDropFrameThresh) {
ChangingDropFrameThreshTest();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.