Fix math involving enums in C++20

(-Wdeprecated-anon-enum-enum-conversion)
- Replace enum with constexpr if necessary.
- Merge multiple definitions for H.264 NalDefs and FuDefs and apply
  constexpr.

Bug: chromium:1284275
Change-Id: I4a4d95ed6aba258e7c19c3ae6251c8b78caf84ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276561
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#38215}
This commit is contained in:
Byoungchan Lee
2022-09-27 14:37:26 +09:00
committed by WebRTC LUCI CQ
parent 806261ae8e
commit 6c2ac2ea6b
8 changed files with 55 additions and 57 deletions

View File

@ -18,13 +18,13 @@ namespace webrtc {
namespace {
enum { kSpectrumSize = 65 };
constexpr int kSpectrumSize = 65;
// Delay history sizes.
enum { kMaxDelay = 100 };
enum { kLookahead = 10 };
enum { kHistorySize = kMaxDelay + kLookahead };
constexpr int kMaxDelay = 100;
constexpr int kLookahead = 10;
constexpr int kHistorySize = kMaxDelay + kLookahead;
// Length of binary spectrum sequence.
enum { kSequenceLength = 400 };
constexpr int kSequenceLength = 400;
const int kDifferentHistorySize = 3;
const int kDifferentLookahead = 1;