mc.h 1.85 KB

/* These MVs are passed in as arguments */

/* Chroma MVs are calculated and don't need to be sent in */

/* LBASE and OBASE are Relative to the base registers passed in */

#define ROffset	eval(MB_YREF_SIZE/2)

#define CrOffset	eval(MB_YREF_SIZE)
#define RCrOffset	eval(MB_UVREF_SIZE/2)
#define OCrOffset	CrOffset

.name	dum,		$6
.name	dum2,		$7
.name	mc4,		$8

.name	Lbasep1,	$15
.name	Rbasep1,	$16

.name	xh,		$17
.name	yh,		$18


.name	mvx,		$19
.name	mvy,		$20
.name	xRbase,		$21
.name	xLbase,		$22
.name	xObase,		$23
.name	rtn2,		$24
	
.name	v0,		$v4
.name	v1,		$v5
.name	v2,		$v6
.name	v3,		$v7
	
.name	v0h,		$v8
.name	v1h,		$v9
.name	v2h,		$v10
.name	v3h,		$v11

#define t0	t1p1
#define t3	t2p1

.name	t1,		$v12
.name	t1p1,		$v13
.name	t2,		$v14
.name	t2p1,		$v15

.name	t0h,		$v16
.name	t1h,		$v17
.name	t2h,		$v18
.name	t3h,		$v19

.name   vdum,		$v20
.name	vdum2,		$v21
.name	vdum3,		$v22
.name	vdum4,		$v23
.name   lo_res,		$v24
.name	hi_res,		$v25
	
.name	vconsts,	$v31


#define	HI_BYTE		0
#define	LO_BYTE		1
#define	DIV2		2
#define	DIV4		3
	
define(vaddb2, 
       `vmudl	vdum,	$2, vconsts[HI_BYTE]
	vmadl	vdum,	$3, vconsts[HI_BYTE]
	vmulf	hi_res,	vdum, vconsts[DIV2]
	vand	vdum,	$2, vconsts[LO_BYTE]
	vand	vdum2,	$3, vconsts[LO_BYTE]
	vadd	vdum,	vdum, vdum2
	vmulf	lo_res,	vdum, vconsts[DIV2]
	vmudn	$1, hi_res, vconsts[HI_BYTE]
	vadd	$1, $1, lo_res')

define(vaddb4, 
	`vmudl	vdum,	$2, vconsts[HI_BYTE]
	vmadl	vdum,	$3, vconsts[HI_BYTE]
	vmadl	vdum,	$4, vconsts[HI_BYTE]
	vmadl	vdum,	$5, vconsts[HI_BYTE]
	vmulf	hi_res, vdum, vconsts[DIV4]
	vand	vdum,	$2, vconsts[LO_BYTE]
	vand	vdum2,	$3, vconsts[LO_BYTE]
	vand	vdum3,	$4, vconsts[LO_BYTE]
	vand	vdum4,	$5, vconsts[LO_BYTE]
	vmulf	vdum,	vdum, vconsts[DIV4]
	vmacf	vdum,	vdum2, vconsts[DIV4]
	vmacf	vdum,	vdum3, vconsts[DIV4]
	vmacf	lo_res,	vdum4, vconsts[DIV4]
	vmudn	$1, hi_res, vconsts[HI_BYTE]
	vadd	$1, $1, lo_res')