[FFmpeg-devel] [PATCH] Port gradfun to libavfilter (GCI)

Aurelien Jacobs aurel
Wed Dec 8 23:55:04 CET 2010


On Wed, Dec 08, 2010 at 09:50:30PM +0100, Stefano Sabatini wrote:
> On date Wednesday 2010-12-08 22:23:42 +0200, Martin Storsj? encoded:
> > On Tue, 7 Dec 2010, Stefano Sabatini wrote:
> > 
> > > On date Monday 2010-12-06 21:11:34 -0500, Nolan L encoded:
> > > > +    
> > > > +    gf->chroma_w = -((-inlink->w) >> hsub);
> > > > +    gf->chroma_h = -((-inlink->h) >> vsub);
> > > 
> > > is this -((-foo)>>bar) required? (why not simply foo>>bar)?
> > 
> > This rounds up properly, for the cases where the luma width isn't evenly 
> > divisible for chroma subsampling.
> 
> Yes but what's the point of the double negation?

What Martin said : Rounding up (instead of down).
Just try it with a few numbers and you will see that the double negation
changes the result. So no, it can't be removed.

Aurel



More information about the ffmpeg-devel mailing list