diff options
Diffstat (limited to 'libavutil/lfg.h')
-rw-r--r-- | libavutil/lfg.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libavutil/lfg.h b/libavutil/lfg.h index 5e526c1dae..03f779ad8a 100644 --- a/libavutil/lfg.h +++ b/libavutil/lfg.h @@ -2,26 +2,28 @@ * Lagged Fibonacci PRNG * Copyright (c) 2008 Michael Niedermayer * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVUTIL_LFG_H #define AVUTIL_LFG_H +#include <stdint.h> + typedef struct AVLFG { unsigned int state[64]; int index; @@ -30,6 +32,13 @@ typedef struct AVLFG { void av_lfg_init(AVLFG *c, unsigned int seed); /** + * Seed the state of the ALFG using binary data. + * + * Return value: 0 on success, negative value (AVERROR) on failure. + */ +int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); + +/** * Get the next random unsigned 32-bit number using an ALFG. * * Please also consider a simple LCG like state= state*1664525+1013904223, |