On Wed, 25 Jul 2012 02:45:34 +0000, Loren Merritt <lor...@u.washington.edu> 
wrote:
> Change code style to match the rest of libav.
> ---
>  libavfilter/vf_hqdn3d.c |  309 
> +++++++++++++++++++++++------------------------
>  1 files changed, 153 insertions(+), 156 deletions(-)
> 
> diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
> index af69d41..8e2a6a2 100644
> --- a/libavfilter/vf_hqdn3d.c
> +++ b/libavfilter/vf_hqdn3d.c
> @@ -32,165 +32,162 @@
>  #include "video.h"
>  
>  typedef struct {
> -    int Coefs[4][512*16];
> -    unsigned int *Line;
> -    unsigned short *Frame[3];
> +    int coefs[4][512*16];
> +    uint32_t *line;
> +    uint16_t *frame_prev[3];
>      int hsub, vsub;
>  } HQDN3DContext;
>  
> -static inline unsigned int LowPassMul(unsigned int PrevMul, unsigned int 
> CurrMul, int *Coef)
> +static inline uint32_t lowpass(unsigned int prev, unsigned int cur, int 
> *coef)
>  {
> -    //    int dMul= (PrevMul&0xFFFFFF)-(CurrMul&0xFFFFFF);
> -    int dMul= PrevMul-CurrMul;
> -    unsigned int d=((dMul+0x10007FF)>>12);
> -    return CurrMul + Coef[d];
> +    //    int dmul= (prev&0xFFFFFF)-(cur&0xFFFFFF);
> +    int dmul = prev-cur;
> +    uint32_t d = ((dmul+0x10007FF)>>12);
> +    return cur + coef[d];
>  }
>  
> -static void deNoiseTemporal(unsigned char *FrameSrc,
> -                            unsigned char *FrameDest,
> -                            unsigned short *FrameAnt,
> -                            int W, int H, int sStride, int dStride,
> -                            int *Temporal)
> +static void denoise_temporal(uint8_t *src, uint8_t *dst,
> +                             uint16_t *frame_ant,
> +                             int w, int h, int sstride, int dstride,
> +                             int *temporal)
>  {
> -    long X, Y;
> -    unsigned int PixelDst;
> -
> -    for (Y = 0; Y < H; Y++) {
> -        for (X = 0; X < W; X++) {
> -            PixelDst = LowPassMul(FrameAnt[X]<<8, FrameSrc[X]<<16, Temporal);
> -            FrameAnt[X] = ((PixelDst+0x1000007F)>>8);
> -            FrameDest[X]= ((PixelDst+0x10007FFF)>>16);
> +    long x, y;

Is there any reason not to make those plain ints?

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to