mirror of
https://github.com/xiph/opus.git
synced 2025-05-30 15:17:42 +00:00
Use 64-bits in fixed point debug for _P16, fixes spurious failures.
This commit is contained in:
parent
3a9b35453c
commit
e2e1fe922e
1 changed files with 4 additions and 4 deletions
|
@ -462,7 +462,7 @@ static inline int MULT16_32_QX_(int a, long long b, int Q, char *file, int line)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MULT16_32_PX(a, b, Q) MULT16_32_PX_(a, b, Q, __FILE__, __LINE__)
|
#define MULT16_32_PX(a, b, Q) MULT16_32_PX_(a, b, Q, __FILE__, __LINE__)
|
||||||
static inline int MULT16_32_PX_(int a, long long b, int Q, char *file, int line)
|
static inline int MULT16_32_PX_(int a, opus_int64 b, int Q, char *file, int line)
|
||||||
{
|
{
|
||||||
long long res;
|
long long res;
|
||||||
if (!VERIFY_SHORT(a) || !VERIFY_INT(b))
|
if (!VERIFY_SHORT(a) || !VERIFY_INT(b))
|
||||||
|
@ -472,14 +472,14 @@ static inline int MULT16_32_PX_(int a, long long b, int Q, char *file, int line)
|
||||||
celt_assert(0);
|
celt_assert(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ABS32(b)>=((opus_val32)(1)<<(15+Q)))
|
if (ABS32(b)>=((opus_int64)(1)<<(15+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
|
||||||
celt_assert(0);
|
celt_assert(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
res = ((((long long)a)*(long long)b) + (((opus_val32)(1)<<Q)>>1))>> Q;
|
res = ((((opus_int64)a)*(opus_int64)b) + (((opus_val32)(1)<<Q)>>1))>> Q;
|
||||||
if (!VERIFY_INT(res))
|
if (!VERIFY_INT(res))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "MULT16_32_P%d: output is not int: %d*%d=%d in %s: line %d\n\n", Q, (int)a, (int)b,(int)res, file, line);
|
fprintf (stderr, "MULT16_32_P%d: output is not int: %d*%d=%d in %s: line %d\n\n", Q, (int)a, (int)b,(int)res, file, line);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue