aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/sbc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-11 23:25:14 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-14 01:28:29 +0200
commit55fc2c5a892c50feb1b9a8f55b74ec6594755ddb (patch)
treee76ad1561945d9ee48d58e82a027518cae4aca82 /libavcodec/sbc.c
parentff07492cd800d2904816f6cf0c0cca21d3ccef1e (diff)
downloadffmpeg-55fc2c5a892c50feb1b9a8f55b74ec6594755ddb.tar.gz
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>
Diffstat (limited to 'libavcodec/sbc.c')
0 files changed, 0 insertions, 0 deletions