[FFmpeg-devel] [PATCH] make building swscale rgb template conditional

Ramiro Polla ramiro.polla
Wed Aug 25 05:34:01 CEST 2010


On Tue, Aug 17, 2010 at 7:39 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Aug 15, 2010 at 10:34:47PM +0200, Luca Barbato wrote:
>> $subj + why the sse2 variant is always disabled?
>>
>> lu
>>
>> --
>>
>> Luca Barbato
>> Gentoo/linux
>> http://dev.gentoo.org/~lu_zero
>>
>
>> ?rgb2rgb.c ? ? ? ? ?| ? 78 ++++++++++++++++++------------
>> ?rgb2rgb_template.c | ?134 ++++++++++++++++++++++++++---------------------------
>> ?2 files changed, 114 insertions(+), 98 deletions(-)
>> 5c27bf038a4cebac04892e6434ff946149b89a22 ?swscale-make-rgb-templates-build-conditional.diff
>> diff --git a/rgb2rgb.c b/rgb2rgb.c
>> index f92e165..3a6395a 100644
>> --- a/rgb2rgb.c
>> +++ b/rgb2rgb.c
>> @@ -148,41 +148,57 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) ?= 0x0000001f0000001fULL;
>>
>> ?//Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one.
>> ?//plain C versions
>> -#undef HAVE_MMX
>> -#undef HAVE_MMX2
>> -#undef HAVE_AMD3DNOW
>> -#undef HAVE_SSE2
>> -#define HAVE_MMX 0
>> -#define HAVE_MMX2 0
>> -#define HAVE_AMD3DNOW 0
>> -#define HAVE_SSE2 0
>> +
>> +#define TEMPLATE_SSE2 0 // never enabled.
>> +
>> +#define TEMPLATE_MMX 0
>> +#define TEMPLATE_MMX2 0
>> +#define TEMPLATE_AMD3DNOW 0
>> ?#define RENAME(a) a ## _C
>> ?#include "rgb2rgb_template.c"
>> +#undef RENAME
>> +#undef TEMPLATE_AMD3DNOW
>> +#undef TEMPLATE_MMX2
>> +#undef TEMPLATE_MMX
>>
>> ?#if ARCH_X86
>>
>> ?//MMX versions
>> -#undef RENAME
>> -#undef HAVE_MMX
>> -#define HAVE_MMX 1
>> -#define RENAME(a) a ## _MMX
>> -#include "rgb2rgb_template.c"
>> -
>> +#ifdef HAVE_MMX
>> +# ? define TEMPLATE_MMX 1
>> +# ? define TEMPLATE_MMX2 0
>> +# ? define TEMPLATE_AMD3DNOW 0
>> +# ? define RENAME(a) a ## _MMX
>> +# ? include "rgb2rgb_template.c"
>> +# ? undef RENAME
>> +# ? undef TEMPLATE_AMD3DNOW
>> +# ? undef TEMPLATE_MMX2
>> +# ? undef TEMPLATE_MMX
>
> inconsistent to the names used in swscale*

No reply from Luca, so I send a new patchset that works like in
swscale.c (and factors some code out).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-swscale-Always-define-COMPILE_xxx-to-either-0-or-1.patch
Type: application/octet-stream
Size: 3228 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100825/a8a45efd/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-swscale-simplify-selection-of-optimizations-to-comp.patch
Type: application/octet-stream
Size: 1849 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100825/a8a45efd/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-rgb2rgb-Do-not-misuse-HAVE_-defines.-Introduce-COMP.patch
Type: application/octet-stream
Size: 21186 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100825/a8a45efd/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-rgb2rgb-only-compile-requested-optimizations-as-is.patch
Type: application/octet-stream
Size: 6204 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100825/a8a45efd/attachment-0003.obj>



More information about the ffmpeg-devel mailing list