[FFmpeg-devel] [PATCH] Extend slicify filter to make it accept a parametric value

Michael Niedermayer michaelni
Thu Mar 11 01:38:17 CET 2010


On Wed, Mar 10, 2010 at 08:54:01PM +0100, Stefano Sabatini wrote:
> On date Wednesday 2010-03-10 12:59:25 +0100, Michael Niedermayer encoded:
> > On Wed, Mar 10, 2010 at 12:14:09PM +0100, Stefano Sabatini wrote:
> > > On date Wednesday 2010-03-10 11:45:21 +0100, Michael Niedermayer encoded:
> > > > On Wed, Mar 10, 2010 at 01:49:00AM +0100, Stefano Sabatini wrote:
> > > > > Hi, as in subject.
> > > > > 
> > > > > This should be a great help for testing slicing.
> > > > [...]
> > > > > @@ -24,35 +24,74 @@
> > > > >   */
> > > > >  
> > > > >  #include "avfilter.h"
> > > > > +#include "libavutil/lfg.h"
> > > > >  #include "libavutil/pixdesc.h"
> > > > > +#include "libavcodec/eval.h"
> > > > 
> > > > you add a dependancy on lavc
> > > 
> > > libavfilter *already* depends on libavcodec (ff_fill_pointer).
> > > 
> > > And yes I plan to remove all the dependancies. 
> > 
> > removeing the dependancy is ok adding more is rejected.
> > Let us remember you do this to avoid
> > if(arg='r')  sliceheight=lcg()
> 
> Check it again.
[...]
> @@ -65,6 +64,19 @@
>  
>  static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
>  {
> +    SliceContext *slice = link->dst->priv;
> +
> +    if (slice->use_random_h) {
> +        slice->lcg_state = slice->lcg_state * 1664525 + 1013904223;
> +        slice->h = 8 + slice->lcg_state % 25;

please scale the number down dont use modulo, i asked you to do this
already
1664525 % 25 == 0 but thats not the point, the point is we know how
to do it correctly. There is no gain you could achive you can only make
it worse the best you could do is to maintain the same quality of randomness

what do you prefer, that i make h264 decoding 1% faster or that i test if
the next idea you come up with is equally good as the standard NR LCG or
worse than it?


> +    }
> +
> +    /* ensure that slices play nice with chroma subsampling, and enforce
> +     * a reasonable minimum size for the slices */
> +    slice->h = FFMAX(8, slice->h & (-1 << slice->vshift));
> +
> +    av_log(link->dst, AV_LOG_DEBUG, "h:%d\n", slice->h);
> +
>      avfilter_start_frame(link->dst->outputs[0], picref);
>  }
>  
> Index: libavfilter-soc/ffmpeg/doc/libavfilter.texi
> ===================================================================
> --- libavfilter-soc.orig/ffmpeg/doc/libavfilter.texi	2010-03-10 20:24:14.000000000 +0100
> +++ libavfilter-soc/ffmpeg/doc/libavfilter.texi	2010-03-10 20:44:14.000000000 +0100
> @@ -359,8 +359,12 @@
>  ./ffmpeg -i in.avi -vfilters "slicify=32" out.avi
>  @end example
>  
> -The filter accepts the slice height as parameter. If the parameter is
> -not specified it will use the default value of 16.
> +The filter accepts the slice height as parameter. If the parameter
> +``rand'' is passed, for each input frame the filter will use a
> +randomly generated value included between 8 and 32.
> +
> +If the parameter is not specified it will use the default value of
> +16.

i think we should not document rand, rather keep it as internal thing
for our tests without any guranteed future compatibility


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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- 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/20100311/d5ad24c8/attachment.pgp>



More information about the ffmpeg-devel mailing list