ref: 6382a95feee6b28b9c2ad536f1b645daeb4dffd0
parent: 16ddf82dc0395098287ec74eddc2c0f9ea3e3793
author: Yaowu Xu <yaowu@google.com>
date: Tue Apr 16 06:09:21 EDT 2019
Fix PSNRHVS computation Cherry-pick libaom #1362e15990eccab8101305be418528824fb32245 to fix PSNRHVS calculation. BUG=webm:1620 Change-Id: Ife7bd8056fcaed06992ad76e8c1ab734c3956ad7
--- 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;