Revision 9aa2ab42 libavcodec/elbg.c

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;

Also available in: Unified diff