[XviD-devel] GME and Block ME

Christoph Lampert chl at math.uni-bonn.de
Sat Apr 19 16:23:45 CEST 2003


On Sat, 19 Apr 2003, Michael Niedermayer wrote:

> Hi
> 
> On Saturday 19 April 2003 13:15, Christoph Lampert wrote:
> > On Sat, 19 Apr 2003, Michael Niedermayer wrote:
> > > Hi
> > >
> > > On Saturday 19 April 2003 08:56, Marco Al wrote:
> > > > From: "Michael Niedermayer" <michaelni at gmx.at>
> > > >
> > > > > yes sounds better, ill change ffmpeg/mencoder docs to that :)
> > > >
> > > > Hey, since you are reading this a question :) Does your code do an
> > > > optimal search or an M-best search?
> > >
> > > optimal, except that only 0, level, level-1 are checked, IIRC additionaly
> > > checking level-2 had only a few byte lower filesize at constant quant,
> > > the level-2 code is there and outcommented if u want to try
> > >
> > > for h263 quantizers a larger level difference should not be needed
> > > the dequantized level stepsize is 2*qp and so for level-3 (!= 0) we need
> > > to gain at least ((2.5*2*qp)^2 - (0.5*2*qp)^2)/lambda bits where lambda
> > > is 0.85*qp^2 as recommanded by some doc
> >
> > Hi, thanks for explainations, and btw. the lambda values would have
> > been my next question anyway: ffmpeg's mpegvideo.c reads
> >
> >    lambda= (qscale*qscale*64*105 + 64)>>7; //FIXME finetune
> >
> > and
> >
> >    int score= distoration + length[UNI_AC_ENC_INDEX(run,level)]*lambda;
> >
> > which I read as  lambda = 64*105/128 * qscale^2
> >
> > Where does the extra factor of 64 come from (or 16 perhaps, considering
> > stepsize = 2*qscale) ?
> very simple, the unquantized stuff is scaled by 8, so the distoration is 
> scaled by 64, so we need to scale the bits by 64 too 

Ahhh, okay. I thought that was already part taken care of. Okay.

gruel




More information about the XviD-devel mailing list