[Ffmpeg-devel] swscale and regression tests

Luca Abeni lucabe72
Fri Aug 18 08:38:09 CEST 2006

Hi Michael,

On Wed, 2006-08-16 at 09:47 +0200, Michael Niedermayer wrote:
> wait, thinking about it again, theres really no sense in compiling with
> both enabled, what rather should be done is
> * always use swscale but disable the optimized scalers if CONFIG_GPL is not
>   set
> * add a BITEXACT flag to disable optimized code which isnt binary identical
>   to the c counterparts in swscale
> * make all formats which work currently work in swscale
> * update the regression test checksums to the swscale case
Ok, I started with the easy thing: disable the optimized scalers if
CONFIG_GPL is not set

It seems to me that this is quite easy for swscale.c, but it is more
difficult to do for rgb2rgb.c and yuv2rgb.c (swscale.c use those
COMPILE_* macros, while it seems to me that rgb2rgb.c always compile the
simd version on the X86 architecture, and yuv2rgb.c compiles both MMX2
and MMX if HAVE_MMX is defined).

So, I was thinking about using some COMPILE_* macros in rgb2rgb.c and
yuv2rgb.c too (that looks like the cleanest solution).
Something like the attached introduce-compile_.diff.
WARNING: it's only lightly tested, and it probably breaks things in very
interesting ways... I am posting it to know if people agree that this is
the way to go, and so that interested people can help in testing it.

If that is ok, then the attached gpled-simd.diff should disable SIMD
instructions if CONFIG_GPL is not defined (this is ok for mplayer too,
because CONFIG_GPL is always 1 in mplayer's config.h). I tested it by
putting some "#error" in the *_template.c files, and it seems to do the

If something like introduce-compile_.diff is not ok, then I can add some
"&& defined(CONFIG_GPL)" to all the "#ifdef" in the swscale code.

Copy this in your signature, if you think it is important:
                               N O    W A R ! ! !

-------------- next part --------------
A non-text attachment was scrubbed...
Name: introduce-compile_.diff
Type: text/x-patch
Size: 5971 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060818/f0673f07/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpled_simd.diff
Type: text/x-patch
Size: 1549 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060818/f0673f07/attachment-0001.bin>

More information about the ffmpeg-devel mailing list