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

film_grain: don't attempt copying chroma planes for I400

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