shithub: dav1d

Download patch

ref: a7c024ce073bfecff3c794685b31a2cc59a71f19
parent: c688d5b24690c52294620e1a859f8948b349ec85
author: James Almer <[email protected]>
date: Wed Oct 9 19:09:40 EDT 2019

x86: fix generate_grain_uv checkasm crashes on Windows x64

The uv argument is normally in a gpr, but in checkasm it's forcefully
loaded from stack.

--- a/src/film_grain.h
+++ b/src/film_grain.h
@@ -51,7 +51,7 @@
 #define decl_generate_grain_uv_fn(name) \
 void (name)(entry buf[][GRAIN_WIDTH], \
             const entry buf_y[][GRAIN_WIDTH], \
-            const Dav1dFilmGrainData *const data, const int uv HIGHBD_DECL_SUFFIX)
+            const Dav1dFilmGrainData *const data, const intptr_t uv HIGHBD_DECL_SUFFIX)
 typedef decl_generate_grain_uv_fn(*generate_grain_uv_fn);
 
 #define decl_fgy_32x32xn_fn(name) \
--- a/src/film_grain_tmpl.c
+++ b/src/film_grain_tmpl.c
@@ -88,7 +88,7 @@
 static NOINLINE void
 generate_grain_uv_c(entry buf[][GRAIN_WIDTH],
                     const entry buf_y[][GRAIN_WIDTH],
-                    const Dav1dFilmGrainData *const data, const int uv,
+                    const Dav1dFilmGrainData *const data, const intptr_t uv,
                     const int subx, const int suby HIGHBD_DECL_SUFFIX)
 {
     const int bitdepth_min_8 = bitdepth_from_max(bitdepth_max) - 8;
--- a/tests/checkasm/filmgrain.c
+++ b/tests/checkasm/filmgrain.c
@@ -85,7 +85,7 @@
 
     declare_func(void, entry grain_lut[][GRAIN_WIDTH],
                  const entry grain_lut_y[][GRAIN_WIDTH],
-                 const Dav1dFilmGrainData *data, int uv HIGHBD_DECL_SUFFIX);
+                 const Dav1dFilmGrainData *data, intptr_t uv HIGHBD_DECL_SUFFIX);
 
     for (int layout_idx = 0; layout_idx < 3; layout_idx++) {
         const enum Dav1dPixelLayout layout = layout_idx + 1;