|
|
@@ -271,13 +271,13 @@ jsmpeg.prototype.decodePicture = function() {
|
|
271
|
271
|
this.pictureCodingType = this.buffer.getBits(3);
|
|
272
|
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
|
276
|
return;
|
|
277
|
277
|
}
|
|
278
|
278
|
|
|
279
|
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
|
281
|
this.fullPelForward = this.buffer.getBits(1);
|
|
282
|
282
|
this.forwardFCode = this.buffer.getBits(3);
|
|
283
|
283
|
if( this.forwardFCode == 0 ) {
|
|
|
@@ -288,12 +288,6 @@ jsmpeg.prototype.decodePicture = function() {
|
|
288
|
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
|
291
|
var code = 0;
|
|
298
|
292
|
do {
|
|
299
|
293
|
code = this.buffer.findNextMPEGStartCode();
|
|
|
@@ -334,6 +328,7 @@ jsmpeg.prototype.YCbCrToRGBA = function() {
|
|
334
|
328
|
var pCb = this.currentCb;
|
|
335
|
329
|
var pCr = this.currentCr;
|
|
336
|
330
|
var pRGBA = this.currentRGBA.data;
|
|
|
331
|
+
|
|
337
|
332
|
|
|
338
|
333
|
|
|
339
|
334
|
// Chroma values are the same for each block of 4 pixels, so we proccess
|