changeset 726:5d344280a1f8 libavutil

cosmetics: Rename prn variable to prng (Pseudo Random Number Generator).
author diego
date Fri, 10 Apr 2009 17:23:38 +0000
parents d199c3b8cbd3
children 98b64f65be0d
files aes.c pca.c tree.c
diffstat 3 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/aes.c	Fri Apr 10 11:32:09 2009 +0000
+++ b/aes.c	Fri Apr 10 17:23:38 2009 +0000
@@ -208,12 +208,12 @@
         {0x73, 0x22, 0x81, 0xc0, 0xa0, 0xaa, 0xb8, 0xf7, 0xa5, 0x4a, 0x0c, 0x67, 0xa0, 0xc4, 0x5e, 0xcf},
         {0x6d, 0x25, 0x1e, 0x69, 0x44, 0xb0, 0x51, 0xe0, 0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65}};
     uint8_t temp[16];
-    AVLFG prn;
+    AVLFG prng;
 
     av_aes_init(&ae, "PI=3.141592654..", 128, 0);
     av_aes_init(&ad, "PI=3.141592654..", 128, 1);
     av_log_set_level(AV_LOG_DEBUG);
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
 
     for(i=0; i<2; i++){
         av_aes_init(&b, rkey[i], 128, 1);
@@ -225,7 +225,7 @@
 
     for(i=0; i<10000; i++){
         for(j=0; j<16; j++){
-            pt[j] = av_lfg_get(&prn);
+            pt[j] = av_lfg_get(&prng);
         }
 {START_TIMER
         av_aes_crypt(&ae, temp, pt, 1, NULL, 0);
--- a/pca.c	Fri Apr 10 11:32:09 2009 +0000
+++ b/pca.c	Fri Apr 10 17:23:38 2009 +0000
@@ -174,18 +174,18 @@
 #define LEN 8
     double eigenvector[LEN*LEN];
     double eigenvalue[LEN];
-    AVLFG prn;
+    AVLFG prng;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
 
     pca= ff_pca_init(LEN);
 
     for(i=0; i<9000000; i++){
         double v[2*LEN+100];
         double sum=0;
-        int pos = av_lfg_get(&prn) % LEN;
-        int v2  = av_lfg_get(&prn) % 101 - 50;
-        v[0]    = av_lfg_get(&prn) % 101 - 50;
+        int pos = av_lfg_get(&prng) % LEN;
+        int v2  = av_lfg_get(&prng) % 101 - 50;
+        v[0]    = av_lfg_get(&prng) % 101 - 50;
         for(j=1; j<8; j++){
             if(j<=pos) v[j]= v[0];
             else       v[j]= v2;
@@ -194,7 +194,7 @@
 /*        for(j=0; j<LEN; j++){
             v[j] -= v[pos];
         }*/
-//        sum += av_lfg_get(&prn) % 10;
+//        sum += av_lfg_get(&prng) % 10;
 /*        for(j=0; j<LEN; j++){
             v[j] -= sum/LEN;
         }*/
--- a/tree.c	Fri Apr 10 11:32:09 2009 +0000
+++ b/tree.c	Fri Apr 10 17:23:38 2009 +0000
@@ -182,12 +182,12 @@
     int i;
     void *k;
     AVTreeNode *root= NULL, *node=NULL;
-    AVLFG prn;
+    AVLFG prng;
 
-    av_lfg_init(&prn, 1);
+    av_lfg_init(&prng, 1);
 
     for(i=0; i<10000; i++){
-        int j = av_lfg_get(&prn) % 86294;
+        int j = av_lfg_get(&prng) % 86294;
         if(check(root) > 999){
             av_log(NULL, AV_LOG_ERROR, "FATAL error %d\n", i);
         print(root, 0);
@@ -198,7 +198,7 @@
             node= av_mallocz(av_tree_node_size);
         av_tree_insert(&root, (void*)(j+1), cmp, &node);
 
-        j = av_lfg_get(&prn) % 86294;
+        j = av_lfg_get(&prng) % 86294;
         {
             AVTreeNode *node2=NULL;
             av_log(NULL, AV_LOG_ERROR, "removing %4d\n", j);