/* * Copyright (c) 2014 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.
*/
typedefint (*Vp9DenoiserFilterFunc)(const uint8_t *sig, int sig_stride, const uint8_t *mc_avg, int mc_avg_stride,
uint8_t *avg, int avg_stride, int increase_denoising, BLOCK_SIZE bs, int motion_magnitude); typedef std::tuple<Vp9DenoiserFilterFunc, BLOCK_SIZE> VP9DenoiserTestParam;
class VP9DenoiserTest
: public ::testing::Test, public ::testing::WithParamInterface<VP9DenoiserTestParam> { public:
~VP9DenoiserTest() override = default;
// Allocate the space for input and output, // where sig_block is the block to be denoised, // mc_avg_block is the denoised reference block, // avg_block_c is the denoised result from C code, // avg_block_sse2 is the denoised result from SSE2 code.
DECLARE_ALIGNED(16, uint8_t, sig_block[kNumPixels]);
DECLARE_ALIGNED(16, uint8_t, mc_avg_block[kNumPixels]);
DECLARE_ALIGNED(16, uint8_t, avg_block_c[kNumPixels]);
DECLARE_ALIGNED(16, uint8_t, avg_block_sse2[kNumPixels]);
for (int i = 0; i < count_test_block; ++i) { // Generate random motion magnitude, 20% of which exceed the threshold. constint motion_magnitude_random =
rnd.Rand8() % static_cast<int>(MOTION_MAGNITUDE_THRESHOLD * 1.2);
// Initialize a test block with random number in range [0, 255]. for (int j = 0; j < kNumPixels; ++j) { int temp = 0;
sig_block[j] = rnd.Rand8(); // The pixels in mc_avg_block are generated by adding a random // number in range [-19, 19] to corresponding pixels in sig_block.
temp =
sig_block[j] + ((rnd.Rand8() % 2 == 0) ? -1 : 1) * (rnd.Rand8() % 20); // Clip.
mc_avg_block[j] = (temp < 0) ? 0 : ((temp > 255) ? 255 : temp);
}
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.