Commit 9824c5d9 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Don't filter top/left intra edge if intra_edge_filter=0

Fixes #236.
parent 9a550985
...@@ -81,8 +81,8 @@ enum IntraPredMode ...@@ -81,8 +81,8 @@ enum IntraPredMode
const pixel *dst, ptrdiff_t stride, const pixel *dst, ptrdiff_t stride,
const pixel *prefilter_toplevel_sb_edge, const pixel *prefilter_toplevel_sb_edge,
enum IntraPredMode mode, int *angle, enum IntraPredMode mode, int *angle,
int tw, int th, pixel *topleft_out int tw, int th, int filter_edge,
HIGHBD_DECL_SUFFIX); pixel *topleft_out HIGHBD_DECL_SUFFIX);
// These flags are OR'd with the angle argument into intra predictors. // These flags are OR'd with the angle argument into intra predictors.
// ANGLE_USE_EDGE_FILTER_FLAG signals that edges should be convolved // 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, ...@@ -82,7 +82,7 @@ bytefn(dav1d_prepare_intra_edges)(const int x, const int have_left,
const ptrdiff_t stride, const ptrdiff_t stride,
const pixel *prefilter_toplevel_sb_edge, const pixel *prefilter_toplevel_sb_edge,
enum IntraPredMode mode, int *const angle, 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) pixel *const topleft_out HIGHBD_DECL_SUFFIX)
{ {
const int bitdepth = bitdepth_from_max(bitdepth_max); const int bitdepth = bitdepth_from_max(bitdepth_max);
...@@ -201,7 +201,7 @@ bytefn(dav1d_prepare_intra_edges)(const int x, const int have_left, ...@@ -201,7 +201,7 @@ bytefn(dav1d_prepare_intra_edges)(const int x, const int have_left,
} else { } else {
*topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1; *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 = (topleft_out[-1] * 5 + topleft_out[0] * 6 +
topleft_out[1] * 5 + 8) >> 4; topleft_out[1] * 5 + 8) >> 4;
} }
......
...@@ -833,8 +833,9 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize ...@@ -833,8 +833,9 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
edge_flags, dst, edge_flags, dst,
f->cur.stride[0], top_sb_edge, f->cur.stride[0], top_sb_edge,
b->y_mode, &angle, b->y_mode, &angle,
t_dim->w, t_dim->h, edge t_dim->w, t_dim->h,
HIGHBD_CALL_SUFFIX); f->seq_hdr->intra_edge_filter,
edge HIGHBD_CALL_SUFFIX);
dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge, dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
t_dim->w * 4, t_dim->h * 4, t_dim->w * 4, t_dim->h * 4,
angle | intra_flags, angle | intra_flags,
...@@ -951,9 +952,8 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize ...@@ -951,9 +952,8 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
ts->tiling.row_end >> ss_ver, ts->tiling.row_end >> ss_ver,
0, uv_dst[pl], stride, 0, uv_dst[pl], stride,
top_sb_edge, DC_PRED, &angle, top_sb_edge, DC_PRED, &angle,
uv_t_dim->w, uv_t_dim->w, uv_t_dim->h, 0,
uv_t_dim->h, edge edge HIGHBD_CALL_SUFFIX);
HIGHBD_CALL_SUFFIX);
dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge, dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
uv_t_dim->w * 4, uv_t_dim->w * 4,
uv_t_dim->h * 4, uv_t_dim->h * 4,
...@@ -1053,8 +1053,9 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize ...@@ -1053,8 +1053,9 @@ void bytefn(dav1d_recon_b_intra)(Dav1dTileContext *const t, const enum BlockSize
edge_flags, dst, stride, edge_flags, dst, stride,
top_sb_edge, uv_mode, top_sb_edge, uv_mode,
&angle, uv_t_dim->w, &angle, uv_t_dim->w,
uv_t_dim->h, edge uv_t_dim->h,
HIGHBD_CALL_SUFFIX); f->seq_hdr->intra_edge_filter,
edge HIGHBD_CALL_SUFFIX);
angle |= intra_edge_filter_flag; angle |= intra_edge_filter_flag;
dsp->ipred.intra_pred[m](dst, stride, edge, dsp->ipred.intra_pred[m](dst, stride, edge,
uv_t_dim->w * 4, uv_t_dim->w * 4,
...@@ -1216,7 +1217,7 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize ...@@ -1216,7 +1217,7 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
t->by, t->by > ts->tiling.row_start, t->by, t->by > ts->tiling.row_start,
ts->tiling.col_end, ts->tiling.row_end, ts->tiling.col_end, ts->tiling.row_end,
0, dst, f->cur.stride[0], top_sb_edge, 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); HIGHBD_CALL_SUFFIX);
dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel), dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0 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 ...@@ -1358,7 +1359,7 @@ int bytefn(dav1d_recon_b_inter)(Dav1dTileContext *const t, const enum BlockSize
ts->tiling.row_end >> ss_ver, ts->tiling.row_end >> ss_ver,
0, uvdst, f->cur.stride[1], 0, uvdst, f->cur.stride[1],
top_sb_edge, m, top_sb_edge, m,
&angle, cbw4, cbh4, tl_edge &angle, cbw4, cbh4, 0, tl_edge
HIGHBD_CALL_SUFFIX); HIGHBD_CALL_SUFFIX);
dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel), dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0 tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
......
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