package com.google.android.gms.internal.ads;

import android.graphics.Bitmap;
import androidx.annotation.Nullable;
import java.util.Arrays;

/* JADX INFO: loaded from: classes2.dex */
public final class v8 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final p01 f17539a = new p01();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int[] f17540b = new int[256];

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

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

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

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

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

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

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

    @Nullable
    public final ad0 zza() {
        p01 p01Var;
        int i10;
        int i11;
        if (this.f17542d == 0 || this.f17543e == 0 || this.f17546h == 0 || this.f17547i == 0 || (i10 = (p01Var = this.f17539a).f15227c) == 0 || p01Var.f15226b != i10 || !this.f17541c) {
            return null;
        }
        p01Var.C(0);
        int i12 = this.f17546h * this.f17547i;
        int[] iArr = new int[i12];
        int i13 = 0;
        while (i13 < i12) {
            int I = p01Var.I();
            int[] iArr2 = this.f17540b;
            if (I != 0) {
                i11 = i13 + 1;
                iArr[i13] = iArr2[I];
            } else {
                int I2 = p01Var.I();
                if (I2 != 0) {
                    int I3 = I2 & 63;
                    if ((I2 & 64) != 0) {
                        I3 = (I3 << 8) | p01Var.I();
                    }
                    i11 = I3 + i13;
                    Arrays.fill(iArr, i13, i11, (I2 & 128) == 0 ? iArr2[0] : iArr2[p01Var.I()]);
                }
            }
            i13 = i11;
        }
        Bitmap bitmapCreateBitmap = Bitmap.createBitmap(iArr, this.f17546h, this.f17547i, Bitmap.Config.ARGB_8888);
        gc0 gc0Var = new gc0();
        gc0Var.b(bitmapCreateBitmap);
        float f10 = this.f17544f;
        float f11 = this.f17542d;
        gc0Var.f11708d = f10 / f11;
        gc0Var.f11709e = 0;
        float f12 = this.f17545g;
        float f13 = this.f17543e;
        gc0Var.f11705a = f12 / f13;
        gc0Var.f11706b = 0;
        gc0Var.f11707c = 0;
        gc0Var.f11712h = this.f17546h / f11;
        gc0Var.f11713i = this.f17547i / f13;
        return gc0Var.c();
    }
}
