Commit 499ff6a0 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '7acdd3a1'

* commit '7acdd3a1':
  hevc_filter: avoid excessive calls to ff_hevc_get_ref_list()

Conflicts:
	libavcodec/hevc_filter.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 5a3a83f0 7acdd3a1
...@@ -594,12 +594,14 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -594,12 +594,14 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
boundary_upper = 0; boundary_upper = 0;
if (boundary_upper) { if (boundary_upper) {
int yp_pu = (y0 - 1) >> log2_min_pu_size; RefPicList *rpl_top = (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ?
int yq_pu = y0 >> log2_min_pu_size; ff_hevc_get_ref_list(s, s->ref, x0, y0 - 1) :
int yp_tu = (y0 - 1) >> log2_min_tu_size; s->ref->refPicList;
int yq_tu = y0 >> log2_min_tu_size; int yp_pu = (y0 - 1) >> log2_min_pu_size;
RefPicList *top_refPicList = ff_hevc_get_ref_list(s, s->ref, int yq_pu = y0 >> log2_min_pu_size;
x0, y0 - 1); int yp_tu = (y0 - 1) >> log2_min_tu_size;
int yq_tu = y0 >> log2_min_tu_size;
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;
...@@ -613,7 +615,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -613,7 +615,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
else if (curr_cbf_luma || top_cbf_luma) else if (curr_cbf_luma || top_cbf_luma)
bs = 1; bs = 1;
else else
bs = boundary_strength(s, curr, top, top_refPicList); bs = boundary_strength(s, curr, top, rpl_top);
s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs; s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs;
} }
} }
...@@ -630,12 +632,13 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -630,12 +632,13 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
boundary_left = 0; boundary_left = 0;
if (boundary_left) { if (boundary_left) {
int xp_pu = (x0 - 1) >> log2_min_pu_size; RefPicList *rpl_left = (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ?
int xq_pu = x0 >> log2_min_pu_size; ff_hevc_get_ref_list(s, s->ref, x0 - 1, y0) :
int xp_tu = (x0 - 1) >> log2_min_tu_size; s->ref->refPicList;
int xq_tu = x0 >> log2_min_tu_size; int xp_pu = (x0 - 1) >> log2_min_pu_size;
RefPicList *left_refPicList = ff_hevc_get_ref_list(s, s->ref, int xq_pu = x0 >> log2_min_pu_size;
x0 - 1, y0); int xp_tu = (x0 - 1) >> log2_min_tu_size;
int xq_tu = x0 >> log2_min_tu_size;
for (i = 0; i < (1 << log2_trafo_size); i += 4) { for (i = 0; i < (1 << log2_trafo_size); i += 4) {
int y_pu = (y0 + i) >> log2_min_pu_size; int y_pu = (y0 + i) >> log2_min_pu_size;
...@@ -650,15 +653,14 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -650,15 +653,14 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
else if (curr_cbf_luma || left_cbf_luma) else if (curr_cbf_luma || left_cbf_luma)
bs = 1; bs = 1;
else else
bs = boundary_strength(s, curr, left, left_refPicList); bs = boundary_strength(s, curr, left, rpl_left);
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) {
RefPicList *refPicList = ff_hevc_get_ref_list(s, s->ref, RefPicList *rpl = s->ref->refPicList;
x0,
y0);
// bs for TU internal horizontal PU boundaries // bs for TU internal horizontal PU boundaries
for (j = 8; j < (1 << log2_trafo_size); j += 8) { for (j = 8; j < (1 << log2_trafo_size); j += 8) {
int yp_pu = (y0 + j - 1) >> log2_min_pu_size; int yp_pu = (y0 + j - 1) >> log2_min_pu_size;
...@@ -669,7 +671,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -669,7 +671,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu];
MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu];
bs = boundary_strength(s, curr, top, refPicList); bs = boundary_strength(s, curr, top, rpl);
s->horizontal_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs; s->horizontal_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs;
} }
} }
...@@ -684,7 +686,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, ...@@ -684,7 +686,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu];
MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu];
bs = boundary_strength(s, curr, left, refPicList); bs = boundary_strength(s, curr, left, rpl);
s->vertical_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs; s->vertical_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs;
} }
} }
......
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