[FFmpeg-cvslog] x86: huffyuv: fix {add,diff}_int16

Christophe Gisquet git at videolan.org
Thu Jun 12 00:55:24 CEST 2014


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Wed Jun 11 21:13:23 2014 +0200| [508e7a5c16c93ae3df31d79b7e808cb7bc893b52] | committer: Michael Niedermayer

x86: huffyuv: fix {add,diff}_int16

They used an extra, undeclared register. Fixes a crash in
fate-vsynth3-ffvhuff444p16

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=508e7a5c16c93ae3df31d79b7e808cb7bc893b52
---

 libavcodec/x86/lossless_videodsp.asm |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/libavcodec/x86/lossless_videodsp.asm b/libavcodec/x86/lossless_videodsp.asm
index c822213..43958be 100644
--- a/libavcodec/x86/lossless_videodsp.asm
+++ b/libavcodec/x86/lossless_videodsp.asm
@@ -37,19 +37,21 @@ SECTION_TEXT
     add     wd, wd
     test    wq, 2*mmsize - 1
     jz %%.tomainloop
+    push  tmpq
 %%.wordloop:
     sub     wq, 2
 %ifidn %2, add
-    mov     ax, [srcq+wq]
-    add     ax, [dstq+wq]
+    mov   tmpw, [srcq+wq]
+    add   tmpw, [dstq+wq]
 %else
-    mov     ax, [src1q+wq]
-    sub     ax, [src2q+wq]
+    mov   tmpw, [src1q+wq]
+    sub   tmpw, [src2q+wq]
 %endif
-    and     ax, maskw
-    mov     [dstq+wq], ax
+    and   tmpw, maskw
+    mov     [dstq+wq], tmpw
     test    wq, 2*mmsize - 1
     jnz %%.wordloop
+    pop   tmpq
 %%.tomainloop:
 %ifidn %2, add
     add     srcq, wq
@@ -85,11 +87,11 @@ SECTION_TEXT
 %endmacro
 
 INIT_MMX mmx
-cglobal add_int16, 4,4,5, dst, src, mask, w
+cglobal add_int16, 4,4,5, dst, src, mask, w, tmp
     INT16_LOOP a, add
 
 INIT_XMM sse2
-cglobal add_int16, 4,4,5, dst, src, mask, w
+cglobal add_int16, 4,4,5, dst, src, mask, w, tmp
     test srcq, mmsize-1
     jnz .unaligned
     test dstq, mmsize-1
@@ -99,11 +101,11 @@ cglobal add_int16, 4,4,5, dst, src, mask, w
     INT16_LOOP u, add
 
 INIT_MMX mmx
-cglobal diff_int16, 5,5,5, dst, src1, src2, mask, w
+cglobal diff_int16, 5,5,5, dst, src1, src2, mask, w, tmp
     INT16_LOOP a, sub
 
 INIT_XMM sse2
-cglobal diff_int16, 5,5,5, dst, src1, src2, mask, w
+cglobal diff_int16, 5,5,5, dst, src1, src2, mask, w, tmp
     test src1q, mmsize-1
     jnz .unaligned
     test src2q, mmsize-1



More information about the ffmpeg-cvslog mailing list