changeset 9388:2313bf51945b libavcodec

cosmetics: Rename prn variable to prng (Pseudo Random Number Generator).
author diego
date Fri, 10 Apr 2009 17:23:38 +0000
parents cd207441ca56
children 0d7c2dee6b4d
files cabac.c dct-test.c fft-test.c motion-test.c rangecoder.c snow.c
diffstat 6 files changed, 30 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/cabac.c	Fri Apr 10 17:16:19 2009 +0000
+++ b/cabac.c	Fri Apr 10 17:23:38 2009 +0000
@@ -191,14 +191,14 @@
     uint8_t r[9*SIZE];
     int i;
     uint8_t state[10]= {0};
-    AVLFG prn;
+    AVLFG prng;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
     ff_init_cabac_encoder(&c, b, SIZE);
     ff_init_cabac_states(&c);
 
     for(i=0; i<SIZE; i++){
-        r[i] = av_lfg_get(&prn) % 7;
+        r[i] = av_lfg_get(&prng) % 7;
     }
 
     for(i=0; i<SIZE; i++){
--- a/dct-test.c	Fri Apr 10 17:16:19 2009 +0000
+++ b/dct-test.c	Fri Apr 10 17:23:38 2009 +0000
@@ -208,9 +208,9 @@
     int64_t sysErr[64], sysErrMax=0;
     int maxout=0;
     int blockSumErrMax=0, blockSumErr;
-    AVLFG prn;
+    AVLFG prng;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
 
     err_inf = 0;
     err2 = 0;
@@ -221,7 +221,7 @@
         switch(test){
         case 0:
             for(i=0;i<64;i++)
-                block1[i] = (av_lfg_get(&prn) % 512) -256;
+                block1[i] = (av_lfg_get(&prng) % 512) -256;
             if (is_idct){
                 ff_ref_fdct(block1);
 
@@ -230,12 +230,12 @@
             }
         break;
         case 1:{
-            int num = av_lfg_get(&prn) % 10 + 1;
+            int num = av_lfg_get(&prng) % 10 + 1;
             for(i=0;i<num;i++)
-                block1[av_lfg_get(&prn) % 64] = av_lfg_get(&prn) % 512 -256;
+                block1[av_lfg_get(&prng) % 64] = av_lfg_get(&prng) % 512 -256;
         }break;
         case 2:
-            block1[0] = av_lfg_get(&prn) % 4096 - 2048;
+            block1[0] = av_lfg_get(&prng) % 4096 - 2048;
             block1[63]= (block1[0]&1)^1;
         break;
         }
@@ -335,7 +335,7 @@
     switch(test){
     case 0:
         for(i=0;i<64;i++)
-            block1[i] = av_lfg_get(&prn) % 512 -256;
+            block1[i] = av_lfg_get(&prng) % 512 -256;
         if (is_idct){
             ff_ref_fdct(block1);
 
@@ -345,10 +345,10 @@
     break;
     case 1:{
     case 2:
-        block1[0] = av_lfg_get(&prn) % 512 -256;
-        block1[1] = av_lfg_get(&prn) % 512 -256;
-        block1[2] = av_lfg_get(&prn) % 512 -256;
-        block1[3] = av_lfg_get(&prn) % 512 -256;
+        block1[0] = av_lfg_get(&prng) % 512 -256;
+        block1[1] = av_lfg_get(&prng) % 512 -256;
+        block1[2] = av_lfg_get(&prng) % 512 -256;
+        block1[3] = av_lfg_get(&prng) % 512 -256;
     }break;
     }
 
@@ -472,9 +472,9 @@
 {
     int it, i, it1, ti, ti1, err_max, v;
 
-    AVLFG prn;
+    AVLFG prng;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
 
     /* just one test to see if code is correct (precision is less
        important here) */
@@ -483,7 +483,7 @@
 
         /* XXX: use forward transform to generate values */
         for(i=0;i<64;i++)
-            block1[i] = av_lfg_get(&prn) % 256 - 128;
+            block1[i] = av_lfg_get(&prng) % 256 - 128;
         block1[0] += 1024;
 
         for(i=0; i<64; i++)
--- a/fft-test.c	Fri Apr 10 17:16:19 2009 +0000
+++ b/fft-test.c	Fri Apr 10 17:23:38 2009 +0000
@@ -131,9 +131,9 @@
 
 static float frandom(void)
 {
-    AVLFG prn;
-    av_lfg_init(&prn, 1);
-    return (float)((av_lfg_get(&prn) & 0xffff) - 32768) / 32768.0;
+    AVLFG prng;
+    av_lfg_init(&prng, 1);
+    return (float)((av_lfg_get(&prng) & 0xffff) - 32768) / 32768.0;
 }
 
 static int64_t gettime(void)
--- a/motion-test.c	Fri Apr 10 17:16:19 2009 +0000
+++ b/motion-test.c	Fri Apr 10 17:23:38 2009 +0000
@@ -45,12 +45,12 @@
 static void fill_random(uint8_t *tab, int size)
 {
     int i;
-    AVLFG prn;
+    AVLFG prng;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
     for(i=0;i<size;i++) {
 #if 1
-        tab[i] = av_lfg_get(&prn) % 256;
+        tab[i] = av_lfg_get(&prng) % 256;
 #else
         tab[i] = i;
 #endif
--- a/rangecoder.c	Fri Apr 10 17:16:19 2009 +0000
+++ b/rangecoder.c	Fri Apr 10 17:23:38 2009 +0000
@@ -120,9 +120,9 @@
     uint8_t r[9*SIZE];
     int i;
     uint8_t state[10]= {0};
-    AVLFG prn;
+    AVLFG prng;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
 
     ff_init_range_encoder(&c, b, SIZE);
     ff_build_rac_states(&c, 0.05*(1LL<<32), 128+64+32+16);
@@ -130,7 +130,7 @@
     memset(state, 128, sizeof(state));
 
     for(i=0; i<SIZE; i++){
-        r[i] = av_lfg_get(&prn) % 7;
+        r[i] = av_lfg_get(&prng) % 7;
     }
 
     for(i=0; i<SIZE; i++){
--- a/snow.c	Fri Apr 10 17:16:19 2009 +0000
+++ b/snow.c	Fri Apr 10 17:23:38 2009 +0000
@@ -4721,15 +4721,15 @@
     int buffer[2][width*height];
     SnowContext s;
     int i;
-    AVLFG prn;
+    AVLFG prng;
     s.spatial_decomposition_count=6;
     s.spatial_decomposition_type=1;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
 
     printf("testing 5/3 DWT\n");
     for(i=0; i<width*height; i++)
-        buffer[0][i] = buffer[1][i] = av_lfg_get(&prn) % 54321 - 12345;
+        buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 54321 - 12345;
 
     ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
     ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
@@ -4740,7 +4740,7 @@
     printf("testing 9/7 DWT\n");
     s.spatial_decomposition_type=0;
     for(i=0; i<width*height; i++)
-        buffer[0][i] = buffer[1][i] = av_lfg_get(&prn) % 54321 - 12345;
+        buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 54321 - 12345;
 
     ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);
     ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count);