Permit rational precision to vary by quality setting in RatioOftenChanging mode
This commit is contained in:
@@ -122,6 +122,7 @@ BQResampler::QualityParams::QualityParams(Quality q)
|
||||
k_snr = 70.0;
|
||||
k_transition = 0.2;
|
||||
cut = 0.9;
|
||||
rational_max = 48000;
|
||||
break;
|
||||
case FastestTolerable:
|
||||
p_multiple = 62;
|
||||
@@ -129,6 +130,7 @@ BQResampler::QualityParams::QualityParams(Quality q)
|
||||
k_snr = 90.0;
|
||||
k_transition = 0.05;
|
||||
cut = 0.975;
|
||||
rational_max = 96000;
|
||||
break;
|
||||
case Best:
|
||||
p_multiple = 122;
|
||||
@@ -136,6 +138,7 @@ BQResampler::QualityParams::QualityParams(Quality q)
|
||||
k_snr = 100.0;
|
||||
k_transition = 0.01;
|
||||
cut = 0.995;
|
||||
rational_max = 192000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -375,7 +378,7 @@ BQResampler::pick_params(double ratio) const
|
||||
{
|
||||
// Farey algorithm, see
|
||||
// https://www.johndcook.com/blog/2010/10/20/best-rational-approximation/
|
||||
int max_denom = 192000;
|
||||
int max_denom = m_qparams.rational_max;
|
||||
double a = 0.0, b = 1.0, c = 1.0, d = 0.0;
|
||||
double pa = a, pb = b, pc = c, pd = d;
|
||||
double eps = 1e-9;
|
||||
|
||||
@@ -71,6 +71,7 @@ private:
|
||||
double k_snr;
|
||||
double k_transition;
|
||||
double cut;
|
||||
int rational_max;
|
||||
QualityParams(Quality);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user