Commit 6285c667 authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review
Browse files

Merge "Increase deringing horizontal padding to 4 pixels on each side" into nextgenv2

parents 4cb9a620 471687a9
......@@ -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];
}
}
......
......@@ -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];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment