mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 02:09:26 +02:00
Save some more CPU cycles in the limiter (#939)
Optimise limiter CPU usage
This commit is contained in:
parent
72af0d2014
commit
c6e97a7f8a
3 changed files with 62 additions and 56 deletions
|
@ -187,7 +187,7 @@ fn get_setup() -> Setup {
|
|||
const VALID_INITIAL_VOLUME_RANGE: RangeInclusive<u16> = 0..=100;
|
||||
const VALID_VOLUME_RANGE: RangeInclusive<f64> = 0.0..=100.0;
|
||||
const VALID_NORMALISATION_KNEE_RANGE: RangeInclusive<f64> = 0.0..=10.0;
|
||||
const VALID_NORMALISATION_PREGAIN_RANGE: RangeInclusive<f32> = -10.0..=10.0;
|
||||
const VALID_NORMALISATION_PREGAIN_RANGE: RangeInclusive<f64> = -10.0..=10.0;
|
||||
const VALID_NORMALISATION_THRESHOLD_RANGE: RangeInclusive<f64> = -10.0..=0.0;
|
||||
const VALID_NORMALISATION_ATTACK_RANGE: RangeInclusive<u64> = 1..=500;
|
||||
const VALID_NORMALISATION_RELEASE_RANGE: RangeInclusive<u64> = 1..=1000;
|
||||
|
@ -1339,7 +1339,7 @@ fn get_setup() -> Setup {
|
|||
.unwrap_or(player_default_config.normalisation_type);
|
||||
|
||||
normalisation_pregain_db = opt_str(NORMALISATION_PREGAIN)
|
||||
.map(|pregain| match pregain.parse::<f32>() {
|
||||
.map(|pregain| match pregain.parse::<f64>() {
|
||||
Ok(value) if (VALID_NORMALISATION_PREGAIN_RANGE).contains(&value) => value,
|
||||
_ => {
|
||||
let valid_values = &format!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue