diff options
Diffstat (limited to 'apps/codecs/libcook/cook.c')
-rw-r--r-- | apps/codecs/libcook/cook.c | 13 |
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 | */ | ||
78 | static 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; |