Revision 3b0b8479 libavcodec/nellymoserdec.c

View differences:

libavcodec/nellymoserdec.c
32 32
 */
33 33

  
34 34
#include "nellymoser.h"
35
#include "libavutil/random.h"
35
#include "libavutil/lfg.h"
36
#include "libavutil/random_seed.h"
36 37
#include "avcodec.h"
37 38
#include "dsputil.h"
38 39

  
......
44 45
    AVCodecContext* avctx;
45 46
    DECLARE_ALIGNED_16(float,float_buf[NELLY_SAMPLES]);
46 47
    float           state[128];
47
    AVRandomState   random_state;
48
    AVLFG           random_state;
48 49
    GetBitContext   gb;
49 50
    int             add_bias;
50 51
    float           scale_bias;
......
107 108
        for (j = 0; j < NELLY_FILL_LEN; j++) {
108 109
            if (bits[j] <= 0) {
109 110
                aptr[j] = M_SQRT1_2*pows[j];
110
                if (av_random(&s->random_state) & 1)
111
                if (av_lfg_get(&s->random_state) & 1)
111 112
                    aptr[j] *= -1.0;
112 113
            } else {
113 114
                v = get_bits(&s->gb, bits[j]);
......
128 129
    NellyMoserDecodeContext *s = avctx->priv_data;
129 130

  
130 131
    s->avctx = avctx;
131
    av_random_init(&s->random_state, 0);
132
    av_lfg_init(&s->random_state, ff_random_get_seed());
132 133
    ff_mdct_init(&s->imdct_ctx, 8, 1);
133 134

  
134 135
    dsputil_init(&s->dsp, avctx);

Also available in: Unified diff