changeset 6448:e10e3264c19c

higher quality mode
author michael
date Sun, 16 Jun 2002 13:54:36 +0000
parents 751a5775ac35
children 6ee8233283a3
files libmpcodecs/vf_noise.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_noise.c	Sun Jun 16 13:45:52 2002 +0000
+++ b/libmpcodecs/vf_noise.c	Sun Jun 16 13:54:36 2002 +0000
@@ -49,6 +49,7 @@
 	int strength;
 	int uniform;
 	int temporal;
+	int quality;
 	int8_t *noise;
 }FilterParam;
 
@@ -105,7 +106,6 @@
 #ifdef HAVE_MMX
 static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
 	int mmx_len= len&(~7);
-	shift&= ~7;
 	noise+=shift;
 
 	asm volatile(
@@ -135,7 +135,6 @@
 #ifdef HAVE_MMX2
 static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){
 	int mmx_len= len&(~7);
-	shift&= ~7;
 	noise+=shift;
 
 	asm volatile(
@@ -189,7 +188,7 @@
 			{
 				memcpy(dst, src, width);
 				dst+= dstStride;
-				src+= srcStride;	
+				src+= srcStride;
 			}
 		}
 		return;
@@ -200,6 +199,7 @@
 		if(fp->temporal)	shift=  rand()&(MAX_SHIFT  -1);
 		else			shift= nonTempRandShift[y];
 
+		if(fp->quality==0) shift&= ~7;
 		lineNoise(dst, src, noise, width, shift);
 		dst+= dstStride;
 		src+= srcStride;
@@ -209,7 +209,7 @@
 static int config(struct vf_instance_s* vf,
         int width, int height, int d_width, int d_height,
 	unsigned int flags, unsigned int outfmt){
-    
+
 	return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
 }
 
@@ -299,6 +299,8 @@
 	if(pos && pos<max) fp->uniform=1;
 	pos= strchr(args, 't');
 	if(pos && pos<max) fp->temporal=1;
+	pos= strchr(args, 'h');
+	if(pos && pos<max) fp->quality=1;
 
 	if(fp->strength) initNoise(fp);
 }