Revision 9aa2ab42

View differences:

libavcodec/elbg.c
25 25

  
26 26
#include <string.h>
27 27

  
28
#include "libavutil/random.h"
28
#include "libavutil/lfg.h"
29 29
#include "elbg.h"
30 30
#include "avcodec.h"
31 31

  
......
52 52
    int *utility_inc;
53 53
    int *nearest_cb;
54 54
    int *points;
55
    AVRandomState *rand_state;
55
    AVLFG *rand_state;
56 56
} elbg_data;
57 57

  
58 58
static inline int distance_limited(int *a, int *b, int dim, int limit)
......
105 105
{
106 106
    int i=0;
107 107
    /* Using linear search, do binary if it ever turns to be speed critical */
108
    int r = av_random(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1;
108
    int r = av_lfg_get(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1;
109 109
    while (elbg->utility_inc[i] < r)
110 110
        i++;
111 111

  
......
318 318

  
319 319
void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
320 320
                  int numCB, int max_steps, int *closest_cb,
321
                  AVRandomState *rand_state)
321
                  AVLFG *rand_state)
322 322
{
323 323
    int i, k;
324 324

  
......
345 345

  
346 346
void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
347 347
                int numCB, int max_steps, int *closest_cb,
348
                AVRandomState *rand_state)
348
                AVLFG *rand_state)
349 349
{
350 350
    int dist;
351 351
    elbg_data elbg_d;
libavcodec/elbg.h
39 39
 */
40 40
void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
41 41
                int numCB, int num_steps, int *closest_cb,
42
                AVRandomState *rand_state);
42
                AVLFG *rand_state);
43 43

  
44 44
/**
45 45
 * Initialize the **codebook vector for the elbg algorithm. If you have already
......
50 50
 */
51 51
void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
52 52
                  int numCB, int num_steps, int *closest_cb,
53
                  AVRandomState *rand_state);
53
                  AVLFG *rand_state);
54 54

  
55 55
#endif /* AVCODEC_ELBG_H */
libavcodec/roqvideo.h
22 22
#ifndef AVCODEC_ROQVIDEO_H
23 23
#define AVCODEC_ROQVIDEO_H
24 24

  
25
#include "libavutil/random.h"
25
#include "libavutil/lfg.h"
26 26
#include "avcodec.h"
27 27
#include "dsputil.h"
28 28

  
......
58 58
    int width, height;
59 59

  
60 60
    /* Encoder only data */
61
    AVRandomState randctx;
61
    AVLFG randctx;
62 62
    uint64_t lambda;
63 63

  
64 64
    motion_vect *this_motion4;
libavcodec/roqvideoenc.c
929 929
{
930 930
    RoqContext *enc = avctx->priv_data;
931 931

  
932
    av_random_init(&enc->randctx, 1);
932
    av_lfg_init(&enc->randctx, 1);
933 933

  
934 934
    enc->framesSinceKeyframe = 0;
935 935
    if ((avctx->width & 0xf) || (avctx->height & 0xf)) {

Also available in: Unified diff