Closed ankuPRK closed 3 years ago
The _iqa_convolve function doesn't output the same size array after convolution, it rather outputs a (w-kernelsize/2, h-kernelsize/2) image when a kernel of size (kernelsize, kernelsize) is convolved with an image of size (w,h). So:
https://github.com/danielgtaylor/jpeg-archive/blob/5b56afa11872fc4b9f68c5a3dcf2ec5afe869504/src/iqa/source/ssim.c#L197 ^this rewrites an output of (w-kernelsize/2, h-kernelsize/2) in a buffer size of (w, h)?
And then we use the full buffer to calculate average SSIM: https://github.com/danielgtaylor/jpeg-archive/blob/5b56afa11872fc4b9f68c5a3dcf2ec5afe869504/src/iqa/source/ssim.c#L214
^Woudn't this calculate wrong SSIM?
Okay got it h,w get updated later here: https://github.com/danielgtaylor/jpeg-archive/blob/5b56afa11872fc4b9f68c5a3dcf2ec5afe869504/src/iqa/source/ssim.c#L199
The _iqa_convolve function doesn't output the same size array after convolution, it rather outputs a (w-kernelsize/2, h-kernelsize/2) image when a kernel of size (kernelsize, kernelsize) is convolved with an image of size (w,h). So:
https://github.com/danielgtaylor/jpeg-archive/blob/5b56afa11872fc4b9f68c5a3dcf2ec5afe869504/src/iqa/source/ssim.c#L197 ^this rewrites an output of (w-kernelsize/2, h-kernelsize/2) in a buffer size of (w, h)?
And then we use the full buffer to calculate average SSIM: https://github.com/danielgtaylor/jpeg-archive/blob/5b56afa11872fc4b9f68c5a3dcf2ec5afe869504/src/iqa/source/ssim.c#L214
^Woudn't this calculate wrong SSIM?