[FFmpeg-devel] runtime-cpu-detect bug in swscale

Frank Barchard fbarchard at google.com
Tue Apr 5 03:28:59 CEST 2011

On Mon, Apr 4, 2011 at 6:16 PM, Michael Niedermayer <michaelni at gmx.at>wrote:

> On Fri, Mar 04, 2011 at 10:15:57PM +0000, Darren Horrocks wrote:
> > swscale doesnt ever actually do any runtime detection at all when
> > runtime cpu detection is enabled, it simply passes whatever is passed
> > to -sws_flags, which could be nothing at all making swscale default to
> > the C implementation.
> >
> > i have uploaded a patched libswscale.dll (win32 build), the patch its
> > self, and a pre-patched swscale.c file:
> > http://www.bizzeh.com/ffmpeg/free/swstest/
> >
> > the patch has been tested, an unpatched swscale gained roughly 79fps
> > during an encode with no flags and around 190fps with mmx2 set in the
> > sws_flags. the patched swscale dll gained 190fps without any flags set
> > at all since it detected the capabilities of the processor before
> > choosing.
> >
> > could anyone else test this patch and submit it to trunk if its usable?
> patch applied and pushed
> thankx

Thanks.    With --enable-cpu-detect I was seeing this performance issue.
ffmpeg -benchmark -y -i tulip2.mp4 -s 1272x724 -an -f null out.yuv

without patch:
bench: utime=21.310s maxrss=31424kB
with patch
bench: utime=6.068s maxrss=30924kB

More information about the ffmpeg-devel mailing list