|
@@ -22,7 +22,7 @@ var MP2 = function(options) {
|
22
|
22
|
this.D = new Float32Array(1024);
|
23
|
23
|
this.D.set(MP2.SYNTHESIS_WINDOW, 0);
|
24
|
24
|
this.D.set(MP2.SYNTHESIS_WINDOW, 512);
|
25
|
|
- this.V = new Float32Array(1024);
|
|
25
|
+ this.V = [new Float32Array(1024), new Float32Array(1024)];
|
26
|
26
|
this.U = new Int32Array(32);
|
27
|
27
|
this.VPos = 0;
|
28
|
28
|
|
|
@@ -242,7 +242,7 @@ MP2.prototype.decodeFrame = function(left, right) {
|
242
|
242
|
this.VPos = (this.VPos - 64) & 1023;
|
243
|
243
|
|
244
|
244
|
for (var ch = 0; ch < 2; ch++) {
|
245
|
|
- MP2.MatrixTransform(this.sample[ch], p, this.V, this.VPos);
|
|
245
|
+ MP2.MatrixTransform(this.sample[ch], p, this.V[ch], this.VPos);
|
246
|
246
|
|
247
|
247
|
// Build U, windowing, calculate output
|
248
|
248
|
JSMpeg.Fill(this.U, 0);
|
|
@@ -251,7 +251,7 @@ MP2.prototype.decodeFrame = function(left, right) {
|
251
|
251
|
var vIndex = (this.VPos % 128) >> 1;
|
252
|
252
|
while (vIndex < 1024) {
|
253
|
253
|
for (var i = 0; i < 32; ++i) {
|
254
|
|
- this.U[i] += this.D[dIndex++] * this.V[vIndex++];
|
|
254
|
+ this.U[i] += this.D[dIndex++] * this.V[ch][vIndex++];
|
255
|
255
|
}
|
256
|
256
|
|
257
|
257
|
vIndex += 128-32;
|
|
@@ -262,7 +262,7 @@ MP2.prototype.decodeFrame = function(left, right) {
|
262
|
262
|
dIndex -= (512 - 32);
|
263
|
263
|
while (vIndex < 1024) {
|
264
|
264
|
for (var i = 0; i < 32; ++i) {
|
265
|
|
- this.U[i] += this.D[dIndex++] * this.V[vIndex++];
|
|
265
|
+ this.U[i] += this.D[dIndex++] * this.V[ch][vIndex++];
|
266
|
266
|
}
|
267
|
267
|
|
268
|
268
|
vIndex += 128-32;
|