Commit b260f44f authored by Ryan's avatar Ryan Committed by Sebastien Alaiwan

clean up dead code in deblocking filter

Change-Id: I0ca217b0e94b8b65fb481cda6fe361212280637b
parent ab6c9c77
......@@ -20,9 +20,6 @@ static INLINE int8_t signed_char_clamp(int t) {
return (int8_t)clamp(t, -128, 127);
}
#define PARALLEL_DEBLOCKING_11_TAP 0
#define PARALLEL_DEBLOCKING_9_TAP 0
#if CONFIG_DEBLOCK_13TAP
#define PARALLEL_DEBLOCKING_13_TAP 1
#define PARALLEL_DEBLOCKING_5_TAP_CHROMA 1
......@@ -92,29 +89,6 @@ static INLINE int8_t flat_mask4(uint8_t thresh, uint8_t p3, uint8_t p2,
return ~mask;
}
#if PARALLEL_DEBLOCKING_9_TAP
static INLINE int8_t flat_mask2(uint8_t thresh, uint8_t p4, uint8_t p0,
uint8_t q0, uint8_t q4) {
int8_t mask = 0;
mask |= (abs(p4 - p0) > thresh) * -1;
mask |= (abs(q4 - q0) > thresh) * -1;
return ~mask;
}
#endif
#if PARALLEL_DEBLOCKING_11_TAP
static INLINE int8_t flat_mask3(uint8_t thresh, uint8_t p5, uint8_t p4,
uint8_t p0, uint8_t q0, uint8_t q4,
uint8_t q5) {
int8_t mask = 0;
mask |= (abs(p4 - p0) > thresh) * -1;
mask |= (abs(q4 - q0) > thresh) * -1;
mask |= (abs(p5 - p0) > thresh) * -1;
mask |= (abs(q5 - q0) > thresh) * -1;
return ~mask;
}
#endif
#if !PARALLEL_DEBLOCKING_13_TAP
static INLINE int8_t flat_mask5(uint8_t thresh, uint8_t p4, uint8_t p3,
uint8_t p2, uint8_t p1, uint8_t p0, uint8_t q0,
......@@ -453,61 +427,6 @@ static INLINE void filter14(int8_t mask, uint8_t thresh, int8_t flat,
}
#endif
#if PARALLEL_DEBLOCKING_11_TAP
static INLINE void filter12(int8_t mask, uint8_t thresh, int8_t flat,
int8_t flat2, uint8_t *op5, uint8_t *op4,
uint8_t *op3, uint8_t *op2, uint8_t *op1,
uint8_t *op0, uint8_t *oq0, uint8_t *oq1,
uint8_t *oq2, uint8_t *oq3, uint8_t *oq4,
uint8_t *oq5) {
if (flat2 && flat && mask) {
const uint8_t p5 = *op5, p4 = *op4, p3 = *op3, p2 = *op2, p1 = *op1,
p0 = *op0;
const uint8_t q0 = *oq0, q1 = *oq1, q2 = *oq2, q3 = *oq3, q4 = *oq4,
q5 = *oq5;
// 11-tap filter [1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1]
*op4 = (p5 * 5 + p4 * 2 + p3 + p2 + p1 + p0 + q0 + 6) / 12;
*op3 = (p5 * 4 + p4 + p3 * 2 + p2 + p1 + p0 + q0 + q1 + 6) / 12;
*op2 = (p5 * 3 + p4 + p3 + p2 * 2 + p1 + p0 + q0 + q1 + q2 + 6) / 12;
*op1 = (p5 * 2 + p4 + p3 + p2 + p1 * 2 + p0 + q0 + q1 + q2 + q3 + 6) / 12;
*op0 = (p5 + p4 + p3 + p2 + p1 + p0 * 2 + q0 + q1 + q2 + q3 + q4 + 6) / 12;
*oq0 = (p4 + p3 + p2 + p1 + p0 + q0 * 2 + q1 + q2 + q3 + q4 + q5 + 6) / 12;
*oq1 = (p3 + p2 + p1 + p0 + q0 + q1 * 2 + q2 + q3 + q4 + q5 * 2 + 6) / 12;
*oq2 = (p2 + p1 + p0 + q0 + q1 + q2 * 2 + q3 + q4 + q5 * 3 + 6) / 12;
*oq3 = (p1 + p0 + q0 + q1 + q2 + q3 * 2 + q4 + q5 * 4 + 6) / 12;
*oq4 = (p0 + q0 + q1 + q2 + q3 + q4 * 2 + q5 * 5 + 6) / 12;
} else {
filter8(mask, thresh, flat, op3, op2, op1, op0, oq0, oq1, oq2, oq3);
}
}
#endif
#if PARALLEL_DEBLOCKING_9_TAP
static INLINE void filter10(int8_t mask, uint8_t thresh, int8_t flat,
int8_t flat2, uint8_t *op4, uint8_t *op3,
uint8_t *op2, uint8_t *op1, uint8_t *op0,
uint8_t *oq0, uint8_t *oq1, uint8_t *oq2,
uint8_t *oq3, uint8_t *oq4) {
if (flat2 && flat && mask) {
const uint8_t p4 = *op4, p3 = *op3, p2 = *op2, p1 = *op1, p0 = *op0;
const uint8_t q0 = *oq0, q1 = *oq1, q2 = *oq2, q3 = *oq3, q4 = *oq4;
// 9-tap filter [1, 1, 1, 1, 2, 1, 1, 1, 1]
*op3 = (p4 * 4 + p3 * 2 + p2 + p1 + p0 + q0 + 5) / 10;
*op2 = (p4 * 3 + p3 + p2 * 2 + p1 + p0 + q0 + q1 + 5) / 10;
*op1 = (p4 * 2 + p3 + p2 + p1 * 2 + p0 + q0 + q1 + q2 + 5) / 10;
*op0 = (p4 + p3 + p2 + p1 + p0 * 2 + q0 + q1 + q2 + q3 + 5) / 10;
*oq0 = (p3 + p2 + p1 + p0 + q0 * 2 + q1 + q2 + q3 + q4 + 5) / 10;
*oq1 = (p2 + p1 + p0 + q0 + q1 * 2 + q2 + q3 + q4 * 2 + 5) / 10;
*oq2 = (p1 + p0 + q0 + q1 + q2 * 2 + q3 + q4 * 3 + 5) / 10;
*oq3 = (p0 + q0 + q1 + q2 + q3 * 2 + q4 * 4 + 5) / 10;
} else {
filter8(mask, thresh, flat, op3, op2, op1, op0, oq0, oq1, oq2, oq3);
}
}
#endif
#if !PARALLEL_DEBLOCKING_13_TAP
static INLINE void filter16(int8_t mask, uint8_t thresh, int8_t flat,
int8_t flat2, uint8_t *op7, uint8_t *op6,
......@@ -594,20 +513,6 @@ static void mb_lpf_horizontal_edge_w(uint8_t *s, int p, const uint8_t *blimit,
filter14(mask, *thresh, flat, flat2, s - 7 * p, s - 6 * p, s - 5 * p,
s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, s, s + 1 * p,
s + 2 * p, s + 3 * p, s + 4 * p, s + 5 * p, s + 6 * p);
#elif PARALLEL_DEBLOCKING_11_TAP
const int8_t flat2 = flat_mask3(1, p5, p4, p0, q0, q4, q5);
filter12(mask, *thresh, flat, flat2, s - 6 * p, s - 5 * p, s - 4 * p,
s - 3 * p, s - 2 * p, s - 1 * p, s, s + 1 * p, s + 2 * p,
s + 3 * p, s + 4 * p, s + 5 * p);
#elif PARALLEL_DEBLOCKING_9_TAP
const int8_t flat2 = flat_mask2(1, p4, p0, q0, q4);
filter10(mask, *thresh, flat, flat2, s - 5 * p, s - 4 * p, s - 3 * p,
s - 2 * p, s - 1 * p, s, s + 1 * p, s + 2 * p, s + 3 * p,
s + 4 * p);
#else
const int8_t flat2 = flat_mask5(1, p7, p6, p5, p4, p0, q0, q4, q5, q6, q7);
......@@ -656,17 +561,6 @@ static void mb_lpf_vertical_edge_w(uint8_t *s, int p, const uint8_t *blimit,
filter14(mask, *thresh, flat, flat2, s - 7, s - 6, s - 5, s - 4, s - 3,
s - 2, s - 1, s, s + 1, s + 2, s + 3, s + 4, s + 5, s + 6);
#elif PARALLEL_DEBLOCKING_11_TAP
const int8_t flat2 = flat_mask3(1, p5, p4, p0, q0, q4, q5);
filter12(mask, *thresh, flat, flat2, s - 6, s - 5, s - 4, s - 3, s - 2,
s - 1, s, s + 1, s + 2, s + 3, s + 4, s + 5);
#elif PARALLEL_DEBLOCKING_9_TAP
const int8_t flat2 = flat_mask2(1, p4, p0, q0, q4);
filter10(mask, *thresh, flat, flat2, s - 5, s - 4, s - 3, s - 2, s - 1, s,
s + 1, s + 2, s + 3, s + 4);
#else
const int8_t flat2 = flat_mask5(1, p7, p6, p5, p4, p0, q0, q4, q5, q6, q7);
......
......@@ -35,8 +35,6 @@ static const int delta_lf_id_lut[MAX_MB_PLANE][2] = {
#endif // CONFIG_EXT_DELTA_Q
#endif // CONFIG_LOOPFILTER_LEVEL
#define PARALLEL_DEBLOCKING_15TAPLUMAONLY 1
#define PARALLEL_DEBLOCKING_DISABLE_15TAP 0
#if CONFIG_DEBLOCK_13TAP
#define PARALLEL_DEBLOCKING_5_TAP_CHROMA 1
#else
......@@ -2172,7 +2170,6 @@ static void set_lpf_parameters(
params->filter_length = 8;
} else {
params->filter_length = 16;
#if PARALLEL_DEBLOCKING_15TAPLUMAONLY
// No wide filtering for chroma plane
if (plane != 0) {
#if PARALLEL_DEBLOCKING_5_TAP_CHROMA
......@@ -2181,13 +2178,8 @@ static void set_lpf_parameters(
params->filter_length = 8;
#endif
}
#endif
}
#if PARALLEL_DEBLOCKING_DISABLE_15TAP
params->filter_length = (TX_4X4 >= AOMMIN(ts, pv_ts)) ? (4) : (8);
#endif // PARALLEL_DEBLOCKING_DISABLE_15TAP
// update the level if the current block is skipped,
// but the previous one is not
level = (curr_level) ? (curr_level) : (pv_lvl);
......
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