changeset 8015:403f7a58ccf2

vf_unsharp: proper rounding & print if sharpening or bluring patch by R«±mi Guyomarch <rguyom@pobox.com>
author arpi
date Fri, 01 Nov 2002 00:02:52 +0000
parents 3d6904cee13e
children 892c73ce9ba3
files libmpcodecs/vf_unsharp.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_unsharp.c	Fri Nov 01 00:01:53 2002 +0000
+++ b/libmpcodecs/vf_unsharp.c	Fri Nov 01 00:02:52 2002 +0000
@@ -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",
     "",