aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/elbg.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2009-03-08 17:43:12 +0000
committerVitor Sessak <vitor1001@gmail.com>2009-03-08 17:43:12 +0000
commit9aa2ab4276baeca2f968f6c9b90002d8c8a62a89 (patch)
tree699948803ae07463c4958ef8b3e44f781cd2ef4d /libavcodec/elbg.c
parent74e2a0784e7702d2a3e0d88c7ea4f900ea223edd (diff)
downloadffmpeg-9aa2ab4276baeca2f968f6c9b90002d8c8a62a89.tar.gz
Use FLG pseudo-random number generator in RoQ and ELBG
Originally committed as revision 17881 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/elbg.c')
-rw-r--r--libavcodec/elbg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/elbg.c b/libavcodec/elbg.c
index 712c927cec..35f068825f 100644
--- a/libavcodec/elbg.c
+++ b/libavcodec/elbg.c
@@ -25,7 +25,7 @@
#include <string.h>
-#include "libavutil/random.h"
+#include "libavutil/lfg.h"
#include "elbg.h"
#include "avcodec.h"
@@ -52,7 +52,7 @@ typedef struct{
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)
@@ -105,7 +105,7 @@ static int get_high_utility_cell(elbg_data *elbg)
{
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++;
@@ -318,7 +318,7 @@ static void do_shiftings(elbg_data *elbg)
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;
@@ -345,7 +345,7 @@ void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
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;