[XviD-devel] Return PSNR in new API?

Christoph Lampert xvid-devel@xvid.org
Fri, 24 Jan 2003 15:02:19 +0100 (CET)


Hi,

I admit I don't remember the new API exactly, but when thinking about
bframes and adaptive learning, I though, we should extend our return
values to support more than just what is needed for current two-pass. 

I though of a new class of flags e.g.  STATS_xxx  which triggers the
creation of encoding statistic and Statistics structure could have entries
for them. 

Currently, filesize and number of INTER/INTRA-blocks, etc. is always
calculate, and that's okay because those can be very fast (just a few 
incs)

But e.g. internal PSNR (or rather MSE because it can be done in integers)
is also an interesting value to return, and that's not as fast to
calculate, so it should only be done if the user wants it (e.g. only in
first pass, not in second, or for a "learning" mode, not for final encode,
etc.).  Therefore a flag STATS_MSE, and the value would be calculated and
return in pStats->mse (we might need this flag also during encoder
generation, because we need an extra buffer). 
I'm sure other things are possibole, too. Do we return quantizer
distribution within a frame for adaptive quant? Do we return distribution 
of bits needed for encoding, or average length of motion vectors? 
This might all be helpful to decide on ratecontrol and/or bframes, etc. 

MSE/PSNR code is already there, just #ifdef'ed .

Any objections to turning #ifdef's into FLAGS ? 

gruel