[FFmpeg-devel] [PATCH] make building swscale rgb template conditional
Måns Rullgård
mans
Wed Aug 25 10:50:23 CEST 2010
Ramiro Polla <ramiro.polla at gmail.com> writes:
> 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).
Why does libswscale have to be this disgustingly ugly? There's none
of this ifdef hell in libavcodec, and it has many more different kinds
of asm.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list