Commit 3fa2f04f authored by Niklas Haas's avatar Niklas Haas Committed by Janne Grunau

film_grain: don't attempt copying chroma planes for I400

Fixes #191
parent b28788c0
......@@ -521,12 +521,14 @@ void bitfn(dav1d_apply_grain)(Dav1dPicture *const out,
memcpy(out->data[0], in->data[0], out->p.h * out->stride[0]);
}
for (int i = 0; i < 2; i++) {
if (!data->num_uv_points[i] && !data->chroma_scaling_from_luma) {
const int suby = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
assert(out->stride[1] == in->stride[1]);
memcpy(out->data[1+i], in->data[1+i],
(out->p.h >> suby) * out->stride[1]);
if (in->p.layout != DAV1D_PIXEL_LAYOUT_I400) {
for (int i = 0; i < 2; i++) {
if (!data->num_uv_points[i] && !data->chroma_scaling_from_luma) {
const int suby = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
assert(out->stride[1] == in->stride[1]);
memcpy(out->data[1+i], in->data[1+i],
(out->p.h >> suby) * out->stride[1]);
}
}
}
}
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