From 0cb3ad58b3033ec1b78cc74943775e27ae7faeca Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Mon, 11 May 2009 23:35:50 +0000 Subject: -Took cook_random() from an old cook.c revision [6 mar 2007], which is a simple RNG, to eliminate the need for lfg.c/h. -Remove lfg.c/h and md5.c/h as they are no longer needed and use the more common form of my name in docs/COMMITTERS. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20915 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libcook/cook.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'apps/codecs/libcook/cook.c') diff --git a/apps/codecs/libcook/cook.c b/apps/codecs/libcook/cook.c index bd72179cbd..5b2c59a6c5 100644 --- a/apps/codecs/libcook/cook.c +++ b/apps/codecs/libcook/cook.c @@ -71,6 +71,17 @@ const uint8_t ff_log2_tab[256]={ #define MAX_SUBPACKETS 5 //#define COOKDEBUG #define DEBUGF(message,args ...) av_log(NULL,AV_LOG_ERROR,message,## args) + +/** + * Random bit stream generator. + */ +static int inline cook_random(COOKContext *q) +{ + q->random_state = + q->random_state * 214013 + 2531011; /* typical RNG numbers */ + + return (q->random_state/0x1000000)&1; /*>>31*/ +} #include "cook_fixpoint.h" /* debug functions */ @@ -742,7 +753,7 @@ av_cold int cook_decode_init(RMContext *rmctx, COOKContext *q) q->bit_rate = rmctx->bit_rate; /* Initialize RNG. */ - av_lfg_init(&q->random_state, 1); + q->random_state = 0; /* Initialize extradata related variables. */ q->samples_per_channel = q->samples_per_frame / q->nb_channels; -- cgit v1.2.3