[x265] [PATCH] noise reduction, ported from x264

Jason Garrett-Glaser jason at x264.com
Mon May 19 18:14:40 CEST 2014


> +        if (nr->bNoiseReduction)
> +        {
> +            int index = (DCT_4x4 + log2BlockSize - ((trSize == 4) && (mode != REG_DCT)));
> +            if (index == 1)
> +            {
> +                denoiseDct(m_tmpCoeff, nr->residualSum[0], nr->offset[0], 16);
> +                nr->count[0]++;
> +            }
> +            else if (index == 2)
> +            {
> +                denoiseDct(m_tmpCoeff, nr->residualSum[1], nr->offset[1], 64);
> +                nr->count[1]++;
> +            }
> +            else if (index == 3)
> +            {
> +                denoiseDct(m_tmpCoeff, nr->residualSum[2], nr->offset[2], 256);
> +                nr->count[2]++;
> +            }
> +            else if (index == 4)
> +            {
> +                denoiseDct(m_tmpCoeff, nr->residualSum[3], nr->offset[3], 1024);
> +                nr->count[3]++;
> +            }
> +        }
>      }

How about

denoiseDct(m_tmpCoeff, nr->residualSum[index], nr->offset[index], 16
<< (index*2));
nr->count[index]++;

?


More information about the x265-devel mailing list