On Mon, Jun 08, 2009 at 07:12:09PM +0200, Giovanni Bechis wrote:
> ImageMagick updated to 6.5.3.2, some regression tests (which uses 
> ffmpeg) fails and ffmpeg segfaults in put_pixels_clamped_mmx 
> (libavcodec.so.13.0) @amd64.
> Does anybody knows if is a known ffmpeg bug ?

probably.  maybe this patch (picked from ffmpeg svn some time ago)
helps?  ffmpeg really needs to be updated ...

-- 
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org

$OpenBSD$
--- libavcodec/i386/dsputil_mmx.c.orig  Sat May 24 22:00:38 2008
+++ libavcodec/i386/dsputil_mmx.c       Tue Oct 21 13:54:30 2008
@@ -482,6 +482,7 @@ static void clear_blocks_mmx(DCTELEM *blocks)
 static void add_bytes_mmx(uint8_t *dst, uint8_t *src, int w){
     x86_reg i=0;
     asm volatile(
+        "jmp 2f                         \n\t"
         "1:                             \n\t"
         "movq  (%1, %0), %%mm0          \n\t"
         "movq  (%2, %0), %%mm1          \n\t"
@@ -492,8 +493,9 @@ static void add_bytes_mmx(uint8_t *dst, uint8_t *src, 
         "paddb %%mm0, %%mm1             \n\t"
         "movq %%mm1, 8(%2, %0)          \n\t"
         "add $16, %0                    \n\t"
+        "2:                             \n\t"
         "cmp %3, %0                     \n\t"
-        " jb 1b                         \n\t"
+        " js 1b                         \n\t"
         : "+r" (i)
         : "r"(src), "r"(dst), "r"((x86_reg)w-15)
     );
@@ -504,6 +506,7 @@ static void add_bytes_mmx(uint8_t *dst, uint8_t *src, 
 static void add_bytes_l2_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int 
w){
     x86_reg i=0;
     asm volatile(
+        "jmp 2f                         \n\t"
         "1:                             \n\t"
         "movq   (%2, %0), %%mm0         \n\t"
         "movq  8(%2, %0), %%mm1         \n\t"
@@ -512,8 +515,9 @@ static void add_bytes_l2_mmx(uint8_t *dst, uint8_t *sr
         "movq %%mm0,  (%1, %0)          \n\t"
         "movq %%mm1, 8(%1, %0)          \n\t"
         "add $16, %0                    \n\t"
+        "2:                             \n\t"
         "cmp %4, %0                     \n\t"
-        " jb 1b                         \n\t"
+        " js 1b                         \n\t"
         : "+r" (i)
         : "r"(dst), "r"(src1), "r"(src2), "r"((x86_reg)w-15)
     );
@@ -784,7 +788,7 @@ static void draw_edges_mmx(uint8_t *buf, int wrap, int
 }
 
 #define PAETH(cpu, abs3)\
-void add_png_paeth_prediction_##cpu(uint8_t *dst, uint8_t *src, uint8_t *top, 
int w, int bpp)\
+static void add_png_paeth_prediction_##cpu(uint8_t *dst, uint8_t *src, uint8_t 
*top, int w, int bpp)\
 {\
     x86_reg i = -bpp;\
     x86_reg end = w-3;\
@@ -2018,7 +2022,7 @@ static void vector_fmul_add_add_sse(float *dst, const 
         ff_vector_fmul_add_add_c(dst, src0, src1, src2, src3, len, step);
 }
 
-static void float_to_int16_3dnow(int16_t *dst, const float *src, int len){
+static void float_to_int16_3dnow(int16_t *dst, const float *src, long len){
     // not bit-exact: pf2id uses different rounding than C and SSE
     int i;
     for(i=0; i<len; i+=4) {
@@ -2033,7 +2037,7 @@ static void float_to_int16_3dnow(int16_t *dst, const f
     }
     asm volatile("femms");
 }
-static void float_to_int16_sse(int16_t *dst, const float *src, int len){
+static void float_to_int16_sse(int16_t *dst, const float *src, long len){
     int i;
     for(i=0; i<len; i+=4) {
         asm volatile(

Reply via email to