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
diff --git a/av1/common/av1_loopfilter.c b/av1/common/av1_loopfilter.c
index 97d0021..4da314a 100644
--- a/av1/common/av1_loopfilter.c
+++ b/av1/common/av1_loopfilter.c
@@ -757,16 +757,16 @@
       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
 
diff --git a/av1/common/entropy.c b/av1/common/entropy.c
index 6980d56..b53f52b 100644
--- a/av1/common/entropy.c
+++ b/av1/common/entropy.c
@@ -2312,6 +2312,9 @@
   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
diff --git a/av1/common/seg_common.c b/av1/common/seg_common.c
index 4603026..6859d0f4 100644
--- a/av1/common/seg_common.c
+++ b/av1/common/seg_common.c
@@ -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 };