From 56b0c3c51b78a57808242f5c6df2391e28d3b58b Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Mon, 18 Jul 2016 11:48:59 -0400 Subject: [PATCH] Don't dering skipped superblocks No change in metrics Change-Id: I0da09270d78c3caf78a32a3157f02c87f2232e3e --- av1/common/dering.c | 2 +- av1/encoder/pickdering.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/av1/common/dering.c b/av1/common/dering.c index 7405fb542..725be2eb1 100644 --- a/av1/common/dering.c +++ b/av1/common/dering.c @@ -113,7 +113,7 @@ void av1_dering_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm, /* FIXME: This is a temporary hack that uses more conservative deringing for chroma. */ if (pli) level = (level * 5 + 4) >> 3; - if (sb_all_skip(cm, sbr * MAX_MIB_SIZE, sbc * MAX_MIB_SIZE)) level = 0; + if (sb_all_skip(cm, sbr * MAX_MIB_SIZE, sbc * MAX_MIB_SIZE)) continue; threshold = level << coeff_shift; od_dering(&OD_DERING_VTBL_C, dst, MAX_MIB_SIZE * bsize[pli], &src[pli][sbr * stride * bsize[pli] * MAX_MIB_SIZE + diff --git a/av1/encoder/pickdering.c b/av1/encoder/pickdering.c index 726a4c10f..952e36b85 100644 --- a/av1/encoder/pickdering.c +++ b/av1/encoder/pickdering.c @@ -96,6 +96,7 @@ int av1_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref, int16_t dst[MAX_MIB_SIZE * MAX_MIB_SIZE * 8 * 8]; nhb = AOMMIN(MAX_MIB_SIZE, cm->mi_cols - MAX_MIB_SIZE * sbc); nvb = AOMMIN(MAX_MIB_SIZE, cm->mi_rows - MAX_MIB_SIZE * sbr); + if (sb_all_skip(cm, sbr * MAX_MIB_SIZE, sbc * MAX_MIB_SIZE)) continue; for (level = 0; level < 64; level++) { int cur_mse; int threshold; @@ -126,6 +127,7 @@ int av1_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref, for (sbc = 0; sbc < nhsb; sbc++) { int gi; int best_mse = mse[nhsb * sbr + sbc][0]; + if (sb_all_skip(cm, sbr * MAX_MIB_SIZE, sbc * MAX_MIB_SIZE)) continue; for (gi = 1; gi < 4; gi++) { level = compute_level_from_index(global_level, gi); if (mse[nhsb * sbr + sbc][level] < best_mse) { @@ -145,6 +147,7 @@ int av1_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref, int gi; int best_gi; int best_mse = mse[nhsb * sbr + sbc][0]; + if (sb_all_skip(cm, sbr * MAX_MIB_SIZE, sbc * MAX_MIB_SIZE)) continue; best_gi = 0; for (gi = 1; gi < DERING_REFINEMENT_LEVELS; gi++) { level = compute_level_from_index(best_level, gi);