changeset 6965:f8ea0af8edb0

optimization
author michael
date Sun, 11 Aug 2002 10:12:15 +0000
parents f35d05c32dd1
children 2994bd73f35d
files libmpcodecs/vf_noise.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_noise.c	Sun Aug 11 09:52:23 2002 +0000
+++ b/libmpcodecs/vf_noise.c	Sun Aug 11 10:12:15 2002 +0000
@@ -193,13 +193,13 @@
 /***************************************************************************/
 
 static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift){
-	int i, j, n;
+	int i;
+        int8_t *src2= (int8_t*)src;
 	
 	for(i=0; i<len; i++)
 	{
-	    for(j=0,n=0;j<3;j++)
-		n+=shift[j][i];
-	    dst[i]= src[i]+n*(128-abs(128-src[i]))/128;
+	    const int n= shift[0][i] + shift[1][i] + shift[2][i];
+	    dst[i]= src2[i]+((n*src2[i])>>7);
 	}
 }