[XviD-devel] vop flag question

MAILER-DAEMON MAILER-DAEMON
Tue Jun 14 16:47:58 CEST 2005


I have a question about the vop flag XVID_VOP_GREYSCALE.

By looking through src code I noticed that setting XVID_VOP_GREYSCALE
for the vop flag makes sure no Cb and Cr blocks are encoded.

But looking and xvid_encraw.c example it doesn't use the 
XVID_VOP_GREYSCALE flag when encoding greyscale images.
Instead it divides the image and makes an RGB image.
Is there a reason XVID_VOP_GREYSCALE is not used(there 
is a bug to be worked out?), or is it just by choice?

Also looking through the code I couldn't find an option for
a 1-channel image so I'm feeding a 3-channel image.
I use XVID_CSP_I420  and set Cb & Cr channel to 0.
Is there a better option?

Finally I tested the XVID_VOP_GREYSCALE option by the two following 
tests.
The src images are a sequence of greyscale images using XVID_CSP_I420 
option and setting Cb & Cr channel to 0. The image size is 1008x752.
All options were the same for both encoding except for the
XVID_VOP_GREYSCALE flag.
If I set the XVID_VOP_GREYSCALE option the resulting encoded frames
are smaller than not setting the XVID_VOP_GREYSCALE. At 
'xvid_enc_frame.quant = 2' the difference is about 100 bytes, and
at 'xvid_enc_frame.quant = 31' the difference is about 150 bytes
for P frames. I only used I and P frames.
In theory, shouldn't they be the same? The Cb and Cr channels are
all set to 0 so no matter what the motion vector is the difference
should be all 0. If I understand correctly you skip a block when
its all 0s. Therefore the block pattern that is generated should be the 
same as setting XVID_VOP_GREYSCALE, shouldn't it?

I'd appreciate any feedback. Thanks.


More information about the XviD-devel mailing list