[MPlayer-cvslog] CVS: main/libmpcodecs vf_expand.c,1.29,1.30

Oded Shimon ods15 at ods15.dyndns.org
Fri Jul 8 08:39:26 CEST 2005


On Thu, Jul 07, 2005 at 11:32:03PM +0200, Reimar D?ffinger wrote:
> Hi,
> On Thu, Jul 07, 2005 at 09:55:00PM +0200, Oded Shimon CVS wrote:
> > add 'aspect' and 'round' params to vf_expand.
> > (my first commit! I hope I did this correctly ;)
> 
> Well, I would have prefered a clear warning that you would commit before
> doing it, I would have taken the time to review it then.

I sent the patch to the mailing list quite a while ago, no-one made any 
comment on it. I discussed it on IRC a bit before committing...

> > +    	vf->priv->exp_w = (1 + (vf->priv->exp_w - 1) / vf->priv->round) * vf->priv->round;
> > +        vf->priv->exp_h = (1 + (vf->priv->exp_h - 1) / vf->priv->round) * vf->priv->round;
> 
> Broken indetation,

oops, didn't notice that one. Fixing.

> and also: what on earth are you trying to do with
> that code?? simply rounding down? Then just do
> vf->priv->exp_w -= vf->priv->exp_w % vf->priv->round;

No, round up. These are the possible ways to do it:

if (x % r) x += (r - x % r);
x  = (1 + (x - 1) / r) * r;
x += (r - 1 - (x + 1) % r);

I couldn't decide on which one is most readable... Maybe I should just add 
a comment?...

- ods15




More information about the MPlayer-cvslog mailing list