aboutsummaryrefslogtreecommitdiff
path: root/src/dsp/intrapred_directional.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/intrapred_directional.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/intrapred_directional.cc')
-rw-r--r--src/dsp/intrapred_directional.cc47
1 files changed, 44 insertions, 3 deletions
diff --git a/src/dsp/intrapred_directional.cc b/src/dsp/intrapred_directional.cc
index 21a40b5..9146074 100644
--- a/src/dsp/intrapred_directional.cc
+++ b/src/dsp/intrapred_directional.cc
@@ -94,11 +94,19 @@ void DirectionalIntraPredictorZone1_C(
} while (++y < height);
}
+// clang 14.0.0 produces incorrect code with LIBGAV1_RESTRICT.
+// https://github.com/llvm/llvm-project/issues/54427
+#if defined(__clang__) && __clang_major__ == 14
+#define LOCAL_RESTRICT
+#else
+#define LOCAL_RESTRICT LIBGAV1_RESTRICT
+#endif
+
template <typename Pixel>
void DirectionalIntraPredictorZone2_C(
- void* LIBGAV1_RESTRICT const dest, ptrdiff_t stride,
- const void* LIBGAV1_RESTRICT const top_row,
- const void* LIBGAV1_RESTRICT const left_column, const int width,
+ void* LOCAL_RESTRICT const dest, ptrdiff_t stride,
+ const void* LOCAL_RESTRICT const top_row,
+ const void* LOCAL_RESTRICT const left_column, const int width,
const int height, const int xstep, const int ystep,
const bool upsampled_top, const bool upsampled_left) {
const auto* const top = static_cast<const Pixel*>(top_row);
@@ -143,6 +151,8 @@ void DirectionalIntraPredictorZone2_C(
} while (++y < height);
}
+#undef LOCAL_RESTRICT
+
template <typename Pixel>
void DirectionalIntraPredictorZone3_C(
void* LIBGAV1_RESTRICT const dest, ptrdiff_t stride,
@@ -236,6 +246,34 @@ void Init10bpp() {
}
#endif // LIBGAV1_MAX_BITDEPTH >= 10
+#if LIBGAV1_MAX_BITDEPTH == 12
+void Init12bpp() {
+ Dsp* const dsp = dsp_internal::GetWritableDspTable(12);
+ assert(dsp != nullptr);
+#if LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
+ dsp->directional_intra_predictor_zone1 =
+ DirectionalIntraPredictorZone1_C<uint16_t>;
+ dsp->directional_intra_predictor_zone2 =
+ DirectionalIntraPredictorZone2_C<uint16_t>;
+ dsp->directional_intra_predictor_zone3 =
+ DirectionalIntraPredictorZone3_C<uint16_t>;
+#endif // LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
+ static_cast<void>(dsp);
+#ifndef LIBGAV1_Dsp12bpp_DirectionalIntraPredictorZone1
+ dsp->directional_intra_predictor_zone1 =
+ DirectionalIntraPredictorZone1_C<uint16_t>;
+#endif
+#ifndef LIBGAV1_Dsp12bpp_DirectionalIntraPredictorZone2
+ dsp->directional_intra_predictor_zone2 =
+ DirectionalIntraPredictorZone2_C<uint16_t>;
+#endif
+#ifndef LIBGAV1_Dsp12bpp_DirectionalIntraPredictorZone3
+ dsp->directional_intra_predictor_zone3 =
+ DirectionalIntraPredictorZone3_C<uint16_t>;
+#endif
+}
+#endif // LIBGAV1_MAX_BITDEPTH == 12
+
} // namespace
void IntraPredDirectionalInit_C() {
@@ -243,6 +281,9 @@ void IntraPredDirectionalInit_C() {
#if LIBGAV1_MAX_BITDEPTH >= 10
Init10bpp();
#endif
+#if LIBGAV1_MAX_BITDEPTH == 12
+ Init12bpp();
+#endif
}
} // namespace dsp