Comment 13 for bug 383240

Revision history for this message
Mans Rullgard (mansr) wrote :

Let me explain how the ARM feature selection in FFmpeg works. First, there is the question of runtime feature detection.
This is not done on ARM for two reasons: 1) building the entire code for the correct target makes a big difference in
performance, and 2) there is currently no good way to detect processor features from userspace.

The CPU selection flags passed to the compiler are determined by the --cpu configure option. Specific optimisations
are activated by compiling a test file using a representative instruction. The assembler will reject this if the chosen target
does not support that instruction. For this approach to work, the compiler must be either statically configured for the
correct target, or the appropriate flags must be passed. The FFmpeg configure script has no means of determining
correct values for -mfpu and similar flags. If any such flags are required, these must be set using --extra-cflags.

The correct way to configure for Cortex-A8 with NEON looks like this:

  configure --arch=arm --cpu=cortex-a8 --extra-cflags='-mfpu=neon -mfloat-abi=softfp' --cross-prefix=arm-none-linux-gnueabi-

Add other flags such as --sysroot, --enable/disable-stuff as necessary. There is rarely any need to explicitly --disable
anything, since optional features are only enabled if the required support libraries etc are available.

Hope this clarifies the situation.

As for the ultrasparc flags, this is weird and probably broken. I'd fix it, but I don't have the hardware.