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

Stefano Sabatini stefano.sabatini-lala
Fri Mar 12 01:09:59 CET 2010


On date Thursday 2010-03-11 01:38:17 +0100, Michael Niedermayer encoded:
> On Wed, Mar 10, 2010 at 08:54:01PM +0100, Stefano Sabatini wrote:
[...]
> > @@ -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

OK I naively believed that couldn't affect randomness quality.
 
> 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

I agree.

Regards.
-- 
FFmpeg = Funny & Fast Mega Pure Enchanting Guru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slicify-add-rand.patch
Type: text/x-diff
Size: 1998 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100312/8c0aa416/attachment.patch>



More information about the ffmpeg-devel mailing list