Commit ed129818 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Change stride of emu_edge buffer from 160 to 192

To account for overwrites of up to 31 pixels and widths of up to
128+7=135 pixels, yet still be aligned to 32.
parent 47a581a5
......@@ -117,7 +117,7 @@ int dav1d_open(Dav1dContext **const c_out,
if (!t->scratch.mem) goto error;
memset(t->cf, 0, 32 * 32 * sizeof(int32_t));
t->emu_edge =
dav1d_alloc_aligned(160 * (128 + 7) * sizeof(uint16_t), 32);
dav1d_alloc_aligned(192 * (128 + 7) * sizeof(uint16_t), 32);
if (!t->emu_edge) goto error;
if (f->n_tc > 1) {
pthread_mutex_init(&t->tile_thread.td.lock, NULL);
......
......@@ -530,10 +530,10 @@ static int mc(Dav1dTileContext *const t,
{
f->dsp->mc.emu_edge(bw4 * h_mul + !!mx * 7, bh4 * v_mul + !!my * 7,
w, h, dx - !!mx * 3, dy - !!my * 3,
t->emu_edge, 160 * sizeof(pixel),
t->emu_edge, 192 * sizeof(pixel),
refp->p.data[pl], ref_stride);
ref = &t->emu_edge[160 * !!my * 3 + !!mx * 3];
ref_stride = 160 * sizeof(pixel);
ref = &t->emu_edge[192 * !!my * 3 + !!mx * 3];
ref_stride = 192 * sizeof(pixel);
} else {
ref = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
}
......@@ -668,10 +668,10 @@ static int warp_affine(Dav1dTileContext *const t,
}
if (dx < 3 || dx + 8 + 4 > width || dy < 3 || dy + 8 + 4 > height) {
f->dsp->mc.emu_edge(15, 15, width, height, dx - 3, dy - 3,
t->emu_edge, 160 * sizeof(pixel),
t->emu_edge, 192 * sizeof(pixel),
refp->p.data[pl], ref_stride);
ref_ptr = &t->emu_edge[160 * 3 + 3];
ref_stride = 160 * sizeof(pixel);
ref_ptr = &t->emu_edge[192 * 3 + 3];
ref_stride = 192 * sizeof(pixel);
} else {
ref_ptr = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment