shithub: dav1d

Download patch

ref: 703c72fd3ff43365929c6181662ba5495349cc46
parent: 65d963d4cd1a2bc2f6990b78137b603cd1326c73
author: Martin Storsjö <[email protected]>
date: Fri Feb 8 05:29:29 EST 2019

cdef_apply_tmpl: Restore the y variables to int

Split out y_off as a separate declaration outside of the for loop,
with ptrdiff_t type.

--- a/src/cdef_apply_tmpl.c
+++ b/src/cdef_apply_tmpl.c
@@ -58,7 +58,8 @@
                       const ptrdiff_t src_stride[2], int x_off,
                       const enum Dav1dPixelLayout layout)
 {
-    for (ptrdiff_t y = 0, y_off = 0; y < 8; y++, y_off += PXSTRIDE(src_stride[0]))
+    ptrdiff_t y_off = 0;
+    for (int y = 0; y < 8; y++, y_off += PXSTRIDE(src_stride[0]))
         pixel_copy(dst[0][y], &src[0][y_off + x_off - 2], 2);
 
     if (layout == DAV1D_PIXEL_LAYOUT_I400) return;
@@ -66,7 +67,8 @@
     const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
 
     x_off >>= ss_hor;
-    for (ptrdiff_t y = 0, y_off = 0; y < (8 >> ss_ver); y++, y_off += PXSTRIDE(src_stride[1])) {
+    y_off = 0;
+    for (int y = 0; y < (8 >> ss_ver); y++, y_off += PXSTRIDE(src_stride[1])) {
         pixel_copy(dst[1][y], &src[1][y_off + x_off - 2], 2);
         pixel_copy(dst[2][y], &src[2][y_off + x_off - 2], 2);
     }