@@ -1424,9 +1424,6 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
1424
1424
MagickBooleanType
1425
1425
status ;
1426
1426
1427
- ssize_t
1428
- i ;
1429
-
1430
1427
status = GetMeanSquaredDistortion (image ,reconstruct_image ,channel ,distortion ,
1431
1428
exception );
1432
1429
if ((channel & RedChannel ) != 0 )
@@ -1443,8 +1440,8 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
1443
1440
{
1444
1441
if ((fabs (distortion [GreenChannel ]) < MagickEpsilon ) ||
1445
1442
(fabs (distortion [GreenChannel ]) >= 1.0 ))
1446
- distortion [GreenChannel ]= fabs (distortion [GreenChannel ]) < MagickEpsilon ?
1447
- 0.0 : 1.0 ;
1443
+ distortion [GreenChannel ]= fabs (distortion [GreenChannel ]) <
1444
+ MagickEpsilon ? 0.0 : 1.0 ;
1448
1445
else
1449
1446
distortion [GreenChannel ]= (-10.0 * MagickLog10 (PerceptibleReciprocal (
1450
1447
distortion [GreenChannel ])))/48.1647 ;
@@ -1463,8 +1460,8 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
1463
1460
{
1464
1461
if ((fabs (distortion [OpacityChannel ]) < MagickEpsilon ) ||
1465
1462
(fabs (distortion [OpacityChannel ]) >= 1.0 ))
1466
- distortion [OpacityChannel ]= fabs (distortion [OpacityChannel ]) < MagickEpsilon ?
1467
- 0.0 : 1.0 ;
1463
+ distortion [OpacityChannel ]= fabs (distortion [OpacityChannel ]) <
1464
+ MagickEpsilon ? 0.0 : 1.0 ;
1468
1465
else
1469
1466
distortion [OpacityChannel ]= (-10.0 * MagickLog10 (PerceptibleReciprocal (
1470
1467
distortion [OpacityChannel ])))/48.1647 ;
@@ -1473,17 +1470,12 @@ static MagickBooleanType GetPeakSignalToNoiseRatio(const Image *image,
1473
1470
{
1474
1471
if ((fabs (distortion [BlackChannel ]) < MagickEpsilon ) ||
1475
1472
(fabs (distortion [BlackChannel ]) >= 1.0 ))
1476
- distortion [BlackChannel ]= fabs (distortion [BlackChannel ]) < MagickEpsilon ?
1477
- 0.0 : 1.0 ;
1473
+ distortion [BlackChannel ]= fabs (distortion [BlackChannel ]) <
1474
+ MagickEpsilon ? 0.0 : 1.0 ;
1478
1475
else
1479
1476
distortion [BlackChannel ]= (-10.0 * MagickLog10 (PerceptibleReciprocal (
1480
1477
distortion [BlackChannel ])))/48.1647 ;
1481
1478
}
1482
- distortion [CompositeChannels ]= 0.0 ;
1483
- for (i = 0 ; i < (ssize_t ) CompositeChannels ; i ++ )
1484
- if (fabs (distortion [i ]) >= MagickEpsilon )
1485
- distortion [CompositeChannels ]+= distortion [i ];
1486
- distortion [CompositeChannels ]/=(double ) GetNumberChannels (image ,channel );
1487
1479
return (status );
1488
1480
}
1489
1481
0 commit comments