ssimulacra2.h (1058B)
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 #ifndef TOOLS_SSIMULACRA2_H_ 7 #define TOOLS_SSIMULACRA2_H_ 8 9 #include <vector> 10 11 #include "lib/jxl/base/status.h" 12 #include "lib/jxl/image_bundle.h" 13 14 struct MsssimScale { 15 double avg_ssim[3 * 2]; 16 double avg_edgediff[3 * 4]; 17 }; 18 19 struct Msssim { 20 std::vector<MsssimScale> scales; 21 22 double Score() const; 23 }; 24 25 // Computes the SSIMULACRA 2 score between reference image 'orig' and 26 // distorted image 'distorted'. In case of alpha transparency, assume 27 // a gray background if intensity 'bg' (in range 0..1). 28 jxl::StatusOr<Msssim> ComputeSSIMULACRA2(const jxl::ImageBundle &orig, 29 const jxl::ImageBundle &distorted, 30 float bg); 31 jxl::StatusOr<Msssim> ComputeSSIMULACRA2(const jxl::ImageBundle &orig, 32 const jxl::ImageBundle &distorted); 33 34 #endif // TOOLS_SSIMULACRA2_H_