package com.bytedance.sdk.openadsdk.core.YoT.tN;

import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import java.util.Arrays;
import java.util.List;
/* loaded from: classes2.dex */
public class AlY {
    public static final List<String> YFl = Arrays.asList("video/mp4", "video/3gpp");

    public static double YFl(int i, double d, int i2, int i3, int i4, String str) {
        double YFl2 = YFl(i, d, i2, i3);
        return YFl(str) * (1.0d / ((YFl2 + 1.0d) + YFl(i4)));
    }

    private static double YFl(int i, double d, int i2, int i3) {
        double d2 = FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE;
        double abs = d > FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE ? Math.abs(d - (i3 > 0 ? i2 / i3 : 0.0d)) : 0.0d;
        if (i > 0) {
            d2 = Math.abs((i - i2) / i);
        }
        return abs + d2;
    }

    private static double YFl(int i) {
        int max = Math.max(i, 0);
        return (700 > max || max > 1500) ? Math.min(Math.abs(700 - max) / 700.0f, Math.abs(1500 - max) / 1500.0f) : FirebaseRemoteConfig.DEFAULT_VALUE_FOR_DOUBLE;
    }

    private static double YFl(String str) {
        if (str == null) {
            str = "";
        }
        int hashCode = str.hashCode();
        if (hashCode != -1664118616) {
            return (hashCode == 1331848029 && str.equals("video/mp4")) ? 1.5d : 1.0d;
        }
        str.equals("video/3gpp");
        return 1.0d;
    }
}
