aboutsummaryrefslogtreecommitdiff
path: root/src/dsp/intrapred_directional.cc
diff options
context:
space:
mode:
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