[x264-devel] Re: QP related variables

Måns Rullgård mru at mru.ath.cx
Fri Jul 23 00:30:36 CEST 2004


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.

-- 
Måns Rullgård
mru at mru.ath.cx

-- 
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