mirror of
https://github.com/lexi-lambda/shattered-plans.git
synced 2024-11-22 02:52:23 +03:00
Rename VorbisResidue variables to match Vorbis spec
This commit is contained in:
parent
058b140b28
commit
ffcc94db96
@ -129,22 +129,19 @@ public final class VorbisCodebook {
|
||||
final int[] var1 = new int[this.cbSize];
|
||||
final int[] var2 = new int[33];
|
||||
|
||||
int var5;
|
||||
int var6;
|
||||
|
||||
for (int i = 0; i < this.cbSize; ++i) {
|
||||
int cwLength = this.cwLengths[i];
|
||||
for (int entry = 0; entry < this.cbSize; ++entry) {
|
||||
final int cwLength = this.cwLengths[entry];
|
||||
if (cwLength == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var5 = 1 << 32 - cwLength;
|
||||
var6 = var2[cwLength];
|
||||
var1[i] = var6;
|
||||
final int bitMask = 1 << 32 - cwLength;
|
||||
final int var6 = var2[cwLength];
|
||||
var1[entry] = var6;
|
||||
int var9;
|
||||
int var7;
|
||||
if ((var6 & var5) == 0) {
|
||||
var7 = var6 | var5;
|
||||
if ((var6 & bitMask) == 0) {
|
||||
var7 = var6 | bitMask;
|
||||
|
||||
for (int j = cwLength - 1; j >= 1; --j) {
|
||||
var9 = var2[j];
|
||||
@ -166,10 +163,10 @@ public final class VorbisCodebook {
|
||||
|
||||
var2[cwLength] = var7;
|
||||
|
||||
for (int j = cwLength + 1; j <= 32; ++j) {
|
||||
var9 = var2[j];
|
||||
for (int bit = cwLength + 1; bit <= 32; ++bit) {
|
||||
var9 = var2[bit];
|
||||
if (var9 == var6) {
|
||||
var2[j] = var7;
|
||||
var2[bit] = var7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,17 +174,17 @@ public final class VorbisCodebook {
|
||||
this.tree = new int[8];
|
||||
int var11 = 0;
|
||||
|
||||
for (int i = 0; i < this.cbSize; ++i) {
|
||||
int len = this.cwLengths[i];
|
||||
if (len == 0) {
|
||||
for (int entry = 0; entry < this.cbSize; ++entry) {
|
||||
int cwLength = this.cwLengths[entry];
|
||||
if (cwLength == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var5 = var1[i];
|
||||
var6 = 0;
|
||||
int var5 = var1[entry];
|
||||
int var6 = 0;
|
||||
|
||||
for (int j = 0; j < len; ++j) {
|
||||
int var8 = Integer.MIN_VALUE >>> j;
|
||||
for (int bit = 0; bit < cwLength; ++bit) {
|
||||
int var8 = Integer.MIN_VALUE >>> bit;
|
||||
if ((var5 & var8) == 0) {
|
||||
++var6;
|
||||
} else {
|
||||
@ -207,7 +204,7 @@ public final class VorbisCodebook {
|
||||
}
|
||||
}
|
||||
|
||||
this.tree[var6] = ~i;
|
||||
this.tree[var6] = ~entry;
|
||||
if (var6 >= var11) {
|
||||
var11 = var6 + 1;
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ public final class VorbisFormat {
|
||||
}
|
||||
}
|
||||
|
||||
public void b720() {
|
||||
public void decodeAllAudioPackets() {
|
||||
this.lastWindowN = 0;
|
||||
this.lastWindow = new float[blocksize1];
|
||||
for (int i = 0; i < this.packets.length; ++i) {
|
||||
|
@ -48,45 +48,46 @@ public final class VorbisResidue {
|
||||
|
||||
final int cbDim = VorbisFormat.codebooks[this.classbook].cbDim;
|
||||
final int range = this.end - this.begin;
|
||||
final int numChunks = range / this.partitionSize;
|
||||
final int[] classes = new int[numChunks];
|
||||
final int partitionCount = range / this.partitionSize;
|
||||
final int[] classes = new int[partitionCount];
|
||||
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
for (int chunk = 0; chunk < numChunks; ++chunk) {
|
||||
if (i == 0) {
|
||||
for (int pass = 0; pass < 8; ++pass) {
|
||||
for (int part = 0; part < partitionCount; ++part) {
|
||||
if (pass == 0) {
|
||||
int value = VorbisFormat.codebooks[this.classbook].decodeScalar();
|
||||
for (int j = cbDim - 1; j >= 0; --j) {
|
||||
if (chunk + j < numChunks) {
|
||||
classes[chunk + j] = value % this.classifications;
|
||||
if (part + j < partitionCount) {
|
||||
classes[part + j] = value % this.classifications;
|
||||
}
|
||||
value /= this.classifications;
|
||||
}
|
||||
}
|
||||
|
||||
for (int dim = 0; dim < cbDim; ++dim) {
|
||||
int cls = classes[chunk];
|
||||
final int bookIndex = this.books[cls * 8 + i];
|
||||
int cls = classes[part];
|
||||
final int bookIndex = this.books[cls * 8 + pass];
|
||||
if (bookIndex < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final int offset = this.begin + chunk * this.partitionSize;
|
||||
final int offset = this.begin + part * this.partitionSize;
|
||||
final VorbisCodebook book = VorbisFormat.codebooks[bookIndex];
|
||||
|
||||
if (this.type == 0) {
|
||||
int n = this.partitionSize / book.cbDim;
|
||||
for (int a = 0; a < n; ++a) {
|
||||
final float[] var20 = book.decodeVector();
|
||||
for (int b = 0; b < book.cbDim; ++b) {
|
||||
window[offset + a + b * n] += var20[b];
|
||||
int step = this.partitionSize / book.cbDim;
|
||||
for (int i = 0; i < step; ++i) {
|
||||
final float[] vector = book.decodeVector();
|
||||
for (int j = 0; j < book.cbDim; ++j) {
|
||||
window[offset + i + j * step] += vector[j];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int a = 0; a < this.partitionSize; ) {
|
||||
final float[] var16 = book.decodeVector();
|
||||
for (int b = 0; b < book.cbDim; ++b) {
|
||||
window[offset + a] += var16[b];
|
||||
++a;
|
||||
int i = 0;
|
||||
while (i < this.partitionSize) {
|
||||
final float[] vector = book.decodeVector();
|
||||
for (int j = 0; j < book.cbDim; ++j) {
|
||||
window[offset + i] += vector[j];
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ public final class JagexLogoIntroAnimation {
|
||||
|
||||
private static void load1(final ResourceLoader loader) {
|
||||
VorbisFormat.readIdentificationAndSetup(loader.getResource("headers.packvorbis", ""));
|
||||
final VorbisFormat var2 = VorbisFormat.loadAudio(loader, "jagex logo2.packvorbis", "");
|
||||
assert var2 != null;
|
||||
var2.b720();
|
||||
final VorbisFormat logo2 = VorbisFormat.loadAudio(loader, "jagex logo2.packvorbis", "");
|
||||
assert logo2 != null;
|
||||
logo2.decodeAllAudioPackets();
|
||||
}
|
||||
|
||||
private static void load2(final ResourceLoader loader) {
|
||||
|
Loading…
Reference in New Issue
Block a user