[Mplayer-cvslog] CVS: main/libmpcodecs vf_unsharp.c,1.1,1.2

Arpi of Ize arpi at mplayerhq.hu
Fri Nov 1 01:02:55 CET 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv4951

Modified Files:
	vf_unsharp.c 
Log Message:
vf_unsharp: proper rounding & print if sharpening or bluring
patch by Rémi Guyomarch <rguyom at pobox.com>


Index: vf_unsharp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_unsharp.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vf_unsharp.c	29 Oct 2002 22:37:11 -0000	1.1
+++ vf_unsharp.c	1 Nov 2002 00:02:52 -0000	1.2
@@ -86,7 +86,7 @@
     int stepsX = fp->msizeX/2;
     int stepsY = fp->msizeY/2;
     int scalebits = (stepsX+stepsY)*2;
-    int32_t halfscale = 1 << (stepsX+stepsY);
+    int32_t halfscale = 1 << ((stepsX+stepsY)*2-1);
 
     if( !fp->amount ) {
 	if( src == dst )
@@ -138,11 +138,13 @@
 
     int z, stepsX, stepsY;
     FilterParam *fp;
+    char *effect;
 
     // allocate buffers
 
     fp = &vf->priv->lumaParam;
-    mp_msg( MSGT_VFILTER, MSGL_INFO, "unsharp: %dx%d:%0.2f (luma) \n", fp->msizeX, fp->msizeY, fp->amount );
+    effect = fp->amount == 0 ? "don't touch" : fp->amount < 0 ? "blur" : "sharpen";
+    mp_msg( MSGT_VFILTER, MSGL_INFO, "unsharp: %dx%d:%0.2f (%s luma) \n", fp->msizeX, fp->msizeY, fp->amount, effect );
     memset( fp->SC, 0, sizeof( fp->SC ) );
     stepsX = fp->msizeX/2;
     stepsY = fp->msizeY/2;
@@ -150,7 +152,8 @@
 	fp->SC[z] = memalign( 16, sizeof(*(fp->SC[z])) * (width+2*stepsX) );
 
     fp = &vf->priv->chromaParam;
-    mp_msg( MSGT_VFILTER, MSGL_INFO, "unsharp: %dx%d:%0.2f (chroma)\n", fp->msizeX, fp->msizeY, fp->amount );
+    effect = fp->amount == 0 ? "don't touch" : fp->amount < 0 ? "blur" : "sharpen";
+    mp_msg( MSGT_VFILTER, MSGL_INFO, "unsharp: %dx%d:%0.2f (%s chroma)\n", fp->msizeX, fp->msizeY, fp->amount, effect );
     memset( fp->SC, 0, sizeof( fp->SC ) );
     stepsX = fp->msizeX/2;
     stepsY = fp->msizeY/2;
@@ -317,7 +320,7 @@
 }
 
 vf_info_t vf_info_unsharp = {
-    "unsharp mask",
+    "unsharp mask & gaussian blur",
     "unsharp",
     "Rémi Guyomarch",
     "",




More information about the MPlayer-cvslog mailing list