Commit 8d7c4cc0 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'a7a17e3f'

* commit 'a7a17e3f':
  hevc_filter: move some conditions out of loops

Conflicts:
	libavcodec/hevc_filter.c

This is possibly less readable than the variant used before.
Thus please take a look and if people agree its worse, dont
hesitate to revert.

See: 83976e40Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 3f2495d9 a7a17e3f
...@@ -580,22 +580,26 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -580,22 +580,26 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
int min_tu_width = s->sps->min_tb_width; int min_tu_width = s->sps->min_tb_width;
int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width + int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width +
(x0 >> log2_min_pu_size)].pred_flag == PF_INTRA; (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA;
int boundary_upper, boundary_left;
int i, j, bs; int i, j, bs;
if (y0 > 0 && (y0 & 7) == 0) { boundary_upper = y0 > 0 && !(y0 & 7);
int bd_ctby = y0 & ((1 << s->sps->log2_ctb_size) - 1); if (boundary_upper &&
int bd_slice = s->sh.slice_loop_filter_across_slices_enabled_flag || ((!s->sh.slice_loop_filter_across_slices_enabled_flag &&
!(lc->boundary_flags & BOUNDARY_UPPER_SLICE); lc->boundary_flags & BOUNDARY_UPPER_SLICE &&
int bd_tiles = s->pps->loop_filter_across_tiles_enabled_flag || (y0 % (1 << s->sps->log2_ctb_size)) == 0) ||
!(lc->boundary_flags & BOUNDARY_UPPER_TILE); (!s->pps->loop_filter_across_tiles_enabled_flag &&
if (((bd_slice && bd_tiles) || bd_ctby)) { lc->boundary_flags & BOUNDARY_UPPER_TILE &&
(y0 % (1 << s->sps->log2_ctb_size)) == 0)))
boundary_upper = 0;
if (boundary_upper) {
int yp_pu = (y0 - 1) >> log2_min_pu_size; int yp_pu = (y0 - 1) >> log2_min_pu_size;
int yq_pu = y0 >> log2_min_pu_size; int yq_pu = y0 >> log2_min_pu_size;
int yp_tu = (y0 - 1) >> log2_min_tu_size; int yp_tu = (y0 - 1) >> log2_min_tu_size;
int yq_tu = y0 >> log2_min_tu_size; int yq_tu = y0 >> log2_min_tu_size;
RefPicList *top_refPicList = ff_hevc_get_ref_list(s, s->ref, RefPicList *top_refPicList = ff_hevc_get_ref_list(s, s->ref,
x0, y0 - 1); x0, y0 - 1);
for (i = 0; i < (1 << log2_trafo_size); i += 4) { for (i = 0; i < (1 << log2_trafo_size); i += 4) {
int x_pu = (x0 + i) >> log2_min_pu_size; int x_pu = (x0 + i) >> log2_min_pu_size;
int x_tu = (x0 + i) >> log2_min_tu_size; int x_tu = (x0 + i) >> log2_min_tu_size;
...@@ -612,17 +616,20 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -612,17 +616,20 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
bs = boundary_strength(s, curr, top, top_refPicList); bs = boundary_strength(s, curr, top, top_refPicList);
s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs; s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs;
} }
}
} }
// bs for vertical TU boundaries // bs for vertical TU boundaries
if (x0 > 0 && (x0 & 7) == 0) { boundary_left = x0 > 0 && !(x0 & 7);
int bd_ctbx = x0 & ((1 << s->sps->log2_ctb_size) - 1); if (boundary_left &&
int bd_slice = s->sh.slice_loop_filter_across_slices_enabled_flag || ((!s->sh.slice_loop_filter_across_slices_enabled_flag &&
!(lc->boundary_flags & BOUNDARY_LEFT_SLICE); lc->boundary_flags & BOUNDARY_LEFT_SLICE &&
int bd_tiles = s->pps->loop_filter_across_tiles_enabled_flag || (x0 % (1 << s->sps->log2_ctb_size)) == 0) ||
!(lc->boundary_flags & BOUNDARY_LEFT_TILE); (!s->pps->loop_filter_across_tiles_enabled_flag &&
if (((bd_slice && bd_tiles) || bd_ctbx)) { lc->boundary_flags & BOUNDARY_LEFT_TILE &&
(x0 % (1 << s->sps->log2_ctb_size)) == 0)))
boundary_left = 0;
if (boundary_left) {
int xp_pu = (x0 - 1) >> log2_min_pu_size; int xp_pu = (x0 - 1) >> log2_min_pu_size;
int xq_pu = x0 >> log2_min_pu_size; int xq_pu = x0 >> log2_min_pu_size;
int xp_tu = (x0 - 1) >> log2_min_tu_size; int xp_tu = (x0 - 1) >> log2_min_tu_size;
...@@ -646,7 +653,6 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -646,7 +653,6 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
bs = boundary_strength(s, curr, left, left_refPicList); bs = boundary_strength(s, curr, left, left_refPicList);
s->vertical_bs[(x0 + (y0 + i) * s->bs_width) >> 2] = bs; s->vertical_bs[(x0 + (y0 + i) * s->bs_width) >> 2] = bs;
} }
}
} }
if (log2_trafo_size > log2_min_pu_size && !is_intra) { if (log2_trafo_size > log2_min_pu_size && !is_intra) {
......
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