From e34e1080d26b843554137c4340ae4d550aa3db6a Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 11 Jun 2014 00:21:36 +0200 Subject: vf_noise: remove global variables --- video/filter/vf_noise.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'video') 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; inonTempRandShift[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; ytemporal) shift= rand()&(MAX_SHIFT -1); - else shift= nonTempRandShift[y]; + else shift= fp->nonTempRandShift[y]; if(fp->quality==0) shift&= ~7; if (fp->averaged) { -- cgit v1.2.3