[x264-devel] Re: QP related variables

Laurent Aimar fenrir at via.ecp.fr
Fri Jul 23 20:18:09 CEST 2004


On Fri, Jul 23, 2004, Måns Rullgård wrote:
> Laurent Aimar <fenrir at via.ecp.fr> writes:
> 
> > On Thu, Jul 15, 2004, Måns Rullgård wrote:
> >> I've been trying to figure out the meaning of the various QP related
> >> variables used during encoding.  From what I can see the global QP
> >> value is used for all MBs.  Is this the case, or have I overlooked
> >> something?
> >  Yes it's that case, a global qp per frame.
> >
> >>  I also noticed a TODO comment in encoder/analyse.c, line
> >> 850.  What is this referring to?
> >   Implementing a RC that change QP per MB ;)
> >> 
> >> QP adjustments should be done by the rate control, so I need to know
> >> how to properly change the QP used for each MB.  Any hints there?
> >  Yes, the best is just to pass it to x264_macroblock_analyse and to replace
> >   h->mb.qp[h->mb.i_mb_xy] = x264_clip3( h->pps->i_pic_init_qp + h->sh.i_qp_delta + 0, 0, 51 );
> > by
> >   h->mb.qp[h->mb.i_mb_xy] = i_my_qp_for_this_mb;
> >
> > It should work but I never tested if the bitstream is correct.

> Well, it doesn't seem to work all that well.  The sample at
> http://mru.ath.cx/~mru/samples/x264-rc-1200.avi has some rather ugly
> artefacts that showed up when I started adjusting the QP per MB.
> Using CABAC gives different artefacts
> (http://mru.ath.cx/~mru/samples/x264-rc-1200-cabac.avi).  These do not
> look like typical blocking artefacts that would be expected from a
> misbehaving rate control.
 Yep, there was a bug I have just fixed. Now it seems to work well.

Btw, I have added a check at the start of analyse that verifies that 
abs(qp - last_qp) <= 12 and fixes qp if needed.

-- 
fenrir

-- 
This is the x264-devel mailing-list
If you are in trouble, please contact <postmaster at videolan.org>



More information about the x264-devel mailing list