diff options
author | wm4 <wm4@nowhere> | 2014-06-11 00:21:36 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-11 00:39:14 +0200 |
commit | e34e1080d26b843554137c4340ae4d550aa3db6a (patch) | |
tree | 27fd47ebebd5766f1e578a36cf5d60264d756818 /video | |
parent | e9391e5827a4dc13fd030e9b579b607abcbf7a44 (diff) | |
download | mpv-e34e1080d26b843554137c4340ae4d550aa3db6a.tar.bz2 mpv-e34e1080d26b843554137c4340ae4d550aa3db6a.tar.xz |
vf_noise: remove global variables
Diffstat (limited to 'video')
-rw-r--r-- | video/filter/vf_noise.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/video/filter/vf_noise.c b/video/filter/vf_noise.c index acf8f4f0fd..f612469b8d 100644 --- a/video/filter/vf_noise.c +++ b/video/filter/vf_noise.c @@ -56,6 +56,7 @@ typedef struct FilterParam{ int shiftptr; int8_t *noise; int8_t *prev_shift[MAX_RES][3]; + int nonTempRandShift[MAX_RES]; }FilterParam; struct vf_priv_s { @@ -70,9 +71,6 @@ struct vf_priv_s { struct vf_lw_opts *lw_opts; }; -static int nonTempRandShift_init; -static int nonTempRandShift[MAX_RES]; - static const int patt[4] = { -1,0,1,0 }; @@ -134,11 +132,8 @@ static int8_t *initNoise(FilterParam *fp){ for (j = 0; j < 3; j++) fp->prev_shift[i][j] = noise + (rand()&(MAX_SHIFT-1)); - if(!nonTempRandShift_init){ - for(i=0; i<MAX_RES; i++){ - nonTempRandShift[i]= rand()&(MAX_SHIFT-1); - } - nonTempRandShift_init = 1; + for(i=0; i<MAX_RES; i++){ + fp->nonTempRandShift[i]= rand()&(MAX_SHIFT-1); } fp->noise= noise; @@ -200,7 +195,7 @@ static void donoise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, in for(y=0; y<height; y++) { if(fp->temporal) shift= rand()&(MAX_SHIFT -1); - else shift= nonTempRandShift[y]; + else shift= fp->nonTempRandShift[y]; if(fp->quality==0) shift&= ~7; if (fp->averaged) { |