[FFmpeg-devel] [PATCH] swscale: Support setting filters through AVOptions

Stefano Sabatini stefasab at gmail.com
Mon Oct 14 19:28:41 CEST 2013


On date Sunday 2013-10-13 20:57:40 +0200, Stefano Sabatini encoded:
[...]
> > > not very robust (this will ignore leading characters, possibly
> > > introduced because of typos)
> > > 
> > > > +    if (p) {
> > > > +        p++;
> > > > +    } else
> > > > +        p = strchr(str, id[0]);
> > > 
> > > > +    if (!p)
> > > > +        p = strchr(str, id[1]);
> > > 
> > > this is weird
> > 
> > all that is required for the parser in its current form to work
> > 
> > there are 4 filters, luma horizontal, vertical and chroma horizontal
> > and vertical
> > 
> > filter specifications can be for all 4, for 2 (like luma h+v or for
> > luma+chroma horizontal for example) or for just one specific
> > filter.
> > If there are multiple overlapping specifications, the most specific
> > is used for each of the 4 filters
> > This way you can specify a default and override 1 specific case to
> > get filter A on 3 and B on 1 case.
> > 
> > a use case would be to sharpen luma and shift chroma by 1 pixel left
> > to compensate some error
> > (this would need 2 filters to be written while 3 of the 4 would be
> >  set)
> > iam sure there exist many such use cases ...
> > 
> > also multiple specifications of a filter possibly could/should be
> > combined by convolution to actually apply both filters
> > 
[...]
> > > 
> > > I volunteer to write the parsing code during the weekend if you don't
> > > want to do it yourself.
> > 
> > do whatever you prefer as long as it doesnt loose features and isnt
> > more messy than mine
> > 
> > Also please check with wm4, iam not sure what he is working on and
> > if that includes a filter string parser
> 
> Incomplete and partially untested, for your comments.
[...]

Updated and more tested, and with some docs.

I still need sane documentation telling exactly what source and
destination filter are, and some relevant use cases/examples (I'm not
the best person to tell).

Also, what happens if the filter are not specified, what if the input
is not scaled (pixel format conversion?)? Is it possible to apply the
filters *without* rescaling?
-- 
FFmpeg = Free and Fundamentalist Meaningless Peaceless Excellent Gem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-swscale-support-setting-filters-through-AVOptions.patch
Type: text/x-diff
Size: 14249 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131014/2df39c2e/attachment.bin>


More information about the ffmpeg-devel mailing list