/* * Copyright (c) 2017 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
template <int bitdepth, typename Pixel> void AvgPredTest<bitdepth, Pixel>::TestSizeCombinations() { // This is called as part of the sub pixel variance. As such it must be one of // the variance block sizes. for (int width_pow = 2; width_pow <= 6; ++width_pow) { for (int height_pow = width_pow - 1; height_pow <= width_pow + 1;
++height_pow) { // Don't test 4x2 or 64x128 if (height_pow == 1 || height_pow == 7) continue;
// The sse2 special-cases when ref width == stride, so make sure to test // it. for (int ref_padding = 0; ref_padding < 2; ref_padding++) { constint width = 1 << width_pow; constint height = 1 << height_pow; // Only the reference buffer may have a stride not equal to width.
Buffer<Pixel> ref = Buffer<Pixel>(width, height, ref_padding ? 8 : 0);
ASSERT_TRUE(ref.Init());
Buffer<Pixel> pred = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(pred.Init());
Buffer<Pixel> avg_ref = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(avg_ref.Init());
Buffer<Pixel> avg_chk = Buffer<Pixel>(width, height, 0, 32);
ASSERT_TRUE(avg_chk.Init()); constint bitdepth_mask = (1 << bitdepth) - 1; for (int h = 0; h < height; ++h) { for (int w = 0; w < width; ++w) {
ref.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
} for (int h = 0; h < height; ++h) { for (int w = 0; w < width; ++w) {
pred.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
for (int i = 0; i < 500; ++i) { constint bitdepth_mask = (1 << bitdepth) - 1; for (int h = 0; h < height; ++h) { for (int w = 0; w < width; ++w) {
ref.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
} for (int h = 0; h < height; ++h) { for (int w = 0; w < width; ++w) {
pred.TopLeftPixel()[w + h * width] = rnd_.Rand16() & bitdepth_mask;
}
}
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.