changeset 9358:f1c4e01a584a

simpler/faster LowPass() macro
author arpi
date Sun, 09 Feb 2003 02:07:11 +0000
parents 21347f49e8d8
children 9a80b815506c
files libmpcodecs/vf_denoise3d.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_denoise3d.c	Sun Feb 09 01:29:21 2003 +0000
+++ b/libmpcodecs/vf_denoise3d.c	Sun Feb 09 02:07:11 2003 +0000
@@ -68,8 +68,20 @@
     free(vf->priv->Line);
 }
 
+//#define LowPass(Prev, Curr, Coef) (((Prev)*Coef[Prev - Curr] + (Curr)*(65536-(Coef[Prev - Curr]))) / 65536)
+//#define LowPass(Prev, Curr, Coef) ((  Prev*Coef[Prev-Curr] + Curr*(65536-(Coef[Prev-Curr]))  )/65536)
+//#define LowPass(Prev, Curr, Coef) ((  Prev*Coef[Prev-Curr] + Curr*65536 - Curr*Coef[Prev-Curr]  )/65536)
+//#define LowPass(Prev, Curr, Coef) (((int)(Curr)) + ((  (int)Prev*Coef[Prev-Curr] - (int)Curr*Coef[Prev-Curr]  )>>16) )
+//#define LowPass(Prev, Curr, Coef) (Curr + ((  Prev*Coef[Prev-Curr] - Curr*Coef[Prev-Curr]  )>>16) )
+//#define LowPass(Prev, Curr, Coef) (Curr + ((  (Prev-Curr)*(Coef[Prev-Curr])  )>>16) )
 
-#define LowPass(Prev, Curr, Coef) (((Prev)*Coef[Prev - Curr] + (Curr)*(65536-(Coef[Prev - Curr]))) / 65536)
+//#define LowPass(Prev, Curr, Coef) (Curr + (((Prev - Curr)*Coef[Prev - Curr]) / 65536))
+#define LowPass(Prev, Curr, Coef) (Curr + ((((unsigned int)(Prev - Curr))*Coef[Prev - Curr]) / 65536))
+//#define LowPass(Prev, Curr, Coef) (Curr + ((((unsigned int)(Prev - Curr))*Coef[((unsigned int)(Prev - Curr))]) / 65536))
+//#define LowPass(Prev, Curr, Coef) (Curr + ((((unsigned char)(Prev - Curr))*Coef[Prev - Curr]) / 65536))
+//#define LowPass(Prev, Curr, Coef) (Curr + (( ((((int)(Prev))-((int)(Curr)))) *Coef[Prev - Curr]) / 65536))
+//#define LowPass(Prev, Curr, Coef) (Curr + (((unsigned int)((Prev - Curr)*Coef[Prev - Curr])) / 65536))
+//#define LowPass(Prev, Curr, Coef) (Curr + (((Prev - Curr)*Coef[Prev - Curr]) >> 16))
 
 static void deNoise(unsigned char *Frame,        // mpi->planes[x]
                     unsigned char *FramePrev,    // pmpi->planes[x]