[FFmpeg-devel] port mplayer eq filter to libavfilter

Michael Niedermayer michaelni
Sat Dec 4 16:44:34 CET 2010


On Fri, Dec 03, 2010 at 02:47:58AM +0100, Michael Niedermayer wrote:
[...]
>
> > +
> > +    __asm__ volatile (
> > +        "movd %3, %%mm3 \n\t"
> > +        "movd %4, %%mm4 \n\t"
> > +        "punpcklwd %%mm3, %%mm3 \n\t"
> > +        "punpcklwd %%mm4, %%mm4 \n\t"
> > +        "punpckldq %%mm3, %%mm3 \n\t"
> > +        "punpckldq %%mm4, %%mm4 \n\t"
> > +        "1: \n\t"
> > +        "pxor %%mm0, %%mm0 \n\t"
> > +        "mov %2, %%"REG_c" \n\t"
> > +        "sar $3, %%"REG_c" \n\t"
> > +        "2: \n\t"
> > +        "movq (%0), %%mm1 \n\t"
> 
> > +        "movq %%mm1, %%mm2 \n\t"
> 
> have you benchmarked changeing this one from mplayer?

note, you can trivially benchmark code by putting START/STOP_TIMER around
code that you want to benchmark


> 
> 
> > +        "punpcklbw %%mm0, %%mm1 \n\t"
> > +        "punpckhbw %%mm0, %%mm2 \n\t"
> > +        "psllw $4, %%mm1 \n\t"
> > +        "psllw $4, %%mm2 \n\t"
> > +        "pmulhw %%mm4, %%mm1 \n\t"
> > +        "pmulhw %%mm4, %%mm2 \n\t"
> > +        "paddw %%mm3, %%mm1 \n\t"
> > +        "paddw %%mm3, %%mm2 \n\t"
> > +        "packuswb %%mm2, %%mm1 \n\t"
> > +        "movq %%mm1, (%0) \n\t"
> > +        "add $8, %0 \n\t"
> > +        "dec %%"REG_c" \n\t"
> > +        "jnz 2b \n\t"
> > +        "mov %2, %%"REG_c" \n\t"
> > +        "and $7, %%"REG_c" \n\t"
> > +        "je 5f \n\t"
> > +        "3: \n\t"
> > +        "movzb (%0), %%"REG_a" \n\t"
> > +        "imul %4, %%"REG_a" \n\t"
> > +        "sar $12, %%"REG_a" \n\t"
> > +        "add %3, %%"REG_a" \n\t"
> > +        "mov %%"REG_a", %%"REG_d" \n\t"
> > +        "and $768, %%"REG_a" \n\t"
> > +        "je 4f \n\t"
> > +        "mov %%"REG_d", %%"REG_a" \n\t"
> > +        "neg %%"REG_a" \n\t"
> > +        "sar $31, %%"REG_a" \n\t"
> > +        "mov %%"REG_a", %%"REG_d" \n\t"
> > +        "4: \n\t"
> > +        "movb %%dl, (%0) \n\t"
> > +        "inc %0 \n\t"
> > +        "dec %%"REG_a" \n\t"
> > +        "jnz 3b \n\t"
> > +        "5: \n\t"
> > +        "add %5, %0 \n\t"
> > +        "dec"OPSIZE " %1 \n\t"
> > +        "jnz 1b \n\t"
> 
> > +        : "+r" (line), "+m" (h)
> > +        : "r" (w), "r" (brightness), "r" (contrast), "m" (step)
> > +        : "%"REG_c, "%"REG_d, "%"REG_a, "memory"
> 
> this has some potential to fail on some x86_32 compilers

if it does fail it can likely be solved by putting the code under #if HAVE_7REGS

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101204/0e973519/attachment.pgp>



More information about the ffmpeg-devel mailing list