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,
52 uint8_t *
const *ref_picture,
54 int motion_x,
int motion_y,
int h)
58 int dxy,
mx,
my, src_x, src_y, v_edge_pos;
59 ptrdiff_t
offset, linesize, uvlinesize;
62 dxy = ((motion_y & 1) << 1) | (motion_x & 1);
63 dxy = 2 * dxy +
w->hshift;
64 src_x =
s->mb_x * 16 + (motion_x >> 1);
65 src_y =
s->mb_y * 16 + (motion_y >> 1);
68 v_edge_pos =
s->v_edge_pos;
69 src_x =
av_clip(src_x, -16,
s->width);
70 src_y =
av_clip(src_y, -16,
s->height);
72 if (src_x <= -16 || src_x >=
s->width)
74 if (src_y <= -16 || src_y >=
s->height)
77 linesize =
s->linesize;
78 uvlinesize =
s->uvlinesize;
79 ptr = ref_picture[0] + (src_y * linesize) + src_x;
81 if (src_x < 1 || src_y < 1 || src_x + 17 >=
s->h_edge_pos ||
82 src_y +
h + 1 >= v_edge_pos) {
83 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr - 1 -
s->linesize,
84 s->linesize,
s->linesize, 19, 19,
86 s->h_edge_pos,
s->v_edge_pos);
87 ptr =
s->sc.edge_emu_buffer + 1 +
s->linesize;
91 w->wdsp.put_mspel_pixels_tab[dxy](dest_y, ptr, linesize);
92 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8, ptr + 8, linesize);
93 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 * linesize, ptr + 8 * linesize, linesize);
94 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 + 8 * linesize, ptr + 8 + 8 * linesize, linesize);
100 if ((motion_x & 3) != 0)
102 if ((motion_y & 3) != 0)
107 src_x =
s->mb_x * 8 +
mx;
108 src_y =
s->mb_y * 8 +
my;
109 src_x =
av_clip(src_x, -8,
s->width >> 1);
110 if (src_x == (
s->width >> 1))
112 src_y =
av_clip(src_y, -8,
s->height >> 1);
113 if (src_y == (
s->height >> 1))
115 offset = (src_y * uvlinesize) + src_x;
116 ptr = ref_picture[1] +
offset;
118 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr,
119 s->uvlinesize,
s->uvlinesize,
122 s->h_edge_pos >> 1,
s->v_edge_pos >> 1);
123 ptr =
s->sc.edge_emu_buffer;
125 pix_op[1][dxy](dest_cb, ptr, uvlinesize,
h >> 1);
127 ptr = ref_picture[2] +
offset;
129 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr,
130 s->uvlinesize,
s->uvlinesize,
133 s->h_edge_pos >> 1,
s->v_edge_pos >> 1);
134 ptr =
s->sc.edge_emu_buffer;
136 pix_op[1][dxy](dest_cr, ptr, uvlinesize,
h >> 1);