Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Android NEON Support

Taner Şener edited this page Sep 18, 2020 · 15 revisions

Starting from v4.2, MobileFFmpeg Main releases dropped support for non-NEON devices using ARMv7 (arm-v7a) architecture.

But LTS releases still support them. In those releases, arm-v7a and arm-v7a-neon architectures share the same ABI armeabi-v7a. MobileFFmpeg detects the NEON support at runtime and loads the appropriate architecture for armeabi-v7a. This mechanism aims to benefit from NEON optimizations, but the size of armeabi-v7a ABI is bigger than other ABIs since two architectures are included in the same ABI.

Since v2.1 the following .so files are packaged for each ABI.

libavcodec.so
libavdevice.so
libavfilter.so
libavformat.so
libavutil.so
libc++_shared.so    # included only if openh264, rubberband, snappy, tesseract or x265 is enabled
libcpufeatures.so
libmobileffmpeg-abidetect.so
libmobileffmpeg.so
libswresample.so
libswscale.so

To enable NEON support on armeabi-v7a, the following libraries with _neon postfix are included additionally.

libavcodec_neon.so
libavdevice_neon.so
libavfilter_neon.so
libavformat_neon.so
libavutil_neon.so
libmobileffmpeg_armv7a_neon.so
libswresample_neon.so
libswscale_neon.so

If you want to decrease the size of armeabi-v7a ABI, you can use the following configurations and exclude one of these two architectures.

  • Use this configuration in build.gradle to remove arm-v7a-neon architecture
android {
    packagingOptions {
        exclude 'lib/armeabi-v7a/*_neon.so'
    }
}
  • Use this configuration in build.gradle to remove arm-v7a architecture
android {
    packagingOptions {
        exclude 'lib/armeabi-v7a/libavcodec.so'
        exclude 'lib/armeabi-v7a/libavformat.so'
        exclude 'lib/armeabi-v7a/libavfilter.so'
        exclude 'lib/armeabi-v7a/libavutil.so'
        exclude 'lib/armeabi-v7a/libswscale.so'
        exclude 'lib/armeabi-v7a/libswresample.so'
        exclude 'lib/armeabi-v7a/libavdevice.so'
    }
}
Clone this wiki locally