ffmpeg/libswresample
Andreas Rheinhardt 55fc2c5a89 swresample/resample: Properly empty MMX state
There is a x86-32 MMXEXT implementation for resampling
planar 16bit data. multiple_resample() therefore calls
emms_c() if it thinks that this needed. And this is bad:

1. It is a maintenance nightmare because changes to the
x86 resample DSP code would necessitate changes to the check
whether to call emms_c().
2. The return value of av_get_cpu_flags() does not tell
whether the MMX DSP functions are in use, as they could
have been overridden by av_force_cpu_flags().
3. The MMX DSP functions will never be overridden in case of
an x86-32 build with --disable-sse2. In this scenario lots of
resampling tests (like swr-resample_exact_lin_async-s16p-8000-48000)
fail because the cpuflags indicate that SSE2 is available
(presuming that the test is run on a CPU with SSE2).
4. The check includes a call to av_get_cpu_flags(). This is not
optimized away for arches other than x86-32.
5. The check takes about as much time as emms_c() itself,
making it pointless.

This commit therefore removes the check and calls emms_c()
unconditionally (it is a no-op for non-x86).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-14 01:28:29 +02:00
..
aarch64 swresample/aarch64: fix relocation out of range error 2021-09-25 21:55:29 +03:00
arm Include attributes.h directly 2021-04-19 14:34:10 +02:00
tests swresample: convert to new channel layout API 2022-03-15 09:42:46 -03:00
x86 Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
audioconvert.c libswresample/audioconvert: Fix undefined NULL + 0 2021-04-01 14:15:20 +02:00
audioconvert.h avutil/internal, swresample/audioconvert: Remove cpu.h inclusions 2021-07-22 14:33:45 +02:00
dither_template.c
dither.c
libswresample.v
log2_tab.c
Makefile lib*/version: Move library version functions into files of their own 2022-05-10 06:49:32 +02:00
noise_shaping_data.c
options.c swresample: convert to new channel layout API 2022-03-15 09:42:46 -03:00
rematrix_template.c swresample: convert to new channel layout API 2022-03-15 09:42:46 -03:00
rematrix.c swresample/rematrix: fix typo in clean_layout() 2022-03-28 00:07:42 -03:00
resample_dsp.c
resample_template.c
resample.c swresample/resample: Properly empty MMX state 2022-06-14 01:28:29 +02:00
resample.h
soxr_resample.c
swresample_frame.c swresample: convert to new channel layout API 2022-03-15 09:42:46 -03:00
swresample_internal.h swresample: convert to new channel layout API 2022-03-15 09:42:46 -03:00
swresample.c lib*/version: Move library version functions into files of their own 2022-05-10 06:49:32 +02:00
swresample.h Keep including the full version.h when headers are included externally 2022-03-19 00:01:57 +02:00
swresampleres.rc
version_major.h libswresample: Split version.h 2022-03-16 14:05:26 +02:00
version.c lib*/version: Move library version functions into files of their own 2022-05-10 06:49:32 +02:00
version.h doc: Add an entry to APIchanges about changes to version.h and version_major.h 2022-03-16 14:12:46 +02:00