Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/common/TestCommon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*
******************************************************************************/

#include <gtest/gtest.h>

#include <algorithm>
#include <cstring>
#include <random>
Expand Down
6 changes: 4 additions & 2 deletions tests/common/TestCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#pragma once

#include <gtest/gtest.h>

#include <algorithm>
#include <cstring>
#include <iostream>
Expand Down Expand Up @@ -49,6 +47,9 @@ const std::vector<std::pair<int, int>>& getChromaPUBlockSizes();
const std::vector<UWORD8>& getSrc8Buf();
const std::vector<IV_ARCH_T>& getTstArch();

#if __has_include(<gtest/gtest.h>)
#include <gtest/gtest.h>

// Compare outputs
template <typename T>
static void compare_output(const std::vector<T>& ref,
Expand All @@ -62,5 +63,6 @@ static void compare_output(const std::vector<T>& ref,
<< ht;
}
}
#endif

std::string get_arch_str(IV_ARCH_T arch);
35 changes: 17 additions & 18 deletions tests/common/func_selector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <algorithm>
#include <cstring>
#include <gtest/gtest.h>
#include <random>
#include <sstream>
#include <string>
Expand All @@ -35,7 +34,7 @@

const ihevc_func_selector_t ref = []() {
ihevc_func_selector_t ret = {};
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \
defined(_M_IX86)
ihevc_init_function_ptr_generic(&ret);
#elif defined(__aarch64__) || defined(__arm__)
Expand All @@ -44,7 +43,7 @@ const ihevc_func_selector_t ref = []() {
return ret;
}();

#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \
defined(_M_IX86)
const ihevc_func_selector_t test_ssse3 = []() {
ihevc_func_selector_t ret = {};
Expand Down Expand Up @@ -87,28 +86,28 @@ const ihevc_func_selector_t test_arm32 = []() {
}();
#endif

const ihevc_func_selector_t *get_ref_func_ptr() { return &ref; }
const ihevc_func_selector_t* get_ref_func_ptr() { return &ref; }

const ihevc_func_selector_t *get_tst_func_ptr(IV_ARCH_T arch) {
const ihevc_func_selector_t* get_tst_func_ptr(IV_ARCH_T arch) {
switch (arch) {
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \
defined(_M_IX86)
case ARCH_X86_SSSE3:
return &test_ssse3;
case ARCH_X86_SSE42:
return &test_sse42;
case ARCH_X86_SSSE3:
return &test_ssse3;
case ARCH_X86_SSE42:
return &test_sse42;
#ifndef DISABLE_AVX2
case ARCH_X86_AVX2:
return &test_avx2;
case ARCH_X86_AVX2:
return &test_avx2;
#endif
#elif defined(__aarch64__)
case ARCH_ARMV8_GENERIC:
return &test_arm64;
case ARCH_ARMV8_GENERIC:
return &test_arm64;
#elif defined(__arm__)
case ARCH_ARM_A9Q:
return &test_arm32;
case ARCH_ARM_A9Q:
return &test_arm32;
#endif
default:
return nullptr;
default:
return nullptr;
}
}
7 changes: 3 additions & 4 deletions tests/common/func_selector.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define __FUNC_SELECTOR_H__
#include <algorithm>
#include <cstring>
#include <gtest/gtest.h>
#include <random>
#include <sstream>
#include <string>
Expand All @@ -33,7 +32,7 @@
#include "iv.h"
// clang-format on

const ihevc_func_selector_t *get_ref_func_ptr();
const ihevc_func_selector_t *get_tst_func_ptr(IV_ARCH_T arch);
const ihevc_func_selector_t* get_ref_func_ptr();
const ihevc_func_selector_t* get_tst_func_ptr(IV_ARCH_T arch);

#endif /* __FUNC_SELECTOR_H__ */
#endif /* __FUNC_SELECTOR_H__ */
Loading