video_dmem.h 3.5 KB
 #
 # video_dmem.h
 # 
 # This file lays out the overall DMEM usage for the RSP MPEG video decoding
 # task.

#ifdef _LANGUAGE_C
# ifndef eval
#    define eval(s)          (s)
# endif
#endif

#include <rsp.h>
#include <rcp.h>
#include <sptask.h>



/*
 * Memory layout of DMEM:
 *
 *   ----------------------------------------------
 *   | Cosine matrices and constants for IDCT     |
 *   |                             (80 bytes)     |
 *   |                                            |
 *   |--------------------------------------------|
 *   | Q matrices and constants for IQ            |
 *   |                             (272 bytes)    |
 *   |                                            |
 *   |--------------------------------------------|
 *   | Switch table and constants for MC	  |
 *   |				   (32 bytes)     |
 *   |						  |
 *   |--------------------------------------------|
 *   | Constants for Recon                        |
 *   |                             (16 bytes)     |
 *   |                                            |
 *   |--------------------------------------------|
 *   | Macroblock data                            |
 *   |                             (3328 bytes)   |
 *   |                                            |
 *   |--------------------------------------------|
 *   | Temporary workspace                        |
 *   |                             (?  bytes)	  |
 *   |						  |
 *   ----------------------------------------------
 */




	.data	RSP_DMEM_BASE

#define	IDCT_CONST_BASE		RSP_DMEM_BASE  
	
  #################################		
  #	IDCT Constants		  #
  #	(80 bytes)		  #
  #################################
		
#include "idct_dmem.h"
		

#define	IQ_CONST_BASE		(IDCT_CONST_BASE+80)
	
  #################################		
  #	IQ Constants and QMAT	  #
  #	(272 bytes)		  #
  #################################

#include "iq_dmem.h"
	

#define MC_CONST_BASE		(IQ_CONST_BASE+272)

  #################################
  #	MC Constants		  #
  #     (32 bytes)		  #
  #################################
	
#include "mc_dmem.h"
	
#define REC_CONST_BASE		(MC_CONST_BASE+32)

	
  #################################
  #	Recon Constants		  #
  #	(16 bytes)		  #
  #################################

#include "recon_dmem.h"

#define	MB_BASE			(REC_CONST_BASE+16)

#define MB_DMEM_SIZE		832

#define MB_BASE2		(MB_BASE+MB_DMEM_SIZE)

  #################################
  #	MacroBlock Data		  #
  #	(3328 bytes)		  #
  #################################

	.space		0x0d00  


/* all addresses are offsets to MB_BASE or MB_BASE2 */
	
#define MBH_MBTYPE		0
#define MBH_CBP			2
#define MBH_QUANT		4
#define MBH_MVFX		6
#define MBH_MVFY		8
#define MBH_MVBX		10
#define MBH_MVBY		12
#define MBH_BNUM		14

#define MB_DATA			16
#define MB_DATA_SIZE		(6*64*2)
#define MB_YREF_SIZE		(16*17*2)
#define MB_UVREF_SIZE		(16*9*2)

#ifdef _FETCH_REF

#define MBS_FYPTR		(MB_DATA+MB_DATA_SIZE)
#define MBS_FYLEN		(MBS_FYPTR+4)
#define MBS_FUVPTR		(MBS_FYPTR+8)
#define MBS_FUVLEN		(MBS_FYPTR+12)
#define MBS_BYPTR		(MBS_FYPTR+16)
#define MBS_BYLEN		(MBS_FYPTR+20)
#define MBS_BUVPTR		(MBS_FYPTR+24)
#define MBS_BUVLEN		(MBS_FYPTR+28)

#define MBS_OUTYBUF             (MBS_FYPTR+32)
#define MBS_OUTUVBUF            (MBS_FYPTR+36)

#endif
		
#define MB_SIZE		        2496

#define MB_DATA_FREF		(MB_BASE+MB_DMEM_SIZE*2)
#define MB_DATA_BREF		(MB_DATA_FREF+MB_YREF_SIZE+MB_UVREF_SIZE)


#define	TEMP_BASE		(MB_BASE+0x0d00)

  #################################
  #	Temp Workspace		  #
  #				  #
  #################################
	
	.space		0x0100