ref: bd45c003bbda02ba46e8854b48c07dea73e48ece
parent: f96b7117b1579f05b4d795d6c834005ece590f31
parent: 6382a95feee6b28b9c2ad536f1b645daeb4dffd0
author: James Zern <jzern@google.com>
date: Fri Apr 19 02:10:01 EDT 2019
Merge "Fix PSNRHVS computation"
--- a/vpx_dsp/psnrhvs.c
+++ b/vpx_dsp/psnrhvs.c
@@ -144,7 +144,7 @@
been normalized and then squared." Their CSF matrix (from PSNR-HVS)
was also constructed from the JPEG matrices. I can not find any obvious
scheme of normalizing to produce their table, but if I multiply their
- CSF by 0.38857 and square the result I get their masking table.
+ CSF by 0.3885746225901003 and square the result I get their masking table.
I have no idea where this constant comes from, but deviating from it
too greatly hurts MOS agreement.
@@ -152,11 +152,15 @@
Jaakko Astola, Vladimir Lukin, "On between-coefficient contrast masking
of DCT basis functions", CD-ROM Proceedings of the Third
International Workshop on Video Processing and Quality Metrics for Consumer
- Electronics VPQM-07, Scottsdale, Arizona, USA, 25-26 January, 2007, 4 p.*/
+ Electronics VPQM-07, Scottsdale, Arizona, USA, 25-26 January, 2007, 4 p.
+
+ Suggested in aomedia issue #2363:
+ 0.3885746225901003 is a reciprocal of the maximum coefficient (2.573509)
+ of the old JPEG based matrix from the paper. Since you are not using that,
+ divide by actual maximum coefficient. */
for (x = 0; x < 8; x++)
for (y = 0; y < 8; y++)
- mask[x][y] =
- (_csf[x][y] * 0.3885746225901003) * (_csf[x][y] * 0.3885746225901003);
+ mask[x][y] = (_csf[x][y] / _csf[1][0]) * (_csf[x][y] / _csf[1][0]);
for (y = 0; y < _h - 7; y += _step) {
for (x = 0; x < _w - 7; x += _step) {
int i;