34 s->idsp.perm_type =
w->wdsp.idct_perm;
42 s->idsp.idct_permutation);
44 s->idsp.idct_permutation);
45 s->idsp.idct_put =
w->wdsp.idct_put;
46 s->idsp.idct_add =
w->wdsp.idct_add;
51 uint8_t *dest_cb, uint8_t *dest_cr,
53 int motion_x,
int motion_y,
int h)
57 int dxy, mx, my, src_x, src_y, v_edge_pos;
58 ptrdiff_t
offset, linesize, uvlinesize;
61 dxy = ((motion_y & 1) << 1) | (motion_x & 1);
62 dxy = 2 * dxy +
w->hshift;
63 src_x =
s->mb_x * 16 + (motion_x >> 1);
64 src_y =
s->mb_y * 16 + (motion_y >> 1);
67 v_edge_pos =
s->v_edge_pos;
68 src_x =
av_clip(src_x, -16,
s->width);
69 src_y =
av_clip(src_y, -16,
s->height);
71 if (src_x <= -16 || src_x >=
s->width)
73 if (src_y <= -16 || src_y >=
s->height)
76 linesize =
s->linesize;
77 uvlinesize =
s->uvlinesize;
78 ptr = ref_picture[0] + (src_y * linesize) + src_x;
80 if (src_x < 1 || src_y < 1 || src_x + 17 >=
s->h_edge_pos ||
81 src_y +
h + 1 >= v_edge_pos) {
82 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr - 1 -
s->linesize,
83 s->linesize,
s->linesize, 19, 19,
85 s->h_edge_pos,
s->v_edge_pos);
86 ptr =
s->sc.edge_emu_buffer + 1 +
s->linesize;
90 w->wdsp.put_mspel_pixels_tab[dxy](dest_y, ptr, linesize);
91 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8, ptr + 8, linesize);
92 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 * linesize, ptr + 8 * linesize, linesize);
93 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 + 8 * linesize, ptr + 8 + 8 * linesize, linesize);
99 if ((motion_x & 3) != 0)
101 if ((motion_y & 3) != 0)
106 src_x =
s->mb_x * 8 + mx;
107 src_y =
s->mb_y * 8 + my;
108 src_x =
av_clip(src_x, -8,
s->width >> 1);
109 if (src_x == (
s->width >> 1))
111 src_y =
av_clip(src_y, -8,
s->height >> 1);
112 if (src_y == (
s->height >> 1))
114 offset = (src_y * uvlinesize) + src_x;
115 ptr = ref_picture[1] +
offset;
117 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr,
118 s->uvlinesize,
s->uvlinesize,
121 s->h_edge_pos >> 1,
s->v_edge_pos >> 1);
122 ptr =
s->sc.edge_emu_buffer;
124 pix_op[1][dxy](dest_cb, ptr, uvlinesize,
h >> 1);
126 ptr = ref_picture[2] +
offset;
128 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr,
129 s->uvlinesize,
s->uvlinesize,
132 s->h_edge_pos >> 1,
s->v_edge_pos >> 1);
133 ptr =
s->sc.edge_emu_buffer;
135 pix_op[1][dxy](dest_cr, ptr, uvlinesize,
h >> 1);