Commit 19ba5a94 authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Fix minor reconstruction bugs for 10-bit content.

parent d88abfec
......@@ -133,26 +133,40 @@ dc_lfn(width, height,, unsigned dc = (width + height) >> 1; \
dc += topleft[-(i + 1)]; \
dc_gen)
#if BITDEPTH == 8
#define MULTIPLIER_1x2 0x5556
#define MULTIPLIER_1x4 0x3334
#define BASE_SHIFT 16
#else
#define MULTIPLIER_1x2 0xAAAB
#define MULTIPLIER_1x4 0x6667
#define BASE_SHIFT 17
#endif
dc2d_lfn( 4, 4, dc >>= 3)
dc2d_lfn( 4, 8, dc = iclip_pixel(0x5556 * dc >> 18))
dc2d_lfn( 4, 16, dc = iclip_pixel(0x3334 * dc >> 18))
dc2d_lfn( 8, 4, dc = iclip_pixel(0x5556 * dc >> 18))
dc2d_lfn( 4, 8, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 2)))
dc2d_lfn( 4, 16, dc = iclip_pixel(MULTIPLIER_1x4 * dc >> (BASE_SHIFT + 2)))
dc2d_lfn( 8, 4, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 2)))
dc2d_lfn( 8, 8, dc >>= 4)
dc2d_lfn( 8, 16, dc = iclip_pixel(0x5556 * dc >> 19))
dc2d_lfn( 8, 32, dc = iclip_pixel(0x3334 * dc >> 19))
dc2d_lfn(16, 4, dc = iclip_pixel(0x3334 * dc >> 18))
dc2d_lfn(16, 8, dc = iclip_pixel(0x5556 * dc >> 19))
dc2d_lfn( 8, 16, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 3)))
dc2d_lfn( 8, 32, dc = iclip_pixel(MULTIPLIER_1x4 * dc >> (BASE_SHIFT + 3)))
dc2d_lfn(16, 4, dc = iclip_pixel(MULTIPLIER_1x4 * dc >> (BASE_SHIFT + 2)))
dc2d_lfn(16, 8, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 3)))
dc2d_lfn(16, 16, dc >>= 5)
dc2d_lfn(16, 32, dc = iclip_pixel(0x5556 * dc >> 20))
dc2d_lfn(16, 64, dc = iclip_pixel(0x3334 * dc >> 20))
dc2d_lfn(32, 8, dc = iclip_pixel(0x3334 * dc >> 19))
dc2d_lfn(32, 16, dc = iclip_pixel(0x5556 * dc >> 20))
dc2d_lfn(16, 32, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 4)))
dc2d_lfn(16, 64, dc = iclip_pixel(MULTIPLIER_1x4 * dc >> (BASE_SHIFT + 4)))
dc2d_lfn(32, 8, dc = iclip_pixel(MULTIPLIER_1x4 * dc >> (BASE_SHIFT + 3)))
dc2d_lfn(32, 16, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 4)))
dc2d_lfn(32, 32, dc >>= 6)
dc2d_lfn(32, 64, dc = iclip_pixel(0x5556 * dc >> 21))
dc2d_lfn(64, 16, dc = iclip_pixel(0x3334 * dc >> 20))
dc2d_lfn(64, 32, dc = iclip_pixel(0x5556 * dc >> 21))
dc2d_lfn(32, 64, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 5)))
dc2d_lfn(64, 16, dc = iclip_pixel(MULTIPLIER_1x4 * dc >> (BASE_SHIFT + 4)))
dc2d_lfn(64, 32, dc = iclip_pixel(MULTIPLIER_1x2 * dc >> (BASE_SHIFT + 5)))
dc2d_lfn(64, 64, dc >>= 7)
#undef MULTIPLIER_1x2
#undef MULTIPLIER_1x4
#undef BASE_SHIFT
#define dc128_lfn(width, height) \
dc_lfn(width, height, 128, const unsigned dc = (1 << BITDEPTH) >> 1)
......
......@@ -136,16 +136,16 @@ loop_filter(pixel *dst, int E, int I, int H,
int f = iclip_diff(p1 - q1), f1, f2;
f = iclip_diff(3 * (q0 - p0) + f);
f1 = imin(f + 4, 127) >> 3;
f2 = imin(f + 3, 127) >> 3;
f1 = imin(f + 4, (128 << (BITDEPTH - 8)) - 1) >> 3;
f2 = imin(f + 3, (128 << (BITDEPTH - 8)) - 1) >> 3;
dst[strideb * -1] = iclip_pixel(p0 + f2);
dst[strideb * +0] = iclip_pixel(q0 - f1);
} else {
int f = iclip_diff(3 * (q0 - p0)), f1, f2;
f1 = imin(f + 4, 127) >> 3;
f2 = imin(f + 3, 127) >> 3;
f1 = imin(f + 4, (128 << (BITDEPTH - 8)) - 1) >> 3;
f2 = imin(f + 3, (128 << (BITDEPTH - 8)) - 1) >> 3;
dst[strideb * -1] = iclip_pixel(p0 + f2);
dst[strideb * +0] = iclip_pixel(q0 - f1);
......
......@@ -1237,8 +1237,8 @@ void bytefn(recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize bs,
0, uvdst, f->cur.p.stride[1],
top_sb_edge, m,
&angle, cbw4, cbh4, tl_edge);
dsp->ipred.intra_pred[ii_tx][m](tmp, cbw4 * 4, tl_edge, 0);
dsp->mc.blend(uvdst, f->cur.p.stride[1], tmp, cbw4 * 4,
dsp->ipred.intra_pred[ii_tx][m](tmp, cbw4 * 4 * sizeof(pixel), tl_edge, 0);
dsp->mc.blend(uvdst, f->cur.p.stride[1], tmp, cbw4 * 4 * sizeof(pixel),
cbw4 * 4, cbh4 * 4, ii_mask, cbw4 * 4);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment