#include <string.h>
-#include "libavutil/random.h"
+#include "libavutil/lfg.h"
#include "elbg.h"
#include "avcodec.h"
int *utility_inc;
int *nearest_cb;
int *points;
- AVRandomState *rand_state;
+ AVLFG *rand_state;
} elbg_data;
static inline int distance_limited(int *a, int *b, int dim, int limit)
{
int i=0;
/* Using linear search, do binary if it ever turns to be speed critical */
- int r = av_random(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1;
+ int r = av_lfg_get(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1;
while (elbg->utility_inc[i] < r)
i++;
void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
int numCB, int max_steps, int *closest_cb,
- AVRandomState *rand_state)
+ AVLFG *rand_state)
{
int i, k;
void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
int numCB, int max_steps, int *closest_cb,
- AVRandomState *rand_state)
+ AVLFG *rand_state)
{
int dist;
elbg_data elbg_d;
*/
void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
int numCB, int num_steps, int *closest_cb,
- AVRandomState *rand_state);
+ AVLFG *rand_state);
/**
* Initialize the **codebook vector for the elbg algorithm. If you have already
*/
void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
int numCB, int num_steps, int *closest_cb,
- AVRandomState *rand_state);
+ AVLFG *rand_state);
#endif /* AVCODEC_ELBG_H */
#ifndef AVCODEC_ROQVIDEO_H
#define AVCODEC_ROQVIDEO_H
-#include "libavutil/random.h"
+#include "libavutil/lfg.h"
#include "avcodec.h"
#include "dsputil.h"
int width, height;
/* Encoder only data */
- AVRandomState randctx;
+ AVLFG randctx;
uint64_t lambda;
motion_vect *this_motion4;
{
RoqContext *enc = avctx->priv_data;
- av_random_init(&enc->randctx, 1);
+ av_lfg_init(&enc->randctx, 1);
enc->framesSinceKeyframe = 0;
if ((avctx->width & 0xf) || (avctx->height & 0xf)) {