Procházet zdrojové kódy

YCbCr planes only need to be 8bit, clamped

Dominic Szablewski před 12 roky
rodič
revize
170a24e110
2 změnil soubory, kde provedl 9 přidání a 9 odebrání
  1. 0 0
      README.md
  2. 9 9
      jsmpg.js

+ 0 - 0
README.md Zobrazit soubor


+ 9 - 9
jsmpg.js Zobrazit soubor

226
 	this.sequenceStarted = true;
226
 	this.sequenceStarted = true;
227
 	
227
 	
228
 	// Allocated buffers and resize the canvas
228
 	// Allocated buffers and resize the canvas
229
-	this.currentY = new Int16Array(this.codedSize);
230
-	this.currentCr = new Int16Array(this.codedSize >> 2);
231
-	this.currentCb = new Int16Array(this.codedSize >> 2);
229
+	this.currentY = new Uint8ClampedArray(this.codedSize);
230
+	this.currentCr = new Uint8ClampedArray(this.codedSize >> 2);
231
+	this.currentCb = new Uint8ClampedArray(this.codedSize >> 2);
232
 	
232
 	
233
-	this.forwardY = new Int16Array(this.codedSize);
234
-	this.forwardCr = new Int16Array(this.codedSize >> 2);
235
-	this.forwardCb = new Int16Array(this.codedSize >> 2);
233
+	this.forwardY = new Uint8ClampedArray(this.codedSize);
234
+	this.forwardCr = new Uint8ClampedArray(this.codedSize >> 2);
235
+	this.forwardCb = new Uint8ClampedArray(this.codedSize >> 2);
236
 	
236
 	
237
-	this.backwardY = new Int16Array(this.codedSize);
238
-	this.backwardCr = new Int16Array(this.codedSize >> 2);
239
-	this.backwardCb = new Int16Array(this.codedSize >> 2);
237
+	this.backwardY = new Uint8ClampedArray(this.codedSize);
238
+	this.backwardCr = new Uint8ClampedArray(this.codedSize >> 2);
239
+	this.backwardCb = new Uint8ClampedArray(this.codedSize >> 2);
240
 	
240
 	
241
 	this.canvas.width = this.width;
241
 	this.canvas.width = this.width;
242
 	this.canvas.height = this.height;
242
 	this.canvas.height = this.height;