[XviD-devel] optimizations

Radek Czyz radoslaw at airnet.com.au
Tue Apr 8 21:02:07 CEST 2003


Hi,

New stuff optimized - GetReference() this time. Do you remember this
cute 'switch' statement which was choosing appropriate reference
picture (ref, refh, refv, refhv)? Well it was horribly slow :)
Not only the branches were wrongly predicted, but also it was trying
very hard to use "/" symbol to divide by 2 and round towards minus
infinity...

I'll commit new code in a second. It's visibly faster :)

Other changes:
- I didn't understand some of my _BITS code for INTRA ;) so I rewrote
  the part which I didn't understand. It performs better now, too ;).
- Some b-frame decision stuff again... I invented a better way of
  detecting still scenes, it's not so sensitive for them (although the
  detection is very accurate) so the effect is very good :).
- encoder.c - I disabled bframe_threshold (but just uncomment it if you
  need it), because our vfw was setting it to 255 (?). Anyway, it's
  dev-api-4 stuff, not dev-api-3.
  
And now, I'll write something I wanted to write a few days ago but
forgot.
It's about GMC. I tried to incorporate GMC to BITS and it didn't work.
The problem was that BITS decision pays huge attention to vector
prediction. When I changed mcsel, I also changes the average vector,
and this changes prediction for other blocks. The result was very bad.
So if you want to know my opinion, I say you can't do ME first, then
GMC on the basis of vectors, then mcsel. Pre-pass is the only way. And
now the tricky part: we're doing pre-pass already! It's called p/b/i
decision. It's very fast, reasonably accurate (well don't count on it
too much), and it tries to find the best match, it doesn't try to
limit vector length. Exactly what you need for gmc.
Now, a thing to note: our dev-api-4 does not support 'hinted me'
anymore. Well great, but in second pass we're not doing the decision
again - so re-using the vectors from first pass just for GMC appears
reasonable... What now? 

OK this was long ;)

Regards,
Radek



More information about the XviD-devel mailing list