-
-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"uncompressed" tests fail on various platforms #1256
Comments
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. |
The code currently checks that uncompressed images are marked as "big endian": libheif/libheif/codecs/uncompressed_image.cc Lines 208 to 213 in 15ff08f
So I'm thinking the code might only support the internal conversion "big endian image" -> "little endian system". It's using |
Conceivable, but it looks like there are failures on the 8 bit RGB test, which should not be affected by endianess conversions.... |
@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. |
Unfortunately I don't have direct access to such machines (yet). The problem occurred when building the official Debian packages - which I can't just update to test some changes. Hopefully I'll have access soon and will be able to test / debug this further. |
I've cross-compiled libheif to PowerPC. The executables will run when qemu-ppc is installed. This allows to reproduce the failing test cases. I'll have a look at it. Here is the cross-compilation toolchain file:
|
Found it. The bug is in lines like this: libheif/libheif/codecs/uncompressed_image.cc Lines 640 to 641 in acdc8d9
On BE, this copies the high-order byte of It works if I replace it with:
A clean fix is more complex because |
Great, thanks for testing! I'll leave the uncompressed codec disabled for now in the Debian packaging then, so the behaviour / feature set is consistent across platforms: https://salsa.debian.org/multimedia-team/libheif/-/commit/55e08a575f76be0ff4d9c1422c5669ef57922e50 |
@bradh I'm currently trying to fix the endianness issue in the uncompressed codec because it is a blocker for the v1.19.0 release. libheif/tests/uncompressed_decode_ycbcr420.cc Lines 466 to 472 in 41be98e
These are per-byte checks, but the image data is 16bits. Thus these tests only work on little-endian systems. |
It does appear to be byte order dependent. Recommended removal of the values check for 1.19.0 and I will try again with a uint16_t version later. |
The endianness issues should be fixed now (at least to make the tests run on ppc64). @fancycode Can you please retry building the package? Now with @bradh The endianness flags in the |
I have successfully build and tested libheif from 474d68b on a ppc64 box (after installing necessary dependencies):
Plugin details:
Test output:
Let me know if I should run the tests on another platform. Apart from that it looks good to me, so feel free to close this if you want. Thanks! |
Maybe the flags should be checked and files that are not big-endian should be rejected until support for this has been implemented? |
This could easily be done here: libheif/libheif/codecs/uncompressed/unc_codec.cc Lines 50 to 51 in 474d68b
If I see this correctly, the only case for which libheif will generate little-endian output is for |
There already is a (commented) check: libheif/libheif/codecs/uncompressed/unc_codec.cc Lines 204 to 210 in 474d68b
|
Right. Maybe a check could be added whether any component is >8bit so that 8bit still works with any endianness. |
It might be safer to check for exactly 8 bits, because uncompressed will do packed in some situations (e.g. 5-6-5). |
Added the check here: 4da2842 |
@farindk thank you for the work on this. |
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
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!
The text was updated successfully, but these errors were encountered: