package sh;

/* loaded from: classes4.dex */
public abstract class l {

    /* renamed from: a, reason: collision with root package name */
    public static final l f35724a = new a();

    /* renamed from: b, reason: collision with root package name */
    public static final l f35725b = new b();

    /* renamed from: c, reason: collision with root package name */
    public static final l f35726c = new e();

    /* renamed from: d, reason: collision with root package name */
    public static final l f35727d = new c();

    /* renamed from: e, reason: collision with root package name */
    public static final l f35728e;

    /* renamed from: f, reason: collision with root package name */
    public static final l f35729f;

    /* renamed from: g, reason: collision with root package name */
    public static final l f35730g;

    /* renamed from: h, reason: collision with root package name */
    public static final jh.g f35731h;

    /* renamed from: i, reason: collision with root package name */
    static final boolean f35732i;

    /* loaded from: classes4.dex */
    private static class a extends l {
        a() {
        }

        @Override // sh.l
        public g a(int i10, int i11, int i12, int i13) {
            return g.QUALITY;
        }

        @Override // sh.l
        public float b(int i10, int i11, int i12, int i13) {
            if (Math.min(i11 / i13, i10 / i12) == 0) {
                return 1.0f;
            }
            return 1.0f / Integer.highestOneBit(r0);
        }
    }

    /* loaded from: classes4.dex */
    private static class b extends l {
        b() {
        }

        @Override // sh.l
        public g a(int i10, int i11, int i12, int i13) {
            return g.MEMORY;
        }

        @Override // sh.l
        public float b(int i10, int i11, int i12, int i13) {
            int ceil = (int) Math.ceil(Math.max(i11 / i13, i10 / i12));
            return 1.0f / (r1 << (Math.max(1, Integer.highestOneBit(ceil)) >= ceil ? 0 : 1));
        }
    }

    /* loaded from: classes4.dex */
    private static class c extends l {
        c() {
        }

        @Override // sh.l
        public g a(int i10, int i11, int i12, int i13) {
            return b(i10, i11, i12, i13) == 1.0f ? g.QUALITY : l.f35726c.a(i10, i11, i12, i13);
        }

        @Override // sh.l
        public float b(int i10, int i11, int i12, int i13) {
            return Math.min(1.0f, l.f35726c.b(i10, i11, i12, i13));
        }
    }

    /* loaded from: classes4.dex */
    private static class d extends l {
        d() {
        }

        @Override // sh.l
        public g a(int i10, int i11, int i12, int i13) {
            return g.QUALITY;
        }

        @Override // sh.l
        public float b(int i10, int i11, int i12, int i13) {
            return Math.max(i12 / i10, i13 / i11);
        }
    }

    /* loaded from: classes4.dex */
    private static class e extends l {
        e() {
        }

        @Override // sh.l
        public g a(int i10, int i11, int i12, int i13) {
            return l.f35732i ? g.QUALITY : g.MEMORY;
        }

        @Override // sh.l
        public float b(int i10, int i11, int i12, int i13) {
            if (l.f35732i) {
                return Math.min(i12 / i10, i13 / i11);
            }
            if (Math.max(i11 / i13, i10 / i12) == 0) {
                return 1.0f;
            }
            return 1.0f / Integer.highestOneBit(r0);
        }
    }

    /* loaded from: classes4.dex */
    private static class f extends l {
        f() {
        }

        @Override // sh.l
        public g a(int i10, int i11, int i12, int i13) {
            return g.QUALITY;
        }

        @Override // sh.l
        public float b(int i10, int i11, int i12, int i13) {
            return 1.0f;
        }
    }

    /* loaded from: classes4.dex */
    public enum g {
        MEMORY,
        QUALITY
    }

    static {
        d dVar = new d();
        f35728e = dVar;
        f35729f = new f();
        f35730g = dVar;
        f35731h = jh.g.f("com.bumptech.glide.load.resource.bitmap.Downsampler.DownsampleStrategy", dVar);
        f35732i = true;
    }

    public abstract g a(int i10, int i11, int i12, int i13);

    public abstract float b(int i10, int i11, int i12, int i13);
}
