[FFmpeg-devel] [RFC]lavu/x86/pixelutils: Call emms before returning.

Hendrik Leppkes h.leppkes at gmail.com
Mon Oct 3 00:04:26 EEST 2016

On Sun, Oct 2, 2016 at 10:53 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Hi!
> The functions in libavutil/x86/pixelutils.asm are exported
> to the library users if I understand the code correctly.
> I suspect it can be expected that the MMX state is reset
> after returning.
> Fixes the pixelutils fate test with musl on x86-32.
> Please comment, Carl Eugen

These functions are called in tight loops, and emms is then called in
the user-code after the loop. Calling emms inside the DSP function
would result in a performance degredation.

If a test doesn't call emms after using it, then that should be fixed.
And the docs should perhaps be amended to make note of that. Many DSP
functions work like that, to allow using them in tight loops without
the overhead.

- Hendrik

More information about the ffmpeg-devel mailing list