Skip to content

Commit

Permalink
optmiziation: No need to clamp Y, Cb and Cr arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Nagy committed Nov 4, 2014
1 parent 052da3a commit 21b94ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jsmpg.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,23 +520,23 @@ jsmpeg.prototype.initBuffers = function() {
}

// Allocated buffers and resize the canvas
this.currentY = new MaybeClampedUint8Array(this.codedSize);
this.currentY = new Uint8Array(this.codedSize);
this.currentY32 = new Uint32Array(this.currentY.buffer);

this.currentCr = new MaybeClampedUint8Array(this.codedSize >> 2);
this.currentCr = new Uint8Array(this.codedSize >> 2);
this.currentCr32 = new Uint32Array(this.currentCr.buffer);

this.currentCb = new MaybeClampedUint8Array(this.codedSize >> 2);
this.currentCb = new Uint8Array(this.codedSize >> 2);
this.currentCb32 = new Uint32Array(this.currentCb.buffer);


this.forwardY = new MaybeClampedUint8Array(this.codedSize);
this.forwardY = new Uint8Array(this.codedSize);
this.forwardY32 = new Uint32Array(this.forwardY.buffer);

this.forwardCr = new MaybeClampedUint8Array(this.codedSize >> 2);
this.forwardCr = new Uint8Array(this.codedSize >> 2);
this.forwardCr32 = new Uint32Array(this.forwardCr.buffer);

this.forwardCb = new MaybeClampedUint8Array(this.codedSize >> 2);
this.forwardCb = new Uint8Array(this.codedSize >> 2);
this.forwardCb32 = new Uint32Array(this.forwardCb.buffer);

this.canvas.width = this.width;
Expand Down

0 comments on commit 21b94ee

Please sign in to comment.