...
 
Commits (2)
......@@ -47,11 +47,7 @@ uint8_t *dav1d_data_create_internal(Dav1dData *const buf, const size_t sz) {
if (!buf->ref) return NULL;
buf->data = buf->ref->const_data;
buf->sz = buf->m.size = sz;
buf->m.timestamp = INT64_MIN;
buf->m.duration = 0;
buf->m.offset = -1;
buf->m.user_data.data = NULL;
buf->m.user_data.ref = NULL;
dav1d_data_props_set_defaults(&buf->m);
return buf->ref->data;
}
......@@ -70,11 +66,7 @@ int dav1d_data_wrap_internal(Dav1dData *const buf, const uint8_t *const ptr,
if (!buf->ref) return -ENOMEM;
buf->data = ptr;
buf->sz = buf->m.size = sz;
buf->m.timestamp = INT64_MIN;
buf->m.duration = 0;
buf->m.offset = -1;
buf->m.user_data.data = NULL;
buf->m.user_data.ref = NULL;
dav1d_data_props_set_defaults(&buf->m);
return 0;
}
......@@ -132,6 +124,16 @@ void dav1d_data_props_copy(Dav1dDataProps *const dst,
if (dst->user_data.ref) dav1d_ref_inc(dst->user_data.ref);
}
void dav1d_data_props_set_defaults(Dav1dDataProps *const props) {
assert(props != NULL);
props->timestamp = INT64_MIN;
props->duration = 0;
props->offset = -1;
props->user_data.data = NULL;
props->user_data.ref = NULL;
}
void dav1d_data_unref_internal(Dav1dData *const buf) {
validate_input(buf != NULL);
......
......@@ -43,6 +43,8 @@ void dav1d_data_move_ref(Dav1dData *dst, Dav1dData *src);
*/
void dav1d_data_props_copy(Dav1dDataProps *dst, const Dav1dDataProps *src);
void dav1d_data_props_set_defaults(Dav1dDataProps *props);
uint8_t *dav1d_data_create_internal(Dav1dData *buf, size_t sz);
int dav1d_data_wrap_internal(Dav1dData *buf, const uint8_t *ptr, size_t sz,
void (*free_callback)(const uint8_t *data,
......
......@@ -81,8 +81,8 @@ enum IntraPredMode
const pixel *dst, ptrdiff_t stride,
const pixel *prefilter_toplevel_sb_edge,
enum IntraPredMode mode, int *angle,
int tw, int th, pixel *topleft_out
HIGHBD_DECL_SUFFIX);
int tw, int th, int filter_edge,
pixel *topleft_out HIGHBD_DECL_SUFFIX);
// These flags are OR'd with the angle argument into intra predictors.
// ANGLE_USE_EDGE_FILTER_FLAG signals that edges should be convolved
......
......@@ -82,7 +82,7 @@ bytefn(dav1d_prepare_intra_edges)(const int x, const int have_left,
const ptrdiff_t stride,
const pixel *prefilter_toplevel_sb_edge,
enum IntraPredMode mode, int *const angle,
const int tw, const int th,
const int tw, const int th, const int filter_edge,
pixel *const topleft_out HIGHBD_DECL_SUFFIX)
{
const int bitdepth = bitdepth_from_max(bitdepth_max);
......@@ -201,7 +201,7 @@ bytefn(dav1d_prepare_intra_edges)(const int x, const int have_left,
} else {
*topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
}
if (mode == Z2_PRED && tw + th >= 6)
if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
*topleft_out = (topleft_out[-1] * 5 + topleft_out[0] * 6 +
topleft_out[1] * 5 + 8) >> 4;
}
......
......@@ -118,15 +118,11 @@ static int picture_alloc_with_edges(Dav1dPicture *const p,
p->p.w = w;
p->p.h = h;
p->m.timestamp = INT64_MIN;
p->m.duration = 0;
p->m.offset = -1;
p->m.user_data.data = NULL;
p->m.user_data.ref = NULL;
p->seq_hdr = seq_hdr;
p->frame_hdr = frame_hdr;
p->p.layout = seq_hdr->layout;
p->p.bpc = bpc;
dav1d_data_props_set_defaults(&p->m);
int res = p_allocator->alloc_picture_callback(p, p_allocator->cookie);
if (res < 0) {
free(pic_ctx);
......
......@@ -833,8 +833,9 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
edge_flags, dst,
f->cur.stride[0], top_sb_edge,
b->y_mode, &angle,
t_dim->w, t_dim->h, edge
HIGHBD_CALL_SUFFIX);
t_dim->w, t_dim->h,
f->seq_hdr->intra_edge_filter,
edge HIGHBD_CALL_SUFFIX);
dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
t_dim->w * 4, t_dim->h * 4,
angle | intra_flags,
......@@ -951,9 +952,8 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
ts->tiling.row_end >> ss_ver,
0, uv_dst[pl], stride,
top_sb_edge, DC_PRED, &angle,
uv_t_dim->w,
uv_t_dim->h, edge
HIGHBD_CALL_SUFFIX);
uv_t_dim->w, uv_t_dim->h, 0,
edge HIGHBD_CALL_SUFFIX);
dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
uv_t_dim->w * 4,
uv_t_dim->h * 4,
......@@ -1053,8 +1053,9 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
edge_flags, dst, stride,
top_sb_edge, uv_mode,
&angle, uv_t_dim->w,
uv_t_dim->h, edge
HIGHBD_CALL_SUFFIX);
uv_t_dim->h,
f->seq_hdr->intra_edge_filter,
edge HIGHBD_CALL_SUFFIX);
angle |= intra_edge_filter_flag;
dsp->ipred.intra_pred[m](dst, stride, edge,
uv_t_dim->w * 4,
......@@ -1216,7 +1217,7 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
t->by, t->by > ts->tiling.row_start,
ts->tiling.col_end, ts->tiling.row_end,
0, dst, f->cur.stride[0], top_sb_edge,
m, &angle, bw4, bh4, tl_edge
m, &angle, bw4, bh4, 0, tl_edge
HIGHBD_CALL_SUFFIX);
dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0
......@@ -1358,7 +1359,7 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
ts->tiling.row_end >> ss_ver,
0, uvdst, f->cur.stride[1],
top_sb_edge, m,
&angle, cbw4, cbh4, tl_edge
&angle, cbw4, cbh4, 0, tl_edge
HIGHBD_CALL_SUFFIX);
dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
......