dropbox / lepton

Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
https://blogs.dropbox.com/tech/2016/07/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs/
Apache License 2.0
5.01k stars 354 forks source link

Compilation fails on Linux/armhf #13

Closed ThomasKaiser closed 7 years ago

ThomasKaiser commented 8 years ago

I tried out compilation an a dual-core A20 board (Cortex-A7, armhf, Ubuntu 16.04, kernel 4.6.4) but make -j2 stops with

In file included from src/vp8/decoder/boolreader.hh:33:0,
                 from src/vp8/decoder/boolreader.cc:15:
src/vp8/decoder/../model/numeric.hh:11:23: fatal error: smmintrin.h: No such file or directory
compilation terminated.
Makefile:1814: recipe for target 'src/vp8/decoder/boolreader.o' failed
make[1]: *** [src/vp8/decoder/boolreader.o] Error 1

I did not further investigate but wanted to ask first whether the tool is supposed to be used on different platforms than x86/x86-64?

richardeoin commented 8 years ago

lepton makes use of intel SSE intrinsics, which are special assembly instructions found on x86. So it currently only runs on this platform. However, the ARMv7 architecture has somewhat equivalent functionality which is called NEON.

If you're keen you could fork lepton and use the sse2neon.h header to port it to ARMv7. Here's a repo for a different project where NEON support has been added to a codebase that previously only supported SSE, you could use this as an example.

(I have no connection with lepton, just a randomer offering advice)

Edit: lepton uses some SSE4 instructions, which aren't currently in sse2neon.h See https://github.com/dropbox/lepton/issues/11

danielrh commented 8 years ago

Richard: that's a really cool idea!

danielrh commented 8 years ago

For now, we have a scalar version on the emscripten branch: feel free to try it out: https://github.com/dropbox/lepton/tree/emscripten

danielrh commented 7 years ago

merged it into master