Update to current webrtc library
This is from the upstream library commit id 3326535126e435f1ba647885ce43a8f0f3d317eb, corresponding to Chromium 88.0.4290.1.
This commit is contained in:
@ -15,9 +15,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include "rtc_base/checks.h"
|
||||
#include "common_audio/signal_processing/include/signal_processing_library.h"
|
||||
|
||||
int32_t WebRtcSpl_SqrtLocal(int32_t in);
|
||||
|
||||
@ -139,8 +138,19 @@ int32_t WebRtcSpl_Sqrt(int32_t value)
|
||||
|
||||
A = value;
|
||||
|
||||
if (A == 0)
|
||||
return (int32_t)0; // sqrt(0) = 0
|
||||
// The convention in this function is to calculate sqrt(abs(A)). Negate the
|
||||
// input if it is negative.
|
||||
if (A < 0) {
|
||||
if (A == WEBRTC_SPL_WORD32_MIN) {
|
||||
// This number cannot be held in an int32_t after negating.
|
||||
// Map it to the maximum positive value.
|
||||
A = WEBRTC_SPL_WORD32_MAX;
|
||||
} else {
|
||||
A = -A;
|
||||
}
|
||||
} else if (A == 0) {
|
||||
return 0; // sqrt(0) = 0
|
||||
}
|
||||
|
||||
sh = WebRtcSpl_NormW32(A); // # shifts to normalize A
|
||||
A = WEBRTC_SPL_LSHIFT_W32(A, sh); // Normalize A
|
||||
@ -155,7 +165,7 @@ int32_t WebRtcSpl_Sqrt(int32_t value)
|
||||
x_norm = (int16_t)(A >> 16); // x_norm = AH
|
||||
|
||||
nshift = (sh / 2);
|
||||
assert(nshift >= 0);
|
||||
RTC_DCHECK_GE(nshift, 0);
|
||||
|
||||
A = (int32_t)WEBRTC_SPL_LSHIFT_W32((int32_t)x_norm, 16);
|
||||
A = WEBRTC_SPL_ABS_W32(A); // A = abs(x_norm<<16)
|
||||
|
Reference in New Issue
Block a user