[XviD-devel] swo more speedups possible

Radek Czyz syskin at ihug.com.au
Sat Jan 3 21:43:24 CET 2004


Hi everyone,

There are two places in the code where we can add easy (and not very 
big) speedups. I never mentioned that before because I assumed this is 
after-1.0 thing, but then again this is really easy to add, and the risk 
of breaking something isn't huge (but not smaller than usual).

Both have to do with the fact that VHQ is performing the same 
calculations as MBTransquant.

1. after VHQ, we know the coded-block-pattern for all inter-coded 
macroblocks. We can skip fdct and quantization for the blocks which will 
not be coded. This works provided that:
   - we're talking about chroma blocks, or
   - we're talking about luma blocks in halfpel mode
   - and Trellis will not re-encode some blocks which would otherwise be 
not-coded (TRUE for our trellis).

The first two conditions come from the fact that VHQ, as all ME, uses an 
approximation of qpel filter. As a result, CBP is not always identical, 
with a differece of a few blocks per frame.
Perhaps it would even be better to copy ME's CBP than calculate a new 
one... <- just a thought. Or, we can make it benefit hpel/chroma alone.

2. if VHQ decided on INTRA coding, it has already performed AC/DC 
prediction, and it's in HQ_ACDC_PRED mode. We can copy the 
predicted/not-predicted flag from VHQ rather than re-calculate it.

What do you think? CBP is already remembered for p-frames (I used it as 
ASSERT-like debug tool for VHQ), we just have to initialize it (as 0xff 
perhaps) in bframes and add some MBTransquant code, done.
AC/DC prediction is eaven easier.

Comments?
Radek


More information about the XviD-devel mailing list