daala
daala copied to clipboard
Memory leak in FastSSIM when image dimensions are not multiples of 32
In the attached screenshots, I am running FastSSIM with the same image as input and output, of size 627x482. So, we expect that at every level, upon downsampling, the images still have the same entries in corresponding locations. Wherever different, I have printed the column number, row number and the corresponding entries in the two images. The junk values (sometimes negative) at the borders of the image demonstrate the memory leak. The first line of the output shows an attempt to access row index 120 of the image, while the dimensions show that upon downsampling twice, the heights of the image at the first two levels are 482/2 = 241 and 241/2 = 120. So, there should not be an attempt to access row index 120.
The main implementations of ssim in the daala repo are the dump_ssim and dump_msssim implementation (I wrote the latter after discovering similar issues in fastssim). Arguably we should delete the fastssim implementation as I don't think there is any reason to use it instead of the other two.
I see. Considering how much faster it is than dump_ssim and dump_msssim, I think it is worth holding on to. I have created a PR with a simple fix that should help.
Neat, if it's delivering advantages over the other two we should definitely keep it around.