[FFmpeg-devel] [PATCH v2 1/2] x86: aacencdsp: Fix negating signed values in aac_quantize_bands

Martin Storsjö martin at martin.st
Wed Feb 5 23:19:19 EET 2025


Previously, we would do OR with the sign bit, forcing the output
to a negative value, while we want to negate it, by inverting the
sign bit.
---
 libavcodec/x86/aacencdsp.asm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/x86/aacencdsp.asm b/libavcodec/x86/aacencdsp.asm
index 86eaebcbe5..8e435b7d2a 100644
--- a/libavcodec/x86/aacencdsp.asm
+++ b/libavcodec/x86/aacencdsp.asm
@@ -96,7 +96,7 @@ cglobal aac_quantize_bands, 5, 5, 6, out, in, scaled, size, is_signed, maxval, Q
     addps     m2, m1
     minps     m2, m3
     andps     m5, m4, [inq+sizeq]
-    orps      m2, m5
+    xorps     m2, m5
     cvttps2dq m2, m2
     mova      [outq+sizeq], m2
     add       sizeq, mmsize
-- 
2.43.0



More information about the ffmpeg-devel mailing list