SSIM calculation broken

Issue #276 resolved
Former user created an issue

While comparing x265 against some other encoders I noticed some problems with the ssim calculation implemented in x265...

For example there is this in FrameFilter::processPostRow(): uint32_t bEnd = ((row + 1) == (this->m_numRows - 1));

This is off by one.

There is this: uint32_t maxPixY = (row + 1) * g_maxCUSize - 4 * !bEnd;

Which does not take the maximum picture height or the conformance window into account.

There is this in calculateSSIM(): primitives.ssim_4x4x2_core(&pix1[(4 * x + (z * stride1))], stride1, &pix2[(4 * x + (z * stride2))], stride2, &sum0[x]);

The variable z should be multiplied by 4 as well to address pixels correctly.

Please do check, thanks.

Comments (2)

  1. Log in to comment