[FFmpeg-devel] [PATCH] lavc/x86/videodsp: Fix clobbered FPU state on x86-32

James Almer jamrial at gmail.com
Mon Nov 11 01:57:56 EET 2024


On 11/10/2024 3:38 PM, Frank Plowman wrote:
> These assembly optimisations can use MMX.  They failed to reset the
> floating-point state when they are done, hence subsequent floating-point
> operations return nonsense values.
> 
> This fixes the FATE failure for vvc-output-ref on x86-32, e.g.
> https://fate.ffmpeg.org/report.cgi?slot=x86_32-uubuntu-mingw32-gcc&time=20241110053421
> 
> Signed-off-by: Frank Plowman <post at frankplowman.com>
> ---
>   libavcodec/x86/videodsp.asm | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/x86/videodsp.asm b/libavcodec/x86/videodsp.asm
> index 3cc07878d3..6144f13fca 100644
> --- a/libavcodec/x86/videodsp.asm
> +++ b/libavcodec/x86/videodsp.asm
> @@ -313,6 +313,7 @@ cglobal emu_edge_vfix %+ %%n, 1, 5, 1, dst, src, start_y, end_y, bh
>       jnz .bottom_loop                            ; }
>   
>   .end:
> +    emms

This needs to be added only for the MMX version, not the SSE one, so 
wrap it in a %if mmsize == 8 check.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241110/bbec9ca9/attachment.sig>


More information about the ffmpeg-devel mailing list