[XviD-devel] New Qpel code
Edouard Gomez
ed.gomez at free.fr
Sun Aug 24 15:44:50 CEST 2003
Christoph Lampert (chl at math.uni-bonn.de) wrote:
> Feature freeze was 2 month ago. Do we really need new code just for
> speedup, possibly introducing new errors before releasing 1.0?
The only i dislike with this code is the fact we have now:
1/ code for ia32 only
2/ another piece of code for the non ia32
Moreover, i had a look at the new code, and it is impossible to code
equivalent functions to plug them in a XVID_QP_FUNCS because with the
old functions (transfer8x8_... interpolate16x16_...) we need a temporary
storage area, that the new type of prototype does not provide.
Another point i dislike is the fact that we could have removed the nasty
switch easily, just by not using a structure for qpel function
pointers. I mean something like that:
typedef struct XVID_QP_PASS xvid_qp_funcs_t[16];
Then somewhere we would have filled the 16 pointers, each pointer
replacing the equivalent calls we can find in a switch case in current
code.
Then the big switch becomes simply:
qp_funcs[(dx&3) | ((dy&3)<<2)](dst, src, tmp, 16, stride, rounding);
I use that a lot in mbtransquant[1], where i removed most of the
branching using function arrays. As xvid already uses pointers to
functions, that does not slow things down.
PS: while checking the code, i just noticed it's a trick i have ready in
a patchset but is neither commited to my tree nor the CVS. Btw i use it
extensively to remove branches when i know the branches just decide what
function has to be called.
--
Edouard Gomez
More information about the XviD-devel
mailing list