<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">2013/4/11 Reuben Scratton <span dir="ltr"><<a href="mailto:reuben.scratton@gmail.com" target="_blank">reuben.scratton@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">Hi,<div><br></div><div>How can I get FFmpeg to detect and use ARM Neon code at runtime? </div><div><br></div><div>If I compile with -mfpu=neon then FFmpeg blows up with SIGILL (ILLOPTPC) when run on a non-Neon CPU. <br>
</div>
<div>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...</div><div><br></div><div><br></div><div>
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.</div>

<div><br></div><div><br></div></div></blockquote><div><br></div><div style>We had similar problems with optimized code for ARM that was caused by an outdated <a href="http://gas-preprocessor.pl">gas-preprocessor.pl</a>. Try to update it from <a href="https://github.com/mansr/gas-preprocessor" target="_blank" style="font-size:13px;font-family:arial,sans-serif">https://github.com/mansr/gas-preprocessor</a> and recompile. A good indicator if you need to update your gas-preproc is that you get a lot of warnings like this:</div>
<div style><br></div><div style><div class="im" style="font-family:arial,sans-serif;font-size:13px"><div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: empty_row from libavcodec/libavcodec.a(jrevdct_arm.o)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: end_of_row_loop from libavcodec/libavcodec.a(jrevdct_arm.o)</font></div><div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: start_column_loop from libavcodec/libavcodec.a(jrevdct_arm.o)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: column_loop from libavcodec/libavcodec.a(jrevdct_arm.o)</font></div><div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: empty_odd_column from libavcodec/libavcodec.a(jrevdct_arm.o)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: the_end from libavcodec/libavcodec.a(jrevdct_arm.o)</font></div><div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __b_evaluation from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __end_b_evaluation from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div><div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __a_evaluation from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __almost_empty_row from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div><div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __end_row_loop from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __end_b_evaluation2 from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div><div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __a_evaluation2 from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">ld: warning: ARM function not 4-byte aligned: __end_simple_idct_arm from libavcodec/libavcodec.a(simple_idct_arm.o)</font></div></div><div class="gmail_extra" style="font-family:arial,sans-serif;font-size:13px">
<font face="courier new, monospace" color="#0000ff"><b>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</b></font></div>
<div><font face="courier new, monospace" color="#0000ff"><b><br></b></font></div></div><div style>  </div></div></div></div>