all.h 1.13 KB
/*

	C-code sketch of how RSP microcode will process a macroblock.

	Different versions will make different I/O and computational
	assumptions.

    Version #1 assumptions:
	Macroblocks are un-tokenized into a mbdata[NBLKS][64] area of 16-bit
	words in DMEM.  Which blocks are non-zero is in CBP in header.

	iquant and idct routines work on single blocks per call.

	No longer true:
	    motion-compensation and reference combining (F+B) occur
	    all at once in a separate routine. DMAs are assummed to
	    already be complete (results are inputs).
*/

typedef struct mb_hdr_struct
    {
	short mbtype,
	      cbp,
	      quant,
	      mvfx, mvfy,
	      mvbx, mvby,
	      block_num;    /* sMMMMMMMMMMMbbbb	s=sign (<0 implies new MB)
						M=Macroblock number (0-2047)
						b=block number within MB */

    } MB_header;

#define NBLKS	(6)
#define MC_YTILE_SIZE	(2*16*17)
#define MC_UVTILE_SIZE	(2*16*9)

typedef struct mb_struct
    {
	MB_header header;

	short mbdata[NBLKS][64];

	unsigned char fyref[MC_YTILE_SIZE];
	unsigned char fuvref[MC_UVTILE_SIZE];

	unsigned char byref[MC_YTILE_SIZE];
	unsigned char buvref[MC_UVTILE_SIZE];
    } MacroBlock;