wma.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 61 行

H
61
字号
#define _PCM_TO_DEVICE
//#define _PCM_TO_FILE

#define LlevelOrig_Offset 0x000
#define LrunOrig_Offset 0x800
#define RlevelOrig_Offset 0x1000
#define RrunOrig_Offset 0x1800
#define LmaskqOrig_offset 0x2000
#define LnotCode_offset   0x2100
#define RmaskqOrig_offset 0x2300
#define RnotCode_offset   0x2200
#define LglobalOrig_offset 0x2600
#define RglobalOrig_offset 0x2700

#define ARMDMA_FLG 0xaa7
#define SRdbgFrame 0xaa6
//#define SDRAM1_BASE 0xaae

#define HR_SIZE 3
#define WMA_DATAL 0x51c
#define WMA_DATAH 0x51d
#define WMA_ADR 0x51f
#define WMA_END 0x520
#define WMA_BUFF_BASE 0x521
/*bit 0: ARMDMA_FLG, bit 1~5: HR_OUT, bit 6~10: HR_NUM */
#define HR_REG 0x51e
//for lichao 07/26 begin
#define PCM_IN_REG 0x520
#define PCM_OUT_REG 0x521
//for debuging
#define PCM_SIZE 0xaad
#define PCM_ADDR 0xaae
#define LPCM_BASE 0xe0000
#define RPCM_BASE 0xe0000

/*
WMA decoder will fill buf0, 1,2,3,..,(PCM_BUFFERS_NUM-1),0,1... one by one, pcmout engine will output audio from buf0 ,1 ,2,3 ,...,(PCM_BUFFERS_NUM-1),0,1...one by one,too. You can read current WR point  from PCM_IN_REG, (only bit 0,1,2 is valid), can read current Rd point from PCM_OUT_REG, (only bit 0,1,2 is valid).
WR point shows which buffer is being used by decoder now, RD point shows currently which buffer is being played by output engine.
Below is two sample:
PCM_OUT_REG&0x7 is 1 and PCM_IN_REG&0x7 is 3: now WMA decoder is filling buf3, and buf1 is being played, buf2 is ready for playing.
PCM_OUT_REG&0x7 is 3 and PCM_IN_REG&0x7 is 2: now WMA decoder is filling buf2, and buf3 is being played, buf4~buf(PCM_BUFFERS_NUM-1),buf0 and buf1 are ready for playing.
*/ 

#ifdef OUPPUT_24BIT
#define PCM_BUFFERS_NUM 16
#else
#define PCM_BUFFERS_NUM 8
#endif
//#if (((defined T3290)||(defined T3295)) && (defined MINI_BLOCK) && (defined WMA))

#define MPEG_LMEM_DMA_HOFFSET2        0x7a5   /* CPU LMEM DMA Offset Address   */
#define MPEG_LMEM_DMA_LOFFSET2        0x7a6   /* CPU LMEM DMA Offset Address   */
	
#define PCMVOL 0xf5d
extern void wma_wait();
unsigned char WMADecodeFrame(unsigned char skip);
unsigned int transfer_parameter(unsigned temp_sdram1_buff);
void set_wma_parameter(unsigned nVersion, unsigned nSamplesPerSec, unsigned nChannels, unsigned  nAvgBytesPerSec, unsigned nBlockAlign, unsigned nEncodeOpt);
int WMAInitDecode();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?