Revision 23117d69 libavcodec/vp8.c

View differences:

libavcodec/vp8.c
745 745
    } else if (vp56_rac_get_prob_branchy(c, s->prob->intra)) {
746 746
        VP56mv near[2], best;
747 747
        uint8_t cnt[4] = { 0 };
748
        uint8_t p[4];
749 748

  
750 749
        // inter MB, 16.2
751 750
        if (vp56_rac_get_prob_branchy(c, s->prob->last))
......
757 756

  
758 757
        // motion vectors, 16.3
759 758
        find_near_mvs(s, mb, mb_x, mb_y, near, &best, cnt);
760
        p[0] = vp8_mode_contexts[cnt[0]][0];
761
        p[1] = vp8_mode_contexts[cnt[1]][1];
762
        p[2] = vp8_mode_contexts[cnt[2]][2];
763
        p[3] = vp8_mode_contexts[cnt[3]][3];
764
        mb->mode = vp8_rac_get_tree(c, vp8_pred16x16_tree_mvinter, p);
765
        switch (mb->mode) {
766
        case VP8_MVMODE_SPLIT:
767
            clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y);
768
            mb->mv = mb->bmv[decode_splitmvs(s, c, mb) - 1];
769
            break;
770
        case VP8_MVMODE_ZERO:
759
        if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[0]][0])) {
760
            if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[1]][1])) {
761
                if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[2]][2])) {
762
                    if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[3]][3])) {
763
                        mb->mode = VP8_MVMODE_SPLIT;
764
                        clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y);
765
                        mb->mv = mb->bmv[decode_splitmvs(s, c, mb) - 1];
766
                    } else {
767
                        mb->mode = VP8_MVMODE_NEW;
768
                        clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y);
769
                        mb->mv.y += + read_mv_component(c, s->prob->mvc[0]);
770
                        mb->mv.x += + read_mv_component(c, s->prob->mvc[1]);
771
                    }
772
                } else {
773
                    mb->mode = VP8_MVMODE_NEAR;
774
                    clamp_mv(s, &mb->mv, &near[1], mb_x, mb_y);
775
                }
776
            } else {
777
                mb->mode = VP8_MVMODE_NEAREST;
778
                clamp_mv(s, &mb->mv, &near[0], mb_x, mb_y);
779
            }
780
        } else {
781
            mb->mode = VP8_MVMODE_ZERO;
771 782
            AV_ZERO32(&mb->mv);
772
            break;
773
        case VP8_MVMODE_NEAREST:
774
            clamp_mv(s, &mb->mv, &near[0], mb_x, mb_y);
775
            break;
776
        case VP8_MVMODE_NEAR:
777
            clamp_mv(s, &mb->mv, &near[1], mb_x, mb_y);
778
            break;
779
        case VP8_MVMODE_NEW:
780
            clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y);
781
            mb->mv.y += + read_mv_component(c, s->prob->mvc[0]);
782
            mb->mv.x += + read_mv_component(c, s->prob->mvc[1]);
783
            break;
784 783
        }
785 784
        if (mb->mode != VP8_MVMODE_SPLIT) {
786 785
            mb->partitioning = VP8_SPLITMVMODE_NONE;

Also available in: Unified diff