/* * 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.
*/
namespace { // The number of frames to be encoded/decoded constint kLimit = 8; // Skip 1 frame to check the frame decoding independency. constint kSkip = 5; constint kTileSize = 1; constint kTIleSizeInPixels = (kTileSize << 6); // Fake width and height so that they can be multiples of the tile size. constint kImgWidth = 704; constint kImgHeight = 576;
// This test tests large scale tile coding case. Non-large-scale tile coding // is tested by the tile_independence test. class AV1ExtTileTest
: public ::libaom_test::CodecTestWith2Params<libaom_test::TestMode, int>, public ::libaom_test::EncoderTest { protected:
AV1ExtTileTest()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
set_cpu_used_(GET_PARAM(2)) {
init_flags_ = AOM_CODEC_USE_PSNR;
aom_codec_dec_cfg_t cfg = aom_codec_dec_cfg_t();
cfg.w = kImgWidth;
cfg.h = kImgHeight;
cfg.allow_lowbitdepth = 1;
// TODO(yunqingwang): test single_tile_decoding = 0.
encoder->Control(AV1E_SET_SINGLE_TILE_DECODING, 1); // Always use 64x64 max partition.
encoder->Control(AV1E_SET_SUPERBLOCK_SIZE, AOM_SUPERBLOCK_SIZE_64X64); // Set tile_columns and tile_rows to MAX values, which guarantees the tile // size of 64 x 64 pixels(i.e. 1 SB) for <= 4k resolution.
encoder->Control(AV1E_SET_TILE_COLUMNS, 6);
encoder->Control(AV1E_SET_TILE_ROWS, 6);
} elseif (video->frame() == 1) {
frame_flags_ =
AOM_EFLAG_NO_UPD_LAST | AOM_EFLAG_NO_UPD_GF | AOM_EFLAG_NO_UPD_ARF;
}
}
void DecompressedFrameHook(const aom_image_t &img,
aom_codec_pts_t pts) override { // Skip 1 already decoded frame to be consistent with the decoder in this // test. if (pts == (aom_codec_pts_t)kSkip) return;
// Calculate MD5 as the reference.
::libaom_test::MD5 md5_res;
md5_res.Add(&img);
md5_.push_back(md5_res.Get());
}
// Decode the first (kLimit - 1) frames as whole frame, and decode the last // frame in single tiles. for (int r = 0; r < kImgHeight / kTIleSizeInPixels; ++r) { for (int c = 0; c < kImgWidth / kTIleSizeInPixels; ++c) { if (!IsLastFrame) {
decoder_->Control(AV1_SET_DECODE_TILE_ROW, -1);
decoder_->Control(AV1_SET_DECODE_TILE_COL, -1);
} else {
decoder_->Control(AV1_SET_DECODE_TILE_ROW, r);
decoder_->Control(AV1_SET_DECODE_TILE_COL, c);
}
AV1_INSTANTIATE_TEST_SUITE( // Now only test 2-pass mode.
AV1ExtTileTestLarge, ::testing::Values(::libaom_test::kTwoPassGood),
::testing::Range(0, 1));
} // namespace
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.