Blender V4.3
ffmpeg_cpu_flags.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "testing/testing.h"
6
7extern "C" {
8#include <libavutil/cpu.h>
9}
10
11namespace ffmpeg::tests {
12
13TEST(ffmpeg, correct_av_cpu_flags)
14{
15 int flags = av_get_cpu_flags();
16#if defined(_M_X64) || defined(__x86_64__)
17 /* x64 expected to have at least up to SSE4.2. */
18 EXPECT_TRUE((flags & AV_CPU_FLAG_SSE2) != 0);
19 EXPECT_TRUE((flags & AV_CPU_FLAG_SSE4) != 0);
20 EXPECT_TRUE((flags & AV_CPU_FLAG_SSE42) != 0);
21#elif defined(__aarch64__) || defined(_M_ARM64)
22 /* arm64 expected to have at least NEON. */
23 EXPECT_TRUE((flags & AV_CPU_FLAG_ARMV8) != 0);
24 EXPECT_TRUE((flags & AV_CPU_FLAG_NEON) != 0);
25#endif
26}
27
28} // namespace ffmpeg::tests
TEST(ffmpeg, correct_av_cpu_flags)