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

Michael Niedermayer michaelni
Tue Dec 23 03:40:26 CET 2008


On Tue, Dec 23, 2008 at 02:19:56AM +0100, Mathieu Velten wrote:
> 2008/12/23 Michael Niedermayer <michaelni at gmx.at>:
> > you are not doing ff_pw_tab[bias>>3], you are doing
> > "*ff_pw_tab[bias] >>3"
> >
> in this case it is the same.

yes both can be done by changing the table

hint:
%2 and 8+%2 can be then used to address both the original and
the >>3 variant


[...]

> Index: libavcodec/x86/dsputil_h264_template_mmx.c
> ===================================================================
> --- libavcodec/x86/dsputil_h264_template_mmx.c	(revision 16270)
> +++ libavcodec/x86/dsputil_h264_template_mmx.c	(working copy)
> @@ -25,9 +25,8 @@
>   * H264_CHROMA_OP must be defined to empty for put and pavgb/pavgusb for avg
>   * H264_CHROMA_MC8_MV0 must be defined to a (put|avg)_pixels8 function
>   */
> -static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y, int rnd)
> + static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y, const uint64_t *bias_reg)

added " " before static ?


>  {
> -    const uint64_t *rnd_reg;
>      DECLARE_ALIGNED_8(uint64_t, AA);
>      DECLARE_ALIGNED_8(uint64_t, DD);
>      int i;
> @@ -45,17 +44,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 */
>              "punpcklwd %%mm5, %%mm5\n\t"
>              "punpckldq %%mm5, %%mm5\n\t" /* mm5 = B = x */
>              "pxor %%mm7, %%mm7\n\t"
>              "psubw %%mm5, %%mm4\n\t"     /* mm4 = A = 8-x */

> -            :: "rm"(x+y), "m"(ff_pw_8), "m"(*rnd_reg));
> +            :: "rm"(x+y), "m"(ff_pw_8), "m"(*bias_reg));
>  
>          for(i=0; i<h; i++) {
>              __asm__ volatile(

this renaming is purely cosmetic -> does not belong in this patch,
besides i dont see the sense in it.


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

> ... defining _GNU_SOURCE...
For the love of all that is holy, and some that is not, don't do that.
-- Luca & Mans
-------------- 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/c5090752/attachment.pgp>



More information about the ffmpeg-devel mailing list