[FFmpeg-devel] [PATCH] modification of the MMX H264 MC chroma functions to support RV40

Michael Niedermayer michaelni
Tue Dec 23 01:53:30 CET 2008


On Tue, Dec 23, 2008 at 12:40:18AM +0100, Mathieu Velten wrote:
[...]
> >> @@ -45,17 +46,16 @@
> >>          /* 1 dimensional filter only */
> >>          const int dxy = x ? 1 : stride;
> >>
> >> -        rnd_reg = rnd ? &ff_pw_4 : &ff_pw_3;
> >> -
> >>          __asm__ volatile(
> >>              "movd %0, %%mm5\n\t"
> >>              "movq %1, %%mm4\n\t"
> >> -            "movq %2, %%mm6\n\t"         /* mm6 = rnd */
> >> +            "movq %2, %%mm6\n\t"
> >
> >> +            "psrlw $3, %%mm6\n\t"        /* mm6 = bias >> 3 */
> >
> > is this a useless instruction that can be merged into the table?
> >
> 
> I can do it in C (bias_reg = ff_pw_tab[bias>>3]) instead of shift the
> mmx register itself but I'm not sure we will gain in performance.

you are not doing ff_pw_tab[bias>>3], you are doing 
"*ff_pw_tab[bias] >>3"


> 
> > [...]
> >> Index: libavcodec/x86/h264dsp_mmx.c
> >> ===================================================================
> >> --- libavcodec/x86/h264dsp_mmx.c      (revision 16270)
> >> +++ libavcodec/x86/h264dsp_mmx.c      (working copy)
> >> @@ -19,6 +19,7 @@
> >>   */
> >>
> >>  #include "dsputil_mmx.h"
> >> +#include "libavcodec/rv40data.h"
> >
> > duplicating lots of tables ...
> >
> 
> then I could just copy the small rv40_bias table I need in dsputil_mmx.c
> or I could create a rv40data.c file and use extern, as you want.

after looking again, you dont need this table at all.
you have 2 tables and some odd indirection from them, one table is plenty


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

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081223/ea9e5ef2/attachment.pgp>



More information about the ffmpeg-devel mailing list