[FFmpeg-devel] [PATCH] swscale/x86/yuv2rgb: Fix build without SSSE3

James Almer jamrial at gmail.com
Sun Feb 23 20:10:26 EET 2020


On 2/23/2020 2:58 PM, Michael Niedermayer wrote:
> On Sun, Feb 23, 2020 at 05:03:36PM +0100, Carl Eugen Hoyos wrote:
>> Am So., 23. Feb. 2020 um 13:30 Uhr schrieb Michael Niedermayer
>> <michael at niedermayer.cc>:
>>>
>>> From: Parker Ernest <@>
>>>
>>> commit fc6a5883d6af8cae0e96af84dda0ad74b360a084 breaks build on
>>> x86_64 CPUs which do not have SSSE3, e.g. AMD Phenom-II
>>
>> Does the commit break build on specific CPUs or specific toolchains?
> 
> I dont know what the testcase was the author encountered, i just posted
> this here as the author wanted me to post it for him.
> but a simple
> make distclean ; ./configure --disable-ssse3 && make -j32
> replicates the build failure here (see below for the errors)
> 
> We do have the 
> extern void RENAME(ff_yuv_420_rgb32)(x86_reg index, uint8_t *image, const uint8_t *pu_index,
>                                      const uint8_t *pv_index, const uint64_t *pointer_c_dither,
>                                      const uint8_t *py_2index);
> ...
> 
> under #if HAVE_SSSE3
> 
> so i think either that needs to be changed or the code using it needs to be
> similarly protected.
> the if(...)
> is not good enough because it is not something failingh at linking stage but
> already before because the compiler has no idea what the identifer even is.
> (compared to knowing what it is but not having a implemenetation later, which
>  works as disabled code and optimized out references dont fail to link)

This would also happen with --disable-mmxext.

IMO, the #if HAVE_* checks should be removed and always include all
three instances of yuv2rgb_template.c.
The actual asm code is always assembled after all, and as Hendrik
mentioned, we only ever make AVX functions or higher optional, mainly
because of assembler support and because disabling such instruction sets
also affects alignment and stride constants across the codebase.

> 
> 
> 
> libswscale/x86/yuv2rgb.c: In function ‘ff_yuv2rgb_init_x86’:
> libswscale/x86/yuv2rgb.c:91:24: error: ‘yuva420_rgb32_ssse3’ undeclared (first use in this function); did you mean ‘yuva420_rgb32_mmx’?
>                  return yuva420_rgb32_ssse3;
>                         ^~~~~~~~~~~~~~~~~~~
>                         yuva420_rgb32_mmx
> libswscale/x86/yuv2rgb.c:91:24: note: each undeclared identifier is reported only once for each function it appears in
> libswscale/x86/yuv2rgb.c:95:24: error: ‘yuv420_rgb32_ssse3’ undeclared (first use in this function); did you mean ‘yuva420_rgb32_ssse3’?
>                  return yuv420_rgb32_ssse3;
>                         ^~~~~~~~~~~~~~~~~~
>                         yuva420_rgb32_ssse3
> libswscale/x86/yuv2rgb.c:99:24: error: ‘yuva420_bgr32_ssse3’ undeclared (first use in this function); did you mean ‘yuva420_rgb32_ssse3’?
>                  return yuva420_bgr32_ssse3;
>                         ^~~~~~~~~~~~~~~~~~~
>                         yuva420_rgb32_ssse3
> libswscale/x86/yuv2rgb.c:103:24: error: ‘yuv420_bgr32_ssse3’ undeclared (first use in this function); did you mean ‘yuva420_bgr32_ssse3’?
>                  return yuv420_bgr32_ssse3;
>                         ^~~~~~~~~~~~~~~~~~
>                         yuva420_bgr32_ssse3
> libswscale/x86/yuv2rgb.c:105:20: error: ‘yuv420_rgb24_ssse3’ undeclared (first use in this function); did you mean ‘yuv420_rgb32_ssse3’?
>              return yuv420_rgb24_ssse3;
>                     ^~~~~~~~~~~~~~~~~~
>                     yuv420_rgb32_ssse3
> libswscale/x86/yuv2rgb.c:107:20: error: ‘yuv420_bgr24_ssse3’ undeclared (first use in this function); did you mean ‘yuv420_rgb24_ssse3’?
>              return yuv420_bgr24_ssse3;
>                     ^~~~~~~~~~~~~~~~~~
>                     yuv420_rgb24_ssse3
> libswscale/x86/yuv2rgb.c:109:20: error: ‘yuv420_rgb16_ssse3’ undeclared (first use in this function); did you mean ‘yuv420_rgb24_ssse3’?
>              return yuv420_rgb16_ssse3;
>                     ^~~~~~~~~~~~~~~~~~
>                     yuv420_rgb24_ssse3
> libswscale/x86/yuv2rgb.c:111:20: error: ‘yuv420_rgb15_ssse3’ undeclared (first use in this function); did you mean ‘yuv420_rgb16_ssse3’?
>              return yuv420_rgb15_ssse3;
>                     ^~~~~~~~~~~~~~~~~~
>                     yuv420_rgb16_ssse3
> ffbuild/common.mak:59: recipe for target 'libswscale/x86/yuv2rgb.o' failed
> make: *** [libswscale/x86/yuv2rgb.o] Error 1
> make: *** Waiting for unfinished jobs....
> 
> [...]
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list