[XviD-devel] More MMX improvements => funky cbp!

skal skal at planet-d.net
Fri Sep 16 14:55:19 CEST 2005




    Howdy,

    i sent this message beginning of august, but it
    somehow got lost in oblivion.
    In case you're still interested, Carlo ;)

    bye!
Skal

----- Message transféré  -----
   Date : Sun, 07 Aug 2005 14:13:47 +0200



   Hi Carlo and all,

> after receiving your message, I tested again that MMX function.
> I extracted some parts from the benchmark and I did a small program for cross
> testing, like you suggested me.

   Thanks! I've added something similar in xvid_bench.c, based
   on your ideas. Your test is indeed the Right Thing.

> I perfectly understood your algorithm, but I had some doubts it could give us
> more speed.
> So, after an afternoon of work I was able coded this alternative function.
> It uses the method you suggested (just a bit modified because MMX instructions
> capabilities).
[...]
> Unfortunately, the final result can't be obtained so easily as you thought.
> Since there are six terms to accumulate, we need a shift-and-add anyways, like
> previous method.

    Hmm... never say never ;)

    I have another suggestion for you: you don't need 8bits
    to store each terms of cbp's scalar product. For luma, only
    4bits are strictly required. So, when i was previously
    talking about a 32-bits multiply (dcba * 0x01020408)>>24, it
    was rather comfortable. This multiply can fit into 16bits
    as: cbp_y = (dcba * 0x1248)>>12, where dcba is now:
        dcba = (d<<12) | (c<<8) | (b<<4) | a

    So: it's my impression the overall cbp_y + cbp_uv scalar
    product could fit into a single 'pmaddwd' instruction.

    (it's only an impression, since i'm making terrible
     efforts right now not fire up nasm and test the idea.
     And focus on packing my stuff for holiday leave, instead;)

> PS: I hope I passed the test on my coding skills with this exercise ^_-

   There's no such test around here.
   The only valued metric is the amount of phun you had
   coding tricks, and what you possibly learnt doing so! ;)

-Skal

ps: happy holidays everybody! (back in September)

----- Fin du message transféré -----




More information about the XviD-devel mailing list