codec.h 1016 Bytes
#ifndef _CODEC_H_
#define _CODEC_H_



#define	CO_PROCESSOR_MASK_BITS    0x03

#if 1//def MP3_ENCODE_ENABLE
#define MAX_CODEC_MEM_SIZE        (0xB400+0x6000+0x500-0x5000)//(0xB400+0x3800+0x4000) //please pay attention to moydifing the content of the elf32xtensa.x file
#else
#define MAX_CODEC_MEM_SIZE        0xA400
#endif


typedef struct{
	U8 valid;
	U8 busy;
	U16 bytes;
} SECOND_OUTPUT;

extern SECOND_OUTPUT second;

extern U8 wNoMoreFrames;
extern U16 decoder_buf[];


static __inline__ void enableCoProcessor( unsigned int mask )
{
	__asm__ __volatile__ (
		"wsr.cpenable   %0 \n\t"
		"esync\n\t"
		:
		: "a" (mask)
		);
}


long xa_ftell(void *ptr);
int xa_fseek( void *stream, long offset, int origin );
int xa_fread(void *buffer, int size, int count, void *fp);

int Decode_Wait_EnoughSpace(void);
int Decode_OutputBuffer(U32 *buffer,int out_bytes);
int Decode_ClearOutputBuffer(int out_bytes);
U32 codec_get_mem_used(void);
void codec_malloc_init (void);
U8 *codec_malloc ( U32 size);

#endif //_CODEC_H_