mirror of
https://github.com/lexi-lambda/shattered-plans.git
synced 2024-11-25 07:48:04 +03:00
VorbisResidue control flow fix
This commit is contained in:
parent
ffcc94db96
commit
4659116a2e
@ -52,7 +52,8 @@ public final class VorbisResidue {
|
|||||||
final int[] classes = new int[partitionCount];
|
final int[] classes = new int[partitionCount];
|
||||||
|
|
||||||
for (int pass = 0; pass < 8; ++pass) {
|
for (int pass = 0; pass < 8; ++pass) {
|
||||||
for (int part = 0; part < partitionCount; ++part) {
|
int part = 0;
|
||||||
|
while (part < partitionCount) {
|
||||||
if (pass == 0) {
|
if (pass == 0) {
|
||||||
int value = VorbisFormat.codebooks[this.classbook].decodeScalar();
|
int value = VorbisFormat.codebooks[this.classbook].decodeScalar();
|
||||||
for (int j = cbDim - 1; j >= 0; --j) {
|
for (int j = cbDim - 1; j >= 0; --j) {
|
||||||
@ -66,30 +67,34 @@ public final class VorbisResidue {
|
|||||||
for (int dim = 0; dim < cbDim; ++dim) {
|
for (int dim = 0; dim < cbDim; ++dim) {
|
||||||
int cls = classes[part];
|
int cls = classes[part];
|
||||||
final int bookIndex = this.books[cls * 8 + pass];
|
final int bookIndex = this.books[cls * 8 + pass];
|
||||||
if (bookIndex < 0) {
|
|
||||||
continue;
|
if (bookIndex >= 0) {
|
||||||
|
final int offset = this.begin + part * this.partitionSize;
|
||||||
|
final VorbisCodebook book = VorbisFormat.codebooks[bookIndex];
|
||||||
|
|
||||||
|
if (this.type == 0) {
|
||||||
|
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 {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final int offset = this.begin + part * this.partitionSize;
|
++part;
|
||||||
final VorbisCodebook book = VorbisFormat.codebooks[bookIndex];
|
if (part >= partitionCount) {
|
||||||
|
break;
|
||||||
if (this.type == 0) {
|
|
||||||
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 {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user