package defpackage;

import java.math.RoundingMode;

/* renamed from: ᵨᵸ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3766 implements InterfaceC1593 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final int f14039;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public long f14040;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final int f14041;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final int f14042;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public long f14043;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C2419 f14044;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C4089 f14045 = new C4089(1);

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public InterfaceC2154 f14046;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final int f14047;

    public C3766(C2419 c2419) {
        this.f14044 = c2419;
        this.f14042 = c2419.f9447;
        String str = (String) c2419.f9448.get("mode");
        str.getClass();
        if (ᵿᵧ.ᵶᵷᵕ(str, "AAC-hbr")) {
            this.f14047 = 13;
            this.f14039 = 3;
        } else {
            if (!ᵿᵧ.ᵶᵷᵕ(str, "AAC-lbr")) {
                C0190.m1432("AAC mode not supported");
                throw null;
            }
            this.f14047 = 6;
            this.f14039 = 2;
        }
        this.f14041 = this.f14039 + this.f14047;
    }

    @Override // defpackage.InterfaceC1593
    /* renamed from: ˏᵙ */
    public final void mo2630(InterfaceC1982 interfaceC1982, int i) {
        InterfaceC2154 interfaceC2154Mo4996 = interfaceC1982.mo4996(i, 1);
        this.f14046 = interfaceC2154Mo4996;
        interfaceC2154Mo4996.mo4407(this.f14044.f9445);
    }

    @Override // defpackage.InterfaceC1593
    /* renamed from: ᵥᵯˎ */
    public final void mo2631(long j) {
        this.f14040 = j;
    }

    @Override // defpackage.InterfaceC1593
    /* renamed from: ᵴᵳ */
    public final void mo2632(long j, long j2) {
        this.f14040 = j;
        this.f14043 = j2;
    }

    @Override // defpackage.InterfaceC1593
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo2633(C3493 c3493, long j, int i, boolean z) {
        this.f14046.getClass();
        short sM7974 = c3493.m7974();
        int i2 = sM7974 / this.f14041;
        long j2 = ˁˈᵸ.ᵡᵘˎʽ(this.f14042, this.f14043, j, this.f14040);
        C4089 c4089 = this.f14045;
        c4089.m8949(c3493);
        int i3 = this.f14039;
        int i4 = this.f14047;
        if (i2 == 1) {
            int iM8966 = c4089.m8966(i4);
            c4089.m8956(i3);
            this.f14046.mo4406(c3493.m7959(), c3493);
            if (z) {
                this.f14046.mo4410(j2, 1, iM8966, 0, null);
                return;
            }
            return;
        }
        c3493.m7946((sM7974 + 7) / 8);
        long jM8115 = j2;
        for (int i5 = 0; i5 < i2; i5++) {
            int iM89662 = c4089.m8966(i4);
            c4089.m8956(i3);
            this.f14046.mo4406(iM89662, c3493);
            this.f14046.mo4410(jM8115, 1, iM89662, 0, null);
            jM8115 += AbstractC3558.m8115(i2, 1000000L, this.f14042, RoundingMode.DOWN);
        }
    }
}
