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

Michael Niedermayer michaelni at gmx.at
Wed Apr 27 17:31:17 CEST 2011

On Thu, Apr 21, 2011 at 07:24:52AM -0700, Josh Harris wrote:
> On 3/4/2011 2:15 PM, 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.
> > could anyone else test this patch and submit it to trunk if its usable?
> >
> The patch has been causing purple and green bars/rectangles with a 32bit
> build of ffmpeg on Windows when my source is RGB and the output is not
> RGB.  See this bug report (the title is "mjpeg decoder is broken" but, I
> believe it is a libswscale bug caused by this patch):
> https://ffmpeg.org/trac/ffmpeg/ticket/52
> As posted there:
> With --enable-runtime-cpudetect and this patch applied, ff_getSwsFunc
> from swscale.c calls av_get_cpu_flags() and applies runtime detected CPU
> flags so that the correct version of sws_init_swScale_* gets called. 
> The problem appears to be that sws_rgb2rgb_init from rgb2rgb.c has
> already been called and it does not perform any runtime CPU detection so
> the C version of rgb2rgb_init_* is always called.
> I posted a patch to
> https://ffmpeg.org/trac/ffmpeg/attachment/ticket/52/libswscale_enable_cpu_runtime.diff
> which fixes the issue for me.  I added a test for AV_CPU_FLAG_SSE2 since
> there is an rgb2rgb_init_SSE2() function but I am not 100% sure that it
> should be there.

That patch was applied yesterday

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110427/c4f79d97/attachment.asc>

More information about the ffmpeg-devel mailing list