mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
meson: Enable SSE intrinsics in audio-resampler
This files need to be built with the specific C flags for the corresponding processor optimisations.
This commit is contained in:
parent
4de66632d7
commit
87905cc48b
3 changed files with 65 additions and 1 deletions
|
@ -245,6 +245,9 @@
|
||||||
/* Define if RDTSC is available */
|
/* Define if RDTSC is available */
|
||||||
#mesondefine HAVE_RDTSC
|
#mesondefine HAVE_RDTSC
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <smmintrin.h> header file. */
|
||||||
|
#mesondefine HAVE_SMMINTRIN_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
#mesondefine HAVE_STDINT_H
|
#mesondefine HAVE_STDINT_H
|
||||||
|
|
||||||
|
|
|
@ -85,10 +85,53 @@ else
|
||||||
configuration : configuration_data())
|
configuration : configuration_data())
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
simd_cargs = []
|
||||||
|
simd_dependencies = []
|
||||||
|
|
||||||
|
if have_sse
|
||||||
|
audio_resampler_sse = static_library('audio_resampler_sse',
|
||||||
|
[ 'audio-resampler-x86-sse.c' ],
|
||||||
|
c_args : gst_plugins_base_args + [sse_args] + [pic_args],
|
||||||
|
include_directories : [configinc, libsinc],
|
||||||
|
dependencies : [gst_base_dep],
|
||||||
|
install : false
|
||||||
|
)
|
||||||
|
|
||||||
|
simd_cargs += ['-DHAVE_SSE']
|
||||||
|
simd_dependencies += audio_resampler_sse
|
||||||
|
endif
|
||||||
|
|
||||||
|
if have_sse2
|
||||||
|
audio_resampler_sse2 = static_library('audio_resampler_sse2',
|
||||||
|
[ 'audio-resampler-x86-sse2.c' ],
|
||||||
|
c_args : gst_plugins_base_args + [sse2_args] + [pic_args],
|
||||||
|
include_directories : [configinc, libsinc],
|
||||||
|
dependencies : [gst_base_dep],
|
||||||
|
install : false
|
||||||
|
)
|
||||||
|
|
||||||
|
simd_cargs += ['-DHAVE_SSE2']
|
||||||
|
simd_dependencies += audio_resampler_sse2
|
||||||
|
endif
|
||||||
|
|
||||||
|
if have_sse41
|
||||||
|
audio_resampler_sse41 = static_library('audio_resampler_sse41',
|
||||||
|
[ 'audio-resampler-x86-sse41.c' ],
|
||||||
|
c_args : gst_plugins_base_args + [sse41_args] + [pic_args],
|
||||||
|
include_directories : [configinc, libsinc],
|
||||||
|
dependencies : [gst_base_dep],
|
||||||
|
install : false
|
||||||
|
)
|
||||||
|
|
||||||
|
simd_cargs += ['-DHAVE_SSE41']
|
||||||
|
simd_dependencies += audio_resampler_sse41
|
||||||
|
endif
|
||||||
|
|
||||||
gstaudio = library('gstaudio-@0@'.format(api_version),
|
gstaudio = library('gstaudio-@0@'.format(api_version),
|
||||||
audio_src, gstaudio_h, gstaudio_c, orc_c, orc_h,
|
audio_src, gstaudio_h, gstaudio_c, orc_c, orc_h,
|
||||||
c_args: gst_plugins_base_args,
|
c_args : gst_plugins_base_args + simd_cargs,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
|
link_with : simd_dependencies,
|
||||||
version : libversion,
|
version : libversion,
|
||||||
soversion : soversion,
|
soversion : soversion,
|
||||||
install : true,
|
install : true,
|
||||||
|
|
18
meson.build
18
meson.build
|
@ -50,6 +50,7 @@ check_headers = [
|
||||||
['HAVE_INTTYPES_H', 'inttypes.h'],
|
['HAVE_INTTYPES_H', 'inttypes.h'],
|
||||||
['HAVE_MEMORY_H', 'memory.h'],
|
['HAVE_MEMORY_H', 'memory.h'],
|
||||||
['HAVE_PROCESS_H', 'process.h'],
|
['HAVE_PROCESS_H', 'process.h'],
|
||||||
|
['HAVE_SMMINTRIN_H', 'smmintrin.h'],
|
||||||
['HAVE_STDINT_H', 'stdint.h'],
|
['HAVE_STDINT_H', 'stdint.h'],
|
||||||
['HAVE_STDLIB_H', 'stdlib.h'],
|
['HAVE_STDLIB_H', 'stdlib.h'],
|
||||||
['HAVE_STRINGS_H', 'strings.h'],
|
['HAVE_STRINGS_H', 'strings.h'],
|
||||||
|
@ -175,6 +176,23 @@ else
|
||||||
core_conf.set('DISABLE_ORC', 1)
|
core_conf.set('DISABLE_ORC', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Used to build SSE* things in audio-resampler
|
||||||
|
sse_args = '-msse'
|
||||||
|
sse2_args = '-msse2'
|
||||||
|
sse41_args = '-msse4.1'
|
||||||
|
|
||||||
|
have_sse = cc.has_argument(sse_args)
|
||||||
|
have_sse2 = cc.has_argument(sse2_args)
|
||||||
|
have_sse41 = cc.has_argument(sse41_args)
|
||||||
|
|
||||||
|
# FIXME: Meson should have a way for portably adding -fPIC when needed for use
|
||||||
|
# with static libraries that are linked into shared libraries. Or, it should
|
||||||
|
# add it by default with an option to turn it off if needed.
|
||||||
|
pic_args = ['-fPIC']
|
||||||
|
if host_machine.system() == 'windows'
|
||||||
|
pic_args = []
|
||||||
|
endif
|
||||||
|
|
||||||
subdir('gst-libs')
|
subdir('gst-libs')
|
||||||
subdir('gst')
|
subdir('gst')
|
||||||
subdir('ext')
|
subdir('ext')
|
||||||
|
|
Loading…
Reference in a new issue