Commit cce013cd authored by David Barker's avatar David Barker Committed by Cheng Chen

loopfilter-level: Fix some inconsistencies

* Fix a case where we would calculate the Y horizontal filter strength
  as the sum of the base Y *vertical* strength and the
  per-segment delta Y horizontal strength.

* When using delta_lf_multi, adapt the corresponding CDFs between frames

* Correct values in seg_feature_data_{signed,max}

Change-Id: I1976d2024e9e16fe73258cf41d56aafe8a830957
parent 3dffa270
......@@ -757,16 +757,16 @@ void av1_loop_filter_frame_init(AV1_COMMON *cm, int default_filt_lvl,
const int seg_lf_feature_id = seg_lvl_lf_lut[plane][dir];
if (segfeature_active(seg, seg_id, seg_lf_feature_id)) {
const int data = get_segdata(&cm->seg, seg_id, seg_lf_feature_id);
lvl_seg = clamp(
seg->abs_delta == SEGMENT_ABSDATA ? data : default_filt_lvl + data,
0, MAX_LOOP_FILTER);
lvl_seg =
clamp(seg->abs_delta == SEGMENT_ABSDATA ? data : lvl_seg + data, 0,
MAX_LOOP_FILTER);
}
#else
if (segfeature_active(seg, seg_id, SEG_LVL_ALT_LF)) {
const int data = get_segdata(seg, seg_id, SEG_LVL_ALT_LF);
lvl_seg = clamp(
seg->abs_delta == SEGMENT_ABSDATA ? data : default_filt_lvl + data,
0, MAX_LOOP_FILTER);
lvl_seg =
clamp(seg->abs_delta == SEGMENT_ABSDATA ? data : lvl_seg + data, 0,
MAX_LOOP_FILTER);
}
#endif // CONFIG_LOOPFILTER_LEVEL
......
......@@ -2312,6 +2312,9 @@ void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
AVERAGE_TILE_CDFS(delta_q_cdf)
#if CONFIG_EXT_DELTA_Q
AVERAGE_TILE_CDFS(delta_lf_cdf)
#if CONFIG_LOOPFILTER_LEVEL
AVERAGE_TILE_CDFS(delta_lf_multi_cdf)
#endif
#endif
#if CONFIG_NEW_MULTISYMBOL
......
......@@ -17,10 +17,10 @@
#include "av1/common/quant_common.h"
#if CONFIG_LOOPFILTER_LEVEL
static const int seg_feature_data_signed[SEG_LVL_MAX] = { 1, 1, 1, 1, 0, 0 };
static const int seg_feature_data_signed[SEG_LVL_MAX] = { 1, 1, 1, 1, 1, 0, 0 };
static const int seg_feature_data_max[SEG_LVL_MAX] = {
MAXQ, MAX_LOOP_FILTER, MAX_LOOP_FILTER, MAX_LOOP_FILTER, 0
MAXQ, MAX_LOOP_FILTER, MAX_LOOP_FILTER, MAX_LOOP_FILTER, MAX_LOOP_FILTER, 3, 0
};
#else
static const int seg_feature_data_signed[SEG_LVL_MAX] = { 1, 1, 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