Skip to content

Investigate why some tests lossy test images aren't bit-exact with reference #146

@fintelia

Description

@fintelia

Our reference tests for lossy WebP images currently check that 90+% of pixels are bit-exact with the output:

// NOTE: WebP lossy images are stored in YUV format. The conversion to RGB is not precisely
// defined, but we currently attempt to match the dwebp's "-nofancy" conversion option.
//
// TODO: Investigate why we don't get bit exact output for all pixels.
let num_bytes_different = data
.iter()
.zip(reference_data.iter())
.filter(|(a, b)| a != b)
.count();
let percentage_different = 100 * num_bytes_different / data.len();
if percentage_different >= 10 {

This is because there are still some small fraction of pixels that differ from the references produced by libwebp despite our attempts to exactly match its output. In particular, the actual percentage differences are:

reftest_animated_random_lossy: 0.016%

reftest_gallery1_2: 0.15%
reftest_gallery1_4: 0.1%
reftest_gallery1_5: 0.0035%
 
reftest_gallery2_1_webp_a: 5.3%
reftest_gallery2_2_webp_a: 1.4%
reftest_gallery2_3_webp_a: 0.96%
reftest_gallery2_4_webp_a: 1.7%
reftest_gallery2_5_webp_a: 1.6%

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions