[Ffmpeg-devel] Segfault when encoding MPEG with MMX support

Michael Niedermayer michaelni
Mon Jul 11 01:23:54 CEST 2005


Hi

On Sunday 10 July 2005 23:57, Tobias Grimm wrote:
> Some more information:
>
> For Debian mpegvideo_mmx_template.c is modified for PIC. Maybe the
> problem is caused there.
>
> When compiling I get this warning:
>
> i386/mpegvideo_mmx_template.c: In Funktion ?dct_quantize_MMX?:
> i386/mpegvideo_mmx_template.c:156: Warnung: use of memory input without
> lvalue in asm operand 2 is deprecated
>
> And thats the code in question, starting with line 156. The "#if
> defined(PIC)"-Parts are the modifications for the Debian package.
>
>         asm volatile(
>             "movd %%"REG_a", %%mm3        \n\t" // last_non_zero_p1
>             SPREADW(%%mm3)
>             "pxor %%mm7, %%mm7            \n\t" // 0
>             "pxor %%mm4, %%mm4            \n\t" // 0
>             "mov $-128, %%"REG_a"        \n\t"
>             ".balign 16                \n\t"
>             "1:                    \n\t"
>             "pxor %%mm1, %%mm1            \n\t" // 0
>             "movq (%1, %%"REG_a"), %%mm0    \n\t" // block[i]
>             "pcmpgtw %%mm0, %%mm1        \n\t" // block[i] <= 0 ? 0xFF :
> 0x00
>             "pxor %%mm1, %%mm0            \n\t"
>             "psubw %%mm1, %%mm0            \n\t" // ABS(block[i])
>             "movq (%3, %%"REG_a"), %%mm6    \n\t" // bias[0]
>             "paddusw %%mm6, %%mm0        \n\t" // ABS(block[i]) + bias[0]
> #if defined(PIC) && !defined(ARCH_X86_64)
>             "push %%"REG_a"            \n\t"
>             "movl %2, %%"REG_a"            \n\t"
>             "movq (%%"REG_a", %%"REG_a"), %%mm5    \n\t" // qmat[i]

note: dereferencing (2*pointer) does work in assembly as well as in c except 
you dont need these ugly casts to silence that silly compiler thinking it 
wont work

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list