Giter VIP home page Giter VIP logo

android-libjpeg-turbo's Introduction

libjpeg-turbo for Android

This repository provides a working Android.mk build configuration for libjpeg-turbo, which means that you'll be able to build your app with ndk-build instead of resorting to toolchain trickery. Just add this repository as a Git submodule and you should be good to go.

Note however that this repository was originally created for a single purpose; to encode JPG files in a different NDK project. Therefore JNI bindings are not provided but a pull request is welcome. Also, any libjpeg-turbo feature that requires another dependency is currently not supported (incl. colorspace conversions). Again, pull requests are welcome.

Currrently, the following ABIs are supported:

  • armeabi
  • armeabi-v7a
  • armeabi-v7a-hard
  • arm64-v8a
  • x86
  • x86_64, requires Android NDK Revision 10e (May 2015) or later

SIMD/ASM optimizations are enabled for supported ABIs where possible. libjpeg-turbo does not support MIPS properly (yet). Since MIPS is not supported, you'll need to specify your supported ABIs in Application.mk instead of simply giving it APP_ABI := all.

Note that compiler optimization options are NOT included right now. If, for example, you wish to use -Ofast or other options, you'll need to add them yourself, possibly to your Application.mk.

Requirements

The following combinations are known to work:

Usage

First, set up a vendor folder in your own project. You can skip this step if you've already decided where you wish to put the module.

mkdir -p jni/vendor
echo 'include $(call all-subdir-makefiles)' >> jni/vendor/Android.mk

Then add this repo as a submodule to your own project.

git submodule add --name libjpeg-turbo \
  https://github.com/openstf/android-libjpeg-turbo.git jni/vendor/libjpeg-turbo

You should now be able to do LOCAL_STATIC_LIBRARIES += libjpeg-turbo in your own module, #include <turbojpeg.h> and ndk-build.

Updating libjpeg-turbo

You need to go and fetch libjpeg-turbo first. Download and extract the source package to jni/vendor/libjpeg-turbo. It's not a submodule because they still use SVN. Check jni/vendor/libjpeg-turbo/Android.mk to see which version of libjpeg-turbo is expected.

cd jni/vendor/libjpeg-turbo
cp ~/Downloads/libjpeg-turbo-1.4.1.tar.gz .
tar xzvf libjpeg-turbo-1.4.1.tar.gz

To make updating easier, the jni/vendor/libjpeg-turbo/libjpeg-turbo-*-*-* folder should contain only unmodified original source files. Do not configure or move files around, it will be a pain later. Just unpack the source package and leave it be as-is.

You may sometimes also need to update the convenience files in jni/vendor/libjpeg-turbo/include. This doesn't seem to happen very often, though.

Now update the SOURCE_PATH in jni/vendor/libjpeg-turbo/Android.mk. Then run ndk-build to make sure nothing broke.

Then git rm -r the previous libjpeg-turbo source and commit the new source with your Android.mk modification(s).

Contributing

See CONTRIBUTING.md.

License

See LICENSE. libjpeg-turbo itself is governed by its own license.

Copyright © CyberAgent, Inc. All Rights Reserved.

android-libjpeg-turbo's People

Contributors

sorccu avatar

Stargazers

Enrique-porras15 avatar

Watchers

James Cloos avatar xinyu0601 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.