]> granicus.if.org Git - libvpx/commitdiff
Increase deringing horizontal padding to 4 pixels on each side
authorJean-Marc Valin <jmvalin@mozilla.com>
Thu, 13 Oct 2016 18:14:39 +0000 (14:14 -0400)
committerYaowu Xu <yaowu@google.com>
Wed, 2 Nov 2016 22:37:35 +0000 (22:37 +0000)
This makes vectorization easier by having buffer lines be a multiple of 4.

No change in output

Change-Id: I7ec06e03a49554206af0a55aab03daccc411b50f

av1/common/od_dering.c
av1/common/od_dering.h

index f86335d3977bc52121220a49579db3a6e4cc551f..3023202f6867a60f2721de147b3a19375826538d 100644 (file)
@@ -113,7 +113,7 @@ int od_dir_find8_c(const od_dering_in *img, int stride, int32_t *var,
 
 #define OD_DERING_VERY_LARGE (30000)
 #define OD_DERING_INBUF_SIZE \
-  ((OD_BSIZE_MAX + 2 * OD_FILT_BORDER) * (OD_BSIZE_MAX + 2 * OD_FILT_BORDER))
+  ((OD_BSIZE_MAX + 2 * OD_FILT_HBORDER) * (OD_BSIZE_MAX + 2 * OD_FILT_VBORDER))
 
 /* Smooth in the direction detected. */
 int od_filter_dering_direction_8x8_c(int16_t *y, int ystride, const int16_t *in,
@@ -321,15 +321,15 @@ void od_dering(int16_t *y, const od_dering_in *x, int xstride,
     od_filter_dering_orthogonal_4x4, od_filter_dering_orthogonal_8x8
   };
   bsize = 3 - xdec;
-  in = inbuf + OD_FILT_BORDER * OD_FILT_BSTRIDE + OD_FILT_BORDER;
+  in = inbuf + OD_FILT_VBORDER * OD_FILT_BSTRIDE + OD_FILT_HBORDER;
   /* We avoid filtering the pixels for which some of the pixels to average
      are outside the frame. We could change the filter instead, but it would
      add special cases for any future vectorization. */
   for (i = 0; i < OD_DERING_INBUF_SIZE; i++) inbuf[i] = OD_DERING_VERY_LARGE;
-  for (i = -OD_FILT_BORDER * (sby != 0);
-       i < (nvb << bsize) + OD_FILT_BORDER * (sby != nvsb - 1); i++) {
-    for (j = -OD_FILT_BORDER * (sbx != 0);
-         j < (nhb << bsize) + OD_FILT_BORDER * (sbx != nhsb - 1); j++) {
+  for (i = -OD_FILT_VBORDER * (sby != 0);
+       i < (nvb << bsize) + OD_FILT_VBORDER * (sby != nvsb - 1); i++) {
+    for (j = -OD_FILT_HBORDER * (sbx != 0);
+         j < (nhb << bsize) + OD_FILT_HBORDER * (sbx != nhsb - 1); j++) {
       in[i * OD_FILT_BSTRIDE + j] = x[i * xstride + j];
     }
   }
index 5ec9027444972b50a13a98a612acad92eb0bb9e1..9e4e7323385ef8d67004b20f5f5d41c61e4796d3 100644 (file)
@@ -25,8 +25,12 @@ typedef int16_t od_dering_in;
 
 #define OD_DERING_NBLOCKS (OD_BSIZE_MAX / 8)
 
-#define OD_FILT_BORDER (3)
-#define OD_FILT_BSTRIDE (OD_BSIZE_MAX + 2 * OD_FILT_BORDER)
+/* We need to buffer three vertical lines. */
+#define OD_FILT_VBORDER (3)
+/* We only need to buffer three horizontal lines too, but let's make it four
+   to make vectorization easier. */
+#define OD_FILT_HBORDER (4)
+#define OD_FILT_BSTRIDE (OD_BSIZE_MAX + 2 * OD_FILT_HBORDER)
 
 extern const int OD_DIRECTION_OFFSETS_TABLE[8][3];