]> granicus.if.org Git - libvpx/commitdiff
Select segment based loopfilter strength for supertx blocks.
authorGeza Lore <gezalore@gmail.com>
Fri, 10 Jun 2016 08:32:21 +0000 (09:32 +0100)
committerGeza Lore <gezalore@gmail.com>
Tue, 14 Jun 2016 15:07:51 +0000 (16:07 +0100)
Segment based loopfilter strength for supertx coded blocks is now
selected based on the minimum of all segment IDs within a supertx
coded block (same as the quantiser settings).

Change-Id: Ib056bd0d05f6a1d3b512a76deb4e2ad4db0f7dc4

vp10/common/loopfilter.c
vp10/decoder/decodeframe.c
vp10/encoder/encodeframe.c

index 17fb0f6f84a9a71464b1dbac25a773fad44c487e..55715d7dae6d8e412375bc1c9ce77014e7e71753 100644 (file)
@@ -240,8 +240,16 @@ static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {
 
 static uint8_t get_filter_level(const loop_filter_info_n *lfi_n,
                                 const MB_MODE_INFO *mbmi) {
-  return lfi_n->lvl[mbmi->segment_id][mbmi->ref_frame[0]]
-                   [mode_lf_lut[mbmi->mode]];
+#if CONFIG_SUPERTX
+  const int segment_id = VPXMIN(mbmi->segment_id, mbmi->segment_id_supertx);
+  assert(IMPLIES(supertx_enabled(mbmi),
+                 mbmi->segment_id_supertx != MAX_SEGMENTS));
+  assert(IMPLIES(supertx_enabled(mbmi),
+                 mbmi->segment_id_supertx <= mbmi->segment_id));
+#else
+  const int segment_id = mbmi->segment_id;
+#endif  // CONFIG_SUPERTX
+  return lfi_n->lvl[segment_id][mbmi->ref_frame[0]][mode_lf_lut[mbmi->mode]];
 }
 
 void vp10_loop_filter_init(VP10_COMMON *cm) {
index 53dbfcf87f71c0fa9d26bc144ee8118e63cf608e..437da9ac8568a036f5fa53a058d7aa875e8a9e45 100644 (file)
@@ -1309,6 +1309,8 @@ static void decode_block(VP10Decoder *const pbi, MACROBLOCKD *const xd,
   }
 
 #if CONFIG_SUPERTX
+  mbmi->segment_id_supertx = MAX_SEGMENTS;
+
   if (supertx_enabled) {
     xd->corrupted |= vp10_reader_has_error(r);
     return;
index 29492220ed86ca3c9793b60c41a22c10887b5a1c..014a874792516dcdba39dd8802fd71cb880b2a15 100644 (file)
@@ -339,6 +339,10 @@ static void set_offsets(VP10_COMP *cpi, const TileInfo *const tile,
     mbmi->segment_id = 0;
     x->encode_breakout = cpi->encode_breakout;
   }
+
+#if CONFIG_SUPERTX
+  mbmi->segment_id_supertx = MAX_SEGMENTS;
+#endif  // CONFIG_SUPERTX
 }
 
 #if CONFIG_SUPERTX
@@ -1329,6 +1333,7 @@ static void update_state_supertx(VP10_COMP *cpi, ThreadData *td,
                                                  : cm->last_frame_seg_map;
       mi_addr->mbmi.segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
     }
+    mi_addr->mbmi.segment_id_supertx = MAX_SEGMENTS;
   }
 
   // Restore the coding context of the MB to that that was in place