diff options
| author | Lioncash <mathew1800@gmail.com> | 2020-10-29 22:40:46 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2020-10-29 22:57:32 -0400 |
| commit | 0d713cf8eb8c8b8802584c73b83d5ca9d88c70b2 (patch) | |
| tree | da460c31a61ce87e17d94a9da12010755b9c2554 /src/video_core/command_classes/codecs/vp9.cpp | |
| parent | badea3b30134b02c6502c8174719f2c984e37524 (diff) | |
vp9: Mark functions with [[nodiscard]] where applicable
Prevents values from mistakenly being discarded in cases where it's a
bug to do so.
Diffstat (limited to 'src/video_core/command_classes/codecs/vp9.cpp')
| -rw-r--r-- | src/video_core/command_classes/codecs/vp9.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/command_classes/codecs/vp9.cpp b/src/video_core/command_classes/codecs/vp9.cpp index aeb9866de..42520f856 100644 --- a/src/video_core/command_classes/codecs/vp9.cpp +++ b/src/video_core/command_classes/codecs/vp9.cpp @@ -200,7 +200,7 @@ constexpr std::array<s32, 254> map_lut{ // 6.2.14 Tile size calculation -s32 CalcMinLog2TileCols(s32 frame_width) { +[[nodiscard]] s32 CalcMinLog2TileCols(s32 frame_width) { const s32 sb64_cols = (frame_width + 63) / 64; s32 min_log2 = 0; @@ -211,7 +211,7 @@ s32 CalcMinLog2TileCols(s32 frame_width) { return min_log2; } -s32 CalcMaxLog2TileCols(s32 frame_width) { +[[nodiscard]] s32 CalcMaxLog2TileCols(s32 frame_width) { const s32 sb64_cols = (frame_width + 63) / 64; s32 max_log2 = 1; @@ -223,7 +223,7 @@ s32 CalcMaxLog2TileCols(s32 frame_width) { } // Recenters probability. Based on section 6.3.6 of VP9 Specification -s32 RecenterNonNeg(s32 new_prob, s32 old_prob) { +[[nodiscard]] s32 RecenterNonNeg(s32 new_prob, s32 old_prob) { if (new_prob > old_prob * 2) { return new_prob; } @@ -236,7 +236,7 @@ s32 RecenterNonNeg(s32 new_prob, s32 old_prob) { } // Adjusts old_prob depending on new_prob. Based on section 6.3.5 of VP9 Specification -s32 RemapProbability(s32 new_prob, s32 old_prob) { +[[nodiscard]] s32 RemapProbability(s32 new_prob, s32 old_prob) { new_prob--; old_prob--; |
