[XviD-devel] some bframes ideas

Christoph Lampert chl at math.uni-bonn.de
Sat Mar 22 11:10:20 CET 2003


On Sat, 22 Mar 2003, suxen_drol wrote:
> > Trellis quantization _is_ great  ;-)  and it _is_ slow ;-)
> > BITS stuff for bframes would be great, btw., because there are much more
> > possible encoding mode here. 
> 
> iam sure this has been discussed before, and is not specific to bframes.
> why not sum up the coefficents values lost by a range of quantizers, and
> select one which results in the least error? 

I guess it's not much of a difference compared to SSE or SAD.  
1 "unit" less in coefficient data might lead to several more bits. I guess
ffmpeg has implemented this method (or rather full PSNR, but sum of
squared quantization error should be isomorphic to that), but the overall
effect is not big.  
What really is needed is a "perfect tradeoff" between bits needed and
quantization error. In theory a lagrangian should do, but fixing a good
value for that is... difficult.

The current BITS method of INTER/INTER4V decision is rather good for two
reasons: 
1) The SAD based method really sucks. Decision is almost pure chance...
2) There is a hierarchy between INTER and INTER4V: 4 vectors should always
lead to lower residue error than INTER, but it might or might not need
more bits for encoding. 
So BITS implements a decision "if INTER4V needs fewer bits, than use
it, otherwise stick to INTER". That way, decision for INTER4V will always 
have positive effect, but we might miss a few cases where INTER4V 
would be good _although_ I needed more bits. 

This problem is everywhere, also with adaptive quantization. You have to
find an optimal value for all MB quantizers to minimize distorsion _and_
bitrate. Minimizing distorsion at _fixed_ bitrate isn't that difficult
(computationally expensive, but possible), but minimizing both isn't a
well-posed problem. 

gruel 



More information about the XviD-devel mailing list