⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3_def.h

📁 三星ic 9980的源代码. 718版.
💻 H
字号:
		LIST OFF
;-----------------------------------------------------------
;		The following program will decoding MP3 bitstream
;		by S/W Algorithm
;			File Name: def_mp3.h
;			copyright jj,Park      1999.2.7
;
;	index_	indicates INdex of RPDx
;	_G		indicates Grobal value
;	_L		indicates Local value
;-----------------------------------------------------------
.ifndef	_MP3_DEF_H
_MP3_DEF_H	.equ	1

EQUALIZER_MODE		equ		1
//SAVE_PCMSAMPLE	equ		1
CALMADM2:			equ	1
PtrLongSize:		equ	1
//OUTPUT_8CH:			.equ	1
//OUTPUT_6CH:			.equ	1
OUTPUT_2CH:			equ	1
TestMode			equ	1
//LRMonoOff:		equ	1

// adjust offset range ///////////////////////////////////////
MacXOffset			equ		0x0
MacYOffset			equ		0x8000
XOffset_0x400Ailgn	equ		1			//XOffset 0x0,0x400,0x800,0xc00.... -> 1
										//        0x200,0x600,0xa00,0xe00.... -> 0
//////////////////////////////////////////////////////////////

.if(XOffset_0x400Ailgn)
StartReadPointer	equ		(MacXOffset*2)+0x4000
MainDataStart		equ		(MacXOffset*2)+0x3800
MainDataEnd			equ		(MacXOffset*2)+0x4000
BitstreamStart		equ		(MacXOffset*2)+0x4000
BitstreamEnd		equ		(MacXOffset*2)+0x4800
CBitstreamEnd		equ		(MacXOffset*2)+0x204800
.else
StartReadPointer	equ		(MacXOffset*2)+0x4000+0x400
MainDataStart		equ		(MacXOffset*2)+0x3800+0x400
MainDataEnd			equ		(MacXOffset*2)+0x4000+0x400
BitstreamStart		equ		(MacXOffset*2)+0x4000+0x400
BitstreamEnd		equ		(MacXOffset*2)+0x4800+0x400
CBitstreamEnd		equ		(MacXOffset*2)+0x204800+0x400
.endif

FetchMASK			equ		0x7ff
SyncMASK			equ		0xf7ff

XMEM_BASE_L3_1		equ		MacXOffset+0x0000

.if(XOffset_0x400Ailgn)
XMEM_BASE_L3_2		equ		(MacXOffset*2)+0x204BA0
.else
XMEM_BASE_L3_2		equ		(MacXOffset*2)+0x204BA0+0x400
.endif

XMEM_BASE_L3_3		equ		MacXOffset+0x1c00
XMEM_BASE_L12_1		equ		MacXOffset+0x0848
XMEM_BASE_L12_2		equ		MacXOffset+0x1b60
XMEM_BASE_L12_3		equ		MacXOffset+0x2500

YMEM_BASE_L3_1		equ		MacYOffset+0x0000
YMEM_BASE_L3_2		equ		MacYOffset+0x0b20
YMEM_BASE_L3_3		equ		MacYOffset+0x1000
YMEM_BASE_L12_1		equ		MacYOffset+0x1c10
YMEM_BASE_L12_2		equ		MacYOffset+0x1b00	
YMEM_BASE_L12_3		equ		MacYOffset+0x1b70

YMEM_TBL_L3_1		equ		0xd000+0x6000
YMEM_TBL_L3_2		equ		0xf160+0x6000  
YMEM_TBL_L3_3		equ		0x10000+0x6000
YMEM_TBL_L12_1		equ		0x13000+0x6000
YMEM_TBL_L12_2		equ		0x12400+0x6000-0x300	
YMEM_TBL_L12_3		equ		0x12700+0x6000

.if(0)
//.extern |WORD3_IDATA_ABS$$ancL1_table$$LOAD|
//.extern |WORD3_IDATA_ABS$$ancL1_table$$SIZE|
//.extern |WORD3_IDATA_ABS$$ancL1_table$$START|
.extern |WORD3_IDATA_ABS$$ancL2_table$$LOAD|
.extern |WORD3_IDATA_ABS$$ancL2_table$$SIZE|
.extern |WORD3_IDATA_ABS$$ancL2_table$$START|
.extern |WORD3_IDATA_ABS$$anc_table$$LOAD|
.extern |WORD3_IDATA_ABS$$anc_table$$SIZE|
.extern |WORD3_IDATA_ABS$$anc_table$$START|
//.extern |WORD3_IDATA_ABS$$secL2_table$$LOAD|
//.extern |WORD3_IDATA_ABS$$secL2_table$$SIZE|
//.extern |WORD3_IDATA_ABS$$secL2_table$$START|
.extern |WORD3_IDATA_ABS$$sec_table$$LOAD|
.extern |WORD3_IDATA_ABS$$sec_table$$SIZE|
.extern |WORD3_IDATA_ABS$$sec_table$$START|
.extern |WORD3_IDATA_ABS$$sec_table2$$LOAD|
.extern |WORD3_IDATA_ABS$$sec_table2$$SIZE|
.extern |WORD3_IDATA_ABS$$sec_table2$$START|
.endif

.if(1)
.extern	|MP3_TBLNEW$$sec_table$$START|
.extern	|MP3_TBLNEW$$sec_table2$$START|
.extern	|MP3_TBLNEW$$anc_table$$START|
.extern	|MP12_TBLNEW$$ancL2_table$$START|

.extern	|T_MP3DEC$$ymem_alloc1$$SIZE|
.extern	|T_MP3DEC$$ymem_alloc2$$SIZE|
.extern	|T_MP3DEC$$ymem_alloc3$$SIZE|
.extern	|T_MP12DEC$$section_tbl_mp12TabelL2$$SIZE|

//.extern |PM_CDATA_ABS$$ancL1_table$$SIZE|
//.extern |PM_CDATA_ABS$$ancL1_table$$START|
.extern |PM_CDATA_ABS$$ancL2_table$$SIZE|
.extern |PM_CDATA_ABS$$ancL2_table$$START|
.extern |PM_CDATA_ABS$$anc_table$$SIZE|
.extern |PM_CDATA_ABS$$anc_table$$START|
//.extern |PM_CDATA_ABS$$secL2_table$$SIZE|
//.extern |PM_CDATA_ABS$$secL2_table$$START|
.extern |PM_CDATA_ABS$$sec_table$$SIZE|
.extern |PM_CDATA_ABS$$sec_table$$START|
.extern |PM_CDATA_ABS$$sec_table2$$SIZE|
.extern |PM_CDATA_ABS$$sec_table2$$START|

.extern |T_MP12DEC$$section_tbl_mp12Tabel$$START|
.extern |T_MP12DEC$$section_tbl_mp12TabelL1$$START|
.extern |T_MP12DEC$$section_tbl_mp12TabelL2$$START|
.extern |T_MP3DEC$$ymem_alloc1$$START|
.extern |T_MP3DEC$$ymem_alloc2$$START|
.extern |T_MP3DEC$$ymem_alloc3$$START|
.endif

rCONFIG0		equ	0x00	
rSBFCON			equ	0x4a
rSBFSTAT		equ	0x50
rSBL0OFF_H		equ	0x52
rSBL0OFF_L		equ 0x54
rSBL1OFF_H		equ 0x56
rSBL1OFF_L		equ 0x58
rSBL0BEGIN_H	equ	0x5a
rSBL0BEGIN_L	equ 0x5c
rSBL0END_H		equ 0x62
rSBL0END_L		equ 0x64


////////////////////////////////////////////////////////////////////
ahh			equ		00h
ahl			equ		01h
alh			equ		02h
all			equ		03h
bhh			equ		04h
bhl			equ		05h
blh			equ		06h
bll			equ		07h

sec_z		equ		00h				;zero flag
sec_nz		equ		01h				;~zero flag
sec_n		equ		02h				;negative flag
sec_nn		equ		03h				;~negative flag
sec_c		equ		04h				;carry flag
sec_nc		equ		05h				;~carry flag
sec_va		equ		06h				;va flag
sec_vb		equ		07h				;vb flag
sec_gt		equ		08h				;gt flag
sec_le		equ		09h				;le flag
sec_vm0		equ		0ah				;vm0 flag
sec_vm1		equ		0bh				;vm1 flag
sec_vs		equ		0ch				;vs flag
sec_1		equ		0dh				;reserved
sec_mv		equ		0eh				;mv flag
sec_t		equ		0fh				;test flag

	
;			section_MACMpegVariables																	;1-byte,in stereo decoder,CalmRISC
index_LmpegCrc					equ		0							;1-byte(high),in fetch main data
index_LbackupB					equ		0							;in dequantizer decoder
index_LhuffB					equ		0							;in huffman	decoder
index_LiStereo					equ		0							;in stereo	

index_GmpegPadding				equ		1							;1-byte(high),in fetch main data
index_GmpegMode					equ		1							;1-byte(middle)
index_GmpegChannel				equ		1							;1-byte(low)

index_GmpegModeExt				equ		2							;1-byte(low)

index_LmsStereo					equ		3							;1-byte,in stereo decoder
index_LptrImdctWindow			equ		3							;2-byte,in IMDCT decoder
index_LbackupTable				equ		3							;in dequantizer
index_LloopCounti				equ		3							;in huffman decoder

index_LbackA					equ		4							;3-byte,in findzeropart,dequantizer,getscalefactor
index_LmainDataBegin			equ		4							;2-byte
index_LRPxBackupBuffer			equ		4							;2-byte,in Huffman,Dequantizer,stereo,reordering,IMDCT,synthesis
index_ptrHEscTable				equ		4							;2-byte,in huffman

index_LptrImdctprevious			equ		5							;2-byte,in IMDCT decoder
index_LglobalGain210			equ		5							;in dequantizer
index_LstereoLeftRight			equ		5							;use in stereo decoder
index_LptrPcmSamples			equ		5							;2-byte,in synthesis
index_Lclumpsz					equ		5												
																	;with full address
index_GptrCurrentDecodingData	equ		6							;2-byte,in synthesis

index_GptrNextMainData			equ		7

index_GcopyB					equ		8							;2-byte

index_GcopyRp1					equ		9							;2-byte

index_GcopySr					equ		10							;2-byte

index_GptrSideInformation		equ		11							;2-byte, for copy

index_GptrSynPrevious			equ		12							;2-byte,points a ch1's SynPrevious
index_GLongSfBandIndex			equ		13							;2-byte
index_GShortSfBandIndex			equ		14							;2-byte

index_GzeroPartCh0				equ		15							;2-byte
index_GzeroPartCh1				equ		16							;2-byte
index_GptrPcmSamples			equ		17							;2-byte,in synthesis
																	;with full address
index_Gscfi						equ		18							;1-byte.in scalefactor decoder

index_GZeroPart					equ		19							;in find zero sfb->stereo decoder

index_Gmax						equ		20							;in find zero sfb->stereo decoder,stereo decoder
index_Gcount1					equ		20							;in huffman,stereo mpeg2
index_GOrgSampFreq				equ		20

index_GranuleLoop				equ		21		
////////////////////////////////////////////////////////////////////
//	0919	HJI
index_Gpart2Lenght				equ		22		
index_LloopCounti2				equ		22							;in mpeg2 LSF only

index_LbitsLeft					equ		23
index_Lbound					equ		23							;in stereo
													
index_Lcachesz					equ		24
index_LsfbL						equ		24							;in stereo		

index_LbitCacheH				equ		25
index_LscaleB					equ		25
index_LlsfBackA					equ		25
index_LsfbS						equ		25							;in stereo

index_LbitCacheL				equ		26
index_LscaleSr					equ		26
index_LloopBound				equ		26							;in stereo
index_Lsamp						equ		26

index_Ltable					equ		27
index_Lf						equ		27							;in stereo	
index_Llayer					equ		27

index_Lstartbits				equ		28
index_Lw						equ		28							;in stereo
index_LID						equ		28

index_Llinbits					equ		29
index_Ln						equ		29							;in stereo
index_Lsync						equ		29

index_Lregion					equ		30
index_LisPos					equ		30
index_LMpegVersion				equ		30

//index_LhuffSr					equ		31
index_Glsf						equ		31

////////////////////////////////////////////////////////////////////
;				section_sideInformation
const_sideInformationSize		equ		8
index_part23Lenght				equ		0						;2-byte,MAC-address
index_bigValues					equ		1						;2-byte,MAC-address

index_globalGain				equ		2						;1-byte,MAC-address
index_scalefacCompress			equ		2						;2-byte,MAC-address
																;for LSF
index_windowSwitchingFlag		equ		3						;1-byte,MAC-address
index_blockType					equ		3						;1-byte,MAC-address
index_mixedBlockFlag			equ		3						;1-byte,MAC-address

index_tableSelection0			equ		4						;1-byte,MAC-address
index_tableSelection1			equ		4						;1-byte,MAC-address
index_tableSelection2			equ		4						;1-byte,MAC-address

index_subBlockGain0				equ		5						;1-byte,MAC-address
index_subBlockGain1				equ		5						;1-byte,MAC-address
index_subBlockGain2				equ		5						;1-byte,MAC-address
		
index_region0Count				equ		6						;1-byte,MAC-address
index_region1Count				equ		6						;1-byte,MAC-address
index_preFlag					equ		6						;1-byte,MAC-address
		
index_scalefacScale				equ		7						;1-byte,MAC-address
index_count1TableSelect			equ		7						;1-byte,MAC-address

//	extension


const_shortBlock				equ		02h
const_idhBank1					equ		04h
const_mono						equ		03h
const_jointStereo				equ		01h
const_subBandNumber				equ		32
SizeOfLongToShort				equ		23
SizeOfScalefactor				equ		36

tbl_exponentOfPow43Org	 		equ		MacYOffset  		///caution, xdm	

///////////////////////////////////////////////////
//	new equ	0416
Index_FrameStartFlag			equ		0
Index_ParsingHeaderFlag			equ	   	1
//
Index_GL2Done					equ		1
//
Index_BitRate					equ	   	2
Index_SamplingFreq				equ	   	3
Index_Mode						equ	   	4
Index_Emphasis					equ	   	5
Index_Aligned					equ	   	6		;using channel loop
Index_ChannelLoop				equ	   	6

Index_FrameErrorFlag			equ	   	7
Index_FrameLength				equ	   	8
// INPUT BUF 
Index_InputBufferPointerH		equ	   10
Index_InputBufferPointerL		equ	   12
Index_InputBufferLength			equ	   14
Index_InputBufferWPointerH		equ	   16
Index_InputBufferWPointerL		equ	   18
Index_InputBufferRPointerH		equ	   20
Index_InputBufferRPointerL		equ	   22

//Index_InputBufferRPointerHigh	equ	   -16
//Index_InputBufferRPointerLow	equ	   -15
Index_InputBufferValidData		equ	   24
//Index_InputBufferValidDataHigh	equ	   -14
//Index_InputBufferValidDataLow	equ	   -13

// OUTPUT BUF 
Index_OutputBufferPointerH		equ	   26
Index_OutputBufferPointerL		equ	   28
Index_OutputBufferLength 		equ	   30
Index_OutputBufferWPointerH		equ	   32
Index_OutputBufferWPointerL		equ	   34
Index_OutputBufferRPointerH		equ    36
Index_OutputBufferRPointerL		equ    38
Index_OutputBufferValidData   	equ	   40

Index_VolumeControl				equ	   42
Index_EqualizerModeControl		equ	   43


Index_TotalFrameNumber			equ		44
Index_DecodingFrameNumber		equ		46
Index_FrameErrorNumber			equ		48

Index_OutputBufferMiddleH		equ		52
Index_OutputBufferMiddleL		equ		54
Index_OutputBufferEndH			equ		56
Index_OutputBufferEndL			equ		58

Index_FrameBitRate				equ		64
Index_EQ_VolumeFlag				equ		78


//-----------------------------------
//	System Interface Variable
//-----------------------------------
Index_CodecStartFlag			equ		0x00
Index_AudioMode					equ	    0x01
Index_pParameterH				equ	    0x02
Index_pParameterL				equ	    0x04
Index_NumberOfSample			equ	    0x06
Index_OutPCMSize				equ	   	0x08
Index_DecodeErrFlag	 			equ	   	0x09
Index_SamplingRate				equ	   	0x0a
Index_BitRateADM				equ	   	0x0e

.ifdef PtrLongSize
Index_InputBufferOffset			equ	   	0x12	
Index_InputBufferSize			equ	   	0x16
Index_OutputBufferOffset		equ	   	0x1A
Index_ExtInputBufferOffset		equ		0x1E
Index_FrameSize					equ		0x22

// Addition
Index_OptionalFunctionOnOff		equ		0x24	// 1B,[xxxx 0000]->[SpectrumDisplay|LevelMeter|EQ|Voume]
Index_VolumeIndex				equ		0x25	// 1B	
Index_LevelMeterValueL			equ		0x26	// 4B
Index_LevelMeterValueR			equ		0x2A	// 4B
Index_pSpectrumDisplay			equ		0x2E	// 4B

Index_SeekFlag					equ		0x3a	// 1B 

.else
Index_InputBufferOffset			equ	   	0x12	
Index_InputBufferSize			equ	   	0x14
Index_OutputBufferOffset		equ	   	0x16
Index_ExtInputBufferOffset		equ		0x18
Index_FrameSize					equ		0x1A

// Addition
Index_OptionalFunctionOnOff		equ		0x24	// 1B,[xxxx 0000]->[SpectrumDisplay|LevelMeter|EQ|Voume]
Index_VolumeIndex				equ		0x25	// 1B	
Index_LevelMeterValueL			equ		0x26	// 4B
Index_LevelMeterValueR			equ		0x2A	// 4B
Index_*pSpectrumDisplay			equ		0x2E	// 4B

.endif

//-----------------------------------
//	MP3 Parameter System Interface Variable
//-----------------------------------
Index_P_MpegMode				equ	   	0x00
Index_P_ChannelLoop				equ	    0x01
Index_P_GL2Done					equ	   	0x02
Index_P_Present					equ		0x03
Index_P_CHSelect				equ	   	0x04

//----------------------------------------
//	Section Define
//----------------------------------------
.if	0
Codec_StartAddr:		.equ	0x4700
//Codec_StartAddr:		.equ	0x1000

Mp3Decoding_section		section	code,abs Codec_StartAddr 
MP3VolumeSection		section code,afteraddr Codec_StartAddr	
MP3DechuffSection		section code,afteraddr Codec_StartAddr	
MP3DecimdctSection		section code,afteraddr Codec_StartAddr	
MP3DecL1libSection		section code,afteraddr Codec_StartAddr	
MP3DecL2libSection		section code,afteraddr Codec_StartAddr	
MP3DecpolySection		section code,afteraddr Codec_StartAddr	
MP3DequantiSection		section code,afteraddr Codec_StartAddr	
MP3EqualizerSection		section code,afteraddr Codec_StartAddr	
MP3FindisSection		section code,afteraddr Codec_StartAddr	
MP3ReorderSection		section code,afteraddr Codec_StartAddr	
MP3SteteoSection		section code,afteraddr Codec_StartAddr	
MP3AntaliasSection		section code,afteraddr Codec_StartAddr	

.else
Mp3Decoding_section		section	code
MP3VolumeSection		section	code
MP3DechuffSection		section	code
MP3DecimdctSection		section	code
MP3DecL1libSection		section	code
MP3DecL2libSection		section	code
MP3DecpolySection		section	code
MP3DequantiSection		section	code
MP3EqualizerSection		section	code
MP3FindisSection		section	code
MP3ReorderSection		section	code
MP3SteteoSection		section	code	
MP3AntaliasSection		section	code
.endif




.endif	//_MP3_DEF_H
		LIST ON

⌨️ 快捷键说明

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