Revision cb231c48

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);
tests/ffmpeg.regression.ref
1 1
ffmpeg regression test
2
6787ecce1da78d5e0cdeb35931f3212c *./data/a-mpeg1.mpg
2
b85daef6da4204e2f85376a34d9ada8d *./data/a-mpeg1.mpg
3 3
6713259d72260740bbddaea30631ea18 *./data/out.yuv
4 4
stddev:  7.58 bytes:7299072
5
40b1ce56144067f5c8d4df422705ae6a *./data/a-mpeg2.vob
5
6640be3963445c470f148382aab77af0 *./data/a-mpeg2.vob
6 6
9f5d85c6473b802a9d86cfc01a3ed046 *./data/out.yuv
7 7
stddev:  7.66 bytes:7450624
8 8
d0dc46dd831398237a690ebbeff18b64 *./data/a-msmpeg4v2.avi
......
35 35
2cbab98ebef5fbd229c66fb6435bf9a2 *./data/a-mpeg4-adv.avi
36 36
b54262af56f6681186fa2c44e4ef6ec7 *./data/out.yuv
37 37
stddev:  7.32 bytes:7602176
38
5515306aa3c69112ee627023856bd696 *./data/a-mpeg1b.mpg
38
3fd47ba846e8d7631304d945af410da2 *./data/a-mpeg1b.mpg
39 39
bd047a4567c366566da96874d176199d *./data/out.yuv
40 40
stddev:  6.35 bytes:6993920
41 41
07042f42b3119c39eb26537a84a451df *./data/a-mjpeg.avi
tests/rotozoom.regression.ref
1 1
ffmpeg regression test
2
6dce999b1f02a94dfd6d6222caf06ff1 *./data/a-mpeg1.mpg
2
31334d408162b55725075347e382d313 *./data/a-mpeg1.mpg
3 3
0cf790edd0f4c5cf993c2d59211b9de2 *./data/out.yuv
4 4
stddev:  4.91 bytes:7299072
5
bbb41fb21c836cff975442e583702216 *./data/a-mpeg2.vob
5
8d7dcc133e04f24f3fb40cdada990b24 *./data/a-mpeg2.vob
6 6
f5436b327c38b66eb95f3428aff790f1 *./data/out.yuv
7 7
stddev:  4.94 bytes:7450624
8 8
14db391f167b52b21a983157b410affc *./data/a-msmpeg4v2.avi
......
35 35
aeb300900461bdf9e0321934aa6dcc93 *./data/a-mpeg4-adv.avi
36 36
e465df12f2c8a6492a6ec0b1bddc1d0d *./data/out.yuv
37 37
stddev:  4.97 bytes:7602176
38
fc873784878d9588e748c1494df606be *./data/a-mpeg1b.mpg
38
33c05290014210e4fb890a11954e1a00 *./data/a-mpeg1b.mpg
39 39
c9b8f923d91d6a574b0673e05fd2d6bd *./data/out.yuv
40 40
stddev:  4.61 bytes:6993920
41 41
e9218a1db885fe0262e88f9df630307d *./data/a-mjpeg.avi

Also available in: Unified diff