Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions encoder/drc_src/impd_drc_gain_calculator.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,16 @@ IA_ERRORCODE impd_drc_td_drc_gain_calc_init(ia_drc_gain_enc_struct *pstr_drc_gai
pstr_chan_param = &pstr_drc_compand->str_channel_param;

if (pstr_chan_param->attack < 1.0 / pstr_drc_gain_enc->sample_rate) {
pstr_chan_param->attack = 1.0;
// Decreasing the upper limit of alphaAttack from 1 -> 1 - EPSILON to avoid DRC payload overflow.
pstr_chan_param->attack = 1.0 - FLT_EPSILON;
} else {
pstr_chan_param->attack =
1.0 - exp(-1.0 / (pstr_drc_gain_enc->sample_rate * pstr_chan_param->attack));
}

if (pstr_chan_param->decay < 1.0 / pstr_drc_gain_enc->sample_rate) {
pstr_chan_param->decay = 1.0;
// Decreasing the upper limit of alphaDecay from 1 -> 1 - EPSILON to avoid DRC payload overflow.
pstr_chan_param->decay = 1.0 - FLT_EPSILON;
} else {
pstr_chan_param->decay =
1.0 - exp(-1.0 / (pstr_drc_gain_enc->sample_rate * pstr_chan_param->decay));
Expand Down
Loading