Revision 8cde1b79

View differences:

libavcodec/vp8.c
162 162

  
163 163
        /**
164 164
         * filter strength adjustment for the following macroblock modes:
165
         * [0] - i4x4
166
         * [1] - zero mv
167
         * [2] - inter modes except for zero or split mv
168
         * [3] - split mv
165
         * [0-3] - i16x16 (always zero)
166
         * [4]   - i4x4
167
         * [5]   - zero mv
168
         * [6]   - inter modes except for zero or split mv
169
         * [7]   - split mv
169 170
         *  i16x16 modes never have any adjustment
170 171
         */
171
        int8_t mode[4];
172
        int8_t mode[VP8_MVMODE_SPLIT+1];
172 173

  
173 174
        /**
174 175
         * filter strength adjustment for macroblocks that reference:
......
278 279
    for (i = 0; i < 4; i++)
279 280
        s->lf_delta.ref[i]  = vp8_rac_get_sint(c, 6);
280 281

  
281
    for (i = 0; i < 4; i++)
282
    for (i = MODE_I4x4; i <= VP8_MVMODE_SPLIT; i++)
282 283
        s->lf_delta.mode[i] = vp8_rac_get_sint(c, 6);
283 284
}
284 285

  
......
762 763
        // motion vectors, 16.3
763 764
        find_near_mvs(s, mb, near, &best, cnt);
764 765
        if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[0]][0])) {
766
            mb->mode = VP8_MVMODE_MV;
765 767
            if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[1]][1])) {
766 768
                if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[2]][2])) {
767 769
                    if (vp56_rac_get_prob_branchy(c, vp8_mode_contexts[cnt[3]][3])) {
......
769 771
                        clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y);
770 772
                        mb->mv = mb->bmv[decode_splitmvs(s, c, mb) - 1];
771 773
                    } else {
772
                        mb->mode = VP8_MVMODE_NEW;
773 774
                        clamp_mv(s, &mb->mv, &mb->mv, mb_x, mb_y);
774 775
                        mb->mv.y += read_mv_component(c, s->prob->mvc[0]);
775 776
                        mb->mv.x += read_mv_component(c, s->prob->mvc[1]);
776 777
                    }
777
                } else {
778
                    mb->mode = VP8_MVMODE_NEAR;
778
                } else
779 779
                    clamp_mv(s, &mb->mv, &near[1], mb_x, mb_y);
780
                }
781
            } else {
782
                mb->mode = VP8_MVMODE_NEAREST;
780
            } else
783 781
                clamp_mv(s, &mb->mv, &near[0], mb_x, mb_y);
784
            }
785 782
        } else {
786 783
            mb->mode = VP8_MVMODE_ZERO;
787 784
            AV_ZERO32(&mb->mv);
......
1481 1478

  
1482 1479
    if (s->lf_delta.enabled) {
1483 1480
        filter_level += s->lf_delta.ref[mb->ref_frame];
1484

  
1485
        if (mb->ref_frame == VP56_FRAME_CURRENT) {
1486
            if (mb->mode == MODE_I4x4)
1487
                filter_level += s->lf_delta.mode[0];
1488
        } else {
1489
            if (mb->mode == VP8_MVMODE_ZERO)
1490
                filter_level += s->lf_delta.mode[1];
1491
            else if (mb->mode == VP8_MVMODE_SPLIT)
1492
                filter_level += s->lf_delta.mode[3];
1493
            else
1494
                filter_level += s->lf_delta.mode[2];
1495
        }
1481
        filter_level += s->lf_delta.mode[mb->mode];
1496 1482
    }
1497 1483
    filter_level = av_clip(filter_level, 0, 63);
1498 1484

  
libavcodec/vp8data.h
48 48
#define MODE_I4x4 4
49 49

  
50 50
enum inter_mvmode {
51
    VP8_MVMODE_NEAREST = MODE_I4x4 + 1,
52
    VP8_MVMODE_NEAR,
53
    VP8_MVMODE_ZERO,
54
    VP8_MVMODE_NEW,
51
    VP8_MVMODE_ZERO = MODE_I4x4 + 1,
52
    VP8_MVMODE_MV,
55 53
    VP8_MVMODE_SPLIT
56 54
};
57 55

  

Also available in: Unified diff