diff mbox

[FFmpeg-devel] ffmpeg fft: fix broken opus on 3dnow

Message ID alpine.DEB.2.02.1711231920180.31462@leontynka
State Accepted
Commit fbdd78fa3e9949eb8b0cf6edc2548ed50e11bf71
Headers show

Commit Message

Mikulas Patocka Nov. 23, 2017, 7:12 p.m. UTC
The commit b7c16a3f2c4921f613319938b8ee0e3d6fa83e8d ("x86: fft: Port to
cpuflags") breaks the opus decoder in ffmpeg when compiling for 3dnow. The
output is audible, but there's a lot of noise.

This could be tested by disabling sse and compiling ffmpeg on a processor
with 3dnow support:
CC='gcc -m32' ./configure --disable-sse --disable-sse2 --disable-sse3

The reason for the breakage is that the commit unintentionally changed the 
INTERL macro so that it is empty when compiling for 3dnow. This patch 
fixes it.

Signed-off-by: Mikulas Patocka <mikulas@twibright.com>

---
 libavcodec/x86/fft.asm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer Nov. 25, 2017, 4:12 p.m. UTC | #1
On 11/23/2017 4:12 PM, Mikulas Patocka wrote:
> The commit b7c16a3f2c4921f613319938b8ee0e3d6fa83e8d ("x86: fft: Port to
> cpuflags") breaks the opus decoder in ffmpeg when compiling for 3dnow. The
> output is audible, but there's a lot of noise.
> 
> This could be tested by disabling sse and compiling ffmpeg on a processor
> with 3dnow support:
> CC='gcc -m32' ./configure --disable-sse --disable-sse2 --disable-sse3
> 
> The reason for the breakage is that the commit unintentionally changed the 
> INTERL macro so that it is empty when compiling for 3dnow. This patch 
> fixes it.
> 
> Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
> 
> ---
>  libavcodec/x86/fft.asm |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: ffmpeg/libavcodec/x86/fft.asm
> ===================================================================
> --- mplayer.orig/libavcodec/x86/fft.asm
> +++ mplayer/libavcodec/x86/fft.asm
> @@ -199,7 +199,7 @@ SECTION .text
>      vextractf128  %4 %+ H(%5), %3, 0
>      vextractf128   %4(%5 + 1), %2, 1
>      vextractf128  %4 %+ H(%5 + 1), %3, 1
> -%elif cpuflag(sse)
> +%elif cpuflag(sse) || cpuflag(3dnow)
>      mova     %3, %2
>      unpcklps %2, %1
>      unpckhps %3, %1

Confirmed and applied. Thanks!
diff mbox

Patch

Index: ffmpeg/libavcodec/x86/fft.asm
===================================================================
--- mplayer.orig/libavcodec/x86/fft.asm
+++ mplayer/libavcodec/x86/fft.asm
@@ -199,7 +199,7 @@  SECTION .text
     vextractf128  %4 %+ H(%5), %3, 0
     vextractf128   %4(%5 + 1), %2, 1
     vextractf128  %4 %+ H(%5 + 1), %3, 1
-%elif cpuflag(sse)
+%elif cpuflag(sse) || cpuflag(3dnow)
     mova     %3, %2
     unpcklps %2, %1
     unpckhps %3, %1