Package-level declarations

Types

Link copied to clipboard
class FrameComparison(val psnrDb: Double, val ssim: Double, val meanAbsoluteDifference: Double)

The outcome of comparing two frames.

Link copied to clipboard
class TestFrame(val pixels: ByteArray, val size: Size)

A frame held as tightly packed RGBA_8888, row-major, with no row padding.

Link copied to clipboard

Measures how much of one frequency a block of decoded audio carries.

Properties

Link copied to clipboard
const val DEFAULT_MIN_PSNR_DB: Double = 40.0

PSNR at or above which two frames are treated as the same, in decibels.

Link copied to clipboard
const val DEFAULT_MIN_SSIM: Double = 0.995

SSIM at or above which two frames are treated as the same.

Link copied to clipboard

The video bitrate a preview parity suite exports at when it compares a preview frame against the written file.

Functions

Link copied to clipboard
fun assertFramesDiffer(expected: TestFrame, actual: TestFrame, minPsnrDb: Double = DEFAULT_MIN_PSNR_DB, minSsim: Double = DEFAULT_MIN_SSIM, message: String? = null)

Fails unless actual differs from expected by more than the tolerances.

Link copied to clipboard
fun assertFramesSimilar(expected: TestFrame, actual: TestFrame, minPsnrDb: Double = DEFAULT_MIN_PSNR_DB, minSsim: Double = DEFAULT_MIN_SSIM, message: String? = null)

Fails unless actual matches expected closely enough to be the same frame.

Link copied to clipboard

Compares two frames of the same size, perceptually rather than byte for byte.