[Libav-user] Runtime ARM Neon detection?

Lars Hammarstrand lars.hammarstrand at gmail.com
Thu Apr 11 19:36:43 CEST 2013


2013/4/11 Reuben Scratton <reuben.scratton at gmail.com>

> Hi,
>
> How can I get FFmpeg to detect and use ARM Neon code at runtime?
>
> 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 because this is what I currently have and I am
> getting performance complaints...
>
>
> Would it be possible for FFmpeg to detect Neon at runtime? This is for
> Android and the Android NDK does includes a demo project that shows how to
> do CPU feature detection at runtime... that's the easy bit. I don't know
> how or where to begin updating FFmpeg to use it.
>
>
>
We had similar problems with optimized code for ARM that was caused by an
outdated gas-preprocessor.pl. Try to update it from
https://github.com/mansr/gas-preprocessor and recompile. A good indicator
if you need to update your gas-preproc is that you get a lot of warnings
like this:

ld: warning: ARM function not 4-byte aligned: empty_row from
libavcodec/libavcodec.a(jrevdct_arm.o)
ld: warning: ARM function not 4-byte aligned: end_of_row_loop from
libavcodec/libavcodec.a(jrevdct_arm.o)
ld: warning: ARM function not 4-byte aligned: start_column_loop from
libavcodec/libavcodec.a(jrevdct_arm.o)
ld: warning: ARM function not 4-byte aligned: column_loop from
libavcodec/libavcodec.a(jrevdct_arm.o)
ld: warning: ARM function not 4-byte aligned: empty_odd_column from
libavcodec/libavcodec.a(jrevdct_arm.o)
ld: warning: ARM function not 4-byte aligned: the_end from
libavcodec/libavcodec.a(jrevdct_arm.o)
ld: warning: ARM function not 4-byte aligned: __b_evaluation from
libavcodec/libavcodec.a(simple_idct_arm.o)
ld: warning: ARM function not 4-byte aligned: __end_b_evaluation from
libavcodec/libavcodec.a(simple_idct_arm.o)
ld: warning: ARM function not 4-byte aligned: __a_evaluation from
libavcodec/libavcodec.a(simple_idct_arm.o)
ld: warning: ARM function not 4-byte aligned: __almost_empty_row from
libavcodec/libavcodec.a(simple_idct_arm.o)
ld: warning: ARM function not 4-byte aligned: __end_row_loop from
libavcodec/libavcodec.a(simple_idct_arm.o)
ld: warning: ARM function not 4-byte aligned: __end_b_evaluation2 from
libavcodec/libavcodec.a(simple_idct_arm.o)
ld: warning: ARM function not 4-byte aligned: __a_evaluation2 from
libavcodec/libavcodec.a(simple_idct_arm.o)
ld: warning: ARM function not 4-byte aligned: __end_simple_idct_arm from
libavcodec/libavcodec.a(simple_idct_arm.o)
*ld: in libavcodec/libavcodec.a(h264qpel_neon.o), in section __TEXT,__text
reloc 12: R_ABS reloc but no absolute symbol at target address for
architecture armv7*
*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130411/d9e650f5/attachment.html>


More information about the Libav-user mailing list