[vlc-devel] [PATCH] hqdn3d video filter, ported from mplayer

Rafaël Carré funman at videolan.org
Wed Nov 23 01:39:10 CET 2011


Le Tue, 22 Nov 2011 22:29:07 +0000,
Cheng Sun <chengsun9 at gmail.com> a écrit :

> Hi,
> 
> >> +
> >> +    for (int i = 0; i < 3; ++i) {
> >> +        sys->w[i] = fmt_in->i_width  * chroma->p[i].w.num /
> >> chroma->p[i].w.den;
> >> +        if (sys->w[i] > wmax) wmax = sys->w[i];
> > 
> > How can width * num / den be less than zero?
> 
> It won't be. This code just sets wmax to the width of the widest plane
> (so that we can allocate enough memory to cfg->Line to be used when
> processing every plane).
> 
> >> +        sys->h[i] = fmt_out->i_height * chroma->p[i].h.num /
> >> chroma->p[i].h.den;
> >> +        if (sys->h[i] > hmax) hmax = sys->h[i];
> > 
> > Same question for height
> 
> hmax is actually unused. I'll remove it.
> 
> >> +    for (int i = 0; i < 3; ++i) {
> >> +        free(cfg->Frame[i]);
> >> +        cfg->Frame[i] = NULL;
> > 
> > No need to set to NULL here, you'll free sys just after
> 
> Good point.
> 
> >> +/*
> >> + * Copyright (C) 2003 Daniel Moreno <comac at comac.darktech.org>
> >> + *
> >> + * This file is part of MPlayer.
> >> + *
> >> + * MPlayer is free software; you can redistribute it and/or modify
> > 
> > Should we change this to "This program" ?
> > 
> > Also why do you keep code in the header, to reduce difference with MPlayer code?
> > 
> Yes, I don't think we should remove it, because the file is almost
> identical to the copy in MPlayer (only a few lines removed).
> 
> Cheng
> 
> 
> (new patch below, which also fixes a sigsegv)

patch OK

Doesn't apply though, your mail program is cutting long lines

-- 
Rafaël Carré



More information about the vlc-devel mailing list