[Ffmpeg-devel] RUNTIME_CPUDETECT broken on PPC due to -maltivec
Fri Mar 9 18:53:25 CET 2007
FFmpeg's runtime AltiVec detection doesn't work, the library crashes
in random places on a G3 machine.
Contrary to common belief, when using -maltivec gcc *can* generate
AltiVec code in unexpected, non-vector-using places. Whether this is the
correct behaviour or not, I don't know, but it's gcc's behaviour. And
without -maltivec, there is no way to include <altivec.h> and use vector
Fixing that is not easy. It requires least the following:
- use -maltivec only for source files that use <altivec.h>
- ensure that no codepath leads to a source file built with
-maltivec when the CPU does not support AltiVec, which means
monsters such as postprocess.c and swscale.c need to be
I have started working on this for the Debian FFmpeg packages, my
work in progress can be followed here:
Before I spend time polishing that patch, I'd like to know whether
there is interest from the FFmpeg developers to integrate a proper fix
upstream, or if you're more of the opinion that it's gcc that needs
fixing or that runtime G3 support is not a requirement (in which case I
won't probably bother cleaning up the patch).
Any comments welcome.
More information about the ffmpeg-devel