314 lines
9.7 KiB
Java
314 lines
9.7 KiB
Java
package c.i.a.c.i2;
|
|
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import java.util.Arrays;
|
|
/* compiled from: NalUnitUtil */
|
|
public final class u {
|
|
public static final byte[] a = {0, 0, 0, 1};
|
|
public static final float[] b = {1.0f, 1.0f, 1.0909091f, 0.90909094f, 1.4545455f, 1.2121212f, 2.1818182f, 1.8181819f, 2.909091f, 2.4242425f, 1.6363636f, 1.3636364f, 1.939394f, 1.6161616f, 1.3333334f, 1.5f, 2.0f};
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public static final Object f909c = new Object();
|
|
public static int[] d = new int[10];
|
|
|
|
/* compiled from: NalUnitUtil */
|
|
public static final class a {
|
|
public final int a;
|
|
public final int b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final boolean f910c;
|
|
|
|
public a(int i, int i2, boolean z2) {
|
|
this.a = i;
|
|
this.b = i2;
|
|
this.f910c = z2;
|
|
}
|
|
}
|
|
|
|
/* compiled from: NalUnitUtil */
|
|
public static final class b {
|
|
public final int a;
|
|
public final int b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final int f911c;
|
|
public final int d;
|
|
public final int e;
|
|
public final int f;
|
|
public final float g;
|
|
public final boolean h;
|
|
public final boolean i;
|
|
public final int j;
|
|
public final int k;
|
|
public final int l;
|
|
public final boolean m;
|
|
|
|
public b(int i, int i2, int i3, int i4, int i5, int i6, float f, boolean z2, boolean z3, int i7, int i8, int i9, boolean z4) {
|
|
this.a = i;
|
|
this.b = i2;
|
|
this.f911c = i3;
|
|
this.d = i4;
|
|
this.e = i5;
|
|
this.f = i6;
|
|
this.g = f;
|
|
this.h = z2;
|
|
this.i = z3;
|
|
this.j = i7;
|
|
this.k = i8;
|
|
this.l = i9;
|
|
this.m = z4;
|
|
}
|
|
}
|
|
|
|
public static void a(boolean[] zArr) {
|
|
zArr[0] = false;
|
|
zArr[1] = false;
|
|
zArr[2] = false;
|
|
}
|
|
|
|
public static int b(byte[] bArr, int i, int i2, boolean[] zArr) {
|
|
int i3 = i2 - i;
|
|
boolean z2 = false;
|
|
AnimatableValueParser.D(i3 >= 0);
|
|
if (i3 == 0) {
|
|
return i2;
|
|
}
|
|
if (zArr[0]) {
|
|
zArr[0] = false;
|
|
zArr[1] = false;
|
|
zArr[2] = false;
|
|
return i - 3;
|
|
} else if (i3 > 1 && zArr[1] && bArr[i] == 1) {
|
|
zArr[0] = false;
|
|
zArr[1] = false;
|
|
zArr[2] = false;
|
|
return i - 2;
|
|
} else if (i3 <= 2 || !zArr[2] || bArr[i] != 0 || bArr[i + 1] != 1) {
|
|
int i4 = i2 - 1;
|
|
int i5 = i + 2;
|
|
while (i5 < i4) {
|
|
if ((bArr[i5] & 254) == 0) {
|
|
int i6 = i5 - 2;
|
|
if (bArr[i6] == 0 && bArr[i5 - 1] == 0 && bArr[i5] == 1) {
|
|
zArr[0] = false;
|
|
zArr[1] = false;
|
|
zArr[2] = false;
|
|
return i6;
|
|
}
|
|
i5 -= 2;
|
|
}
|
|
i5 += 3;
|
|
}
|
|
zArr[0] = i3 <= 2 ? !(i3 != 2 ? !zArr[1] || bArr[i4] != 1 : !(zArr[2] && bArr[i2 + -2] == 0 && bArr[i4] == 1)) : bArr[i2 + -3] == 0 && bArr[i2 + -2] == 0 && bArr[i4] == 1;
|
|
zArr[1] = i3 <= 1 ? !(!zArr[2] || bArr[i4] != 0) : bArr[i2 + -2] == 0 && bArr[i4] == 0;
|
|
if (bArr[i4] == 0) {
|
|
z2 = true;
|
|
}
|
|
zArr[2] = z2;
|
|
return i2;
|
|
} else {
|
|
zArr[0] = false;
|
|
zArr[1] = false;
|
|
zArr[2] = false;
|
|
return i - 1;
|
|
}
|
|
}
|
|
|
|
public static a c(byte[] bArr, int i, int i2) {
|
|
x xVar = new x(bArr, i, i2);
|
|
xVar.k(8);
|
|
int f = xVar.f();
|
|
int f2 = xVar.f();
|
|
xVar.j();
|
|
return new a(f, f2, xVar.d());
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:60:0x00f1 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:63:0x0101 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:81:0x014f */
|
|
/* JADX WARNING: Removed duplicated region for block: B:86:0x0162 */
|
|
/* JADX WARNING: Unknown variable types count: 1 */
|
|
public static b d(byte[] bArr, int i, int i2) {
|
|
boolean z2;
|
|
int i3;
|
|
boolean z3;
|
|
int i4;
|
|
?? d2;
|
|
float f;
|
|
int e;
|
|
int i5;
|
|
int i6;
|
|
x xVar = new x(bArr, i, i2);
|
|
xVar.k(8);
|
|
int e2 = xVar.e(8);
|
|
int e3 = xVar.e(8);
|
|
int e4 = xVar.e(8);
|
|
int f2 = xVar.f();
|
|
int i7 = 1;
|
|
if (e2 == 100 || e2 == 110 || e2 == 122 || e2 == 244 || e2 == 44 || e2 == 83 || e2 == 86 || e2 == 118 || e2 == 128 || e2 == 138) {
|
|
i3 = xVar.f();
|
|
boolean d3 = i3 == 3 ? xVar.d() : false;
|
|
xVar.f();
|
|
xVar.f();
|
|
xVar.j();
|
|
if (xVar.d()) {
|
|
int i8 = i3 != 3 ? 8 : 12;
|
|
int i9 = 0;
|
|
while (i9 < i8) {
|
|
if (xVar.d()) {
|
|
int i10 = i9 < 6 ? 16 : 64;
|
|
int i11 = 8;
|
|
int i12 = 8;
|
|
for (int i13 = 0; i13 < i10; i13++) {
|
|
if (i11 != 0) {
|
|
i11 = ((xVar.g() + i12) + 256) % 256;
|
|
}
|
|
if (i11 != 0) {
|
|
i12 = i11;
|
|
}
|
|
}
|
|
}
|
|
i9++;
|
|
}
|
|
}
|
|
z2 = d3;
|
|
} else {
|
|
i3 = 1;
|
|
z2 = false;
|
|
}
|
|
int f3 = xVar.f() + 4;
|
|
int f4 = xVar.f();
|
|
if (f4 == 0) {
|
|
i6 = xVar.f() + 4;
|
|
} else if (f4 == 1) {
|
|
boolean d4 = xVar.d();
|
|
xVar.g();
|
|
xVar.g();
|
|
long f5 = (long) xVar.f();
|
|
for (int i14 = 0; ((long) i14) < f5; i14++) {
|
|
xVar.f();
|
|
}
|
|
z3 = d4;
|
|
i4 = 0;
|
|
xVar.f();
|
|
xVar.j();
|
|
int f6 = xVar.f() + 1;
|
|
d2 = xVar.d();
|
|
int f7 = (2 - (d2 == true ? 1 : 0)) * (xVar.f() + 1);
|
|
if (d2 == 0) {
|
|
xVar.j();
|
|
}
|
|
xVar.j();
|
|
int i15 = f6 * 16;
|
|
int i16 = f7 * 16;
|
|
if (xVar.d()) {
|
|
int f8 = xVar.f();
|
|
int f9 = xVar.f();
|
|
int f10 = xVar.f();
|
|
int f11 = xVar.f();
|
|
if (i3 == 0) {
|
|
i5 = 2 - d2;
|
|
} else {
|
|
int i17 = i3 == 3 ? 1 : 2;
|
|
int i18 = 1;
|
|
if (i3 == 1) {
|
|
i18 = 2;
|
|
}
|
|
i5 = (2 - d2) * i18;
|
|
i7 = i17;
|
|
}
|
|
i15 -= (f8 + f9) * i7;
|
|
i16 -= (f10 + f11) * i5;
|
|
}
|
|
float f12 = 1.0f;
|
|
if (xVar.d() && xVar.d()) {
|
|
e = xVar.e(8);
|
|
if (e != 255) {
|
|
int e5 = xVar.e(16);
|
|
int e6 = xVar.e(16);
|
|
if (!(e5 == 0 || e6 == 0)) {
|
|
f12 = ((float) e5) / ((float) e6);
|
|
}
|
|
f = f12;
|
|
} else {
|
|
float[] fArr = b;
|
|
if (e < fArr.length) {
|
|
f = fArr[e];
|
|
} else {
|
|
c.d.b.a.a.d0("Unexpected aspect_ratio_idc value: ", e, "NalUnitUtil");
|
|
}
|
|
}
|
|
return new b(e2, e3, e4, f2, i15, i16, f, z2, d2, f3, f4, i4, z3);
|
|
}
|
|
f = 1.0f;
|
|
return new b(e2, e3, e4, f2, i15, i16, f, z2, d2, f3, f4, i4, z3);
|
|
} else {
|
|
i6 = 0;
|
|
}
|
|
i4 = i6;
|
|
z3 = false;
|
|
xVar.f();
|
|
xVar.j();
|
|
int f6 = xVar.f() + 1;
|
|
d2 = xVar.d();
|
|
int f7 = (2 - (d2 == true ? 1 : 0)) * (xVar.f() + 1);
|
|
if (d2 == 0) {
|
|
}
|
|
xVar.j();
|
|
int i15 = f6 * 16;
|
|
int i16 = f7 * 16;
|
|
if (xVar.d()) {
|
|
}
|
|
float f12 = 1.0f;
|
|
e = xVar.e(8);
|
|
if (e != 255) {
|
|
}
|
|
return new b(e2, e3, e4, f2, i15, i16, f, z2, d2, f3, f4, i4, z3);
|
|
}
|
|
|
|
public static int e(byte[] bArr, int i) {
|
|
int i2;
|
|
synchronized (f909c) {
|
|
int i3 = 0;
|
|
int i4 = 0;
|
|
while (i3 < i) {
|
|
while (true) {
|
|
if (i3 >= i - 2) {
|
|
i3 = i;
|
|
break;
|
|
}
|
|
if (bArr[i3] == 0 && bArr[i3 + 1] == 0 && bArr[i3 + 2] == 3) {
|
|
break;
|
|
}
|
|
i3++;
|
|
}
|
|
if (i3 < i) {
|
|
int[] iArr = d;
|
|
if (iArr.length <= i4) {
|
|
d = Arrays.copyOf(iArr, iArr.length * 2);
|
|
}
|
|
d[i4] = i3;
|
|
i3 += 3;
|
|
i4++;
|
|
}
|
|
}
|
|
i2 = i - i4;
|
|
int i5 = 0;
|
|
int i6 = 0;
|
|
for (int i7 = 0; i7 < i4; i7++) {
|
|
int i8 = d[i7] - i6;
|
|
System.arraycopy(bArr, i6, bArr, i5, i8);
|
|
int i9 = i5 + i8;
|
|
int i10 = i9 + 1;
|
|
bArr[i9] = 0;
|
|
i5 = i10 + 1;
|
|
bArr[i10] = 0;
|
|
i6 += i8 + 3;
|
|
}
|
|
System.arraycopy(bArr, i6, bArr, i5, i2 - i5);
|
|
}
|
|
return i2;
|
|
}
|
|
}
|