Relaxing checks for MULT16_32_QX()

MULT16_32_QX() is now implemented using a signed-unsigned multiply,
so the second argument can now have one extra bit compared to the
old signed-signed implementation.

Reviewed by Mark Harris
This commit is contained in:
Jean-Marc Valin 2022-07-22 02:27:34 -04:00
parent c9d5bea13e
commit fbed746cb2
No known key found for this signature in database
GPG key ID: 531A52533318F00A

View file

@ -491,7 +491,7 @@ static OPUS_INLINE int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int
celt_assert(0); celt_assert(0);
#endif #endif
} }
if (ABS32(b)>=((opus_val32)(1)<<(15+Q))) if (ABS32(b)>=((opus_int64)(1)<<(16+Q)))
{ {
fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line); fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q, (int)a, (int)b, file, line);
#ifdef FIXED_DEBUG_ASSERT #ifdef FIXED_DEBUG_ASSERT
@ -524,7 +524,7 @@ static OPUS_INLINE int MULT16_32_PX_(int a, opus_int64 b, int Q, char *file, int
celt_assert(0); celt_assert(0);
#endif #endif
} }
if (ABS32(b)>=((opus_int64)(1)<<(15+Q))) if (ABS32(b)>=((opus_int64)(1)<<(16+Q)))
{ {
fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n\n", Q, (int)a, (int)b,file, line); fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n\n", Q, (int)a, (int)b,file, line);
#ifdef FIXED_DEBUG_ASSERT #ifdef FIXED_DEBUG_ASSERT