shithub: dav1d

Download patch

ref: 3fa2f04f23482dcb97207096c3206605aa53539e
parent: b28788c0275e150b17c209effb5d4dee34bfb5ef
author: Niklas Haas <[email protected]>
date: Thu Nov 22 15:52:30 EST 2018

film_grain: don't attempt copying chroma planes for I400

Fixes #191

--- a/src/film_grain_tmpl.c
+++ b/src/film_grain_tmpl.c
@@ -521,12 +521,14 @@
         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]);
+            }
         }
     }
 }