Revision 1499a1f7 libavcodec/h261.c

View differences:

libavcodec/h261.c
596 596

  
597 597
static int h261_decode_mb(H261Context *h){
598 598
    MpegEncContext * const s = &h->s;
599
    int i, cbp, xy, old_mtype;
599
    int i, cbp, xy;
600 600

  
601 601
    cbp = 63;
602 602
    // Read mba
......
634 634
    s->dsp.clear_blocks(s->block[0]);
635 635

  
636 636
    // Read mtype
637
    old_mtype = h->mtype;
638 637
    h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
639 638
    h->mtype = h261_mtype_map[h->mtype];
640 639

  
......
654 653
        // 2) evaluating MVD for macroblocks in which MBA does not represent a difference of 1;
655 654
        // 3) MTYPE of the previous macroblock was not MC.
656 655
        if ( ( h->current_mba == 1 ) || ( h->current_mba == 12 ) || ( h->current_mba == 23 ) ||
657
             ( h->mba_diff != 1) || ( !IS_16X16 ( old_mtype ) ))
656
             ( h->mba_diff != 1))
658 657
        {
659 658
            h->current_mv_x = 0;
660 659
            h->current_mv_y = 0;
......
662 661

  
663 662
        h->current_mv_x= decode_mv_component(&s->gb, h->current_mv_x);
664 663
        h->current_mv_y= decode_mv_component(&s->gb, h->current_mv_y);
664
    }else{
665
        h->current_mv_x = 0;
666
        h->current_mv_y = 0;
665 667
    }
666 668

  
667 669
    // Read cbp
......
678 680
    s->mv_dir = MV_DIR_FORWARD;
679 681
    s->mv_type = MV_TYPE_16X16;
680 682
    s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
681
    if(IS_16X16 ( h->mtype )){
682
        s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation
683
        s->mv[0][0][1] = h->current_mv_y * 2;
684
    }
685
    else{
686
        h->current_mv_x = s->mv[0][0][0] = 0;
687
        h->current_mv_x = s->mv[0][0][1] = 0;
688
    }
683
    s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation
684
    s->mv[0][0][1] = h->current_mv_y * 2;
689 685

  
690 686
intra:
691 687
    /* decode each block */

Also available in: Unified diff