/* * 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.
*/
// Test that turning on error resilient mode hurts by 10% at most. if (psnr_resilience_off > 0.0) { constdouble psnr_ratio = psnr_resilience_on / psnr_resilience_off;
EXPECT_GE(psnr_ratio, 0.9);
EXPECT_LE(psnr_ratio, 1.1);
}
}
// Check for successful decoding and no encoder/decoder mismatch // if we lose (i.e., drop before decoding) a set of droppable // frames (i.e., frames that don't update any reference buffers).
TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) { if (GET_PARAM(1) == ::libaom_test::kOnePassGood && GET_PARAM(2) == 1) {
fprintf(stderr, "Skipping test case #1 because of bug aomedia:3002\n"); return;
}
SetupEncoder(500, 10);
libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
cfg_.g_timebase.den, cfg_.g_timebase.num,
0, 20);
// Set an arbitrary set of error frames same as droppable frames. unsignedint num_droppable_frames = 3; unsignedint droppable_frame_list[] = { 5, 11, 13 };
SetDroppableFrames(num_droppable_frames, droppable_frame_list);
SetErrorFrames(num_droppable_frames, droppable_frame_list);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video)); // Test that no mismatches have been found
std::cout << " Encoded frames: " << GetEncodedFrames() << "\n";
std::cout << " Decoded frames: " << GetDecodedFrames() << "\n";
std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
EXPECT_EQ(GetEncodedFrames() - GetDecodedFrames(), num_droppable_frames);
}
// Check for ParseAbility property of an error-resilient frame. // Encode a frame in error-resilient mode (E-frame), and disallow all // subsequent frames from using MFMV. If frames are dropped before the // E frame, all frames starting from the E frame should be parse-able.
TEST_P(ErrorResilienceTestLarge, ParseAbilityTest) {
SetupEncoder(500, 10);
// Note that an E-frame cannot be forced on a frame that is a // show_existing_frame, or a frame that comes directly after an invisible // frame. Currently, this will cause an assertion failure. // Set an arbitrary error resilient (E) frame unsignedint num_error_resilient_frames = 1; unsignedint error_resilient_frame_list[] = { 8 };
SetErrorResilientFrames(num_error_resilient_frames,
error_resilient_frame_list); // Ensure that any invisible frames before the E frame are dropped
SetInvisibleErrorFrames(num_error_resilient_frames,
error_resilient_frame_list); // Set all frames after the error resilient frame to not allow MFMV unsignedint num_post_error_resilient_frames = 6; unsignedint post_error_resilient_frame_list[] = { 9, 10, 11, 12, 13, 14 };
SetNoMFMVFrames(num_post_error_resilient_frames,
post_error_resilient_frame_list);
// Set a few frames before the E frame that are lost (not decoded) unsignedint num_error_frames = 5; unsignedint error_frame_list[] = { 3, 4, 5, 6, 7 };
SetErrorFrames(num_error_frames, error_frame_list);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
std::cout << " Encoded frames: " << GetEncodedFrames() << "\n";
std::cout << " Decoded frames: " << GetDecodedFrames() << "\n";
std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
EXPECT_EQ(GetEncodedFrames() - GetDecodedFrames(), num_error_frames); // All frames following the E-frame and the E-frame are expected to have // mismatches, but still be parse-able.
EXPECT_LE(GetMismatchFrames(), num_post_error_resilient_frames + 1);
}
// Check for ParseAbility property of an S frame. // Encode an S-frame. If frames are dropped before the S-frame, all frames // starting from the S frame should be parse-able.
TEST_P(ErrorResilienceTestLarge, SFrameTest) {
SetupEncoder(500, 10);
// Note that an S-frame cannot be forced on a frame that is a // show_existing_frame. This issue still needs to be addressed. // Set an arbitrary S-frame unsignedint num_s_frames = 1; unsignedint s_frame_list[] = { 6 };
SetSFrames(num_s_frames, s_frame_list); // Ensure that any invisible frames before the S frame are dropped
SetInvisibleErrorFrames(num_s_frames, s_frame_list);
// Set a few frames before the S frame that are lost (not decoded) unsignedint num_error_frames = 4; unsignedint error_frame_list[] = { 2, 3, 4, 5 };
SetErrorFrames(num_error_frames, error_frame_list);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
std::cout << " Encoded frames: " << GetEncodedFrames() << "\n";
std::cout << " Decoded frames: " << GetDecodedFrames() << "\n";
std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
EXPECT_EQ(GetEncodedFrames() - GetDecodedFrames(), num_error_frames); // All frames following the S-frame and the S-frame are expected to have // mismatches, but still be parse-able.
EXPECT_LE(GetMismatchFrames(), GetEncodedFrames() - s_frame_list[0]);
}
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.