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

📄 ad_definitions.h

📁 SAMSUNG 5009的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
#ifndef _AD_DEFINITIONS_H_
#define _AD_DEFINITIONS_H_

/*
	if __USE_NEW_FADE is "1", then use SysInfo.Fade_mode for controllable fade-in/out
		if 1, then fade_duration will be 256 samples
		if 2, then fade_duration will be 512 samples 
		if 3, then fade_duration will be 1024 samples 
		if 4, then fade_duration will be 4096 samples 
		others, then fade_duration will be 2048 samples

	now, this SysInfo.Fade_mode is mapped to gAD_curfademode.
	So, to use this feature, Appl or LAPI or AD can modify gAD_curfademode to 0~4.
	
		 -- hspark 060110 
*/
#define __USE_NEW_FADE	1


/* 	
	purpose : ADC data dbug
	
		if defined, then set 2CH only & send MIC_BUFFER to IODMA 
*/
//#define PASS_THROUGH_ADC_INPUT_TO_IODMA


/* 	
	AUD_SUPPORT_NEW_ADMJPEG_FOR_5005
	
	if set to 1, then New ADM for 5005 will work instead of origianl JPEG Decoder.
		
	The only one chnage is the Data Region of ADM JPEG Decoder.
	& It is shifted to left by (0x80000-0x19000) to use X cache for C1 & Y cache for C0
			-- hspark 051018
*/
#if	AUD_SUPPORT_5005_ADM
/* valid only for 5005 */
#define	AUD_SUPPORT_NEW_ADMJPEG_FOR_5005		0			/* default : OFF*/
#define	SHIFT_SIZE_5005_JPEG						0x19000
#endif

//#define _AD_PERF_CHECK
/* 
	Below Codec definitions should be same with Adm_config.h at AMCS project
*/

/* Audio Codec Module identification number */

#define	ID_MODULE_NULL					100
#define	ID_AC3_DECODER					101		/* AC3 audio decoder */
#define	ID_AC3_ENCODER					102		/* AC3 2-ch audio encoder */
#define	ID_MPA_DECODER					103		/* MPEG-2 Layer II audio multichannel decoder */
#define	ID_MPA_ENCODER					104		/* MPEG-1 Layer II 2-ch audio encoder */
#define 	ID_DTS_DECODER					105		/* DTS audio decoder */
#define 	ID_DTS_DIGITAL						106		/* DTS digital output */
#define 	ID_MLP_DECODER					107		/* MLP audio decoder */
#define 	ID_MP3_DECODER					108		/* MPEG-1 Layer III (MP3) audio decoder */
#define 	ID_MP3_ENCODER					109		/* MPEG-1 Layer III (MP3) audio encoder */
#define 	ID_WMA_DECODER					110		/* Windows Media Audio decoder */
#define 	ID_OGG_DECODER					111		/* Ogg vorbis audio decoder */
#define 	ID_AAC_DECODER					112		/* AAC audio decoder */
#define 	ID_AACP_DECODER					113		/* AAC Plus audio decoder */
#define 	ID_LPCM_DECODER					114		/* LPCM audio decoder */
#define 	ID_CDDA_DECODER					115		/* CDDA audio decoder */
#define 	ID_HDCD_DECODER					116		/* HDCD audio decoder */
#define 	ID_BSAC_DECODER					117		/* Bit Sliced Arithmetic Coding */
#define 	ID_MSADPCM_CODEC					118		/* MS-ADPCM audio encoder/decoder */
#define 	ID_G726_CODEC						119		/* G.726 ADPCM audio encoder/decoder */
#define 	ID_JPEG_DECODER					120		/* JPEG baseline decoder */
#define 	ID_POSTCODEC_BASE					121		/* SRS Wow (Focus/SRS/TruBass) */
#define 	ID_SRSWOW							121		/* SRS Wow (Focus/SRS/TruBass) */
#define 	ID_SPATIALIZER_TV					122		/* Spatializer TV mode */
#define 	ID_SPATIALIZER_SPK				123		/* Spatializer Speaker mode */
#define 	ID_SPATIALIZER_NHP				124		/* Spatializer Natural Headphone mode */
#define 	ID_SPATIALIZER_VBX				125		/* Spatializer VBX mode */
#define 	ID_SPATIALIZER_LFE					126		/* Spatializer virtual LFE mode */
#define 	ID_TIME_DELAY						127		/* Time delay effect */
#define 	ID_BASS_MANAGEMENT				128		/* Bass booster */
#define 	ID_SPEED_KEY_CONTROL				129		/* Speed/Key control */
#define 	ID_PRESET_EQUALIZER				130		/* Preset equalizer */
#define 	ID_GRAPHIC_EQUALIZER				131		/* Graphic equalizer */
#define 	ID_PRO_LOGIC_2						132		/* Dolby pro-logic II */
#define 	ID_SPECTRUM_ANALIZER				133		/* Spectrum analizer */
#define 	ID_CALIBRATION_NOISE				134		/* Calibration noise reduction */
#define 	ID_SYS_VOLUME						135		/* Asm. lib for system */
#define 	ID_SYS_FADEINOUT					136		/* Asm. lib for system */
#define 	ID_SYS_DUALMODE					137		/* Asm. lib for DualMode */
/* 
	Below two ID was added
	- hspark.  050208
*/
#define	ID_SYS_POST_V1						150		/* ADM System ID version 1 which includes post-codecs */
#define	ID_SYS_POST_V2						151		/* ADM System ID version 2 which includes post-codecs */
#define	ID_SYS_POST_V3						152		/* ADM System ID version 3 which includes post-codecs */


#define	ID_SYS_JPEG_BASE_DECODER				170		/* ADM SYS + JPEG baseline decoder by SISO */
#define 	ID_SYS_JPEG_PROG_DECODER				171		/* ADM SYS + JPEG progressive decoder by SISO */
#define 	ID_MODULE_LAST					190

#define S5H_AUDIO_TASK_SIZE 	2048*10 /* if this task calls inflate(), then increase STACK_SIZE  form 2048 to 2048*20 */

/*
	Temporary decrease size of hisr stack. by CKLee. 2005.04.25
*/
#define	AD_HISR_SIZE		800//2048
#define S5H_AUDIO_Q_NUM		20

typedef enum {
	V2_AUDIO_STATUS_NEED_RESET		= 0x0, 	/* need to initialize */
	V2_AUDIO_STATUS_NEED_INIT, 				/* need to download specific CODEC to ADM */		
	V2_AUDIO_STATUS_INITIALIZED, 		/* codec downloaded &  first frame is decoded.  */		
	V2_AUDIO_STATUS_PLAYING,			/* streamming is now done */
	V2_AUDIO_STATUS_PAUSED,
	V2_AUDIO_STATUS_STOPPED,			/* */	
	V2_AUDIO_STATUS_EMERGENCY			/* decoding error from ADM,  input empty error from PSD & in my self */
} v2S5H_AudioStatus_t;


typedef struct {
	UINT					streamID;		/* decoding audio stream number   */
	S5H_AudioCodingMode_t	audcodmd;		/* audio coding mode              */
	UINT					numaudch;		/* number of audio channels       */
	S5H_Quantization_t 		quant;			/* quantization                   */
	S5H_SampleRate_t			s_freq;			/* sampling frequency type in stream info  */
	UCHAR					mu_ast_atr[24];	
	UINT					n_freq;			/* sampling frequency from decoder   */	
} v2S5H_StreamInformation_t;

typedef enum {
	DBUFFER_NULL,
	DBUFFER_R_NULL,
	DBUFFER_R_R,	
	DBUFFER_Z_Z,
	DBUFFER_Z_V,
	DBUFFER_V_V,
	DBUFFER_V_Z
} DoubleBuffer_State_t;

typedef enum {
	/* command core operation */
	RES_NOT_ALLOCATED,
	RES_ALLOCATED
} SystemResource_State_t;


typedef enum {
	SH_FADEOUT_NULL = 0,
	SH_FADEOUT_NEED,
	SH_FADEOUT_WAIT,	
	SH_FADEOUT_DONE,
	SH_FADEIN_NEED
} SH_FadeCMD_t;


/*

	SAIU_Format_t	format;
	SAIU_BL_t		burstL;
	SAIU_Ch_t		ch;
	UCHAR			dsize;
	
	SAIU_Reset();
	SAIU_Cmd(SAIU_STOP);


		format	<- gADM_Info.OutPCMSize
		burstL, ch  <- AUDIO_OUTPUT_MODE == OUT_2CH ?

		dsize	<- gADM_Info.OutPCMSize. if 16, then 1 else 2 
		
		now fix for 6ch, 16bit PCM

*/

typedef	struct {
	BOOL		bDiscont;	/* discontinuity flag */
	UCHAR		pcm_size;	/* 16 or 20 or 24*/
	UCHAR		ch_count;	/*2ch or 6ch or 8ch */
	USHORT		sample_count;	/* current sample count! 0 ~ 64K */
	UCHAR		*pSource;	/* address of repository */
	UINT		pts;
	UINT		vob_id;

	USHORT		attr_post;			/* post codec attributes which was applied */
	UCHAR		attr_fade_before;	/* fade state before decoding */	
	UCHAR		attr_fade_after;		/* fade state after decoding */		

	UCHAR		attr_sample;		/* 
										#define	SAMPLE_ATTR_VALID_SPDIFSTREAM	0x10
										#define	SAMPLE_ATTR_VALID_PCM			0x01
										#define	SAMPLE_ATTR_VALID_ALL			(SAMPLE_ATTR_VALID_PCM |SAMPLE_ATTR_VALID_SPDIFSTREAM )
										#define	SAMPLE_ATTR_INVALID_SAMPLE		0x00	
									*/			
} PCM_SAMPLE_t;

typedef struct{
	S5H_OpMode_t			opmode;
	S5H_DualMode_t			dualmode;
	BOOL					activeDRC;
	S5H_Equalizer_t			equalizer;
	BOOL					lpcm_down_sample;
	S5H_SpdifMode_t			spdif_mode;
	S5H_SpdifPcmChannel_t	spdif_pcm_channel;

	BOOL					activetestingtone;
	S5H_Output_Channel_t		outputMode;
	BOOL					activevbx;
	S5H_SpeakerSetup_t		speaker;
}v2AudioSetupInfo_t ;

typedef struct{
	BOOL					masterMute;
	BOOL					activeDeemphasis;
	S5H_SpdifMode_t			spdif;
	S5H_SpdifMode_t			next_spdif;
	S5H_SpdifMode_t			ac3_spdif;
	S5H_SpdifMode_t			mpeg_spdif;
	S5H_SpdifMode_t			dts_spdif;	
	S5H_AdmChnCont_t		mpeg_chn_cont;
	S5H_AdmChnCont_t		cdda_chn_cont;
	UCHAR					audio_output_mode;
	UCHAR					calibration_noise_channel;

	UCHAR					volume;
}v2AudioExtInfo_t ;

/*
 *  top level audio object
 */

typedef struct {
	v2S5H_AudioStatus_t			audio_state;

	/*
		current input audio stream information
	
	*/
	v2S5H_StreamInformation_t		*stream_info; /* will point gStreamInfo */
	
	/* 
		Audio setup information -- from Setup Page
	*/
	v2AudioSetupInfo_t		*audio_setupinfo;/* will point gAudioSetupInfo */
	
	/*
		audio extension information
	*/
	
	v2AudioExtInfo_t			*audio_Extinfo;
	
} V2_AudioInfo_t;



typedef struct{
	UINT	next_dec_offset;
	UINT	next_dec_ext_offset;
	UINT	cur_frame_size;
} INPUT_Offset_info_t;


/*
	All AD Decoder's variable should be here.
*/
typedef struct{

	AUDIO_DEC_STATE_t		cur_decoderstate;

	S5H_AudioCodingMode_t	audio_codingmode;
	S5H_AudioCodingMode_t	previous_audio_codingmode;
	UINT					audio_outputchanneltype; /* channel count 2 or 6 */
	
	/*
		Start Address of the Physical Memory 
			allocated for AD.
	*/
	S5H_MemMapType_t				memmap;	


	UINT				phy_mem_total_size; 
	/* 
		phy_mem_total_size : Code + Data + X + Y + S1 
		i assume that 
			phy_mem_base_S0 = phy_mem_base + phy_mem_total_size, 
			& this will be managed at exernal side ( S5h_memmap.c )
	*/
	UINT				phy_mem_bottom;
	UINT				phy_mem_base_S0; 	
	UINT				phy_mem_base_code; 
	UINT				phy_mem_base_code_region1; /*AUD_SUPPORT_CODE_REGION_FEATURE*/

	UINT				phy_mem_base_data; 
	UINT				phy_mem_base_X; 
	UINT				phy_mem_base_Y; 
	UINT				phy_mem_base_SM; 	/* Shared Memory */
	UINT				phy_mem_base_S1; 
	UINT				phy_mem_top;

/* <<< @: 5010-xxx.JaeYoul_Kim 051219 : use 32bit buffer offset value to support over 64KB S0, S1 buf size*/ //jy noaudext
#if	AUD_SUPPORT_AD_32BIT_BUFOFFSET
	UINT				stream0_offset_from_S0; 	//jy noaudext
	UINT				stream1_offset_from_S0; 	
#else
	USHORT				stream0_offset_from_S0; 	
	USHORT				stream1_offset_from_S0; 	
#endif
/* >>> @: 5010-xxx.JaeYoul_Kim 051215 */		

	UINT				cur_ValidBytes;	/* This will indicates # of valid bytes at S0 */

	UINT				cur_spdifchunk_size; /* size which do not inlcude preamble size */
	S5H_SpdifMode_t		cur_spdif_mode;

	
	/* For jpeg information */
	UINT				cur_jpegDecodeThumbnail;	/* 0: Full decoding, DECODE_THUMBNAIL(10): thumbnail*/
	SH_ScaledImgInfo_st	cur_jpeginfo;
	UINT				cur_jpegError;
	/*
		Buffer Nodes & status
	*/

	BM_FREEPOOL			*pCurBufPool_Aud; /* This pointer will be initialized by iAD_Init() */
	BM_FILLEDLIST		*pCurBufList_Aud; /* This pointer will be initialized by iAD_Init() */
//	BM_FILLEDLIST	*gpCurBufList_AudExt; /* This pointer will be initialized by iAD_Init() */

	/* input nodes */
	BM_NODE			*pInput_main_curr;
	BM_NODE			*pInput_main_next;
	
	/* output node */
	BM_NODE			*pOutput_main;

/* <<< @: 5008CHN-007.hspark 060201 : AUD_SUPPORT_MPEGSTREAM_SPDIFOUT  */
#if AUD_SUPPORT_MPEGSTREAM_SPDIFOUT
	BM_NODE			*pInput_ext_curr;
#endif
/* >>> @: 5008CHN-007.hspark 060201.*/

	/* 
		Decoding Pointer Information
	*/
	
	UINT		cur_dec_addr_main;
	UINT		next_dec_addr_main;
	
	UINT		cur_dec_addr_ext;
	UINT		next_dec_addr_ext;
	
//	INPUT_Offset_info_t	input_offset;
//	UINT		next_dec_offset;			/* offset of */
//	UINT		next_dec_ext_offset;
//	UINT		cur_frame_size;
	UINT		prev_dec_addr_main;	
	UCHAR		bNeedToSkipFrame;		


	/* 
		Input BufferPool Information ( main stream )
	*/
	UINT		main_poolsize;
	UINT		main_poolstart;		/* This should be the physical address of S0 */
	UINT		main_poolstop;
	UINT		main_pool_chunksize;
	UINT		main_pool_chunkcount;


	/* 
		Current Decoding Information
	*/

	UCHAR		bNeedToGetInfo;	
	UINT		szFrameSize;
	UINT		numberofsample;
	UINT		frequency;		
	UINT		bit_rate; 			
	UINT		offset;				/* offset of current played CHUNK */
	UINT		curblock_offset;				/* offset of current played CHUNK */
	UINT		byte_offset;				/* offset of current played CHUNK */	
	UINT		vob_id;				/* vob_id of current played CHUNK */
	UINT		vob_id_backup;				/* vob_id of current played CHUNK */
	
	UINT		callback_lba;				/* offset of current played CHUNK */

⌨️ 快捷键说明

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