[FFmpeg-devel] [PATCH] modification of the MMX H264 MC chroma functions to support RV40
Michael Niedermayer
michaelni
Tue Dec 23 19:57:18 CET 2008
On Tue, Dec 23, 2008 at 01:15:53PM +0100, Mathieu Velten wrote:
> 2008/12/23 Michael Niedermayer <michaelni at gmx.at>:
> > 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
>
> Sorry I don't understand what you mean. Should I use an other table
> (rv40_bias_div_8 for example) and pass the bias for the 1-dimensional
> case in the function call too ?
> or use a bigger rv40_bias table and use a shift to find the >>3
> variant in the table ?
yes
>
> >> {
> >> - 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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- 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/0029734b/attachment.pgp>
More information about the ffmpeg-devel
mailing list