[FFmpeg-devel] [PATCH] swr: compile mmx2 s16p functions only on x86-32.

James Almer jamrial at gmail.com
Sat Jun 14 23:26:16 CEST 2014


On 14/06/14 5:34 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Sat, Jun 14, 2014 at 4:15 PM, Michael Niedermayer <michaelni at gmx.at>
> wrote:
> 
>> On Sat, Jun 14, 2014 at 02:55:49PM -0400, Ronald S. Bultje wrote:
>>> ---
>>>  libswresample/x86/resample_x86_dsp.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/libswresample/x86/resample_x86_dsp.c
>> b/libswresample/x86/resample_x86_dsp.c
>>> index 02a7db5..c9b2bef 100644
>>> --- a/libswresample/x86/resample_x86_dsp.c
>>> +++ b/libswresample/x86/resample_x86_dsp.c
>>> @@ -33,9 +33,11 @@
>>>
>>>  #include "resample_mmx.h"
>>>
>>> +#if ARCH_X86_32
>>>  #define TEMPLATE_RESAMPLE_S16_MMX2
>>>  #include "libswresample/resample_template.c"
>>>  #undef TEMPLATE_RESAMPLE_S16_MMX2
>>> +#endif
>>
>> make distclean ; ./configure && make -j12
>>
>> produces:
>>
>> libswresample/x86/resample_x86_dsp.c: In function
>> ‘swresample_dsp_x86_init’:
>> libswresample/x86/resample_x86_dsp.c:74:61: error:
>> ‘resample_common_int16_mmx2’ undeclared (first use in this function)
>> libswresample/x86/resample_x86_dsp.c:74:61: note: each undeclared
>> identifier is reported only once for each function it appears in
>> libswresample/x86/resample_x86_dsp.c:75:61: error:
>> ‘resample_linear_int16_mmx2’ undeclared (first use in this function)
>> make: *** [libswresample/x86/resample_x86_dsp.o] Error 1
> 
> 
> On 64bit? Deadcode elim takes place after compilation I guess... Ohwell
> it's static so let's just leave the function as-is then... The assignment
> is already using the proper if.
> 
> Ronald

MSVC builds are broken because of this as well. DCE taking place after 
compilation when the relevant version of resample_template.c was not 
included generates undeclared function errors.

Adding prototypes fixes it. I'll send a patch in a moment.


More information about the ffmpeg-devel mailing list