Files
test2/intern/ffmpeg/tests/ffmpeg_cpu_flags.cc
Aras Pranckevicius 246a0ec46a Fix #126394: ffmpeg on win64 is built without SIMD optimizations
Since ee1b2f53cc the ffmpeg libraries for Windows x64 are built effectively
without CPU specific SIMD optimizations. `--arch=x64` is not an architecture
that ffmpeg configure understands, so it falls back to "nothing is known,
turn any architecture specific bits off" code path.

Pull Request: https://projects.blender.org/blender/blender/pulls/126396
2024-08-22 10:36:18 +02:00

29 lines
742 B
C++

/* SPDX-FileCopyrightText: 2024 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "testing/testing.h"
extern "C" {
#include <libavutil/cpu.h>
}
namespace ffmpeg::tests {
TEST(ffmpeg, correct_av_cpu_flags)
{
int flags = av_get_cpu_flags();
#if defined(_M_X64) || defined(__x86_64__)
/* x64 expected to have at least up to SSE4.2. */
EXPECT_TRUE((flags & AV_CPU_FLAG_SSE2) != 0);
EXPECT_TRUE((flags & AV_CPU_FLAG_SSE4) != 0);
EXPECT_TRUE((flags & AV_CPU_FLAG_SSE42) != 0);
#elif defined(__aarch64__) || defined(_M_ARM64)
/* arm64 expected to have at least NEON. */
EXPECT_TRUE((flags & AV_CPU_FLAG_ARMV8) != 0);
EXPECT_TRUE((flags & AV_CPU_FLAG_NEON) != 0);
#endif
}
} // namespace ffmpeg::tests