forked from len0rd/rockbox
Cleanup some logf info in dsp_set_compressor
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22890 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
13afb5ebf6
commit
78d2c1bc25
1 changed files with 7 additions and 4 deletions
11
apps/dsp.c
11
apps/dsp.c
|
@ -1622,12 +1622,10 @@ void dsp_set_compressor(int c_threshold, int c_ratio, int c_gain,
|
||||||
[2] = top of knee
|
[2] = top of knee
|
||||||
[3] = 0 db input */
|
[3] = 0 db input */
|
||||||
db_curve[1].db = c_menu.threshold << 16;
|
db_curve[1].db = c_menu.threshold << 16;
|
||||||
db_curve[1].offset = 0;
|
|
||||||
if (c_menu.soft_knee)
|
if (c_menu.soft_knee)
|
||||||
{
|
{
|
||||||
/* bottom of knee is 3dB below the threshold for soft knee*/
|
/* bottom of knee is 3dB below the threshold for soft knee*/
|
||||||
db_curve[0].db = db_curve[1].db - (3 << 16);
|
db_curve[0].db = db_curve[1].db - (3 << 16);
|
||||||
db_curve[0].offset = 0;
|
|
||||||
/* top of knee is 3dB above the threshold for soft knee */
|
/* top of knee is 3dB above the threshold for soft knee */
|
||||||
db_curve[2].db = db_curve[1].db + (3 << 16);
|
db_curve[2].db = db_curve[1].db + (3 << 16);
|
||||||
if (c_menu.ratio)
|
if (c_menu.ratio)
|
||||||
|
@ -1642,13 +1640,11 @@ void dsp_set_compressor(int c_threshold, int c_ratio, int c_gain,
|
||||||
{
|
{
|
||||||
/* bottom of knee is at the threshold for hard knee */
|
/* bottom of knee is at the threshold for hard knee */
|
||||||
db_curve[0].db = c_menu.threshold << 16;
|
db_curve[0].db = c_menu.threshold << 16;
|
||||||
db_curve[0].offset = 0;
|
|
||||||
/* top of knee is at the threshold for hard knee */
|
/* top of knee is at the threshold for hard knee */
|
||||||
db_curve[2].db = c_menu.threshold << 16;
|
db_curve[2].db = c_menu.threshold << 16;
|
||||||
db_curve[2].offset = 0;
|
db_curve[2].offset = 0;
|
||||||
}
|
}
|
||||||
/* 0db input is also max offset point (most compression) */
|
/* 0db input is also max offset point (most compression) */
|
||||||
db_curve[3].db = 0;
|
|
||||||
if (c_menu.ratio)
|
if (c_menu.ratio)
|
||||||
/* offset = threshold * (ratio - 1) / ratio */
|
/* offset = threshold * (ratio - 1) / ratio */
|
||||||
db_curve[3].offset = (int32_t)((long long)(c_menu.threshold << 16)
|
db_curve[3].offset = (int32_t)((long long)(c_menu.threshold << 16)
|
||||||
|
@ -1679,7 +1675,13 @@ void dsp_set_compressor(int c_threshold, int c_ratio, int c_gain,
|
||||||
}
|
}
|
||||||
comp_curve[64] = fp_factor(db_curve[3].offset, 16) << 8;
|
comp_curve[64] = fp_factor(db_curve[3].offset, 16) << 8;
|
||||||
|
|
||||||
|
#if defined(SIMULATOR) && defined(LOGF_ENABLE)
|
||||||
logf("\n *** Compression Offsets ***");
|
logf("\n *** Compression Offsets ***");
|
||||||
|
/* some settings for display only, not used in calculations */
|
||||||
|
db_curve[0].offset = 0;
|
||||||
|
db_curve[1].offset = 0;
|
||||||
|
db_curve[3].db = 0;
|
||||||
|
|
||||||
for (i = 0; i <= 3; i++)
|
for (i = 0; i <= 3; i++)
|
||||||
{
|
{
|
||||||
logf("Curve[%d]: db: % .1f\toffset: % .4f", i, (float)db_curve[i].db / (1 << 16),
|
logf("Curve[%d]: db: % .1f\toffset: % .4f", i, (float)db_curve[i].db / (1 << 16),
|
||||||
|
@ -1692,6 +1694,7 @@ void dsp_set_compressor(int c_threshold, int c_ratio, int c_gain,
|
||||||
debugf("%02d: %.6f ", i, (float)comp_curve[i] / (1 << 24));
|
debugf("%02d: %.6f ", i, (float)comp_curve[i] / (1 << 24));
|
||||||
if (i % 4 == 0) debugf("\n");
|
if (i % 4 == 0) debugf("\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* if using auto peak, then makeup gain is max offset - .1dB headroom */
|
/* if using auto peak, then makeup gain is max offset - .1dB headroom */
|
||||||
int32_t db_makeup = (c_menu.gain == -1) ?
|
int32_t db_makeup = (c_menu.gain == -1) ?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue