strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.7k stars 298 forks source link

"uncompressed" tests fail on various platforms #1256

Open fancycode opened 1 month ago

fancycode commented 1 month ago

Various uncompressed tests are failing on platforms like powerpc, ppc64 or sparc64 when building for Debian.

Example run: https://buildd.debian.org/status/fetch.php?pkg=libheif&arch=powerpc&ver=1.18.1-1&stamp=1722512466&raw=0

The following tests FAILED:
      5 - uncompressed_decode_generic_compression (Failed)
      6 - uncompressed_decode_mono (Failed)
      7 - uncompressed_decode_rgb (Failed)
      8 - uncompressed_decode_rgb16 (Failed)
      9 - uncompressed_decode_rgb565 (Failed)
     10 - uncompressed_decode_rgb7 (Failed)
     11 - uncompressed_decode_ycbcr (Failed)
     12 - uncompressed_decode_ycbcr420 (Failed)
     13 - uncompressed_decode_ycbcr422 (Failed)

Other examples available on https://buildd.debian.org/status/package.php?p=libheif (click on the "Build-Attempted" links).

CC @bradh as I think you know probably best about the tests. Thanks!

bradh commented 1 month ago

Given it works on ppc64el and fails on ppc64, my guess would be some endianess issue. I have no idea what though - not even whether the problem is in the tests or in in the codec.

fancycode commented 1 month ago

The code currently checks that uncompressed images are marked as "big endian": https://github.com/strukturag/libheif/blob/15ff08fea0695624c875ab92f48556d67fb453f0/libheif/codecs/uncompressed_image.cc#L208-L213

So I'm thinking the code might only support the internal conversion "big endian image" -> "little endian system". It's using memcpy in a couple of places which might need to be replaced for "big endian image" -> "big endian system"? Just guessing though.

bradh commented 1 month ago

Conceivable, but it looks like there are failures on the 8 bit RGB test, which should not be affected by endianess conversions....

bradh commented 12 hours ago

@fancycode Can you re-run on master? I'm not expecting it to work, just that there is a new test that might (or might not) point to the underlying issue.