// Copyright 2013 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING 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. // ----------------------------------------------------------------------------- // // Pseudo-random utilities // // Author: Skal ([email protected]) #ifndef WEBP_UTILS_RANDOM_UTILS_H_ #define WEBP_UTILS_RANDOM_UTILS_H_ #include <assert.h> #include "src/webp/types.h" #ifdef __cplusplus extern "C" { #endif #define VP8_RANDOM_DITHER_FIX … #define VP8_RANDOM_TABLE_SIZE … VP8Random; // Initializes random generator with an amplitude 'dithering' in range [0..1]. void VP8InitRandom(VP8Random* const rg, float dithering); // Returns a centered pseudo-random number with 'num_bits' amplitude. // (uses D.Knuth's Difference-based random generator). // 'amp' is in VP8_RANDOM_DITHER_FIX fixed-point precision. static WEBP_INLINE int VP8RandomBits2(VP8Random* const rg, int num_bits, int amp) { … } static WEBP_INLINE int VP8RandomBits(VP8Random* const rg, int num_bits) { … } #ifdef __cplusplus } // extern "C" #endif #endif // WEBP_UTILS_RANDOM_UTILS_H_