Revision cb231c48 libavcodec/mpeg12.c

View differences:

libavcodec/mpeg12.c
392 392
    // RAL: Forward f_code also needed for B frames
393 393
    if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
394 394
        put_bits(&s->pb, 1, 0); /* half pel coordinates */
395
        put_bits(&s->pb, 3, s->f_code); /* forward_f_code */
395
        if(s->codec_id == CODEC_ID_MPEG1VIDEO)
396
            put_bits(&s->pb, 3, s->f_code); /* forward_f_code */
397
        else
398
            put_bits(&s->pb, 3, 7); /* forward_f_code */
396 399
    }
397 400
    
398 401
    // RAL: Backward f_code necessary for B frames
399 402
    if (s->pict_type == B_TYPE) {
400 403
        put_bits(&s->pb, 1, 0); /* half pel coordinates */
401
        put_bits(&s->pb, 3, s->b_code); /* backward_f_code */
404
        if(s->codec_id == CODEC_ID_MPEG1VIDEO)
405
            put_bits(&s->pb, 3, s->b_code); /* backward_f_code */
406
        else
407
            put_bits(&s->pb, 3, 7); /* backward_f_code */
402 408
    }
403 409

  
404 410
    put_bits(&s->pb, 1, 0); /* extra bit picture */
......
406 412
    if(s->codec_id == CODEC_ID_MPEG2VIDEO){
407 413
        put_header(s, EXT_START_CODE);
408 414
        put_bits(&s->pb, 4, 8); //pic ext
409
        put_bits(&s->pb, 4, s->f_code);
410
        put_bits(&s->pb, 4, s->f_code);
411
        put_bits(&s->pb, 4, s->b_code);
412
        put_bits(&s->pb, 4, s->b_code);
415
        if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
416
            put_bits(&s->pb, 4, s->f_code);
417
            put_bits(&s->pb, 4, s->f_code);
418
        }else{
419
            put_bits(&s->pb, 8, 255);
420
        }
421
        if (s->pict_type == B_TYPE) {
422
            put_bits(&s->pb, 4, s->b_code);
423
            put_bits(&s->pb, 4, s->b_code);
424
        }else{
425
            put_bits(&s->pb, 8, 255);
426
        }
413 427
        put_bits(&s->pb, 2, s->intra_dc_precision);
414 428
        put_bits(&s->pb, 2, s->picture_structure= PICT_FRAME);
415 429
        put_bits(&s->pb, 1, s->top_field_first);

Also available in: Unified diff