Revision 037df60e

View differences:

libavcodec/mpeg12.c
374 374
                s->qscale = get_qscale(s);
375 375

  
376 376
            /* motion vectors */
377
            s->mv_dir = 0;
377
            s->mv_dir= (mb_type>>13)&3;
378 378
            dprintf(s->avctx, "motion_type=%d\n", motion_type);
379 379
            switch(motion_type) {
380 380
            case MT_FRAME: /* or MT_16X8 */
......
383 383
                    s->mv_type = MV_TYPE_16X16;
384 384
                    for(i=0;i<2;i++) {
385 385
                        if (USES_LIST(mb_type, i)) {
386
                            s->mv_dir |= (MV_DIR_FORWARD << i);
387 386
                            /* MT_FRAME */
388 387
                            s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
389 388
                                mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
......
401 400
                    s->mv_type = MV_TYPE_16X8;
402 401
                    for(i=0;i<2;i++) {
403 402
                        if (USES_LIST(mb_type, i)) {
404
                            s->mv_dir |= (MV_DIR_FORWARD << i);
405 403
                            /* MT_16X8 */
406 404
                            for(j=0;j<2;j++) {
407 405
                                s->field_select[i][j] = get_bits1(&s->gb);
......
422 420
                    mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
423 421
                    for(i=0;i<2;i++) {
424 422
                        if (USES_LIST(mb_type, i)) {
425
                            s->mv_dir |= (MV_DIR_FORWARD << i);
426 423
                            for(j=0;j<2;j++) {
427 424
                                s->field_select[i][j] = get_bits1(&s->gb);
428 425
                                val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
......
442 439
                    mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
443 440
                    for(i=0;i<2;i++) {
444 441
                        if (USES_LIST(mb_type, i)) {
445
                            s->mv_dir |= (MV_DIR_FORWARD << i);
446 442
                            s->field_select[i][0] = get_bits1(&s->gb);
447 443
                            for(k=0;k<2;k++) {
448 444
                                val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
......
460 456
                for(i=0;i<2;i++) {
461 457
                    if (USES_LIST(mb_type, i)) {
462 458
                        int dmx, dmy, mx, my, m;
463
                        s->mv_dir |= (MV_DIR_FORWARD << i);
464 459
                        mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
465 460
                                                s->last_mv[i][0][0]);
466 461
                        s->last_mv[i][0][0] = mx;

Also available in: Unified diff