[XviD-devel] vop flag question

Pascal Massimino skal at planet-d.net
Mon Jul 11 23:36:52 CEST 2005


	Hello,

On Thu, 2005-06-23 at 21:36, MAILER-DAEMON at edu.bnhof.de wrote:

> > 	hmm... try setting the Cb & Cr values to '127' instead.
> > 
> 
> Thanks. That is a good idea. Slipped my mind that Cb & Cr is centered.
> I'll try it and post the results just in case anyone is interested.
> 
	you should really use a value of ~127 for Cb/Cr before
	comparing. Because, even if the flag XVID_VOP_GREYSCALE
	discards the Cb/Cr for *INTER* blocks, these chroma values
	still matter for INTRA prediction. Actually, the default 
	prediction value is '128', more or less, but with rounding
	taken into account, the idct(fdct(.)) fixed point is more
	or less around '127', dependent of 'Q'. 
	That why i suggested you this value.

> I also had another question about encoding a 1 channel greyscale image.
> 
> I encoded it two different ways.
> First test was encoded by setting the Y to the greyscale value and setting
> Cb & Cr to 0, and setting the csp to XVID_CSP_I420 . I also set the 
> XVID_VOP_GREYSCALE flag,so the values of Cb & Cr
> should not matter.
> 
> The second test was encoded by using the XVID_CSP_BGR color space and 
> setting the values of BGR to the same greyscale value. I also set the
> XVID_VOP_GREYSCALE flag, and when decoding just ask back the Y value.
> So this case basically does the YUV conversion on the RGB images and then
> just encodes the Y.
> 
> The results from the two tests are very interesting. For the same Q factor
> the second test(feeding it RGB) frame size is significantly smaller. The 
> difference gets smaller as the Q factor goes up, but at Q factor of 7
> the difference is about 1KB, and about 0.5KB at Q = 18. The PSNR is better
> for the first case, even at the same fr size(so the Q factor will be 
> bigger for the first case since it needs a higher Q factor to compress it
> more). Another thing about the 2nd test is that you can get a smaller 
> frame size that is not possible with the first test(For the examples I 
> ran 1st test at Q=31 and 2nd test at Q=22 have about the same fr size).
> 
> Which leads to my question, is there something going on in the YUV
> conversion that makes it compress better?

	There might be very little rounding errors during
	the (RGB)->(YUV) conversion.

	hope it helps,

-Skal





More information about the XviD-devel mailing list