From 5b258ef8ab18180ef428335cff4833aa7d7cea15 Mon Sep 17 00:00:00 2001 From: claincly Date: Mon, 4 Apr 2022 17:16:11 +0100 Subject: [PATCH] Add javadoc for SSIM helper. PiperOrigin-RevId: 439332549 --- .../java/androidx/media3/transformer/SsimHelper.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/SsimHelper.java b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/SsimHelper.java index 5b00cd21b4..dc489d00fe 100644 --- a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/SsimHelper.java +++ b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/SsimHelper.java @@ -330,6 +330,17 @@ public final class SsimHelper { private static final double C2 = pow(IMAGE_DYNAMIC_RANGE * K2, 2); private static final int WINDOW_SIZE = 8; + /** + * Calculates the Structural Similarity Index (SSIM) between two images. + * + * @param expected The luminance channel (Y) bitmap of the expected image. + * @param actual The luminance channel (Y) bitmap of the actual image. + * @param offset The offset. + * @param stride The stride of the bitmap. + * @param width The image width in pixels. + * @param height The image height in pixels. + * @return The SSIM score between the input images. + */ public static double calculate( int[] expected, int[] actual, int offset, int stride, int width, int height) { double totalSsim = 0;