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

Mathieu Velten matmaul
Tue Dec 23 21:47:31 CET 2008


2008/12/23 Michael Niedermayer <michaelni at gmx.at>:
>> or use a bigger rv40_bias table and use a shift to find the >>3
>> variant in the table ?
>
> yes
>

I still don't know how to do.
I don't want to use the rv40 table inside dsputil_h264_template_mmx.c
if possible to do not pollute h264 code with a rv40 table.

I can use a bigger table before the call of the function and I pass
rng_reg and rng_reg_div_8 as arguments, but I am not sure it will be
faster.

>> >>  {
>> >> -    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.
>>
>> before the patch rnd was a "boolean" and it decided bias value
>> according to the boolean.
>> now the bias is directly passed to the function.
>
> i would prefer to keep rnd

done, patch attached
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rv40_mc_mmx_v6.diff
Type: text/x-diff
Size: 12804 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081223/fc98dd0a/attachment.diff>



More information about the ffmpeg-devel mailing list