Defining MAXG/MING/GCONST for log gain

This commit is contained in:
Jean-Marc Valin 2024-06-26 13:37:24 -04:00
parent be37d86633
commit abd512f7f6
No known key found for this signature in database
GPG key ID: 8D2952BBB52C646D
9 changed files with 150 additions and 138 deletions

View file

@ -77,6 +77,12 @@
/** Compile-time conversion of float constant to 32-bit value */
#define QCONST32(x,bits) ((opus_val32)(.5+(x)*(((opus_val32)1)<<(bits))))
/** Compile-time conversion of float constant to log gain value */
#define GCONST2(x,bits) ((celt_glog)(.5+(x)*(((celt_glog)1)<<(bits))))
/** Compile-time conversion of float constant to DB_SHFIT log gain value */
#define GCONST(x) GCONST2((x),DB_SHIFT)
/** Negate a 16-bit value */
#define NEG16(x) (-(x))
/** Negate a 32-bit value */