Sound Open Firmware
Loading...
Searching...
No Matches
format.h File Reference
Include dependency graph for format.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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)
#define Q_CONVERT_QTOF(x, ny)
#define Q_CONVERT_QTOD(x, ny)
#define Q_SHIFT(x, src_q, dst_q)
#define Q_SHIFT_RND(x, src_q, dst_q)
#define Q_SHIFT_LEFT(x, src_q, dst_q)
#define Q_MULTS_16X16(px, py, qx, qy, qp)
#define Q_MULTSR_16X16(px, py, qx, qy, qp)
#define Q_MULTS_32X32(px, py, qx, qy, qp)
#define Q_MULTSR_32X32(px, py, qx, qy, qp)
#define SATP_INT32(x)
#define SATM_INT32(x)

Functions

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)

Macro Definition Documentation

◆ __AUDIO_FORMAT_GENERIC__

#define __AUDIO_FORMAT_GENERIC__   1

◆ __AUDIO_FORMAT_HIFI3__

#define __AUDIO_FORMAT_HIFI3__   0

◆ INT24_MAXVALUE

#define INT24_MAXVALUE   8388607

◆ INT24_MINVALUE

#define INT24_MINVALUE   -8388608

◆ MINUS_10DB_Q1_31

#define MINUS_10DB_Q1_31   679093957 /* 10^(-10/20) */

◆ MINUS_20DB_Q1_31

#define MINUS_20DB_Q1_31   214748365 /* 10^(-20/20) */

◆ MINUS_30DB_Q1_31

#define MINUS_30DB_Q1_31   67909396 /* 10^(-30/20) */

◆ MINUS_3DB_Q1_31

#define MINUS_3DB_Q1_31   1520301996 /* 10^(-3/20) */

◆ MINUS_40DB_Q1_31

#define MINUS_40DB_Q1_31   21474836 /* 10^(-40/20) */

◆ MINUS_50DB_Q1_31

#define MINUS_50DB_Q1_31   6790940 /* 10^(-50/20) */

◆ MINUS_60DB_Q1_31

#define MINUS_60DB_Q1_31   2147484 /* 10^(-60/20) */

◆ MINUS_6DB_Q1_31

#define MINUS_6DB_Q1_31   1076291389 /* 10^(-6/20) */

◆ MINUS_70DB_Q1_31

#define MINUS_70DB_Q1_31   679094 /* 10^(-70/20) */

◆ MINUS_80DB_Q1_31

#define MINUS_80DB_Q1_31   214748 /* 10^(-80/20) */

◆ MINUS_90DB_Q1_31

#define MINUS_90DB_Q1_31   67909 /* 10^(-90/20) */

◆ ONE_Q1_31

#define ONE_Q1_31   2147483647 /* Q1.31 ~1.0 */

◆ ONE_Q2_30

#define ONE_Q2_30   1073741824 /* Q2.30 1.0 */

◆ Q_CONVERT_FLOAT

#define Q_CONVERT_FLOAT ( f,
qy )
Value:
((int32_t)(((const double)f) * ((int64_t)1 << (const int)qy) + 0.5))

◆ Q_CONVERT_QTOD

#define Q_CONVERT_QTOD ( x,
ny )
Value:
((double)(x) / ((int64_t)1 << (ny)))

◆ Q_CONVERT_QTOF

#define Q_CONVERT_QTOF ( x,
ny )
Value:
((float)(x) / ((int64_t)1 << (ny)))

◆ Q_MULTS_16X16

#define Q_MULTS_16X16 ( px,
py,
qx,
qy,
qp )
Value:
((px) * (py) >> (((qx) + (qy) - (qp))))

◆ Q_MULTS_32X32

#define Q_MULTS_32X32 ( px,
py,
qx,
qy,
qp )
Value:
((px) * (py) >> (((qx) + (qy) - (qp))))

◆ Q_MULTSR_16X16

#define Q_MULTSR_16X16 ( px,
py,
qx,
qy,
qp )
Value:
((((px) * (py) >> ((qx) + (qy) - (qp) - 1)) + 1) >> 1)

◆ Q_MULTSR_32X32

#define Q_MULTSR_32X32 ( px,
py,
qx,
qy,
qp )
Value:
((((px) * (py) >> ((qx) + (qy) - (qp) - 1)) + 1) >> 1)

◆ Q_SHIFT

#define Q_SHIFT ( x,
src_q,
dst_q )
Value:
((x) >> ((src_q) - (dst_q)))

◆ Q_SHIFT_BITS_32

#define Q_SHIFT_BITS_32 ( qx,
qy,
qz )
Value:
((qx + qy - qz) <= 31 ? (((qx + qy - qz) >= 0) ? \
(qx + qy - qz) : INT32_MIN) : INT32_MAX)

◆ Q_SHIFT_BITS_64

#define Q_SHIFT_BITS_64 ( qx,
qy,
qz )
Value:
((qx + qy - qz) <= 63 ? (((qx + qy - qz) >= 0) ? \
(qx + qy - qz) : INT64_MIN) : INT64_MAX)

◆ Q_SHIFT_LEFT

#define Q_SHIFT_LEFT ( x,
src_q,
dst_q )
Value:
((x) << ((dst_q) - (src_q)))

◆ Q_SHIFT_RND

#define Q_SHIFT_RND ( x,
src_q,
dst_q )
Value:
((((x) >> ((src_q) - (dst_q) - 1)) + 1) >> 1)

◆ SATM_INT32

#define SATM_INT32 ( x)
Value:
(((x) < INT32_MIN) ? INT32_MIN : (x))

◆ SATP_INT32

#define SATP_INT32 ( x)
Value:
(((x) > INT32_MAX) ? INT32_MAX : (x))

Function Documentation

◆ q_mults_16x16()

int32_t q_mults_16x16 ( int16_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ q_mults_32x32()

int64_t q_mults_32x32 ( int32_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ q_multsr_16x16()

int16_t q_multsr_16x16 ( int16_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ q_multsr_32x32()

int64_t q_multsr_32x32 ( int32_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ q_multsr_sat_16x16()

int16_t q_multsr_sat_16x16 ( int16_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ q_multsr_sat_32x32()

int32_t q_multsr_sat_32x32 ( int32_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ q_multsr_sat_32x32_16()

int32_t q_multsr_sat_32x32_16 ( int32_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ q_multsr_sat_32x32_24()

int32_t q_multsr_sat_32x32_24 ( int32_t x,
int32_t y,
const int shift_bits )
inlinestatic

◆ sign_extend_s24()

int32_t sign_extend_s24 ( int32_t x)
inlinestatic