Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug 3694 - SDL_image fails to compile with the latest NDK (r15)
Olli Kallioinen Compiling SDL_image fails with the latest NDK(r15) with an error: SDL_image/external/jpeg-9/jidctfst.S:17:10: fatal error:'machine/cpu-features.h' file not found I was thinking that maybe it was an issue with the new NDK, but the NDK developers confirmed that the header was removed on purpose: android/ndk#443 Sylvain Some update as I looked more closely on this. The file jidctfst.S contains an assembly version of the fast integer inverse-DCT. the file jidctfst.c contains a C version of this "fast" fonction. It also exists C version "slow", which is more accurate. SDL_images use by default the slow version. JPEG default DCT method is also to use the slow function. To use the fast IDCT (C or Assembly), one needs to enable the compile flag in SDL IMG_jpeg.c FAST_JPEG which set dct_method to "JDCT_FASTEST". I enabled the FAST_JPEG and used the assembly implementation. And it just did not work: images are not decoded correctly and totally screwed up. Tried with ABI arm and armv7a, with clang and gcc. same result. I also tried a small benchmark loading tens of images on a device. When the slow version performs in 430 ms, the C-fast version is doing that 400ms, and the assembly-fast version is doing 390. which is not that much better. So I think, we could just allow the C fast version (which is working), for people who would enable FAST_JPEG in SDL2_image. Here's a patch that modify Android.mk (and also the one in external/jpeg-9).
- Loading branch information