[FFmpeg-devel] [Patch] Scale filter should use multiples of 2

Michael Niedermayer michaelni
Thu Jul 1 23:28:03 CEST 2010


On Thu, Jul 01, 2010 at 04:27:33PM +0200, Stefano Sabatini wrote:
> On date Thursday 2010-07-01 10:00:18 -0400, Daniel G. Taylor encoded:
> > On 06/30/2010 07:40 PM, Stefano Sabatini wrote:
> > >
> > >>Index: libavfilter/vf_scale.c
> > >>===================================================================
> > >>--- libavfilter/vf_scale.c	(revision 23891)
> > >>+++ libavfilter/vf_scale.c	(working copy)
> > >>@@ -33,7 +33,7 @@
> > >>      /**
> > >>       * New dimensions. Special values are:
> > >>       *   0 = original width/height
> > >>-     *  -1 = keep original aspect
> > >>+     *  -x = keep original aspect and make mod-x, e.g. -16 for multiples of 16
> > >
> > >Just a question, couldn't this be achieved using parametric values for
> > >w:h?
> > >
> > >I don't want to add code and complexity when all this may be
> > >accomplished by a more general mechanism.
> > >
> > >For example we may have a = w / h
> > >w'/h' = a = w/h
> > >h' = w' / a
> > >
> > >scale=OUT_W:mod(OUT_W/a, 2)
> > 
> > I suppose that will work (and Michael is right about it being
> > round() instead of mod), but doesn't having to parse such values
> > make this incredibly more complex? Are there utilities in libav* to
> > make parsing that easy?
> > 
> > Also, what other use cases are there for such a system? We can round
> > to the nearest multiple, but what else would it do that warrants
> > such a system?
> 
> For example you may to parametrically change the size:
> # double size
> scale=2*w:2*h
> # decrease size by 50%
> scale=w/2:h/2
> # invert w/h sizes
> scale=h:w
> # seek for greek harmony
> scale=h*PHI:h

include time and all kinds of odd effects become possible



[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100701/6a3aa367/attachment.pgp>



More information about the ffmpeg-devel mailing list