[Libav-user] Runtime ARM Neon detection?
Reuben Scratton
reuben.scratton at gmail.com
Thu Apr 11 21:59:12 CEST 2013
>> If I compile with -mfpu=neon then FFmpeg blows up
>> with SIGILL (ILLOPTPC) when run on a non-Neon CPU.
>> If I compile with -mfpu=vfvp3 then FFmpeg runs fine,
>> but presumably without the optimized code
> Did you test this? (with a debugger)
> I don't know but it seems very unlikely to me that a
> compiler option ("-mfpu=vfvp3") affects FFmpeg asm
> optimizations.
Not with a debugger - I'm not too handy with gdb - just by turning compiler
options on and off in the hope of squeezing better performance from slower
devices. I could be wrong but since -mfpu=neon always results in ILLOPTPC
and other -mfpu options don't, it seemed logical to connect the two.
Here's my configuration and build output for Android's armeabi-v7a ABI ...
perhaps I'm using a wrong combination of options?
# ./configure --target-os=linux --arch=arm
--cross-prefix=/Users/reuben/android/ndk/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-
--sysroot=/Users/reuben/android/ndk/platforms/android-8/arch-arm
--disable-everything --enable-shared --disable-symver --enable-static
--enable-gpl --enable-nonfree --disable-ffmpeg --disable-ffplay
--disable-ffserver --disable-ffprobe --disable-encoders --disable-muxers
--disable-devices --disable-protocols --enable-asm --arch=arm5te
--enable-armv5te --enable-avfilter --enable-parser=mpeg4video
--enable-parser=mpegaudio --enable-parser=mpegvideo --enable-demuxer=m4v
--enable-parser=mov --enable-demuxer=avi --enable-demuxer=mov
--enable-decoder=h264 --enable-parser=h264 --enable-demuxer=h264
--enable-decoder=aac --enable-parser=aac --enable-demuxer=aac
--enable-decoder=mp3 --enable-demuxer=mp3 --enable-avresample
--enable-filter=aconvert --enable-filter=atempo --enable-neon
--prefix=/Users/reuben/work/pluralsight/android/app/jni/build/ffmpeg/armeabi-v7a
--disable-doc --extra-cflags='-fPIC -DANDROID -DANDROID_NDK -std=c99
-march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3 -O3 -Os -Wno-sign-compare
-Wno-switch -Wno-pointer-sign' --extra-ldflags=
C compiler
/Users/reuben/android/ndk/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc
ARCH arm (armv7-a)
big-endian no
runtime cpu detection yes
ARMv5TE enabled yes
ARMv6 enabled yes
ARMv6T2 enabled yes
VFP enabled yes
NEON enabled yes
THUMB enabled no
debug symbols yes
strip symbols yes
optimize for size no
optimizations yes
static yes
shared yes
postprocessing support yes
new filter support yes
network support no
threading support pthreads
safe bitstream reader yes
SDL support no
texi2html enabled no
perl enabled yes
pod2man enabled yes
makeinfo enabled yes
External libraries:
zlib
Enabled decoders:
aac h264 mp3
Enabled encoders:
Enabled hwaccels:
Enabled parsers:
aac mpeg4video mpegvideo
h264 mpegaudio
Enabled demuxers:
aac h264 mov
avi m4v mp3
Enabled muxers:
Enabled protocols:
Enabled filters:
aconvert atempo
Enabled bsfs:
Enabled indevs:
Enabled outdevs:
License: nonfree and unredistributable
Creating config.mak and config.h...
libavutil/avconfig.h is unchanged
WARNING:
/Users/reuben/android/ndk/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-pkg-config
not found, library detection may fail.
CC libavdevice/alldevices.o
...
On Thu, Apr 11, 2013 at 5:48 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Reuben Scratton <reuben.scratton at ...> writes:
>
> > If I compile with -mfpu=neon then FFmpeg blows up
> > with SIGILL (ILLOPTPC) when run on a non-Neon CPU.
>
> > If I compile with -mfpu=vfvp3 then FFmpeg runs fine,
> > but presumably without the optimized code
>
> Did you test this? (with a debugger)
> I don't know but it seems very unlikely to me that a
> compiler option ("-mfpu=vfvp3") affects FFmpeg asm
> optimizations.
>
> [...]
>
> > Would it be possible for FFmpeg to detect Neon at runtime?
>
> Looking at ff_dsputil_init_arm() in
> libavcodec/arm/dsputil_init_arm.c, that is exactly what it
> currently does.
>
> Carl Eugen
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130411/6f1b2a78/attachment.html>
More information about the Libav-user
mailing list