Dominic Szablewski 12 anni fa
parent
commit
42d5720608
1 ha cambiato i file con 4 aggiunte e 9 eliminazioni
  1. 4 9
      jsmpg.js

+ 4 - 9
jsmpg.js Vedi File

271
 	this.pictureCodingType = this.buffer.getBits(3);
271
 	this.pictureCodingType = this.buffer.getBits(3);
272
 	this.buffer.advance(16); // skip vbv_delay
272
 	this.buffer.advance(16); // skip vbv_delay
273
 	
273
 	
274
-	// Skip D-pictures or unknown coding type
275
-	if( this.pictureCodingType <= 0 || this.pictureCodingType >= PICTURE_TYPE_D ) {
274
+	// Skip B and D frames or unknown coding type
275
+	if( this.pictureCodingType <= 0 || this.pictureCodingType >= PICTURE_TYPE_B ) {
276
 		return;
276
 		return;
277
 	}
277
 	}
278
 	
278
 	
279
 	// full_pel_forward, forward_f_code
279
 	// full_pel_forward, forward_f_code
280
-	if( this.pictureCodingType == PICTURE_TYPE_P || this.pictureCodingType == PICTURE_TYPE_B ) {
280
+	if( this.pictureCodingType == PICTURE_TYPE_P ) {
281
 		this.fullPelForward = this.buffer.getBits(1);
281
 		this.fullPelForward = this.buffer.getBits(1);
282
 		this.forwardFCode = this.buffer.getBits(3);
282
 		this.forwardFCode = this.buffer.getBits(3);
283
 		if( this.forwardFCode == 0 ) {
283
 		if( this.forwardFCode == 0 ) {
288
 		this.forwardF = 1 << this.forwardRSize;
288
 		this.forwardF = 1 << this.forwardRSize;
289
 	}
289
 	}
290
 	
290
 	
291
-	// full_pel_backward, backward_f_code
292
-	if( this.pictureCodingType == PICTURE_TYPE_B ) {
293
-		// We can't deal with B frames
294
-		return;
295
-	}
296
-	
297
 	var code = 0;
291
 	var code = 0;
298
 	do {
292
 	do {
299
 		code = this.buffer.findNextMPEGStartCode();
293
 		code = this.buffer.findNextMPEGStartCode();
334
 	var pCb = this.currentCb;
328
 	var pCb = this.currentCb;
335
 	var pCr = this.currentCr;
329
 	var pCr = this.currentCr;
336
 	var pRGBA = this.currentRGBA.data;
330
 	var pRGBA = this.currentRGBA.data;
331
+	
337
 
332
 
338
 
333
 
339
 	// Chroma values are the same for each block of 4 pixels, so we proccess
334
 	// Chroma values are the same for each block of 4 pixels, so we proccess