aboutsummaryrefslogtreecommitdiff
path: root/src/dsp/dsp_test.cc
diff options
context:
space:
mode:
authorBoyuan Yang <byang@debian.org>2022-07-14 15:56:59 -0400
committerBoyuan Yang <byang@debian.org>2022-07-14 15:56:59 -0400
commit1a2e17bd28a068714658551c8c355171ce15dfa0 (patch)
treedb9e739007016850ee355365874a20b07034ef2c /src/dsp/dsp_test.cc
parenta08da9600832caf817125edee2c3206fe24cd5cb (diff)
parentd4dbf19f6b0181ee78034bfe4caf189d1c016998 (diff)
downloadlibgav1-1a2e17bd28a068714658551c8c355171ce15dfa0.tar.gz
libgav1-1a2e17bd28a068714658551c8c355171ce15dfa0.tar.bz2
libgav1-1a2e17bd28a068714658551c8c355171ce15dfa0.zip
Update upstream source from tag 'upstream/0.18.0'
Update to upstream version '0.18.0' with Debian dir a69c1f7f3e7109393a3f9f5f1a2e7a5c3d3eda9f
Diffstat (limited to 'src/dsp/dsp_test.cc')
-rw-r--r--src/dsp/dsp_test.cc30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/dsp/dsp_test.cc b/src/dsp/dsp_test.cc
index 5c2a3aa..6d2817b 100644
--- a/src/dsp/dsp_test.cc
+++ b/src/dsp/dsp_test.cc
@@ -41,7 +41,9 @@ constexpr int kMaxTransform1dSize[kNumTransform1ds] = {
};
void CheckTables(bool c_only) {
-#if LIBGAV1_MAX_BITDEPTH >= 10
+#if LIBGAV1_MAX_BITDEPTH == 12
+ static constexpr int kBitdepths[] = {kBitdepth8, kBitdepth10, kBitdepth12};
+#elif LIBGAV1_MAX_BITDEPTH >= 10
static constexpr int kBitdepths[] = {kBitdepth8, kBitdepth10};
#else
static constexpr int kBitdepths[] = {kBitdepth8};
@@ -108,7 +110,9 @@ void CheckTables(bool c_only) {
const uint32_t cpu_features = GetCpuInfo();
super_res_coefficients_is_nonnull = (cpu_features & kSSE4_1) != 0;
#endif
- if (c_only) super_res_coefficients_is_nonnull = false;
+ if (c_only || bitdepth == kBitdepth12) {
+ super_res_coefficients_is_nonnull = false;
+ }
if (super_res_coefficients_is_nonnull) {
EXPECT_NE(dsp->super_res_coefficients, nullptr);
} else {
@@ -234,6 +238,9 @@ TEST(Dsp, TablesArePopulatedCOnly) {
#if LIBGAV1_MAX_BITDEPTH >= 10
test_utils::ResetDspTable(kBitdepth10);
#endif
+#if LIBGAV1_MAX_BITDEPTH == 12
+ test_utils::ResetDspTable(kBitdepth12);
+#endif
dsp_internal::DspInit_C();
CheckTables(/*c_only=*/true);
}
@@ -241,15 +248,22 @@ TEST(Dsp, TablesArePopulatedCOnly) {
TEST(Dsp, GetDspTable) {
EXPECT_EQ(GetDspTable(1), nullptr);
- EXPECT_NE(GetDspTable(8), nullptr);
+ EXPECT_NE(GetDspTable(kBitdepth8), nullptr);
EXPECT_EQ(dsp_internal::GetWritableDspTable(1), nullptr);
- EXPECT_NE(dsp_internal::GetWritableDspTable(8), nullptr);
+ EXPECT_NE(dsp_internal::GetWritableDspTable(kBitdepth8), nullptr);
#if LIBGAV1_MAX_BITDEPTH >= 10
- EXPECT_NE(GetDspTable(10), nullptr);
- EXPECT_NE(dsp_internal::GetWritableDspTable(10), nullptr);
+ EXPECT_NE(GetDspTable(kBitdepth10), nullptr);
+ EXPECT_NE(dsp_internal::GetWritableDspTable(kBitdepth10), nullptr);
+#else
+ EXPECT_EQ(GetDspTable(kBitdepth10), nullptr);
+ EXPECT_EQ(dsp_internal::GetWritableDspTable(kBitdepth10), nullptr);
+#endif
+#if LIBGAV1_MAX_BITDEPTH == 12
+ EXPECT_NE(GetDspTable(kBitdepth12), nullptr);
+ EXPECT_NE(dsp_internal::GetWritableDspTable(kBitdepth12), nullptr);
#else
- EXPECT_EQ(GetDspTable(10), nullptr);
- EXPECT_EQ(dsp_internal::GetWritableDspTable(10), nullptr);
+ EXPECT_EQ(GetDspTable(kBitdepth12), nullptr);
+ EXPECT_EQ(dsp_internal::GetWritableDspTable(kBitdepth12), nullptr);
#endif
}