aboutsummaryrefslogtreecommitdiff
path: root/src/tile/bitstream/mode_info.cc
diff options
context:
space:
mode:
authorBoyuan Yang <byang@debian.org>2023-11-27 22:46:29 -0500
committerBoyuan Yang <byang@debian.org>2023-11-27 22:46:29 -0500
commit19564cb4f77660cdb2f980ca619d4b979b9fe342 (patch)
treeff97ccd1471553f1e861c8ea747faa45a023e119 /src/tile/bitstream/mode_info.cc
parentd4dbf19f6b0181ee78034bfe4caf189d1c016998 (diff)
downloadlibgav1-19564cb4f77660cdb2f980ca619d4b979b9fe342.tar.gz
libgav1-19564cb4f77660cdb2f980ca619d4b979b9fe342.tar.bz2
libgav1-19564cb4f77660cdb2f980ca619d4b979b9fe342.zip
New upstream version 0.19.0
Diffstat (limited to 'src/tile/bitstream/mode_info.cc')
-rw-r--r--src/tile/bitstream/mode_info.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tile/bitstream/mode_info.cc b/src/tile/bitstream/mode_info.cc
index cb7b311..ffbbf64 100644
--- a/src/tile/bitstream/mode_info.cc
+++ b/src/tile/bitstream/mode_info.cc
@@ -890,6 +890,14 @@ uint16_t* Tile::GetReferenceCdf(
block, kReferenceFrameBackward, kReferenceFrameBackward,
kReferenceFrameAlternate2, kReferenceFrameAlternate2);
}
+ // When using GCC 12.x for some targets the compiler reports a false positive
+ // with the context subscript when is_single=false, is_backward=false and
+ // index=0. GetReferenceContext() can only return values between 0 and 2.
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+ assert(context >= 0 && context <= 2);
if (is_single) {
// The index parameter for single references is offset by one since the spec
// uses 1-based index for these elements.
@@ -900,6 +908,9 @@ uint16_t* Tile::GetReferenceCdf(
.compound_backward_reference_cdf[context][index];
}
return symbol_decoder_context_.compound_reference_cdf[type][context][index];
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
}
void Tile::ReadReferenceFrames(const Block& block, bool skip_mode) {