- const uint8_t *srcp_above = srcp - src_linesize[plane];
- const uint8_t *srcp_below = srcp + src_linesize[plane];
- if (h == lines) srcp_above = srcp; // there is no line above
- if (h == 1) srcp_below = srcp; // there is no line below
+ ptrdiff_t pref = src_linesize[plane];
+ ptrdiff_t mref = -pref;
+ if (h == lines) mref = 0; // there is no line above
+ else if (h == 1) pref = 0; // there is no line below