[XviD-devel] rrv decoding

suxen_drol xvid-devel@xvid.org
Mon, 09 Dec 2002 22:14:10 +1100


On Sun, 8 Dec 2002 10:14:56 +0100 "Marc FD" <marcfd@free.fr> wrote:
> damn !! the first time XviD can decode something that he is unable to encode
> !!!

we can also decode (but cant encode) resync packets.
> 
> > i will now investigate encoding support.

i've just commited rrv i-vop encoding and "incomplete" p-vop encoding.
to enable RRV mode, you must set
	xparam.global |= XVID_GLOBAL_REDUCED
during codec creation, and set
	xframe.general |= XVID_REDUCED
to encode the frame as rrv.

> cool. lemme know if i can help.

okay, iam having problem implementing p-vop rrv motion compensation.
the p-vop coeffs are messed up,

ie. to compensate rrv MODE_INTER macroblocks, we must:
a) grab the reference 32x32 pixel block, from the refernce frame
b) subtract the reference block from the current block
c) filter/scale-down the remainder of the subtration, from 32x32 ->
16x16 pixels. use skal's filter_18x18_to_8x8() function.
d) transfer scaled down block into FOUR 8x8 16-bit coeffient arrays

i believe its something todo with the scale-down and the 18x18 pixel
requirement. anyway, to enable the 'buggy' p-vop encoding, goto
encoder.c/FrameCodeP(), and replace

	if ((pEnc->current->global_flags & XVID_REDUCED))
	{
		// mb_width = (pEnc->mbParam.width + 31) / 32;
		// mb_height = (pEnc->mbParam.height + 31) / 32;

		/* XXX: reduced resoltion not yet supported */
		pEnc->current->global_flags &= ~XVID_REDUCED;	
	}
with:
	if ((pEnc->current->global_flags & XVID_REDUCED))
	{
		mb_width = (pEnc->mbParam.width + 31) / 32;
		mb_height = (pEnc->mbParam.height + 31) / 32;

		/* XXX: reduced resoltion not yet supported */
		// pEnc->current->global_flags &= ~XVID_REDUCED;	
	}


> to choose between i/ri/p/rp/b vops, that's many possibilites.
> is it possible to know the following frames (i think 2-3 frames will be
> enough)
> to fast scan them (with something like AnalyseME) and to choose rrvs
> (more or less interleaved) when frames will change a lot ?
> BTW, i wonder what would rrvs row do against really reduced resolution.
> and how rrvs ivops looks, ect....

yep, there's lots of possibilities.

-- pete; life is like a box of ammo