[XviD-devel] [CVS Commit] bitstream/cbp.c

Christoph Lampert chl at math.uni-bonn.de
Sun Mar 9 13:05:57 CET 2003


I commited a minor change for speeding up plainC. My goal is still to beat
MMX ;-) but I didn't quite manage...

 =====  test cbp =====
PLAINC -   calc_cbp#1 0.356 usec       cbp=0x15
PLAINC -   calc_cbp#2 0.355 usec       cbp=0x38
PLAINC -   calc_cbp#3 0.346 usec       cbp=0xf
PLAINC -   calc_cbp#4 0.478 usec       cbp=0x5
 --- 
MMX    -   calc_cbp#1 0.343 usec       cbp=0x15
MMX    -   calc_cbp#2 0.337 usec       cbp=0x38
MMX    -   calc_cbp#3 0.336 usec       cbp=0xf
MMX    -   calc_cbp#4 0.343 usec       cbp=0x5


Anyway, I remembered Char Acter's proposal about keeping two C routines 
(even though that was for a new H.26L project), which I consider a good
idea, so from now on I'll always do two plain C routines, as it's now in
cbp.c:

One called calc_cbp_plain()  which is a straigh-forward calculatation of
cbp (just loops and checks if 16bit coefficients are 0). This is just as a
reference to understand what the routine does. It should not be used
unless for testing or as a fallback if the other routine turns out to be
buggy. 

The 'real' routine is  calc_cbp_c() which is loop-unrolled, uses 32/64bit
checks instead of 16bit etc. and is therefore faster. It's called when the
machine doesn't have MMX, PPC-asm or Altivec. 

The output of xvid_bench() "PLAINC" is _NOT_ the XXX_plain() routine, but
the XXX_c() routine. The XXX_plain() would have 

PLAINC -   calc_cbp#1 4.084 usec       cbp=0x15
PLAINC -   calc_cbp#2 4.156 usec       cbp=0x38
PLAINC -   calc_cbp#3 3.452 usec       cbp=0xf
PLAINC -   calc_cbp#4 5.657 usec       cbp=0x5

so let's not talk about it...

gruel 






More information about the XviD-devel mailing list