[FFmpeg-devel] [PATCH] libavfilter-soc: sws cpu caps flags detection

Stefano Sabatini stefano.sabatini-lala
Fri Apr 3 01:27:32 CEST 2009


On date Friday 2009-04-03 00:22:12 +0200, Michael Niedermayer encoded:
> On Fri, Apr 03, 2009 at 12:06:05AM +0200, Stefano Sabatini wrote:
[...]
> > > i do and the cpu caps should be merged so they match with the next major bump
> > > and dont need this remappingf anymore
> > 
> > Thus I suggest to move them to lavu, maybe togheter with all the CPU
> > detection stuff.
> 
> lavu is supposed to be a small lightweight lib that contains ONLY
> things that are usefull for a wide range of applications.
> 
> Every time someone suggests to move something into lavu without ANY
> argument that honestly feels like a punch to the face.

Maybe I'm wrong but my idea was:
lavc depends on lavu and on lsws
lsws depends on lavu

so we have to put that thingy either in lavu or in lsws, I believe
lavu is a more suitable place.

Also I don't think that:
* cpu detection is so much code
* cpu detection is not useful to a wide range of applications

> > > [...]
> > > > @@ -66,6 +77,11 @@
> > > >          }
> > > >      }
> > > >  
> > > > +    {
> > > > +        int sws_flags = av_get_int(scale->sws, "sws_flags", NULL);
> > > > +        av_set_int(scale->sws, "sws_flags", sws_flags + get_sws_cpu_caps_flags());
> > > > +    }
> > > > +
> > > >      /* sanity check parms */
> > > >      if(scale->w <  -1 || scale->h <  -1)
> > > >          return -1;
> > > 
> > > can the user still override it ?
> > 
> > No,
> 
> so its broken
> default should be detection but the user should be able to force them
> disabled

Then I think about to set this just before handling the "sws_flags" opt,
but this unfortunately can't work since the application
(ffmpeg/ffplay) sets options with:
sws_flags=d
which overrides previous settings and using:
sws_flags=+d

doesn't work either since we'll end up with more than one scale algo.

Ideally we should have a way to tell:
sws_flags=d-cpu_flags+my_cpu_flag

That would be possible using the opt_handler system, I'll try to
revive it addressing your comments, or I'll look for a simpler
solution.

Regards.
-- 
FFmpeg = Freak & Free Multimedia Ponderous Educated Game



More information about the ffmpeg-devel mailing list