UnitBase own function to divide with rounding overflows when dividend is close to the max int64_t
Bug: b/262999013
Change-Id: I5b0c3f4408165a0f03690cab80bd098e506fc984
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288521
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38943}
There are multiple places in webrtc code where alternative than
default rounding is desired. Typically this rounding is inlined.
e.g. as (<x> + <y>/2) / <y> making code more clumpsy (<y> might be long expression)
and unsafe for large values of <x>
This change introduce small helpers to address both concerns.
Bug: None
Change-Id: Icd8dcee80a697b7c50ba0b2e50295087d2be8670
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153354
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29222}