Blender V5.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
7namespace blender {
8
9extern "C" {
10#include <libavutil/cpu.h>
11}
12
13namespace ffmpeg::tests {
14
15TEST(ffmpeg, correct_av_cpu_flags)
16{
17 int flags = av_get_cpu_flags();
18#if defined(_M_X64) || defined(__x86_64__)
19 /* x64 expected to have at least up to SSE4.2. */
20 EXPECT_TRUE((flags & AV_CPU_FLAG_SSE2) != 0);
21 EXPECT_TRUE((flags & AV_CPU_FLAG_SSE4) != 0);
22 EXPECT_TRUE((flags & AV_CPU_FLAG_SSE42) != 0);
23#elif defined(__aarch64__) || defined(_M_ARM64)
24 /* arm64 expected to have at least NEON. */
25 EXPECT_TRUE((flags & AV_CPU_FLAG_ARMV8) != 0);
26 EXPECT_TRUE((flags & AV_CPU_FLAG_NEON) != 0);
27#endif
28}
29
30} // namespace ffmpeg::tests
31} // namespace blender
#define EXPECT_TRUE(result)
TEST(ffmpeg, correct_av_cpu_flags)
BMesh Iterators.