mpaud.h 5.32 KB

/**************************************************************************
 *								          *
 *               Copyright (C) 1994, Silicon Graphics, Inc.       	  *
 *								          *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *								          *
 *************************************************************************/

#ifndef _mpaud_h_
#define _mpaud_h_

/*
 * File:		mpaud.h
 *
 * This file lays out the DMEM usage for the RSP mpeg audio task.
 *
 */

#define eval(s)	(s)

/*
 * Memory layout of DMEM:
 *
 * Our aim is to minimize DMEM use so that we can process as
 * many samples as possible with a single command. 
 * The buffer area is a resource managed by the Host rather than 
 * divided into hard defined regions.
 *
 *      -------------------------------------------------
 *      | Program data from compiler...                 |     (must be first)
 *	|                               800 bytes       |
 *	|	Includes constants 			|
 *	|	coefficient table for resampler		|
 *	|						|
 *	|-----------------------------------------------|
 *	| Buffers available for command	results		|
 *	|  Managed by the Host CPU			|
 *	|						|
 *	|						|
 *	|-----------------------------------------------|
 *	| Scratch space for intermediate results        |
 *	|   Not touched by the Host CPU                 |
 *	|     Whatever is left                          |
 *	|                                        	|
 *	|                                        	|
 *      -------------------------------------------------
 * 
 */

#ifndef DCACHEBASE
#   define DCACHEBASE	0x00000000
#endif

#ifndef DCACHEBASEHI
#   define DCACHEBASEHI	0x0000
#endif
#ifndef DCACHEBASELO
#   define DCACHEBASELO	0x0000
#endif

/* These relate to the illustration above. Note that everything should
   be kept 8 byte aligned */

#define RSP_DMEM_SIZE8          4096

#define RSP_PDATA_SIZE8	        1424	/* This will change in the 
					    initial stages as we develop
					    algorithms. */

#define RSP_PAR_SIZE8           16       /* Parameter values, such as
                                           current buffer location */

#define RSP_DCT_SIZE8           128

#define RSP_IQIN_SIZE8          64      /* Input values for Inverse
                                           quantization */
#define RSP_IQD_SIZE8           64      /* Coefficient D[] for Inverse
                                           quantization */
#define RSP_IQC_SIZE8           128     /* Coefficient C[] for Inverse
                                           quantization */
#define RSP_IQSCALE_SIZE8       128     /* scalefactors for Inverse
                                           quantization */
#define RSP_OLABUFF_SIZE8       1024    /* OLA buffer - size is for one
                                           word. Buffer is double precision */
#define RSP_COMMAND_SIZE8       32      /* Local command buffer size - one
                                           command at moment */
#define RSP_MPAUD_COMMAND_SIZE8 32      /* Size of a single command */

#define RSP_PDATA_OFFSET        eval(0)
#define RSP_PAR_OFFSET          eval(RSP_PDATA_OFFSET + RSP_PDATA_SIZE8)
#define RSP_DCTIN_OFFSET        eval(RSP_PAR_OFFSET + RSP_PAR_SIZE8)

#define RSP_DCTOUT_OFFSET       eval(RSP_DCTIN_OFFSET + RSP_DCT_SIZE8)

/*
 * DCT output and the inverse quantization input are the same
 */
#define RSP_IQIN_OFFSET         RSP_DCTOUT_OFFSET

#define RSP_IQD_OFFSET          eval(RSP_DCTOUT_OFFSET + RSP_DCT_SIZE8)
#define RSP_IQC_OFFSET          eval(RSP_IQD_OFFSET + RSP_IQD_SIZE8)
#define RSP_IQSCALE_OFFSET      eval(RSP_IQC_OFFSET + RSP_IQC_SIZE8)

/*
 * Overlap add input is the same the the DCT input (and it runs
 * into the DCTOUT area because it has length 64
 */
#define RSP_OLAIN_OFFSET        RSP_DCTIN_OFFSET

/*
 * Overlap and add buffers
 */
#define RSP_OLABUFF_HIGH_OFFSET  eval(RSP_IQSCALE_OFFSET + RSP_IQSCALE_SIZE8)
#define RSP_OLABUFF_LOW_OFFSET  eval(RSP_OLABUFF_HIGH_OFFSET + RSP_OLABUFF_SIZE8)

/*
 * Task and Command buffer uses the same location as the input -
 * basically I only store one command at a time
 */
#define RSP_COMMAND_OFFSET  eval(RSP_IQIN_OFFSET)

.print "\n"
.print "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
.print "DCT input data offset is 0x%x\n", RSP_DCTIN_OFFSET
.print "DCT output data offset is 0x%x\n", RSP_DCTOUT_OFFSET
.print "IQ input data offset is 0x%x\n", RSP_IQIN_OFFSET
.print "D[] data offset is 0x%x\n", RSP_IQD_OFFSET
.print "C[] data offset is 0x%x\n", RSP_IQC_OFFSET
.print "scalefactor[] data offset is 0x%x\n", RSP_IQSCALE_OFFSET
.print "OLA input data offset is 0x%x\n", RSP_OLAIN_OFFSET
.print "OLA input buffer (high) offset is 0x%x\n", RSP_OLABUFF_HIGH_OFFSET
.print "OLA input buffer (low) offset is 0x%x\n", RSP_OLABUFF_LOW_OFFSET
.print "Command buffer offset is 0x%x\n", RSP_COMMAND_OFFSET
.print "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
.print "\n"

/*
 * Defines for parameter offsets
 */
#define OLA_HIGH_OFFSET         0
#define OLA_LOW_OFFSET          2
#define OLA_DRAMBUFF_OFFSET     4

#endif /* _mpaud_h_ */