ref: 95233f9e9f688243cc3fd863c76c68a1e0821170
parent: 61a03c2924fbebb2a58640ccf01fb96befe9aa39
author: Martin Storsjö <martin@martin.st>
date: Thu Feb 7 10:15:59 EST 2019
Avoid warnings about variables being truncated by changing the type of variables
--- a/src/cdef_apply_tmpl.c
+++ b/src/cdef_apply_tmpl.c
@@ -58,7 +58,7 @@
const ptrdiff_t src_stride[2], int x_off,
const enum Dav1dPixelLayout layout)
{
- for (int y = 0, y_off = 0; y < 8; y++, y_off += PXSTRIDE(src_stride[0]))
+ for (ptrdiff_t y = 0, y_off = 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 +66,7 @@
const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
x_off >>= ss_hor;
- for (int y = 0, y_off = 0; y < (8 >> ss_ver); y++, y_off += PXSTRIDE(src_stride[1])) {
+ for (ptrdiff_t y = 0, y_off = 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);
}
--- a/src/lr_apply_tmpl.c
+++ b/src/lr_apply_tmpl.c
@@ -107,7 +107,7 @@
void bytefn(dav1d_lr_copy_lpf)(Dav1dFrameContext *const f,
/*const*/ pixel *const src[3], const int sby)
{
- const ptrdiff_t offset = 8 * !!sby;
+ const int offset = 8 * !!sby;
const ptrdiff_t *const src_stride = f->cur.stride;
const ptrdiff_t lr_stride = ((f->sr_cur.p.p.w + 31) & ~31) * sizeof(pixel);
@@ -132,7 +132,7 @@
const int h = (f->cur.p.h + ss_ver) >> ss_ver;
const int w = f->bw << (2 - ss_hor);
const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h - 1);
- const ptrdiff_t offset_uv = offset >> ss_ver;
+ const int offset_uv = offset >> ss_ver;
const int y_stripe =
(sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
@@ -277,7 +277,7 @@
void bytefn(dav1d_lr_sbrow)(Dav1dFrameContext *const f, pixel *const dst[3],
const int sby)
{
- const ptrdiff_t offset_y = 8 * !!sby;
+ const int offset_y = 8 * !!sby;
const ptrdiff_t *const dst_stride = f->sr_cur.p.stride;
const int restore_planes =
@@ -299,7 +299,7 @@
const int h = (f->sr_cur.p.p.h + ss_ver) >> ss_ver;
const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h);
- const ptrdiff_t offset_uv = offset_y >> ss_ver;
+ const int offset_uv = offset_y >> ss_ver;
const int y_stripe =
(sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
if (restore_planes & LR_RESTORE_U)
--- a/src/recon_tmpl.c
+++ b/src/recon_tmpl.c
@@ -1247,7 +1247,7 @@
// chroma prediction
if (is_sub8x8) {
assert(ss_hor == 1);
- int h_off = 0, v_off = 0;
+ ptrdiff_t h_off = 0, v_off = 0;
if (bw4 == 1 && bh4 == ss_ver) {
for (int pl = 0; pl < 2; pl++) {
res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,