Correctly set loopfilter mask to zero

1. Set loopfilter mask to zero after they're used in loopfiltering,
instead of set them to zero at the beginning of decoding a tile,
which could incorrectly earase mask information when a tile is
not totally coded.

2. Silence a warning that a pointer may not be used when it reaches
boundary of a block.

Change-Id: I924ef1cb8bbe4d07adb2a6ecc2128fc702f77479
diff --git a/av1/common/av1_loopfilter.c b/av1/common/av1_loopfilter.c
index 86e7ae9..0451fa1 100644
--- a/av1/common/av1_loopfilter.c
+++ b/av1/common/av1_loopfilter.c
@@ -1320,6 +1320,7 @@
     const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl;
     // Next block's thresholds.
     const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + step);
+    (void)lfin;
 
     count = 1;
     if (mask & 1) {
@@ -1396,6 +1397,7 @@
     const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl;
     // Next block's thresholds.
     const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + step);
+    (void)lfin;
 
     count = 1;
     if (mask & 1) {
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 604729b..d083d24 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -5493,7 +5493,6 @@
   const int num_planes = av1_num_planes(cm);
 #if LOOP_FILTER_BITMASK
   av1_loop_filter_frame_init(cm, 0, num_planes);
-  av1_zero_array(cm->lf.lfm, cm->lf.lfm_num);
 #endif
 
   if (pbi->max_threads > 1 && !(cm->large_scale_tile && !pbi->ext_tile_debug) &&
@@ -5580,6 +5579,9 @@
       }
     }
   }
+#if LOOP_FILTER_BITMASK
+  av1_zero_array(cm->lf.lfm, cm->lf.lfm_num);
+#endif
 
   if (!xd->corrupted) {
     if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {