package androidx.media3.extractor;

import androidx.annotation.Nullable;
import androidx.media3.exoplayer.RendererCapabilities;
import tv.danmaku.ijk.media.player.IjkMediaMeta;

/* JADX INFO: loaded from: classes.dex */
public final class q0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f3450a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f3451b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f3452c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f3453d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f3454e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f3455f;

    @Nullable
    public String mimeType;

    public final boolean a(int i10) {
        int i11;
        int i12;
        int i13;
        int i14;
        if (!((i10 & (-2097152)) == -2097152) || (i11 = (i10 >>> 19) & 3) == 1 || (i12 = (i10 >>> 17) & 3) == 0 || (i13 = (i10 >>> 12) & 15) == 0 || i13 == 15 || (i14 = (i10 >>> 10) & 3) == 3) {
            return false;
        }
        this.f3450a = i11;
        this.mimeType = b.f3318c[3 - i12];
        int i15 = b.f3319d[i14];
        this.f3452c = i15;
        if (i11 == 2) {
            this.f3452c = i15 / 2;
        } else if (i11 == 0) {
            this.f3452c = i15 / 4;
        }
        int i16 = (i10 >>> 9) & 1;
        int i17 = 1152;
        if (i12 != 1) {
            if (i12 != 2) {
                if (i12 != 3) {
                    throw new IllegalArgumentException();
                }
                i17 = RendererCapabilities.DECODER_SUPPORT_MASK;
            }
        } else if (i11 != 3) {
            i17 = 576;
        }
        this.f3455f = i17;
        if (i12 == 3) {
            int i18 = i11 == 3 ? b.f3320e[i13 - 1] : b.f3321f[i13 - 1];
            this.f3454e = i18;
            this.f3451b = (((i18 * 12) / this.f3452c) + i16) * 4;
        } else {
            int i19 = IjkMediaMeta.FF_PROFILE_H264_HIGH_444;
            if (i11 == 3) {
                int i20 = i12 == 2 ? b.f3322g[i13 - 1] : b.f3323h[i13 - 1];
                this.f3454e = i20;
                this.f3451b = ((i20 * IjkMediaMeta.FF_PROFILE_H264_HIGH_444) / this.f3452c) + i16;
            } else {
                int i21 = b.f3324i[i13 - 1];
                this.f3454e = i21;
                if (i12 == 1) {
                    i19 = 72;
                }
                this.f3451b = ((i19 * i21) / this.f3452c) + i16;
            }
        }
        this.f3453d = ((i10 >> 6) & 3) == 3 ? 1 : 2;
        return true;
    }
}
