Mercurial > libavcodec.hg
comparison snow.c @ 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 | e376facae584 |
children | 5c58923d47d2 |
comparison
equal
deleted
inserted
replaced
9387:cd207441ca56 | 9388:2313bf51945b |
---|---|
4719 int width=256; | 4719 int width=256; |
4720 int height=256; | 4720 int height=256; |
4721 int buffer[2][width*height]; | 4721 int buffer[2][width*height]; |
4722 SnowContext s; | 4722 SnowContext s; |
4723 int i; | 4723 int i; |
4724 AVLFG prn; | 4724 AVLFG prng; |
4725 s.spatial_decomposition_count=6; | 4725 s.spatial_decomposition_count=6; |
4726 s.spatial_decomposition_type=1; | 4726 s.spatial_decomposition_type=1; |
4727 | 4727 |
4728 av_lfg_init(&prn, 1); | 4728 av_lfg_init(&prng, 1); |
4729 | 4729 |
4730 printf("testing 5/3 DWT\n"); | 4730 printf("testing 5/3 DWT\n"); |
4731 for(i=0; i<width*height; i++) | 4731 for(i=0; i<width*height; i++) |
4732 buffer[0][i] = buffer[1][i] = av_lfg_get(&prn) % 54321 - 12345; | 4732 buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 54321 - 12345; |
4733 | 4733 |
4734 ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); | 4734 ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); |
4735 ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); | 4735 ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); |
4736 | 4736 |
4737 for(i=0; i<width*height; i++) | 4737 for(i=0; i<width*height; i++) |
4738 if(buffer[0][i]!= buffer[1][i]) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]); | 4738 if(buffer[0][i]!= buffer[1][i]) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]); |
4739 | 4739 |
4740 printf("testing 9/7 DWT\n"); | 4740 printf("testing 9/7 DWT\n"); |
4741 s.spatial_decomposition_type=0; | 4741 s.spatial_decomposition_type=0; |
4742 for(i=0; i<width*height; i++) | 4742 for(i=0; i<width*height; i++) |
4743 buffer[0][i] = buffer[1][i] = av_lfg_get(&prn) % 54321 - 12345; | 4743 buffer[0][i] = buffer[1][i] = av_lfg_get(&prng) % 54321 - 12345; |
4744 | 4744 |
4745 ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); | 4745 ff_spatial_dwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); |
4746 ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); | 4746 ff_spatial_idwt(buffer[0], width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); |
4747 | 4747 |
4748 for(i=0; i<width*height; i++) | 4748 for(i=0; i<width*height; i++) |