Increase deringing horizontal padding to 4 pixels on each side

This makes vectorization easier by having buffer lines be a multiple of 4.

No change in output

Change-Id: I7ec06e03a49554206af0a55aab03daccc411b50f
This commit is contained in:
Jean-Marc Valin
2016-10-13 14:14:39 -04:00
committed by Yaowu Xu
parent 82c65fc837
commit 471687a9ac
2 changed files with 12 additions and 8 deletions

View 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];
}
}

View 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];