Revision ac3c04e4

View differences:

libavcodec/vp8.c
1218 1218
            vp8_mc_func mc_func[3][3])
1219 1219
{
1220 1220
    if (AV_RN32A(mv)) {
1221
        static const uint8_t idx[8] = { 0, 1, 2, 1, 2, 1, 2, 1 };
1222
        int mx = (mv->x << luma)&7, mx_idx = idx[mx];
1223
        int my = (mv->y << luma)&7, my_idx = idx[my];
1221
        static const uint8_t idx[3][8] = {
1222
            { 0, 1, 2, 1, 2, 1, 2, 1 }, // nr. of left extra pixels,
1223
                                        // also function pointer index
1224
            { 0, 3, 5, 3, 5, 3, 5, 3 }, // nr. of extra pixels required
1225
            { 0, 2, 3, 2, 3, 2, 3, 2 }, // nr. of right extra pixels
1226
        };
1227
        int mx = (mv->x << luma)&7, mx_idx = idx[0][mx];
1228
        int my = (mv->y << luma)&7, my_idx = idx[0][my];
1224 1229

  
1225 1230
        x_off += mv->x >> (3 - luma);
1226 1231
        y_off += mv->y >> (3 - luma);
1227 1232

  
1228 1233
        // edge emulation
1229 1234
        src += y_off * linesize + x_off;
1230
        if (x_off < 2 || x_off >= width  - block_w - 3 ||
1231
            y_off < 2 || y_off >= height - block_h - 3) {
1232
            ff_emulated_edge_mc(s->edge_emu_buffer, src - 2 * linesize - 2, linesize,
1233
                                block_w + 5, block_h + 5,
1234
                                x_off - 2, y_off - 2, width, height);
1235
            src = s->edge_emu_buffer + 2 + linesize * 2;
1235
        if (x_off < mx_idx || x_off >= width  - block_w - idx[2][mx] ||
1236
            y_off < my_idx || y_off >= height - block_h - idx[2][my]) {
1237
            ff_emulated_edge_mc(s->edge_emu_buffer, src - my_idx * linesize - mx_idx, linesize,
1238
                                block_w + idx[1][mx], block_h + idx[1][my],
1239
                                x_off - mx_idx, y_off - my_idx, width, height);
1240
            src = s->edge_emu_buffer + mx_idx + linesize * my_idx;
1236 1241
        }
1237 1242
        mc_func[my_idx][mx_idx](dst, linesize, src, linesize, block_h, mx, my);
1238 1243
    } else

Also available in: Unified diff