2021-06-27 20:44:35 +00:00
|
|
|
package co.discord.media_engine;
|
|
|
|
|
2021-12-21 23:37:30 +00:00
|
|
|
import b.d.b.a.a;
|
2021-08-09 22:50:01 +00:00
|
|
|
import com.google.android.material.shadow.ShadowDrawableWrapper;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.util.Map;
|
|
|
|
/* compiled from: VoiceQuality.kt */
|
|
|
|
public final class VoiceQualityKt {
|
|
|
|
private static final double _calculateMos(double d, double d2) {
|
|
|
|
double _calculateR = _calculateR(d, d2);
|
|
|
|
if (_calculateR < ((double) 0)) {
|
|
|
|
return 1.0d;
|
|
|
|
}
|
|
|
|
double d3 = (double) 100;
|
|
|
|
if (_calculateR > d3) {
|
|
|
|
return 4.5d;
|
|
|
|
}
|
|
|
|
return ((d3 - _calculateR) * (_calculateR - ((double) 60)) * 7.1E-6d * _calculateR) + (0.035d * _calculateR) + ((double) 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static final double _calculateR(double d, double d2) {
|
2021-08-09 22:50:01 +00:00
|
|
|
double d3 = (0.024d * d) + (d > 177.3d ? (d - 177.3d) * 0.11d : ShadowDrawableWrapper.COS_45);
|
2021-06-27 20:44:35 +00:00
|
|
|
double d4 = (double) 10;
|
|
|
|
return (93.4d - d3) - (((((double) 122) * d2) / (d2 + d4)) + d4);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ double access$_calculateMos(double d, double d2) {
|
|
|
|
return _calculateMos(d, d2);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ double access$clamp(double d, double d2, double d3) {
|
|
|
|
return clamp(d, d2, d3);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$explodePlayoutMetric(String str, PlayoutMetric playoutMetric, Map map) {
|
|
|
|
explodePlayoutMetric(str, playoutMetric, map);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static final double clamp(double d, double d2, double d3) {
|
|
|
|
return d < d2 ? d2 : d3 < d ? d3 : d;
|
|
|
|
}
|
|
|
|
|
|
|
|
private static final void explodePlayoutMetric(String str, PlayoutMetric playoutMetric, Map<String, Object> map) {
|
|
|
|
int i = 0;
|
2021-11-08 18:25:28 +00:00
|
|
|
map.put(a.v(str, "_mean"), playoutMetric != null ? Double.valueOf(playoutMetric.getMean()) : 0);
|
2021-07-20 22:20:08 +00:00
|
|
|
map.put(str + "_p75", playoutMetric != null ? Double.valueOf(playoutMetric.getP75()) : 0);
|
|
|
|
map.put(str + "_p95", playoutMetric != null ? Double.valueOf(playoutMetric.getP95()) : 0);
|
|
|
|
map.put(str + "_p99", playoutMetric != null ? Double.valueOf(playoutMetric.getP99()) : 0);
|
2021-06-27 20:44:35 +00:00
|
|
|
String str2 = str + "_max";
|
|
|
|
if (playoutMetric != null) {
|
2021-07-20 22:20:08 +00:00
|
|
|
i = Double.valueOf(playoutMetric.getMax());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
map.put(str2, i);
|
|
|
|
}
|
|
|
|
}
|