|
6 | 6 |
|
7 | 7 | #include <sof/audio/component.h> |
8 | 8 | #include <sof/audio/format.h> |
9 | | -#include <sof/math/decibels.h> |
| 9 | +#include <sof/math/exp_fcn.h> |
10 | 10 | #include <sof/math/numbers.h> |
11 | 11 | #include <stdint.h> |
12 | 12 |
|
@@ -42,7 +42,7 @@ static int32_t knee_curveK(const struct sof_drc_params *p, int32_t x) |
42 | 42 | * gamma = -k * x |
43 | 43 | */ |
44 | 44 | gamma = drc_mult_lshift(x, -p->K, drc_get_lshift(31, 20, 27)); |
45 | | - knee_exp_gamma = exp_fixed(gamma); |
| 45 | + knee_exp_gamma = sofm_exp_fixed(gamma); |
46 | 46 | knee_curve_k = drc_mult_lshift(p->knee_beta, knee_exp_gamma, drc_get_lshift(24, 20, 24)); |
47 | 47 | knee_curve_k = AE_ADD32(knee_curve_k, p->knee_alpha); |
48 | 48 | return knee_curve_k; |
@@ -78,7 +78,7 @@ static int32_t volume_gain(const struct sof_drc_params *p, int32_t x) |
78 | 78 | tmp = AE_SRAI32R(x, 5); /* Q1.31 -> Q5.26 */ |
79 | 79 | tmp = drc_log_fixed(tmp); /* Q6.26 */ |
80 | 80 | tmp2 = AE_SUB32(p->slope, ONE_Q30); /* Q2.30 */ |
81 | | - exp_knee = exp_fixed(drc_mult_lshift(tmp, tmp2, drc_get_lshift(26, 30, 27))); |
| 81 | + exp_knee = sofm_exp_fixed(drc_mult_lshift(tmp, tmp2, drc_get_lshift(26, 30, 27))); |
82 | 82 | y = drc_mult_lshift(p->ratio_base, exp_knee, drc_get_lshift(30, 20, 30)); |
83 | 83 | } |
84 | 84 |
|
@@ -159,7 +159,8 @@ void drc_update_detector_average(struct drc_state *state, |
159 | 159 | db_per_frame = drc_mult_lshift(drc_lin2db_fixed(gain), |
160 | 160 | p->sat_release_frames_inv_neg, |
161 | 161 | drc_get_lshift(21, 30, 24)); |
162 | | - sat_release_rate = AE_SUB32(db2lin_fixed(db_per_frame), ONE_Q20); |
| 162 | + sat_release_rate = AE_SUB32(sofm_db2lin_fixed(db_per_frame), |
| 163 | + ONE_Q20); |
163 | 164 | tmp = drc_mult_lshift(gain_diff, sat_release_rate, |
164 | 165 | drc_get_lshift(30, 20, 30)); |
165 | 166 | } |
@@ -254,7 +255,7 @@ void drc_update_envelope(struct drc_state *state, const struct sof_drc_params *p |
254 | 255 | tmp = p->kSpacingDb << 16; /* Q16.16 */ |
255 | 256 | lshift = drc_get_lshift(30, 16, 24); |
256 | 257 | db_per_frame = drc_mult_lshift(db_per_frame, tmp, lshift); /* Q8.24 */ |
257 | | - envelope_rate = db2lin_fixed(db_per_frame); /* Q12.20 */ |
| 258 | + envelope_rate = sofm_db2lin_fixed(db_per_frame); /* Q12.20 */ |
258 | 259 | } else { |
259 | 260 | /* Attack mode - compression_diff_db should be positive dB */ |
260 | 261 |
|
|
0 commit comments