|
| #define | __AUDIO_FORMAT_GENERIC__ 1 |
| |
| #define | __AUDIO_FORMAT_HIFI3__ 0 |
| |
| #define | INT24_MAXVALUE 8388607 |
| |
| #define | INT24_MINVALUE -8388608 |
| |
| #define | ONE_Q2_30 1073741824 /* Q2.30 1.0 */ |
| |
| #define | ONE_Q1_31 2147483647 /* Q1.31 ~1.0 */ |
| |
| #define | MINUS_3DB_Q1_31 1520301996 /* 10^(-3/20) */ |
| |
| #define | MINUS_6DB_Q1_31 1076291389 /* 10^(-6/20) */ |
| |
| #define | MINUS_10DB_Q1_31 679093957 /* 10^(-10/20) */ |
| |
| #define | MINUS_20DB_Q1_31 214748365 /* 10^(-20/20) */ |
| |
| #define | MINUS_30DB_Q1_31 67909396 /* 10^(-30/20) */ |
| |
| #define | MINUS_40DB_Q1_31 21474836 /* 10^(-40/20) */ |
| |
| #define | MINUS_50DB_Q1_31 6790940 /* 10^(-50/20) */ |
| |
| #define | MINUS_60DB_Q1_31 2147484 /* 10^(-60/20) */ |
| |
| #define | MINUS_70DB_Q1_31 679094 /* 10^(-70/20) */ |
| |
| #define | MINUS_80DB_Q1_31 214748 /* 10^(-80/20) */ |
| |
| #define | MINUS_90DB_Q1_31 67909 /* 10^(-90/20) */ |
| |
| #define | Q_SHIFT_BITS_64(qx, qy, qz) |
| |
| #define | Q_SHIFT_BITS_32(qx, qy, qz) |
| |
| #define | Q_CONVERT_FLOAT(f, qy) ((int32_t)(((const double)f) * ((int64_t)1 << (const int)qy) + 0.5)) |
| |
| #define | Q_CONVERT_QTOF(x, ny) ((float)(x) / ((int64_t)1 << (ny))) |
| |
| #define | Q_CONVERT_QTOD(x, ny) ((double)(x) / ((int64_t)1 << (ny))) |
| |
| #define | Q_SHIFT(x, src_q, dst_q) ((x) >> ((src_q) - (dst_q))) |
| |
| #define | Q_SHIFT_RND(x, src_q, dst_q) ((((x) >> ((src_q) - (dst_q) - 1)) + 1) >> 1) |
| |
| #define | Q_SHIFT_LEFT(x, src_q, dst_q) ((x) << ((dst_q) - (src_q))) |
| |
| #define | Q_MULTS_16X16(px, py, qx, qy, qp) ((px) * (py) >> (((qx) + (qy) - (qp)))) |
| |
| #define | Q_MULTSR_16X16(px, py, qx, qy, qp) ((((px) * (py) >> ((qx) + (qy) - (qp) - 1)) + 1) >> 1) |
| |
| #define | Q_MULTS_32X32(px, py, qx, qy, qp) ((px) * (py) >> (((qx) + (qy) - (qp)))) |
| |
| #define | Q_MULTSR_32X32(px, py, qx, qy, qp) ((((px) * (py) >> ((qx) + (qy) - (qp) - 1)) + 1) >> 1) |
| |
| #define | SATP_INT32(x) (((x) > INT32_MAX) ? INT32_MAX : (x)) |
| |
| #define | SATM_INT32(x) (((x) < INT32_MIN) ? INT32_MIN : (x)) |
| |
|
| static int64_t | q_mults_32x32 (int32_t x, int32_t y, const int shift_bits) |
| |
| static int64_t | q_multsr_32x32 (int32_t x, int32_t y, const int shift_bits) |
| |
| static int32_t | q_mults_16x16 (int16_t x, int32_t y, const int shift_bits) |
| |
| static int16_t | q_multsr_16x16 (int16_t x, int32_t y, const int shift_bits) |
| |
| static int32_t | q_multsr_sat_32x32 (int32_t x, int32_t y, const int shift_bits) |
| |
| static int32_t | q_multsr_sat_32x32_24 (int32_t x, int32_t y, const int shift_bits) |
| |
| static int32_t | q_multsr_sat_32x32_16 (int32_t x, int32_t y, const int shift_bits) |
| |
| static int16_t | q_multsr_sat_16x16 (int16_t x, int32_t y, const int shift_bits) |
| |
| static int32_t | sign_extend_s24 (int32_t x) |
| |