Avoid left-shifting negative values in a number of places

This is undefined behavior, according to specification.

BUG=chromium:661133

Review-Url: https://codereview.webrtc.org/2500953003
Cr-Original-Commit-Position: refs/heads/master@{#15078}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 79dfdadbc861a56596a42ba9f40c8bcbf30e4d75
3 files changed