package j5;

import com.bumptech.glide.load.resource.bitmap.DownsampleStrategy$SampleSizeRounding;

/* JADX INFO: loaded from: classes.dex */
public final class k extends l {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final /* synthetic */ int f28658h;

    public k(int i10) {
        this.f28658h = i10;
    }

    @Override // j5.l
    public final DownsampleStrategy$SampleSizeRounding a(int i10, int i11, int i12, int i13) {
        DownsampleStrategy$SampleSizeRounding downsampleStrategy$SampleSizeRounding = DownsampleStrategy$SampleSizeRounding.f5812b;
        switch (this.f28658h) {
            case 2:
                return b(i10, i11, i12, i13) == 1.0f ? downsampleStrategy$SampleSizeRounding : l.f28659a.a(i10, i11, i12, i13);
            case 3:
            default:
                return downsampleStrategy$SampleSizeRounding;
            case 4:
                return l.f28665g ? downsampleStrategy$SampleSizeRounding : DownsampleStrategy$SampleSizeRounding.f5811a;
        }
    }

    @Override // j5.l
    public final float b(int i10, int i11, int i12, int i13) {
        switch (this.f28658h) {
            case 2:
                return Math.min(1.0f, l.f28659a.b(i10, i11, i12, i13));
            case 3:
                return Math.max(i12 / i10, i13 / i11);
            case 4:
                if (l.f28665g) {
                    return Math.min(i12 / i10, i13 / i11);
                }
                return Math.max(i11 / i13, i10 / i12) != 0 ? 1.0f / Integer.highestOneBit(r3) : 1.0f;
            default:
                return 1.0f;
        }
    }
}
