Commit ef677d6a authored by Janne Grunau's avatar Janne Grunau

calculate and cache the picture dimension in 4x4 blocks

parent e0c3186e
......@@ -1099,8 +1099,7 @@ static int decode_b(Dav1dTileContext *const t,
dav1d_create_lf_mask_intra(t->lf_mask, f->lf.level, f->b4_stride,
&f->frame_hdr, (const uint8_t (*)[8][2])
&ts->lflvl[b->seg_id][0][0][0],
t->bx, t->by, (f->cur.p.p.w + 3) >> 2,
(f->cur.p.p.h + 3) >> 2, bs,
t->bx, t->by, f->w4, f->h4, bs,
b->tx, b->uvtx, f->cur.p.p.layout,
&t->a->tx_lpf_y[bx4], &t->l.tx_lpf_y[by4],
has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
......@@ -1749,9 +1748,7 @@ static int decode_b(Dav1dTileContext *const t,
&ts->lflvl[b->seg_id][0][b->ref[0] + 1][!is_globalmv];
dav1d_create_lf_mask_inter(t->lf_mask, f->lf.level, f->b4_stride,
&f->frame_hdr, lf_lvls, t->bx, t->by,
(f->cur.p.p.w + 3) >> 2,
(f->cur.p.p.h + 3) >> 2,
b->skip, bs, b->tx_split,
f->w4, f->h4, b->skip, bs, b->tx_split,
b->uvtx, f->cur.p.p.layout,
&t->a->tx_lpf_y[bx4], &t->l.tx_lpf_y[by4],
has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
......@@ -2917,6 +2914,8 @@ int dav1d_submit_frame(Dav1dContext *const c) {
dav1d_thread_picture_ref(out_delayed, &f->cur);
}
f->w4 = (f->frame_hdr.width + 3) >> 2;
f->h4 = (f->frame_hdr.height + 3) >> 2;
f->bw = ((f->frame_hdr.width + 7) >> 3) << 1;
f->bh = ((f->frame_hdr.height + 7) >> 3) << 1;
f->sb128w = (f->bw + 31) >> 5;
......
......@@ -149,7 +149,7 @@ struct Dav1dFrameContext {
int ipred_edge_sz;
pixel *ipred_edge[3];
ptrdiff_t b4_stride;
int bw, bh, sb128w, sb128h, sbh, sb_shift, sb_step;
int w4, h4, bw, bh, sb128w, sb128h, sbh, sb_shift, sb_step;
uint16_t dq[NUM_SEGMENTS][3 /* plane */][2 /* dc/ac */];
const uint8_t *qm[2 /* is_1d */][N_RECT_TX_SIZES][3 /* plane */];
BlockContext *a;
......
......@@ -177,7 +177,6 @@ void bytefn(dav1d_loopfilter_sbrow)(const Dav1dFrameContext *const f,
{
int x, have_left;
// Don't filter outside the frame
const int hy4 = (f->cur.p.p.h + 3) >> 2;
const int have_top = sby > 0;
const int is_sb64 = !f->seq_hdr.sb128;
const int starty4 = (sby & is_sb64) << 4;
......@@ -188,7 +187,7 @@ void bytefn(dav1d_loopfilter_sbrow)(const Dav1dFrameContext *const f,
const int ss_hor = f->cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
const unsigned vmax = 1U << vmask, hmax = 1U << hmask;
const unsigned endy4 = starty4 + imin(hy4 - sby * sbsz, sbsz);
const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
// fix lpf strength at tile col boundaries
......
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