/* * 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.
*/
for (int ni = 0; ni < txfm_size; ++ni) {
EXPECT_LE(abs(output[ni] - ref_output[ni]), max_error[tx_size])
<< "tx_size = " << tx_size << ", ni = " << ni
<< ", output[ni] = " << output[ni]
<< ", ref_output[ni] = " << ref_output[ni];
}
}
}
staticinlineint get_max_bit(int x) { int max_bit = -1; while (x) {
x = x >> 1;
max_bit++;
} return max_bit;
}
TEST(av1_inv_txfm1d, get_max_bit) { int max_bit = get_max_bit(8);
EXPECT_EQ(max_bit, 3);
}
TEST(av1_inv_txfm1d, round_trip) {
ACMRandom rnd(ACMRandom::DeterministicSeed()); for (int si = 0; si < NELEMENTS(fwd_txfm_func_ls); ++si) { int txfm_size = txfm_size_ls[si];
for (int ti = 0; ti < txfm_type_num; ++ti) {
TxfmFunc fwd_txfm_func = fwd_txfm_func_ls[si][ti];
TxfmFunc inv_txfm_func = inv_txfm_func_ls[si][ti]; int max_error = 2;
if (!fwd_txfm_func) continue;
constint count_test_block = 5000; for (int i = 0; i < count_test_block; ++i) {
int32_t input[64];
int32_t output[64];
int32_t round_trip_output[64];
ASSERT_LE(txfm_size, NELEMENTS(input));
for (int ni = 0; ni < txfm_size; ++ni) {
input[ni] = rnd.Rand16() % input_base - rnd.Rand16() % input_base;
}
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.