/* * Copyright (c) 2016 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. */ #include "test/randomise.h" namespace libvpx_test { // Add further specialisations as necessary template<> bool Randomise::uniform() { return rnd_.Rand8() & 1 ? true : false; } template<> uint8_t Randomise::uniform() { return rnd_.Rand8(); } template<> uint16_t Randomise::uniform() { return rnd_.Rand16(); } template<> uint32_t Randomise::uniform() { const uint32_t l = uniform(); const uint32_t h = uniform(); return h << 16 | l; } template<> uint64_t Randomise::uniform() { const uint64_t l = uniform(); const uint64_t h = uniform(); return h << 32 | l; } template<> int8_t Randomise::uniform() { return uniform(); } template<> int16_t Randomise::uniform() { return uniform(); } template<> int32_t Randomise::uniform() { return uniform(); } template<> int64_t Randomise::uniform() { return uniform(); } } // namespace libvpx_test