Skip to content
Snippets Groups Projects
Commit 7f4c3f58 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Removes the superblock variance contribution to the threshold

ntt-short1 results:
         MEDIUM (%) HIGH (%)
    PSNR  0.022148 -0.038920
 PSNRHVS  0.047667 -0.053941
    SSIM  0.014602 -0.046534
FASTSSIM -0.450261 -0.690958

Change-Id: Iaa8844d4d84c6265b488a4ade5a223bc3af99707
parent 3dc56f93
No related branches found
No related tags found
No related merge requests found
......@@ -224,19 +224,15 @@ static const int16_t OD_THRESH_TABLE_Q8[18] = {
to blur. */
static void od_compute_thresh(int thresh[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS],
int threshold, int32_t var[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS],
int32_t sb_var, int nhb, int nvb) {
int nhb, int nvb) {
int bx;
int by;
for (by = 0; by < nvb; by++) {
for (bx = 0; bx < nhb; bx++) {
int v1;
int v2;
/* We use both the variance of 8x8 blocks and the variance of the
entire superblock to determine the threshold. */
/* We use the variance of 8x8 blocks to adjust the threshold. */
v1 = OD_MINI(32767, var[by][bx] >> 6);
v2 = OD_MINI(32767, sb_var/(OD_BSIZE_MAX*OD_BSIZE_MAX));
thresh[by][bx] = threshold*OD_THRESH_TABLE_Q8[OD_CLAMPI(0,
OD_ILOG(v1*v2) - 10, 17)] >> 8;
thresh[by][bx] = (threshold*OD_THRESH_TABLE_Q8[OD_ILOG(v1)] + 128) >> 8;
}
}
}
......@@ -253,7 +249,6 @@ void od_dering(const od_dering_opt_vtbl *vtbl, int16_t *y, int ystride,
int16_t inbuf[OD_DERING_INBUF_SIZE];
int16_t *in;
int bsize;
int varsum = 0;
int32_t var[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS];
int thresh[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS];
bsize = 3 - xdec;
......@@ -274,10 +269,9 @@ void od_dering(const od_dering_opt_vtbl *vtbl, int16_t *y, int ystride,
for (bx = 0; bx < nhb; bx++) {
dir[by][bx] = od_dir_find8(&x[8*by*xstride + 8*bx], xstride,
&var[by][bx], coeff_shift);
varsum += var[by][bx];
}
}
od_compute_thresh(thresh, threshold, var, varsum, nhb, nvb);
od_compute_thresh(thresh, threshold, var, nhb, nvb);
}
else {
for (by = 0; by < nvb; by++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment