summaryrefslogtreecommitdiff
path: root/apps/codecs/libcook/cook.c
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2009-05-11 23:35:50 +0000
committerMohamed Tarek <mt@rockbox.org>2009-05-11 23:35:50 +0000
commit0cb3ad58b3033ec1b78cc74943775e27ae7faeca (patch)
tree4c3a648b639b9f0f442f2594543e6eaaba430618 /apps/codecs/libcook/cook.c
parent685cee87bedc06549fba38ea87f1d3461ba4a0fe (diff)
downloadrockbox-0cb3ad58b3033ec1b78cc74943775e27ae7faeca.tar.gz
rockbox-0cb3ad58b3033ec1b78cc74943775e27ae7faeca.zip
-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
Diffstat (limited to 'apps/codecs/libcook/cook.c')
-rw-r--r--apps/codecs/libcook/cook.c13
1 files changed, 12 insertions, 1 deletions
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]={
71#define MAX_SUBPACKETS 5 71#define MAX_SUBPACKETS 5
72//#define COOKDEBUG 72//#define COOKDEBUG
73#define DEBUGF(message,args ...) av_log(NULL,AV_LOG_ERROR,message,## args) 73#define DEBUGF(message,args ...) av_log(NULL,AV_LOG_ERROR,message,## args)
74
75/**
76 * Random bit stream generator.
77 */
78static int inline cook_random(COOKContext *q)
79{
80 q->random_state =
81 q->random_state * 214013 + 2531011; /* typical RNG numbers */
82
83 return (q->random_state/0x1000000)&1; /*>>31*/
84}
74#include "cook_fixpoint.h" 85#include "cook_fixpoint.h"
75 86
76/* debug functions */ 87/* debug functions */
@@ -742,7 +753,7 @@ av_cold int cook_decode_init(RMContext *rmctx, COOKContext *q)
742 q->bit_rate = rmctx->bit_rate; 753 q->bit_rate = rmctx->bit_rate;
743 754
744 /* Initialize RNG. */ 755 /* Initialize RNG. */
745 av_lfg_init(&q->random_state, 1); 756 q->random_state = 0;
746 757
747 /* Initialize extradata related variables. */ 758 /* Initialize extradata related variables. */
748 q->samples_per_channel = q->samples_per_frame / q->nb_channels; 759 q->samples_per_channel = q->samples_per_frame / q->nb_channels;