Commit 8d238cdd authored by David Michael Barr's avatar David Michael Barr

Remove dual-plane chroma-from-luma prediction

parent 59c3370e
...@@ -650,40 +650,6 @@ cfl_pred_1_fn( 8) ...@@ -650,40 +650,6 @@ cfl_pred_1_fn( 8)
cfl_pred_1_fn(16) cfl_pred_1_fn(16)
cfl_pred_1_fn(32) cfl_pred_1_fn(32)
static NOINLINE void
cfl_pred_c(pixel *dstU, pixel *dstV, const ptrdiff_t stride, const int16_t *ac,
const int8_t *const alphas, const int width, const int height)
{
const pixel dcU = *dstU, dcV = *dstV;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
const int diff1 = alphas[0] * ac[x];
dstU[x] = iclip_pixel(dcU + apply_sign((abs(diff1) + 32) >> 6, diff1));
const int diff2 = alphas[1] * ac[x];
dstV[x] = iclip_pixel(dcV + apply_sign((abs(diff2) + 32) >> 6, diff2));
}
ac += width;
dstU += PXSTRIDE(stride);
dstV += PXSTRIDE(stride);
}
}
#define cfl_pred_fn(width) \
static void cfl_pred_##width##xN_c(pixel *const dstU, \
pixel *const dstV, \
const ptrdiff_t stride, \
const int16_t *const ac, \
const int8_t *const alphas, \
const int height) \
{ \
cfl_pred_c(dstU, dstV, stride, ac, alphas, width, height); \
}
cfl_pred_fn( 4)
cfl_pred_fn( 8)
cfl_pred_fn(16)
cfl_pred_fn(32)
static void pal_pred_c(pixel *dst, const ptrdiff_t stride, static void pal_pred_c(pixel *dst, const ptrdiff_t stride,
const uint16_t *const pal, const uint8_t *idx, const uint16_t *const pal, const uint8_t *idx,
const int w, const int h) const int w, const int h)
...@@ -752,11 +718,6 @@ void bitfn(dav1d_intra_pred_dsp_init)(Dav1dIntraPredDSPContext *const c) { ...@@ -752,11 +718,6 @@ void bitfn(dav1d_intra_pred_dsp_init)(Dav1dIntraPredDSPContext *const c) {
c->cfl_pred_1[2] = cfl_pred_1_16xN_c; c->cfl_pred_1[2] = cfl_pred_1_16xN_c;
c->cfl_pred_1[3] = cfl_pred_1_32xN_c; c->cfl_pred_1[3] = cfl_pred_1_32xN_c;
c->cfl_pred[0] = cfl_pred_4xN_c;
c->cfl_pred[1] = cfl_pred_8xN_c;
c->cfl_pred[2] = cfl_pred_16xN_c;
c->cfl_pred[3] = cfl_pred_32xN_c;
c->pal_pred = pal_pred_c; c->pal_pred = pal_pred_c;
#if HAVE_ASM && ARCH_X86 #if HAVE_ASM && ARCH_X86
......
...@@ -65,16 +65,6 @@ void (name)(pixel *dst, ptrdiff_t stride, \ ...@@ -65,16 +65,6 @@ void (name)(pixel *dst, ptrdiff_t stride, \
const int height) const int height)
typedef decl_cfl_pred_1_fn(*cfl_pred_1_fn); typedef decl_cfl_pred_1_fn(*cfl_pred_1_fn);
/*
* dst[plane][x,y] += alpha[plane] * ac[x,y]
* - alphas contains two q3 scalars (one for each plane) in [-16,16] range;
*/
#define decl_cfl_pred_fn(name) \
void (name)(pixel *u_dst, pixel *v_dst, ptrdiff_t stride, \
const int16_t *ac, const int8_t *const alphas, \
const int height)
typedef decl_cfl_pred_fn(*cfl_pred_fn);
/* /*
* dst[x,y] = pal[idx[x,y]] * dst[x,y] = pal[idx[x,y]]
* - palette indices are [0-7] * - palette indices are [0-7]
...@@ -90,7 +80,6 @@ typedef struct Dav1dIntraPredDSPContext { ...@@ -90,7 +80,6 @@ typedef struct Dav1dIntraPredDSPContext {
// chroma-from-luma // chroma-from-luma
cfl_ac_fn cfl_ac[3 /* 420, 422, 444 */][N_RECT_TX_SIZES /* chroma tx size */]; cfl_ac_fn cfl_ac[3 /* 420, 422, 444 */][N_RECT_TX_SIZES /* chroma tx size */];
cfl_pred_1_fn cfl_pred_1[4]; cfl_pred_1_fn cfl_pred_1[4];
cfl_pred_fn cfl_pred[4];
// palette // palette
pal_pred_fn pal_pred; pal_pred_fn pal_pred;
......
...@@ -851,6 +851,14 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize ...@@ -851,6 +851,14 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
const TxfmInfo *const cfl_uv_t_dim = const TxfmInfo *const cfl_uv_t_dim =
&dav1d_txfm_dimensions[cfl_uvtx]; &dav1d_txfm_dimensions[cfl_uvtx];
const int furthest_r =
((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1);
const int furthest_b =
((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1);
dsp->ipred.cfl_ac[f->cur.p.p.layout - 1]
[cfl_uvtx](ac, y_src, f->cur.p.stride[0],
cbw4 - (furthest_r >> ss_hor),
cbh4 - (furthest_b >> ss_ver));
for (int pl = 0; pl < 2; pl++) { for (int pl = 0; pl < 2; pl++) {
int angle = 0; int angle = 0;
const pixel *top_sb_edge = NULL; const pixel *top_sb_edge = NULL;
...@@ -875,26 +883,12 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize ...@@ -875,26 +883,12 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
dsp->ipred.intra_pred[m](uv_dst[pl], stride, edge, dsp->ipred.intra_pred[m](uv_dst[pl], stride, edge,
cfl_uv_t_dim->w * 4, cfl_uv_t_dim->w * 4,
cfl_uv_t_dim->h * 4, 0); cfl_uv_t_dim->h * 4, 0);
} if (b->cfl_alpha[pl]) {
const int furthest_r = dsp->ipred.cfl_pred_1[cfl_uv_t_dim->lw](uv_dst[pl],
((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1); stride, ac,
const int furthest_b = b->cfl_alpha[pl],
((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1); cbh4 * 4);
dsp->ipred.cfl_ac[f->cur.p.p.layout - 1] }
[cfl_uvtx](ac, y_src, f->cur.p.stride[0],
cbw4 - (furthest_r >> ss_hor),
cbh4 - (furthest_b >> ss_ver));
if (b->cfl_alpha[0] && b->cfl_alpha[1]) {
dsp->ipred.cfl_pred[cfl_uv_t_dim->lw](uv_dst[0],
uv_dst[1], stride,
ac, b->cfl_alpha,
cbh4 * 4);
} else {
const int pl = !b->cfl_alpha[0];
dsp->ipred.cfl_pred_1[cfl_uv_t_dim->lw](uv_dst[pl],
stride, ac,
b->cfl_alpha[pl],
cbh4 * 4);
} }
if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) { if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
ac_dump(ac, 4*cbw4, 4*cbh4, "ac"); ac_dump(ac, 4*cbw4, 4*cbh4, "ac");
......
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