/********************************************************************************************
 *     LEGAL DISCLAIMER
 *
 *     (Header of MediaTek Software/Firmware Release or Documentation)
 *
 *     BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
 *     THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
 *     FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
 *     ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
 *     INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
 *     A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
 *     WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
 *     INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
 *     ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
 *     NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
 *     OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
 *
 *     BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
 *     RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
 *     TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
 *     FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
 *
 *     THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
 *     OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
 ************************************************************************************************/
/*----------------------------------------------------------------------------*
 * $RCSfile: x_aud_dec.h,v $
 * $Revision: #4 $
 * $Date: 2019/01/15 $
 * $Author: feilong.wei $
 *
 * Description:
 *         This header file contains audio decoder driver specific definitions,
 *         which are exported.
 *---------------------------------------------------------------------------*/

#ifndef _X_AUD_DEC_H_
#define _X_AUD_DEC_H_


/*-----------------------------------------------------------------------------
                    include files
-----------------------------------------------------------------------------*/

#include "x_common.h"
#include "x_rm.h"
#include "x_drv_cb.h"
#include "x_memtype.h"
#include "drv_def.h"
//#include "x_def.h" //Support audio in @2009/06/22
#include "x_aud_dec_rel.h"
#include "chip_ver.h"
#include "drv_config.h"
/*-----------------------------------------------------------------------------
                    macros, defines, typedefs, enums
 ----------------------------------------------------------------------------*/
#include <linux/ioctl.h>

/*! \name Get Operations
* @{
*/
/* component group command sets **********************************************/
/* primary commands */
#define RISC_IOCTYPE_MTAUDDEC            1
#define RISC_IO_AUDDEC_GETAFIFOSTART               	_IOW(RISC_IOCTYPE_MTAUDDEC, 1, INT32)
#define RISC_IO_AUDDEC_GETAFIFOEND              	_IOW(RISC_IOCTYPE_MTAUDDEC, 2, INT32)
#define RISC_IO_AUDDEC_GETAFIFORp              	_IOW(RISC_IOCTYPE_MTAUDDEC, 3, INT32)
#define RISC_IO_AUDDEC_GETAFIFOWp              	_IOW(RISC_IOCTYPE_MTAUDDEC, 4, INT32)
#define RISC_IO_AUDDEC_GETAFIFOSIZE               	_IOW(RISC_IOCTYPE_MTAUDDEC, 5, INT32)
#define RISC_IO_AUDDEC_GETAFIFORDIDX              	_IOW(RISC_IOCTYPE_MTAUDDEC, 6, INT32)
#define RISC_IO_AUDDEC_UPAFIFORDIDX              	_IOW(RISC_IOCTYPE_MTAUDDEC, 7, INT32)
#define RISC_IO_AUDDEC_ESM_PLAY              	_IOW(RISC_IOCTYPE_MTAUDDEC, 8, INT32)
#define RISC_IO_AUDDEC_ESM_STOP              	_IOW(RISC_IOCTYPE_MTAUDDEC, 9, INT32)
#define RISC_IO_AUDDEC_ESM_EOS              	_IOW(RISC_IOCTYPE_MTAUDDEC, 10, INT32)

#define RISC_IO_AUDDEC_GETPTSQUEUEREMAINDATA               	_IOW(RISC_IOCTYPE_MTAUDDEC, 11, INT32)
#define RISC_IO_AUDDEC_GETPTSQUEUESA              	_IOW(RISC_IOCTYPE_MTAUDDEC, 12, INT32)
#define RISC_IO_AUDDEC_GETPTSQUEUEEA              	_IOW(RISC_IOCTYPE_MTAUDDEC, 13, INT32)
#define RISC_IO_AUDDEC_UPPTSQUEUERDIDX               	_IOW(RISC_IOCTYPE_MTAUDDEC, 14, INT32)
#define RISC_IO_AUDDEC_QUERTYAUDIOINFO               	_IOW(RISC_IOCTYPE_MTAUDDEC, 15, INT32)
#define RISC_IO_AUDDEC_SETDRIVERINFO               	_IOW(RISC_IOCTYPE_MTAUDDEC, 16, INT32)
#define RISC_IO_AUDDEC_GETPTSQSTART               	_IOW(RISC_IOCTYPE_MTAUDDEC, 17, INT32)
#define RISC_IO_AUDDEC_GETPTSQEND              	_IOW(RISC_IOCTYPE_MTAUDDEC, 18, INT32)
#define RISC_IO_AUDDEC_GETPTSQDATA              	_IOW(RISC_IOCTYPE_MTAUDDEC, 19, INT32)
#define RISC_IO_AUDDEC_GETPBINFO              	_IOW(RISC_IOCTYPE_MTAUDDEC, 20, INT32)
#if CONFIG_DRV_DSPB_TO_RISC
#define RISC_IO_AUDDEC_DSPDecSTART               	_IOW(RISC_IOCTYPE_MTAUDDEC, 21, INT32)
#define RISC_IO_AUDDEC_DSPDecEND              	_IOW(RISC_IOCTYPE_MTAUDDEC, 22, INT32)
#define RISC_IO_AUDDEC_GETDSPDecRDIDX              	_IOW(RISC_IOCTYPE_MTAUDDEC, 23, INT32)
#define RISC_IO_AUDDEC_UPDTDSPDecRDIDX              	_IOW(RISC_IOCTYPE_MTAUDDEC, 24, INT32)
#define RISC_IO_AUDDEC_SETDSPBLOADCODE               	_IOW(RISC_IOCTYPE_MTAUDDEC, 25, INT32)
#define RISC_IO_AUDDEC_SETDSPBPLAY               	_IOW(RISC_IOCTYPE_MTAUDDEC, 26, INT32)
#define RISC_IO_AUDDEC_SETDSPBSTOP               	_IOW(RISC_IOCTYPE_MTAUDDEC, 27, INT32)
#define RISC_IO_AUDDEC_GETDSPBINFO               	_IOW(RISC_IOCTYPE_MTAUDDEC, 28, INT32)
#define RISC_IO_AUDDEC_GETDSPSIZE               	_IOW(RISC_IOCTYPE_MTAUDDEC, 29, INT32)
#endif

typedef enum
{
	IO_CTRL_QUERY_HDMITX = 0,
	IO_CTRL_QUERY_DAC,
	IO_CTRL_QUERY_END
} IO_CTRL_DEC_QUERY_IDX_T;
/*
Audio Info
*/
typedef struct MTAUDDEC_AUDIO_INFO
{
	UINT32 u4SampleRate;
	UINT32 u4BitWidth;
    UINT32 u4Format;
}IO_CTRL_AUDIO_INFO_T;
/// MTAL_IOCTL_2ARG_T: Send 2 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[2];
} RISC_IOCTL_2ARG_T;

/// MTAL_IOCTL_4ARG_T: Send 3 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[3];
} RISC_IOCTL_3ARG_T;

/// MTAL_IOCTL_4ARG_T: Send 4 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[4];

} RISC_IOCTL_4ARG_T;

typedef struct
{
    INT32 ai4Arg[5];

} RISC_IOCTL_5ARG_T;

/// MTAL_IOCTL_6ARG_T: Send 6 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[6];
} RISC_IOCTL_6ARG_T;

/// MTAL_IOCTL_7ARG_T: Send 7 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[7];
} RISC_IOCTL_7ARG_T; // 20110801

/// MTAL_IOCTL_8ARG_T: Send 8 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[8];
} RISC_IOCTL_8ARG_T;

/// MTAL_IOCTL_9ARG_T: Send 9 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[9];
} RISC_IOCTL_9ARG_T;

/// MTAL_IOCTL_10ARG_T: Send 10 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[10];
} RISC_IOCTL_10ARG_T;

/// MTAL_IOCTL_11ARG_T: Send 11 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[11];
} RISC_IOCTL_11ARG_T;

/// MTAL_IOCTL_12ARG_T: Send 12 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[12];
} RISC_IOCTL_12ARG_T;

/// MTAL_IOCTL_16ARG_T: Send 16 Arguments between user/kernel mode (ioctl interface)
typedef struct
{
    INT32 ai4Arg[16];
} RISC_IOCTL_16ARG_T;

#define AUD_DEC_GET_TYPE_CTRL                 (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 0))
#define AUD_DEC_GET_TYPE_INP_MODE             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 1))
#define AUD_DEC_GET_TYPE_FMT                  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 2))
#define AUD_DEC_GET_TYPE_VOLUME               (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 3))
#define AUD_DEC_GET_TYPE_MUTE                 (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 4))
#define AUD_DEC_GET_TYPE_SPDIF                (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 5))
#define AUD_DEC_GET_TYPE_HDCD_FLTR            (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 6))
#define AUD_DEC_GET_TYPE_LS_MODE              (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 7))
#define AUD_DEC_GET_TYPE_SOUND_EFFECT         (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 8))
#define AUD_DEC_GET_TYPE_DOWNMIX              (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 9))
#define AUD_DEC_GET_TYPE_DRC                  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 10))
#define AUD_DEC_GET_TYPE_CAPABILITY           (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 11))
#define AUD_DEC_GET_TYPE_OUT_PORT             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 12))
#define AUD_DEC_GET_TYPE_PCR_ID               (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 13))
#define AUD_DEC_GET_TYPE_AUD_INFO             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 14))
#define AUD_DEC_GET_TYPE_CMPSS_MODE           (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 15))
#define AUD_DEC_GET_TYPE_AGC                  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 16))
#define AUD_DEC_GET_TYPE_CHNL_DELAY           (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 17))
#define AUD_DEC_GET_TYPE_MAX_CHNL_DELAY       (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 18))
#define AUD_DEC_GET_TYPE_COPY_PROTECT         (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 19))
#define AUD_DEC_GET_TYPE_MTS                  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 20))
#define AUD_DEC_GET_TYPE_SE_EQ_USER_NUM_BAND  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 21))
#define AUD_DEC_GET_TYPE_SE_EQ_USER_LVL       (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 22))
#define AUD_DEC_GET_TYPE_SE_EQ_USER_INFO_BAND (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 23))
#define AUD_DEC_GET_TYPE_TV_AUD_SYS_MASK      (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 24))
#define AUD_DEC_GET_TYPE_TV_SYS_CAPABILITY    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 25))
#define AUD_DEC_GET_TYPE_AUD_SYS_CAPABILITY   (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 26))
#define AUD_DEC_GET_TYPE_AUD_CLIP             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 27))
#define AUD_DEC_GET_TYPE_AUD_CLIP_INFO        (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 28))
#define AUD_DEC_GET_TYPE_PL2_CTRL             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 29))
#define AUD_DEC_GET_TYPE_DOLBY_CERTI_MODE     (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 30))
#define AUD_DEC_GET_TYPE_OUTPORT_ADJ          (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 31))
#define AUD_DEC_GET_TYPE_BBE_MODE             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 32))
#define AUD_DEC_GET_TYPE_AV_SYNC              (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 33))
#define AUD_DEC_GET_TYPE_BITSTM_INFO          (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 34))
#define AUD_DEC_GET_TYPE_METADATA_ENABLE      (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 35))
#define AUD_DEC_GET_TYPE_AUD_MIX_GAIN         (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 36))
#define AUD_DEC_GET_TYPE_REENC_CTRL           (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 37))
#define AUD_DEC_GET_TYPE_REENC_DDCO_CFG       (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 38))
#define AUD_DEC_GET_TYPE_REENC_DTSTRAN_CHAN_MODE (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 39))
#define AUD_DEC_GET_TYPE_DOLBY_KARA_MODE      (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 40))
#define AUD_DEC_GET_TYPE_DTS_DRC              (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 41))
#define AUD_DEC_GET_TYPE_DTS_AUD_PRESENTATION (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 42))
#define AUD_DEC_GET_TYPE_HDCD_CFG             (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 43))
#define AUD_DEC_GET_TYPE_HDCD_DITHER_MODE     (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 44))
#define AUD_DEC_GET_TYPE_HDCD_AOUT_BIT_LEN    (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 45))
#define AUD_DEC_GET_TYPE_TRUEHD_CFG           (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 46))
#define AUD_DEC_GET_TYPE_SPEAKER_LAYOUT       (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 47))
#define AUD_DEC_GET_TYPE_HDMI                 (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 48))
#define AUD_DEC_GET_TYPE_SPDIF_LPCM           (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 49))
#define AUD_DEC_GET_TYPE_DOLBY_DUAL_MONO      (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 50))
#define AUD_DEC_GET_TYPE_SPDIF_OUTPUT         (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 51))
#define AUD_DEC_GET_TYPE_SPDIF_INPUT          (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 52))
#define AUD_DEC_GET_TYPE_TRNSFER_BITRATE      (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 53))
#define AUD_DEC_GET_TYPE_SPECTRUM_INFO        (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 54))
#define AUD_DEC_GET_TYPE_SACD_INPUT           (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 55))
#define AUD_DEC_GET_TYPE_SACD_OUTPUT          (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 56))
#define AUD_DEC_GET_TYPE_KARA_OUTPUT          (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 57))
#define AUD_DEC_GET_TYPE_NEO6_CFG             (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 62))

// AAC_support_DSP
#define AUD_DEC_GET_TYPE_AAC_DUALMONO         (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 63))
#define AUD_DEC_GET_TYPE_DTS_NO_REMAPPING     (RM_GET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 64))

/* should be remove */
#define AUD_DEC_GET_TYPE_TV_SYS_MASK          (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 66))

//AVD HDMI output mode
#define AUD_DEC_GET_TYPE_AVD_HDMI_OUTPUT_MODE (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 67))
#define AUD_DEC_GET_TYPE_AVD_SPDIF_OUTPUT_MODE  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 68))

/* for AACS Audio Watermark, AW Agent Command to AWD Wrapper */
#define AUD_DEC_GET_TYPE_WM_CMD                (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 69))

#define AUD_DEC_GET_TYPE_CH9CH10_VOLUME       (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 70))
#define AUD_DEC_GET_TYPE_DSP_VERSION_NO       (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 71))

#define AUD_DEC_GET_EXSPIDIF_DATA             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 72))
#define AUD_DEC_GET_ADAC_SF_MUTE             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 73))

#define AUD_DEC_GET_TYPE_CLIP_WRITE_INFO      (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 74))//Added by Morning for BtnSnd Streaming

#define AUD_DEC_GET_TYPE_CLIP_STRM_BUF        (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 75))//Added by Morning for BtnSnd Streaming

#define AUD_DEC_GET_TYPE_ENCODER_PROC         (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 76))  // -- Water (AUD_RIPPING)

#define AUD_DEC_GET_TYPE_HDMI_OUT_TYPE         (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 77))  //Added by Morning for yamaha new feature
#define AUD_DEC_GET_TYPE_ASDATA_CH               (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 78))
#define AUD_DEC_GET_TYPE_ASDATA_CH_ALL        (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 79))

#define AUD_DEC_GET_TYPE_INPUT_CH_LAYOUT_DETAIL (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 80))//Added by Morning for Yamaha

#define AUD_DEC_GET_TYPE_INPUT_FREQ (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 81))//Added by Morning for Yamaha

#define AUD_DEC_GET_IEC_OUTPUT_FMT            (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 82))
#define AUD_DEC_GET_PRI_AUDIO_STATE  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 83))
#define AUD_DEC_GET_TYPE_PL2_STATUS   (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 84))  //added by morning
#define AUD_DEC_GET_TYPE_AAC_FMT             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 85))  //added by morning

// (aud_porting) -- Water 2010-12-26
#define AUD_DEC_GET_TYPE_ENCODER_2ND_PROC       (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 86))  // -- Water (aud_gracenote)

#define AUD_DEC_GET_TYPE_MIC_INPUT_LEVEL (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 87))
#define AUD_DEC_GET_TYPE_CHINFO_FOR_SE (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 88))
#define AUD_DEC_GET_TYPE_HDMI_PCM_OUTPUT_VOL    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 89))

#define AUD_DEC_GET_CH_DELAYSTEP (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 90))//added by Lily Jiang for pioneer cli:mw.se.delay st
//(aud_output_level) ---zhengwen 2011/12/12
#define AUD_DEC_GET_OUTPUT_LEVEL_STATE    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 91))
#define AUD_DEC_GET_TYPE_AVG_AOUT_VOL    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 92))
#define AUD_DEC_GET_AUDIO_IN_INFO        (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 93))
#define AUD_DEC_GET_TYPE_LID             (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 94))
#define AUD_DEC_GET_SIL_BEAT_INFO        (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 95))
#define AUD_DEC_GET_TYPE_CLIP_AOUTON_STATE    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 96))//for CMIF whether delay(200ms) in setparam()

#define AUD_DEC_GET_TYPE_DEVICE_VALID    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 97))
#define AUD_DEC_GET_TYPE_HDMI_PCM_OUTPUT_VOL_FROM_DRAM    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 98))
#define AUD_DEC_GET_AUDIO_IN_SPDIF_IN_CHANNEL_STATUS_INFO    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 99))
#define AUD_DEC_GET_AUDIO_IN_SPDIFPCM_DETECT			(RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 100))
#if (((defined CONFIG_AUD_DRV_PRIMARY_SMOOTH_INVOLVED)&&(CONFIG_AUD_DRV_PRIMARY_SMOOTH_INVOLVED)) || ((defined CONFIG_AUD_MW_PRIMARY_SMOOTH_INVOLVED)&&(CONFIG_AUD_MW_PRIMARY_SMOOTH_INVOLVED)))
#define AUD_DEC_GET_PRIMARY_SMOOTH_PARAM        (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 105))
#define AUD_DEC_GET_PRIMARY_SMOOTH_CURRENT_VOLUME        (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 106))
#endif
#define AUD_DEC_GET_DSP_AUDIO_STATE  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 107))
#define AUD_DEC_GET_DSP_READ_POINTER  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 108))

#define AUD_DEC_GET_RISC_DEC_INFO  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 109))

#if (((defined CONFIG_DRV_EXTPP_PPC_INVOLVED)&&(CONFIG_DRV_EXTPP_PPC_INVOLVED)) || ((defined CONFIG_MW_EXTPP_PPC_INVOLVED)&&(CONFIG_MW_EXTPP_PPC_INVOLVED)) || (((defined CONFIG_MW_SUPPORT_RISC_AUD_DEC)&&(CONFIG_MW_SUPPORT_RISC_AUD_DEC))))
#define ADU_DEC_GET_PPC_PARAM    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 110))
#endif

#define ADU_DEC_GET_QUERY_SUPPORT    (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 111))

/*! @} */

/*! \name Set Operations
* @{
*/
#define AUD_DEC_BITRATE_UNKNOWN                 ((UINT32) 0xFFFFFFFF)


#define AUD_DEC_SET_TYPE_CTRL                ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 0)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_NFY_FCT              (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 1))
#define AUD_DEC_SET_TYPE_INP_MODE            ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 2)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_FMT                  (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 3))
#define AUD_DEC_SET_TYPE_VOLUME               (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 4))
#define AUD_DEC_SET_TYPE_MUTE                ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 5)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SPDIF               ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 6)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_HDCD_FLTR           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 7)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_LS_MODE              (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 8))
#define AUD_DEC_SET_TYPE_SOUND_EFFECT         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 9))
#define AUD_DEC_SET_TYPE_DOWNMIX             ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 10)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_DRC                 ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 11)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_MEM_BUFFER           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 12))
#define AUD_DEC_SET_TYPE_NFY_AUD_CHG          (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 13))
#define AUD_DEC_SET_TYPE_OUT_PORT            ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 14)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_PCR_ID              ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 15)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_CMPSS_MODE          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 16)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_AGC                  (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 17))
#define AUD_DEC_SET_TYPE_CHNL_DELAY           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 18))
#define AUD_DEC_SET_TYPE_COPY_PROTECT         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 19))
#define AUD_DEC_SET_TYPE_MTS                  (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 20))
#define AUD_DEC_SET_TYPE_SE_EQ_USER_LVL       (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 21))
#define AUD_DEC_SET_TYPE_TV_AUD_SYS_MASK      (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 22))
#define AUD_DEC_SET_TYPE_AUD_CLIP             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 23))
#define AUD_DEC_SET_TYPE_AUD_CLIP_INFO        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 24))
#define AUD_DEC_SET_TYPE_PL2_CTRL             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 25))
#define AUD_DEC_SET_TYPE_DOLBY_CERTI_MODE     (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 26))
#define AUD_DEC_SET_TYPE_OUTPORT_ADJ          (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 27))
#define AUD_DEC_SET_TYPE_BBE_MODE             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 28))
#define AUD_DEC_SET_TYPE_AV_SYNC             ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 29)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_AUD_MIX_GAIN         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 30))
#define AUD_DEC_SET_TYPE_AUD_SPEED            (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 31))
#define AUD_DEC_SET_TYPE_METADATA_ENABLE      (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 32))
#define AUD_DEC_SET_TYPE_REENC_CTRL           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 33))
#define AUD_DEC_SET_TYPE_REENC_DDCO_CFG       (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 34))
#define AUD_DEC_SET_TYPE_REENC_DTSTRAN_CHAN_MODE (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 35))
#define AUD_DEC_SET_TYPE_DOLBY_KARA_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 36)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_DTS_DRC             ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 37)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_DTS_AUD_PRESENTATION ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 38)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_HDCD_CFG             ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 39)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_HDCD_DITHER_MODE     (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 40))
#define AUD_DEC_SET_TYPE_HDCD_AOUT_BIT_LEN    (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 41))
#define AUD_DEC_SET_TYPE_TRUEHD_CFG           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 42))
#define AUD_DEC_SET_TYPE_SPEAKER_LAYOUT       (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 43))
#define AUD_DEC_SET_TYPE_AUD_INFO             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 44))
#define AUD_DEC_SET_TYPE_HDMI                ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 45)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SPDIF_LPCM          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 46)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_DOLBY_DUAL_MONO     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 47)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_AUD_PANNING          (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 48))
#define AUD_DEC_SET_TYPE_METADATA_OUTPUT_ENABLE (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 49))
#define AUD_DEC_SET_TYPE_SPDIF_OUTPUT        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 50)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SPDIF_INPUT          (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 51))
#define AUD_DEC_SET_TYPE_CGMS_INFO            (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 52))
#define AUD_DEC_SET_TYPE_TRANSCO_INFO         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 53))
#define AUD_DEC_SET_TYPE_SPECTRUM_INFO        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 54))
#define AUD_DEC_SET_TYPE_SACD_INPUT           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 55))
#define AUD_DEC_SET_TYPE_SACD_OUTPUT          (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 56))
#define AUD_DEC_SET_TYPE_KARA_OUTPUT          (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 57))
// UI_default
#define AUD_DEC_SET_TYPE_UI_DEFAULT           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 58))
//#define AUD_DEC_SET_TYPE_GLOBAL_MUTE         ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 59)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_AUD_RESET            (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 60))
        // Joslyn_UIMUTE_2
#define AUD_DEC_SET_TYPE_METADATA_OUTPUT_ENABLE_UI ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 61)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_NEO6_CFG             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 62))
// AAC_support_DSP
#define AUD_DEC_SET_TYPE_AAC_DUALMONO         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 63))
#define AUD_DEC_SET_TYPE_DTS_NO_REMAPPING    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 64)) | RM_SET_TYPE_ARG_NO_REF)

/* only for BBK test 7.1 channel with 5.1 source */
#define AUD_DEC_SET_TYPE_FORCE_RS_OUTPUT      (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 65))

/* should be remove */
#define AUD_DEC_SET_TYPE_TV_SYS_MASK          (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 66))

/* Test tone */
#define AUD_DEC_SET_TYPE_TEST_TONE            (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 67))

/* for test tone feature @ 12/22/2008 */
#define AUD_DEC_SET_TYPE_TEST_TONE_SELECT    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 68)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_TEST_TONE_CHANNEL   ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 69)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_TEST_TONE_SWITCH    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 70)) | RM_SET_TYPE_ARG_NO_REF)

/*define downmix LR type*/
#define AUD_DEC_SET_TYPE_DOWNMIX_LR          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 71)) | RM_SET_TYPE_ARG_NO_REF)

/*define BDP7300 or BDP500 mode */
#define AUD_DEC_SET_TYPE_CHANN_MODE          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 72)) | RM_SET_TYPE_ARG_NO_REF)

/* for new re-encoder flow @ 01/14/2009 */
#define AUD_DEC_SET_TYPE_REENCODER_CONFIG     (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 73))
#define AUD_DEC_SET_TYPE_REENCODER_CONFIG_APP (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 74))

#define AUD_DEC_SET_TYPE_AACS_RESET           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 75))

#define AUD_DEC_SET_TYPE_SEC_AUDIO_INFO       (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 76))

#define AUD_DEC_SET_TYPE_MEDIA_INFO	          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 77)) | RM_SET_TYPE_ARG_NO_REF)


/* for AACS Audio Watermark */
#define AUD_DEC_SET_WATERMARK_FLAG           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 78)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_WATERMARK_NFY_FCT         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 79))

/* for UI enable/disable interactive audio */

#define AUD_DEC_SET_TYPE_INTERACTIVE_AUDIO_UI ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 80)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_2ND_AUDIO_ENABLE_MW2 (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 81))

#define AUD_DEC_SET_TYPE_DEFAULT_FS           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 82)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_TEST_TONE_CHANNEL_EXT ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 83)) | RM_SET_TYPE_ARG_NO_REF)
/* for  wmdrm-pd output protection */
//#define  AUD_DEC_SET_TYPE_HDMI_MUTE           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 83)) | RM_SET_TYPE_ARG_NO_REF)
//#define  AUD_DEC_SET_TYPE_SPDIF_MUTE          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 84)) | RM_SET_TYPE_ARG_NO_REF)

#if 1 //CONFIG_DRV_AUDIO_IN
/* for ASH set AUDIO_IN_MODE  */
#define AUD_DEC_SET_TYPE_SPDIF_INPUT_MODE  (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 85))
#endif

/* for sound effects version 2 (aud_se_v2) */
#define AUD_DEC_SET_TYPE_SOUND_EFFECT_V2       (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 86))

/* for AACS Audio Watermark, AW Agent Command to AWD Wrapper */
#define AUD_DEC_SET_TYPE_WM_CMD                (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 87))
#define AUD_DEC_SET_TYPE_WM_EVENT_CB           (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 88))

#define AUD_DEC_SET_TYPE_ADAC_MUTE            ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 89)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_TUNE_APLL             ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 90)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_HDMI_CHANNEL_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 91)) | RM_SET_TYPE_ARG_NO_REF)
#define  AUD_DEC_SET_TYPE_KEEP_CGMS            ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 92)))
#define AUD_DEC_SET_TYPE_HDMI_REINIT_INFO      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 93)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_FORCE_2CH_DOWNMIX     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 94)) | RM_SET_TYPE_ARG_NO_REF)

#define  AUD_DEC_SET_EXTSPDIF_REG              ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 95)))

#define AUD_DEC_SET_TYPE_ANALOG_TRIM_ZERO      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 96)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_MAXSPEAKERCFG_OPTION  ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 97)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_ADAC_SF_MUTE          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 98)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_BOOSTER_GAIN          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 99)) | RM_SET_TYPE_ARG_NO_REF)

/*for PHI 2010 module info*/
#define AUD_DEC_SET_TYPE_MODULE_LOGO_MODE           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 100)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_MODULE_AOUT_CHANNEL_MODE   ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 101)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_MODULE_DDCO_MODE           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 102)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_MODULE_BMANAGEMENT_MODE    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 103)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_FEATURE_MODE               ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 104)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_MODULE_HDMI_CHANNEL_MODE   ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 105)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_SACD_INPUT_CHANNEL_NUM    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 106)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_GLOBAL_SMOOTH_MUTE   ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 107)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_HDMI_MUTE_EX         ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 108)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SPDIF_MUTE_EX        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 109)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_CLIP_WRITE_INFO      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 110)) | RM_SET_TYPE_ARG_NO_REF)//Added by Morning for Btnsnd Streaming

#define AUD_DEC_SET_TYPE_DTS_DMP              ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 111)) | RM_SET_TYPE_ARG_NO_REF)//Added by Morning for DTS Certification
#define AUD_DEC_SET_TYPE_DTS_DMX_LFE          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 112)) | RM_SET_TYPE_ARG_NO_REF)//Added by Morning for DTS Certification
#define AUD_DEC_SET_TYPE_DIVERSITY_INFO       ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 113)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_ADSP_CLOCK           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 114)) | RM_SET_TYPE_ARG_NO_REF)//Added by Morning for Btnsnd Streaming
#define AUD_DEC_SET_TYPE_ADSP_C_OFF           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 115)) | RM_SET_TYPE_ARG_NO_REF)//Added by Morning for Btnsnd Streaming
#define AUD_DEC_SET_TYPE_BASS_MANAGEMENT_MODE ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 116)) | RM_SET_TYPE_ARG_NO_REF)//Added by Morning for BM's LFE+Main setting

#define AUD_DEC_SET_TYPE_ENCODER_PROC         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 117))     // -- Water (AUD_RIPPING)
#define AUD_DEC_SET_MIC_CTRL                   (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 118))
#define AUD_DEC_SET_PATH                      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 119)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_ASDATA_CH               (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 120))
#define AUD_DEC_SET_TYPE_ASDATA_CH_ALL        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 121))
#define AUD_DEC_PRINT_MIC_STATUS              ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 122)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_GET_TYPE_DD_CLEV_SLEV           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T)123)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_GET_TYPE_TRUEHD_GAIN             ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T)124)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_HDMI_CLK             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 125))
#define AUD_DEC_SET_KEYSHIFT                 ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T)126)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_CD_OUTPUT_MODE      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 127)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_CODEC_DIGI_OUPUT        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 128))

#define AUD_DEC_SET_TYPE_KARA_VOCALMUTE      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 129)) | RM_SET_TYPE_ARG_NO_REF)

/* scc mini set config interface (aud_mini_set_cfg) -- Water 2010-05-13 */
#define AUD_DEC_SET_TYPE_MINI_SET_CFG       (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 130))
#define AUD_DEC_SET_KEYSHIFT_EX              ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 131)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_KARA_VOCALMUTE_EX   ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 132)) | RM_SET_TYPE_ARG_NO_REF)

// (aud_porting) -- Water 2010-12-26
#define AUD_DEC_SET_TYPE_ENCODER_2ND_PROC    (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 133))     // -- Water (aud_gracenote)
/* scc dts set config interface  */
// (aud_spk_mod) -- QingZ 2010-11-30
#define AUD_DEC_SET_TYPE_MODULE_SPK_CHANNEL_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 134)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_PL2_OUTPUT_CH        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 135)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_BASSM_TABLE                             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 136))
#define AUD_DEC_SET_TYPE_CGMS_COPY_PERMISSION  ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 137)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_HDMI_PCM_OUTPUT_VOL    (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 138))
#define AUD_DEC_SET_TYPE_CLIP_DUAL_MONO_MODE   ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 139)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_KARAOKE_DOWNMIX           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 140)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_ANALOG_DOWNMIX_BYPASS     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 141)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_BM_BYPASS                  ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 142)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_BM_SWITCH                 ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 143)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_FORCE_5CH_DOWNMIX     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 144)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_FORCE_2CH_DOWNMIX_PP     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 145)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_DOLBY_KARAOKE_STREAM_NOTIFY_FUNC     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 147)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_SE_BYPASS_INFO                      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 148)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_DIR_HW_ERR_MUTE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 149)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_BLUE_TOOTH_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 150)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SONY_DELAY_TIME    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 151)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_DYNAMIC_TUNE_APLL    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 152)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_FORCE_2CH_DOWNMIX_PP_LTRT    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 153)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_BIVL_COPY_CONTROL_INFO    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 154)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_DTSHDMA    (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 155))


// (aud_spectrum_mod) -- QingZ 2011-5-09
#define AUD_DEC_SET_TYPE_SPECTRUM_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 164)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SPDIF_OUTPUT_REAL          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 165)) | RM_SET_TYPE_ARG_NO_REF)

// Ao : jellyfish feature mode
#ifdef CONFIG_DRV_SUPPORT_GAIKAI
#define AUD_DEC_SET_TYPE_JELLYFISH_FEATURE_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 166))| RM_SET_TYPE_ARG_NO_REF)
#endif

#define AUD_DEC_SET_DCAC_FRAMEWORK_CTRL                ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 167)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_DCAC_CTRL                ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 168)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_DCAC_SIMU_NOTIFY        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 169)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_RESET_APLL          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 170)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_PRINT_AUDIN_DELAY_INFO     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 171)) | RM_SET_TYPE_ARG_NO_REF)


#define AUD_DEC_SET_TYPE_MODULE_AAC_HDMI_CHANNEL_MODE  ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 182)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SACD_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 185)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_DTS_MKV_DECODING_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 186)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_GET_SHORT_AUDIO_DESCRIPTOR  (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 187))
#define AUD_DEC_SET_APLL_MODE           ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 188)) | RM_SET_TYPE_ARG_NO_REF)



#define AUD_DEC_SET_TYPE_WIFI_AUD             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 172))
#define AUD_DEC_SET_TYPE_PRINT_WIFI_AUD_DELAY_TIME  ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 189))| RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_DRVCUR_WATCH              ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 190)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_DRVCUR_SET				(RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 191))

//Audio streaminfo callback need
#define AUD_DEC_SET_TYPE_REG_APP_STREAMINFO_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 192)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_UNREG_APP_STREAMINFO_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 193)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_UNLOCK_APP_STREAMINFO_SAME     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 194)) | RM_SET_TYPE_ARG_NO_REF)


#define AUD_CFG_SET_TYPE_PROC_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 195)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_CFG_SET_TYPE_EXTDEV_NFY_INFO     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 196)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_CFG_SET_TYPE_CUSTOMER_INFO     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 197)) | RM_SET_TYPE_ARG_NO_REF)

// (lfe_input_gain_mode) -- QingZ 2011-5-25
#define AUD_DEC_SET_TYPE_LFE_INPUT_GAIN_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 198)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_AVG_LVL_ORDER                 ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 199)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_EFFECT_SOUND_CHANNEL_TYPE                 ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 200)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_CLIP_EOS_CMD                 ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 201)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_ADJUST_APTS                ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 202)))

#define AUD_DEC_SET_TYPE_AUD_CONNECT_SIMPLE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 203)))
#define AUD_DEC_SET_TYPE_AUD_DISCONNECT_SIMPLE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 204)))
#define AUD_DEC_SET_TYPE_SIL_NORMALIZE_LEVEL          ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 205)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SIL_THRESHOLD     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 206)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SIL_ENABLE_LOG         ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 207)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SIL_MAX_BUF_COUNTER        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 208)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SIL_BEAT_DETECTED_COUNTER        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 209)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SIL_TIMER_STATUS        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 210)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_TUNE_APLL_EX             ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 211)) | RM_SET_TYPE_ARG_NO_REF)




#define AUD_DEC_SET_TYPE_SYS_MSTR_APLL_THRESHOLD     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 212)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_SYS_MSTR_CONFIG     (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 213))

// for primary decoder upload ctrl
#define AUD_DEC_SET_TYPE_UPLOAD_CTRL        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 215))

//Audio streaminfo callback for Micom use
#define AUD_DEC_SET_TYPE_REG_MICOM_APP_STREAMINFO_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 216)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_UNREG_MICOM_APP_STREAMINFO_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 217)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_UNLOCK_MICOM_APP_STREAMINFO_SAME     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 218)) | RM_SET_TYPE_ARG_NO_REF)


#define AUD_DEC_SET_TYPE_CLIP_SRCFLAG         (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 219))

#define AUD_DEC_SET_SOUND_PRIVACY_CTRL     (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 220))
#define AUD_DEC_SET_TYPE_REG_APP_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 221)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_ENABLE_MOS_LOG     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 222)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_TS_UNKNOWN_CODEC_FLAG_MODE     ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 223)))
#define AUD_DEC_SET_TYPE_HDMI_PCM_OUTPUT_VOL_TO_GLOBAL    (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 224))

#define AUD_DEC_SET_TYPE_FORCE_PP_WORKING         ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 225)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_UPLOAD_SET_INFO        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 227))

#define AUD_DEC_SET_TYPE_DOWNLOAD_CTRL      (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 228))

#define AUD_DEC_SET_TYPE_HDMI_SPDIF      (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 229))

#define AUD_DEC_SET_TYPE_PLC_CTRL                   (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 230))
#define AUD_DEC_SET_TYPE_REG_DL_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 231)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_UPLOAD_INIT      (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 232))
#define AUD_DEC_SET_DSEE_BYPASS      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 233)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_EFFECT_VOLUME               (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 234))
#define AUD_DEC_SET_TYPE_NETFLIX_FLAG        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 235)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_NETFLIX_SKIP_BACK        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 236)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_NETFLIX_INFO        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 237)) | RM_SET_TYPE_ARG_NO_REF)

#define AUD_DEC_SET_TYPE_QUERY_AVD        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 238))

#if (((defined CONFIG_AUD_DRV_PRIMARY_SMOOTH_INVOLVED)&&(CONFIG_AUD_DRV_PRIMARY_SMOOTH_INVOLVED)) || ((defined CONFIG_AUD_MW_PRIMARY_SMOOTH_INVOLVED)&&(CONFIG_AUD_MW_PRIMARY_SMOOTH_INVOLVED)))
#define AUD_DEC_SET_PRIMARY_SMOOTH_PARAM        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 242))
#endif
#define AUD_DEC_SET_TYPE_ALSA_CTRL              (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 243))
#define AUD_DEC_SET_TYPE_REG_VOL_CHANGE_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 244)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_VOL_MUTE_CTRL_TO_ALSA      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 245)))
#define AUD_DEC_SET_TYPE_SPDIF_DELAY             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 246))

#if 1
//risc decoder callback
#define AUD_DEC_SET_TYPE_REG_RISC_IBD_CALLBACK      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 247)) | RM_SET_TYPE_ARG_NO_REF)
#endif
#define AUD_DEC_SET_TYPE_AUDIOAPP_INFO        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 248)) | RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_TYPE_AUDIOAPP_FLAG        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 249)) | RM_SET_TYPE_ARG_NO_REF)



#define AUD_DEC_SET_TYPE_MQA_DECODE_SETTING             (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 250))
#define AUD_DEC_SET_SCENIOR_MODE     (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 251))

#define AUD_DEC_SET_RISC_DEC_REG_CALLBACK       (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 252))
#define AUD_DEC_SET_RISC_DEC_UNREG_CALLBACK     (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 253))

#if (((defined CONFIG_DRV_EXTPP_PPC_INVOLVED)&&(CONFIG_DRV_EXTPP_PPC_INVOLVED)) || ((defined CONFIG_MW_EXTPP_PPC_INVOLVED)&&(CONFIG_MW_EXTPP_PPC_INVOLVED)) || (((defined CONFIG_MW_SUPPORT_RISC_AUD_DEC)&&(CONFIG_MW_SUPPORT_RISC_AUD_DEC))))
#define ADU_DEC_SET_PPC_PARAM    (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 254))
#endif

#define AUD_CFG_CLEAR_TYPE_PROC_MODE    ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 255))|RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_PARAM_STR        ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 256))|RM_SET_TYPE_ARG_NO_REF)
#define AUD_DEC_SET_EARC_INFO        (RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 257))
#define AUD_DEC_SET_ALSA_OPEN_DELAY      ((RM_SET_TYPE_LAST_ENTRY + ((DRV_SET_TYPE_T) 258)))
#define AUD_DEC_GET_TYPE_GGMR_AUD_INFO       (RM_GET_TYPE_LAST_ENTRY + ((DRV_GET_TYPE_T) 259))

/*! @} */
#define AWM_PAYLOAD_LENGTH              (16)

typedef enum
{
    AWAC_UNKNOWN
    , AWAC_CREATE_WRAPPER
    , AWAC_DESTROY_WRAPPER
    , AWAC_ACTIVATE_AWD
    , AWAC_DEACTIVATE_AWD
    , AWAC_SET_PAYLOAD_LIST
    , AWAC_SET_EL_STATE
    , AWAC_GET_EL_STATE_SIZE
    , AWAC_GET_EL_STATE
    , AWAC_TRIGGER_EVENT
    , AWAC_FILE_TRANSFER
    , AWAC_END_CMD
    , AWAC_NUM_OF_CMD
} AUD_DEC_SET_TYPE_WM_Cmd_T;

typedef enum
{
    AWACT_SYNC
    , AWACT_ASYNC
} AUD_DEC_SET_TYPE_WM_CmdType_T;

typedef struct
{
    // commands
    AUD_DEC_SET_TYPE_WM_Cmd_T         eCmd;
    AUD_DEC_SET_TYPE_WM_CmdType_T     eCmdType;
    // path A
    UINT16          au2PayloadList[AWM_PAYLOAD_LENGTH];
    void            *pvELState;
    UINT32          *pu4ELStateSize;
    // path B
    UINT8           u1CmValue;
    UINT16          u2ArSet;
} AUD_DEC_SET_TYPE_WATERMARK_PACK_T;


typedef struct
{

    BOOL            Compensation_flag;
    UINT32          Gain_Compensation;

} AUD_APP_CALLBACK_T;


typedef enum
{
    AUD_DEC_BBE_MODE_OFF = 0,
    AUD_DEC_BBE_MODE_BBE,
    AUD_DEC_BBE_MODE_BBE_VIVA
}   AUD_DEC_BBE_MODE_T;

/* Notify conditions */
typedef enum
{
    AUD_DEC_COND_ERROR = -1,
    AUD_DEC_COND_CTRL_DONE,
    AUD_DEC_COND_AUD_CLIP_DONE,
    AUD_DEC_COND_MEM_BUFFER_DONE,
    AUD_DEC_COND_FLUSH_DONE,
    AUD_DEC_COND_FEED_ME_ON,//6
    AUD_DEC_COND_FEED_ME_OFF,
    AUD_DEC_COND_AUD_INFO_CHG,
    AUD_DEC_COND_TV_AUD_SYS_DETECTED,
    AUD_DEC_COND_AUD_REALPLAY,
    AUD_DEC_COND_INBAND_CMD_DONE,
    AUD_DEC_COND_AOUTON_DONE,
    AUD_DEC_COND_CODEC_DETECT_DONE
}   AUD_DEC_COND_T;

typedef enum
{
	AUD_DEC_HDMI_REINIT_ON = 0,
	AUD_DEC_HDMI_REINIT_OFF
}AUD_DEC_HDMI_REINIT_T;

/*HTS HDMI CHANNEL MODE */
typedef enum
{
	AUD_DEC_HDMI_CHANNEL_5_1_MODE = 0,
	AUD_DEC_HDMI_CHANNEL_7_1_MODE,
        AUD_DEC_HDMI_CHANNEL_2_MODE
}AUD_DEC_HDMI_CHANNEL_MODE_T;

typedef enum
{
    AUD_HDMI_CH_CENTER = 0,
    AUD_HDMI_CH_FRONT_LEFT,
    AUD_HDMI_CH_FRONT_RIGHT,
    AUD_HDMI_CH_SURROUND_LEFT,
    AUD_HDMI_CH_SURROUND_RIGHT,
    AUD_HDMI_CH_CH7,
    AUD_HDMI_CH_CH8,
    AUD_HDMI_CH_SUB_WOOFER,
    AUD_HDMI_CH_ALL
}   AUD_HDMI_CH_T;

typedef struct
{
    AUD_HDMI_CH_T  eHdmiCh;
    UINT8          u1ChVol;
}  AUD_HDMI_CH_VOL_T;

typedef struct
{
    BOOL        fgIncPts;
    UINT32      u4AdjustValue_ms;
}  AUD_ADJ_APTS_T;

typedef struct
{
    UINT32  u4AvgVol;
    UINT32  u4Ch;
}   AUD_AVG_VOL_GET_T;

#if (((defined CONFIG_DRV_EXTPP_PPC_INVOLVED)&&(CONFIG_DRV_EXTPP_PPC_INVOLVED)) || ((defined CONFIG_MW_EXTPP_PPC_INVOLVED)&&(CONFIG_MW_EXTPP_PPC_INVOLVED))  || ((defined CONFIG_MW_SUPPORT_RISC_AUD_DEC)&&(CONFIG_MW_SUPPORT_RISC_AUD_DEC)))
typedef enum
{
    PPC_AUDIO_CFG_PATH_TYPE = 0,
    PPC_AUDIO_DEVICE_TYPE,
    PPC_AUDIO_MODE_TYPE,
    PPC_ELEMENT_PARA_TYPE,
    PPC_ELEMENT_BYPASS_ELEMENT_TYPE,
    PPC_ELEMENT_DUMP_ELEMENT_TYPE,
    PPC_ELEMENT_DUMP_STATUS_TYPE,
    PPC_AUDIO_SYS_INFO_TYPE,
    PPC_AUDIO_TYPE_NUM
}AUD_PPC_PARAM_TYPE;

/* audio sampling rate */
typedef enum
{
    PPC_AUDIO_SAMPLE_RATE_8000  = 0x00000001,
    PPC_AUDIO_SAMPLE_RATE_11025 = 0x00000002,
    PPC_AUDIO_SAMPLE_RATE_16000 = 0x00000004,
    PPC_AUDIO_SAMPLE_RATE_22050 = 0x00000008,
    PPC_AUDIO_SAMPLE_RATE_32000 = 0x00000010,
    PPC_AUDIO_SAMPLE_RATE_44100 = 0x00000020,
    PPC_AUDIO_SAMPLE_RATE_48000 = 0x00000040,
    PPC_AUDIO_SAMPLE_RATE_96000 = 0x00000080,
    PPC_AUDIO_SAMPLE_RATE_192000 = 0x00000100
} AUD_PPC_AUDIO_SAMPLE_RATE;

/* sample format */
typedef enum
{
    PPC_AUDIO_SAMPLE_FORMAT_16BIT_MSB = 0x0001,
    PPC_AUDIO_SAMPLE_FORMAT_24BIT_MSB = 0x0002,
    PPC_AUDIO_SAMPLE_FORMAT_32BIT     = 0x0004
} AUD_PPC_AUDIO_SAMPLE_FORMAT;

/* audio device */
typedef enum
{
    PPC_AUDIO_DEVICE_SPEAKER = 0x00000001,
    PPC_AUDIO_DEVICE_HDMI    = 0x00000002
}AUD_PPC_AUDIO_DEVICE;

/*
 * audio scenario mode
 */
typedef enum
{
    PPC_AUDIO_MODE_MOVIE   = 0x00000001,
    PPC_AUDIO_MODE_MUSIC   = 0x00000002
}AUD_PPC_AUDIO_MODE;

#define AUD_PPC_PARAM_MAX_NUM    128
typedef struct
{
    unsigned int u4element_id;
    unsigned int u4para_id;
    int i4num;
    int ai4value[AUD_PPC_PARAM_MAX_NUM];
}AUD_PPC_ELEMENT_PARA_T;

/*
 * system information
 */
typedef struct
{
    unsigned int in_channel;
    unsigned int out_channel;
    AUD_PPC_AUDIO_SAMPLE_RATE sample_rate;
    AUD_PPC_AUDIO_SAMPLE_FORMAT sample_format;
    AUD_PPC_AUDIO_DEVICE device;
    AUD_PPC_AUDIO_MODE mode;
    int frame_size;
    int ppc_frame_size;
} AUD_PPC_SYS_INFO_T;

#define AUD_PPC_CFG_FILE_PATH_BUFFER_LENGTH    257
#define AUD_PPC_CFG_FILE_PATH_STRING_LENGTH    (AUD_PPC_CFG_FILE_PATH_BUFFER_LENGTH - 2)
typedef struct
{
    unsigned int u4element_id;
    int u4enable;
}AUD_PPC_ELEMENT_BYPASS_T;

typedef struct
{
    unsigned int u4element_id;
    int u4enable;
    char ai1PPCElementDumpPath[AUD_PPC_CFG_FILE_PATH_BUFFER_LENGTH];
}AUD_PPC_ELEMENT_DUMP_T;

typedef struct _AUD_PPC_PARAM_T{
    AUD_PPC_PARAM_TYPE eAudPPCParaType;
    union{
        char ai1PPCCfgFilePath[AUD_PPC_CFG_FILE_PATH_BUFFER_LENGTH];
        AUD_PPC_AUDIO_DEVICE eAudPPCDevice;
        AUD_PPC_AUDIO_MODE   eAudPPCMode;
        AUD_PPC_ELEMENT_PARA_T tAudPPCElePara;
        AUD_PPC_ELEMENT_BYPASS_T tAudPPCEleBypass;
        AUD_PPC_ELEMENT_DUMP_T tAudPPCEleDump;
        AUD_PPC_SYS_INFO_T tAudPPCSysInfo;
    }uParamVal;
	// poweraq go risc path parameters
	int ppcpath;
    int argc;
    const char **argv;
}AUD_PPC_PARAM_T;
#endif

//   Get average volume level-- Bo Pan 2012-11-14

#define     AUD_VOL_GET_CH_L          0x00000001
#define     AUD_VOL_GET_CH_R          0x00000002
#define     AUD_VOL_GET_CH_LS         0x00000004
#define     AUD_VOL_GET_CH_RS         0x00000008
#define     AUD_VOL_GET_CH_C          0x00000010
#define     AUD_VOL_GET_CH_LFE        0x00000020
#define     AUD_VOL_GET_CH_CH7        0x00000040
#define     AUD_VOL_GET_CH_CH8        0x00000080


/* Control types. */
typedef enum
{
    AUD_DEC_CTRL_RESET = 0,
    AUD_DEC_CTRL_STOP,
    AUD_DEC_CTRL_PLAY,
    AUD_DEC_CTRL_PLAY_SYNC,
    AUD_DEC_CTRL_PLAY_AUD_CLIP,
    AUD_DEC_CTRL_FLUSH,
    AUD_DEC_CTRL_PAUSE,
    AUD_DEC_CTRL_RESUME,
    AUD_DEC_CTRL_DETECT_TV_AUD_SYS,
    AUD_DEC_CTRL_SPEED, //MT8520: willy . add for speed control
    AUD_DEC_CTRL_START_PAUSE
}
AUD_DEC_CTRL_T;

/* Audio types. */
typedef enum
{
    AUD_DEC_TYPE_UNKNOWN = 0,
    AUD_DEC_TYPE_MONO,                 /* 1/0 */
    AUD_DEC_TYPE_MONO_SUB,             /* 1+sub-language */
    AUD_DEC_TYPE_DUAL_MONO,            /* 1+1 */
    AUD_DEC_TYPE_STEREO,               /* 2/0 */
    AUD_DEC_TYPE_STEREO_SUB,           /* 2+sub-language */
    AUD_DEC_TYPE_STEREO_DOLBY_SURROUND,/* 2/0, dolby surround */
    AUD_DEC_TYPE_SURROUND_2CH,         /* 2/1 */
    AUD_DEC_TYPE_SURROUND,             /* 3/1 */
    AUD_DEC_TYPE_3_0,                  /* 3/0 */
    AUD_DEC_TYPE_4_0,                  /* 2/2 */
    AUD_DEC_TYPE_4_1,
    AUD_DEC_TYPE_5_0,
    AUD_DEC_TYPE_5_1,                  /* 3/2 */
    AUD_DEC_TYPE_6_0,
    AUD_DEC_TYPE_6_1,
    AUD_DEC_TYPE_7_0,
    AUD_DEC_TYPE_7_1,                  /* 5/2 */
    AUD_DEC_TYPE_FM_MONO_NICAM_MONO,
    AUD_DEC_TYPE_FM_MONO_NICAM_STEREO,
    AUD_DEC_TYPE_FM_MONO_NICAM_DUAL,
    AUD_DEC_TYPE_MULTI_CH,
    AUD_DEC_TYPE_1_0_1,                /* 1/0/1 */
    AUD_DEC_TYPE_2_1_0,                /* 2/1/0 */
    AUD_DEC_TYPE_2_1_1,                /* 2/1/1 */
    AUD_DEC_TYPE_2_2_0,                /* 2/2/0 */
    AUD_DEC_TYPE_2_2_1,                /* 2/2/1 */
    AUD_DEC_TYPE_4_2_0,                /* 4/2/0 */
    AUD_DEC_TYPE_4_2_1,                /* 4/2/1 */
    AUD_DEC_TYPE_4_3_0,                /* 4/3/0 */
    AUD_DEC_TYPE_4_3_1,                /* 4/3/1 */
    AUD_DEC_TYPE_5_2_0,                /* 5/2/0 */
    AUD_DEC_TYPE_5_2_1,                /* 5/2/1 */
    AUD_DEC_TYPE_4_0_0,                /* 4/0/0 */
    AUD_DEC_TYPE_4_0_1,                /* 4/0/1 */
    AUD_DEC_TYPE_4_1_0,                /* 4/1/0 */
    AUD_DEC_TYPE_4_1_1,                /* 4/1/1 */
    AUD_DEC_TYPE_4_4_0,                /* 4/4/0 */
    AUD_DEC_TYPE_5_0_0,                /* 5/0/0 */
    AUD_DEC_TYPE_5_0_1,                /* 5/0/1 */
    AUD_DEC_TYPE_5_1_0,                /* 5/1/0 */
    AUD_DEC_TYPE_5_1_1,                /* 5/1/1 */
    AUD_DEC_TYPE_5_3_0,                /* 5/3/0 */
    AUD_DEC_TYPE_OTHERS
}   AUD_DEC_AUD_TYPE_T;


/*media types*/
typedef enum
{
    AUD_DEC_MEDIA_BDAV = 0,           ///< BDAV
    AUD_DEC_MEDIA_BDMV,            ///< BDMV
    AUD_DEC_MEDIA_DVDVID,          ///< dvd video
    AUD_DEC_MEDIA_DVDAUD,          ///< dvd audio
    AUD_DEC_MEDIA_DVDMVR,          ///< dvd mvr
    AUD_DEC_MEDIA_DVDPVR,          ///< dvd pvr
    AUD_DEC_MEDIA_VCD20,           ///< vcd 2.0
    AUD_DEC_MEDIA_VCD11,           ///< vcd 1.1
    AUD_DEC_MEDIA_SVCD,            ///< svcd
    AUD_DEC_MEDIA_CVD,             ///< cvd
    AUD_DEC_MEDIA_CDDA,            ///< cdda
    AUD_DEC_MEDIA_HDCD,            ///< hdcd
    AUD_DEC_MEDIA_DTSCD,           ///< dtscd
    AUD_DEC_MEDIA_CDG,             ///< cd_g
    AUD_DEC_MEDIA_SACD,            ///< sacd
    AUD_DEC_MEDIA_STILL,           ///< FPB still picture
    AUD_DEC_MEDIA_AUDIO,           ///< FPB audio
    AUD_DEC_MEDIA_MOVIE,           ///< FBP movie picture
    AUD_DEC_MEDIA_HDDPVR,          ///< hdd pvr
    AUD_DEC_MEDIA_HDDMVR,          ///< hdd mvr
    AUD_DEC_MEDIA_HDDAVI,          ///< hdd avi
    AUD_DEC_MEDIA_STREAMING,       ///< streaming
    AUD_DEC_MEDIA_INVALID          ///< invalid
}AUD_DEC_MEDIA_T;

typedef enum
{
    AUD_DEC_FS_16K = 0,
	AUD_DEC_FS_22K,
	AUD_DEC_FS_24K,
	AUD_DEC_FS_32K,
	AUD_DEC_FS_44K,
	AUD_DEC_FS_48K,
	AUD_DEC_FS_64K,
	AUD_DEC_FS_88K,
	AUD_DEC_FS_96K,
	AUD_DEC_FS_176K,
	AUD_DEC_FS_192K,
	AUD_DEC_FS512_44K, //for DSD
	AUD_DEC_FS_768K,
    AUD_DEC_FS_UNKNOWN,
    AUD_DEC_FS_FOLLOW   //Morning 20150115: follow previous Fs, for PP reset in ALSA

}AUDIO_DEC_DEFAULT_FS_T;

/* Ouput port types. */
typedef enum
{
    AUD_DEC_OUT_PORT_OFF = 0,
    AUD_DEC_OUT_PORT_2_CH,
    AUD_DEC_OUT_PORT_5_1_CH,
    AUD_DEC_OUT_PORT_SPDIF,
    AUD_DEC_OUT_PORT_2_CH_BY_PASS,
    AUD_DEC_OUT_PORT_SPEAKER
}   AUD_DEC_OUT_PORT_T;

#define AUD_DEC_OUT_PORT_FLAG_NONE          ((UINT32) (0) )
#define AUD_DEC_OUT_PORT_FLAG_2_CH          MAKE_BIT_MASK_32(0)
#define AUD_DEC_OUT_PORT_FLAG_5_1_CH        MAKE_BIT_MASK_32(1)
#define AUD_DEC_OUT_PORT_FLAG_SPDIF         MAKE_BIT_MASK_32(2)
#define AUD_DEC_OUT_PORT_FLAG_2_CH_BY_PASS  MAKE_BIT_MASK_32(3)
#define AUD_DEC_OUT_PORT_FLAG_SPEAKER       MAKE_BIT_MASK_32(4)


/* SPDIF output types. */
typedef enum
{
    AUD_DEC_SPDIF_OFF = 0,
    AUD_DEC_SPDIF_RAW,
    AUD_DEC_SPDIF_PCM_16,
    AUD_DEC_SPDIF_PCM_24,
    AUD_DEC_SPDIF_NON_PCM
}   AUD_DEC_SPDIF_TYPE_T;


/* mute types. */
typedef enum
{
    AUD_DEC_MUTE_OFF = 0,
    AUD_DEC_MUTE_L_CH,
    AUD_DEC_MUTE_R_CH,
    AUD_DEC_MUTE_ON
}   AUD_DEC_MUTE_TYPE_T;

/* AVD HDMI output types. */
typedef enum
{
	AUD_DEC_AVD_HDMI_OUTPUT_PCM = 0,
	AUD_DEC_AVD_HDMI_OUTPUT_RAW,
	AUD_DEC_AVD_HDMI_OUTPUT_OFF,
	AUD_DEC_AVD_HDMI_OUTPUT_INV
}AUD_DEC_AVD_HDMI_OUTPUT_MODE_T;

/* AVD SPDIF output types. */
typedef enum
{
	AUD_DEC_AVD_SPDIF_OUTPUT_PCM = 0,
	AUD_DEC_AVD_SPDIF_OUTPUT_RAW
}AUD_DEC_AVD_SPDIF_OUTPUT_MODE_T;

/* HDMI mute types */
typedef enum
{
	AUD_DEC_HDMI_MUTE_OFF = 0,
	AUD_DEC_HDMI_MUTE_ON
}	AUD_DEC_HDMI_MUTE_TYPE_T;

/* SPDIF mute types */
typedef enum
{
	AUD_DEC_SPDIF_MUTE_OFF = 0,
	AUD_DEC_SPDIF_MUTE_ON
}	AUD_DEC_SPDIF_MUTE_TYPE_T;

/* mute source id. */
typedef enum
{
    AUD_DEC_MUTE_UI = 1<<0,
    AUD_DEC_MUTE_AW = 1<<1
}   AUD_DEC_MUTE_SRC_T;

/* metadata types for sec audio stream applied in BD */
typedef enum
{
    AUD_DEC_METADATA_OUTPUT_OFF = 0,
    AUD_DEC_METADATA_OUTPUT_ON
}   AUD_DEC_METADATA_OUTPUT_TYPE_T;



/* HDCD Filter types. */
typedef enum
{
    AUD_DEC_HDCD_FLTR_OFF = 0,
    AUD_DEC_HDCD_FLTR_1X,
    AUD_DEC_HDCD_FLTR_2X,
    AUD_DEC_HDCD_FLTR_4X
}   AUD_DEC_HDCD_FLTR_T;


/* equalizer types. */
/*
typedef enum
{
    AUD_DEC_EQ_OFF = 0,
    AUD_DEC_EQ_ROCK,
    AUD_DEC_EQ_POP,
    AUD_DEC_EQ_LIVE,
    AUD_DEC_EQ_DANCE,
    AUD_DEC_EQ_TECHNO,
    AUD_DEC_EQ_CLASSIC,
    AUD_DEC_EQ_SOFT,
    AUD_DEC_EQ_USER_1,
    AUD_DEC_EQ_USER_2,
    AUD_DEC_EQ_USER_3,
    AUD_DEC_EQ_USER_4,
    AUD_DEC_EQ_BBE_TV,
    AUD_DEC_EQ_BBE_AV
}   AUD_DEC_EQ_TYPE_T;
*/
struct AUD_DRVCUR_SET {
    UINT32 u4PinID;
    UINT32 u4DrvCur;
};

/* equalizer types. */
#define AUD_DEC_EQ_SET_U4ENABLE  (1<<0)
#define AUD_DEC_EQ_SET_U4BANDNUM (1<<1)
#define AUD_DEC_EQ_SET_AU4GAIN   (1<<2)
#define AUD_DEC_EQ_SET_IIR_COEF  (1<<3)


/* Downsample to 96k for op_code.(downsample_to_96k)--qingz */
#define AUD_SE_OPCODE_DOWNSAMPLE_TO_96K  (1<<7)

#define AUD_SE_OPCODE_DOWNSAMPLE_FOR_DSEE  (1<<8)

//Upsample by mtk94034
#define AUD_SE_OPCODE_UPSAMPLE_96K   (1<<7)
#define AUD_SE_OPCODE_UPSAMPLE_192K   (1<<8)
#define AUD_SE_OPCODE_UPSAMPLE_96K_LPF   (1<<9)
#define AUD_SE_OPCODE_UPSAMPLE_192K_LPF   (1<<10)

typedef struct AUD_DEC_EQ_TYPE_T {
    UINT32 u4_op;  // bit0: set u4_enable
                   // bit1: set u4_bandnum
                   // bit2: set au4_gain
                   // other bits: reserved

    UINT32 u4_enable;
    UINT32 u4_bandnum;
    //UINT32 au4Coefficient[30];  //coefficient will be set to dead by hard code
    UINT32 au4_gain[7][11]; // 7 channels, each with 1 dry and 10 band
}  AUD_DEC_EQ_TYPE_T;

typedef struct AUD_DEC_EQ_TYPE_V2_T
{
    UINT32 u4_enable;
    UINT32 u4_bandnum;
    //UINT32 au4Coefficient[30];  //coefficient will be set to dead by hard code
    UINT32 au4_gain[7][11]; // 7 channels, each with 1 dry and 10 band
}  AUD_DEC_EQ_TYPE_V2_T;

// 5 groups: 32K/44.1K/48K/96K/192K
typedef struct _tagAUD_DEC_EQ_TYPE_IIR_COEF_T
{
    UINT32 u4IirCoef[5][30];
} AUD_DEC_EQ_TYPE_IIR_COEF_T;

/* reverb modes. */
typedef enum
{
    AUD_DEC_REVERB_OFF = 0,
    AUD_DEC_REVERB_CONCERT,
    AUD_DEC_REVERB_LIVINGROOM,
    AUD_DEC_REVERB_HALL,
    AUD_DEC_REVERB_BATHROOM,
    AUD_DEC_REVERB_CAVE,
    AUD_DEC_REVERB_ARENA,
    AUD_DEC_REVERB_CHURCH
}   AUD_DEC_REVERB_MODE_T;


/* reverb operation modes (aud_se_reverb)  */
#define AUD_DEC_REVERB_MODE_OFF     (1<<0)  /* turn off reverb function */
#define AUD_DEC_REVERB_MODE_ON      (1<<1)  /* turn on reverb function (ON>OFF) */
#define AUD_DEC_REVERB_COEF_GAIN    (1<<2)  /* update reverb gain coefficient */
#define AUD_DEC_REVERB_COEF_BANK    (1<<3)  /* update reverb bank coefficient */
#define AUD_DEC_REVERB_MAX_OP_CNT	(4)

#define AUD_DEC_REVERB_BANK_MAX     (79)
#define AUD_DEC_REVERB_GAIN_MAX     (0x7FFFFF)

#define AUD_DEC_REVERB_FS_CNT       (3)

/* reverb transfer coef struct */
typedef struct
{
    UINT32 ui4_Gain;
    UINT32 aui4_Bank[AUD_DEC_REVERB_FS_CNT][4];
} AUD_DEC_REVERB_COEF_T;

/* reverb operation infor struct (aud_se_reverb) */
typedef struct
{
    UINT32 ui4_OpCode;              /* OpCode = OFF/ON | GAIN | .... */
    AUD_DEC_REVERB_COEF_T *pt_Coef;
} AUD_DEC_REVERB_OP_T;

/* mp3booster operation modes (aud_se_mp3booster_v2) */
#define AUD_SE_MP3BOOSTER_SZ                (13)
#define AUD_SE_MP3BOOSTER_COEF_GROUPNUM     (2)
#define AUD_SE_MP3BOOSTER_COEF_GROUP        (3*13)
#define AUD_SE_MP3BOOSTER_COEF_GROUP_SZ     (AUD_SE_MP3BOOSTER_COEF_GROUP * 4)
#define AUD_SE_MP3BOOSTER_COEF_SIZE         (AUD_SE_MP3BOOSTER_COEF_GROUPNUM * AUD_SE_MP3BOOSTER_COEF_GROUP_SZ)
typedef struct
{
    UINT32 au4Mp3BoosterCoef[AUD_SE_MP3BOOSTER_COEF_GROUP_SZ/sizeof(UINT32)];
} AUD_SE_MP3BOOSTER_COEF_T;


/* QBS operation code bit define (aud_se_qbs) */
#define AUD_SE_QBS_MODE_OFF             (1<<0)
#define AUD_SE_QBS_MODE_ON              (1<<1)
#define AUD_SE_QBS_UPG_COEF             (1<<2)

typedef struct _tagAudSeQbsCoef
{
    UINT32 au4QBSGain[4];                   // Just for test QBS path
} AUD_SE_QBS_COEF_T;


/* Dynamic Bass operation modes (aud_se_dbass_v2) */
#define AUD_SE_DYNAMIC_BASS_COEF_GROUPNUM     (3)
#define AUD_SE_DYNAMIC_BASS_COEF_FS_NUM       (3)
#define AUD_SE_DYNAMIC_BASS_COEF_CNT          (5)
#define AUD_SE_DYNAMIC_BASS_COEF_GROUP        (AUD_SE_DYNAMIC_BASS_COEF_CNT * AUD_SE_DYNAMIC_BASS_COEF_FS_NUM)
#define AUD_SE_DYNAMIC_BASS_COEF_GROUP_SZ     (AUD_SE_DYNAMIC_BASS_COEF_GROUP * 4)
#define AUD_SE_DYNAMIC_BASS_COEF_SIZE         (AUD_SE_DYNAMIC_BASS_COEF_GROUPNUM * AUD_SE_DYNAMIC_BASS_COEF_GROUP_SZ)

typedef struct
{
    UINT32 au4DynamicBassCoef[AUD_SE_DYNAMIC_BASS_COEF_SIZE/sizeof(UINT32)];
} AUD_SE_DYNAMIC_BASS_COEF_T;



/* LPF operation modes (aud_se_lpf_v2) */
#define AUD_SE_LPF_COEF_SIZE         (5)

typedef struct
{
    UINT32 au4LPFCoef[AUD_SE_LPF_COEF_SIZE];
} AUD_SE_LPF_COEF_T;

/* tvs operation modes (aud_se_tvs_v2) */

#define AUD_SE_TVS_TABLE_COEF_SIZE 128
#define AUD_SE_TVS_GAIN_COEF_SIZE  9
typedef enum
{
    TVS_DYNAMIC =0x01,
    TVS_WIDE,
    TVS_9G,
    TVS_NIGHT,
    TVS_STD = 0x08,
    TVS_ENHANCED_SURROUND =0x80,
    TVS_NORMAL_SURROUND =0xF0
} AUD_SE_TVS_MODE_E;

typedef struct
{
    UINT32 u4TvsGainCoef[AUD_SE_TVS_GAIN_COEF_SIZE];     //Gain
    UINT32 u4TvsTableCoef[AUD_SE_TVS_TABLE_COEF_SIZE];   //Table
    UINT8  eTvsMode;
} AUD_SE_TVS_COEF_T;


/* ATT operation infor struct (aud_se_att) */
#define AUD_DEC_ATT_MODE_OFF 0  /* turn off ATT function */
#define AUD_DEC_ATT_MODE_ON  1  /* turn on  ATT function */

typedef struct
{
    UINT32 ui4_OpCode;
    UINT32 *pui4_Coef;
} AUD_DEC_ATT_OP_T;

/* Delay operation infor struct (aud_se_delay) */
#define AUD_DEC_DELAY_MODE_OFF 0  /* turn off delay function */
#define AUD_DEC_DELAY_MODE_ON  1  /* turn on  delay function */

typedef struct
{
    UINT32  u4AVDelayTime;
    UINT32  u4SPKDelayTime;
    UINT32  u4WirelessDelayTime;
} AUD_DEC_DELAY_COEF_T;


/* Audio formats. */
typedef enum
{
    AUD_DEC_FMT_UNKNOWN = 0,
    AUD_DEC_FMT_MPEG,
    AUD_DEC_FMT_AC3,
    AUD_DEC_FMT_PCM,
    AUD_DEC_FMT_MP3,
    AUD_DEC_FMT_AAC,
    AUD_DEC_FMT_DTS,
    AUD_DEC_FMT_WMA,
    AUD_DEC_FMT_RA,
    AUD_DEC_FMT_HDCD,
    AUD_DEC_FMT_MLP,
    AUD_DEC_FMT_MTS,   /* remove */
    AUD_DEC_FMT_EU_CANAL_PLUS,
    AUD_DEC_FMT_TV_SYS,
    AUD_DEC_FMT_EAC3,
    AUD_DEC_FMT_EAC3_SEC,
    AUD_DEC_FMT_DTSHD_PRI_XLL,
    AUD_DEC_FMT_DTSHD_PRI_NO_XLL,
    AUD_DEC_FMT_DTSHD_SEC,
    AUD_DEC_FMT_DTSCD,
    AUD_DEC_FMT_TRUE_HD,
    AUD_DEC_FMT_LOSSLESS_AC3,
    AUD_DEC_FMT_CDDA,
    AUD_DEC_FMT_SACD,//DSD
    AUD_DEC_FMT_VORBIS,
    AUD_DEC_FMT_DST,
    AUD_DEC_FMT_AAC_PURE,
    AUD_DEC_FMT_DTS_ES_6_1_MATRIX,
    AUD_DEC_FMT_DTS_ES_6_1_DISCRETE,
    AUD_DEC_FMT_DTS_ES_8_DISCRETE,
    AUD_DEC_FMT_DTS_96_24,
    AUD_DEC_FMT_DTS_96_24_ES_MATRIX,
    AUD_DEC_FMT_DVDA,
    AUD_DEC_FMT_DTSHD_ES_6_1_MATRIX,
    AUD_DEC_FMT_DTSHD_ES_6_1_DISCRETE,
    AUD_DEC_FMT_DTSHD_ES_8_DISCRETE,
    AUD_DEC_FMT_DTSHD_96_24,
    AUD_DEC_FMT_DTSHD_96_24_ES_MATRIX,
    AUD_DEC_FMT_RA_COOK,
    AUD_DEC_FMT_AACPLUS,
    AUD_DEC_FMT_PURE_AACPLUS,
    AUD_DEC_FMT_HEAAC_V1,
    AUD_DEC_FMT_HEAAC_V2,
    AUD_DEC_FMT_HDMI_IN_PCM,
    AUD_DEC_FMT_DRA,
    AUD_DEC_FMT_DRA_EXT,
    AUD_DEC_FMT_APE,    //mtk70169 mark
    AUD_DEC_FMT_FLAC,
#if (CONFIG_DRV_SUPPORT_WMAPro)
    AUD_DEC_FMT_WMAPro,
#endif
#if (CONFIG_DRV_SUPPORT_ALAC)
    AUD_DEC_FMT_ALAC,
#endif
    AUD_DEC_FMT_AMR,
    AUD_DEC_FMT_AWB,
    AUD_DEC_FMT_DTSHD_LBR,
    AUD_DEC_FMT_SACD_56M,
    AUD_DEC_FMT_LPCM_ALSA,
#if CONFIG_DRV_SUPPORT_RISC_AUD_DEC
    AUD_DEC_FMT_OPUS     = 60, // Risc dec fmt start
    AUD_DEC_FMT_WAV_MQA  = 61,
    AUD_DEC_FMT_FLAC_MQA = 62,
    AUD_DEC_FMT_ALAC_MQA = 63,
    AUD_DEC_FMT_ATMOS    = 64,
    AUD_DEC_FMT_DTSX    = 65,
#endif
    AUD_DEC_FMT_END = 255
  }   AUD_DEC_FMT_T;



/* output port adjust struct. */
typedef struct
{
    AUD_DEC_OUT_PORT_T  e_out_port;
    BOOL                b_is_fixed;
}   AUD_DEC_OUTPORT_ADJ_T;



typedef enum
{
   AUD_DEC_PCM_FMT_PCM_DVDV,  /* for DVD-Video*/
   AUD_DEC_PCM_FMT_WAVE,      /* for AVI etc.*/
   AUD_DEC_PCM_FMT_ADPCM,     /* for ADPCM IMA*/
   AUD_DEC_PCM_FMT_ADPCM_MS,  /* for ADPCM MS*/
   AUD_DEC_PCM_FMT_PCM_NORMAL,/* for ASF, AVI, MPS...etc */
   AUD_DEC_PCM_FMT_PCM_BD,     /* for Blue-ray*/
   AUD_DEC_PCM_FMT_PCM_DVDV_2CH, /* for DVD-Video strip 2ch*/
   AUD_DEC_PCM_FMT_A_LPCM,       /* for A Law PCM*/
    AUD_DEC_PCM_FMT_U_LPCM,        /* for U Law PCM*/
    AUD_DEC_PCM_FMT_IEEE_FLOAT,
    AUD_DEC_PCM_FMT_PCM_INV
}AUD_DEC_PCM_FMT_T;


typedef struct
{
    AUD_DEC_PCM_FMT_T ePCM_Format;
    UINT16 u2BlockAlign;        /* block align, only necessary for ADPCM*/
    BOOL   b_de_emphasis;       /*de-emphasis bit... 0 or 1*/
    BOOL   b_dlna_exist;		/*DLNA exist or not*/
    BOOL   b_8bit_signed;      /*8bit LPCM data signed or not*/
    BOOL   b_audio_reset;
} AUD_DEC_PCM_INFO_T;

typedef enum
{
   AUD_DEC_CGMS_FMT_OTHERS,   /* for UNKONW format */
   AUD_DEC_CGMS_FMT_DVD,      /* for DVD */
   AUD_DEC_CGMS_FMT_VCD,      /* for VCD */
   AUD_DEC_CGMS_FMT_BD,       /* for BD  */
   AUD_DEC_CGMS_FMT_DIVX,     /* for Divx */
   AUD_DEC_CGMS_FMT_SACD,     /* for sacd */
   AUD_DEC_CGMS_FMT_CD,       /* for cdda */
   AUD_DEC_CGMS_FMT_DEFAULT,  /* for default */
   AUD_DEC_CGMS_FMT_DVD_AUDIO, /* for DVD audio*/
   AUD_DEC_CGMS_FMT_CUSTOMER,
   AUD_DEC_CGMS_FMT_BIVL
} AUD_DEC_CGMS_FMT_T;


typedef struct _AUD_DEC_CGMS_INFO_T
{
    AUD_DEC_CGMS_FMT_T e_cgms_format;
    BOOL               b_is_from_usb;
    BOOL                  b_is_CSS;
    BOOL                  b_is_CPPM;
} AUD_DEC_CGMS_INFO_T;

typedef enum
{
    AUD_DEC_CGMS_COPY_PERMITTED = 0,
    AUD_DEC_CGMS_NO_MORE_COPY,
    AUD_DEC_CGMS_ONE_COPY_ALLOWED,
    AUD_DEC_CGMS_NO_COPY_PERMITTED,
    AUD_DEC_CGMS_RESERVED
} AUD_DEC_CGMS_COPY_PERMISSION_T;

/* Audio spectrum info. */
typedef struct _AUD_DEC_SPECTRUM_INFO_T
{
    UINT32    u4_aud_spectrum[16];
    UINT32    u4_aud_spectrum_bar[16];
} AUD_DEC_SPECTRUM_INFO_T;
// (lfe_input_gain_mode) -- QingZ 2011-5-25
typedef enum
{
    AUD_DEC_LFE_INPUT_GAIN_MODE_ON,
    AUD_DEC_LFE_INPUT_GAIN_MODE_BYPASS
}AUD_DEC_LFE_INPUT_GAIN_MODE;


/* CH_DELAY info ,added by Lily */
typedef struct _AUD_CH_DELAY_INFO_T
{
    UINT32 e_ch_delay_step_l;
    UINT32 e_ch_delay_step_r;
    UINT32 e_ch_delay_step_c;
    UINT32 e_ch_delay_step_lfe;
    UINT32 e_ch_delay_step_sl;
    UINT32 e_ch_delay_step_sr;
    UINT32 e_ch_delay_step_sbl;
    UINT32 e_ch_delay_step_sbr;
} AUD_CH_DELAY_INFO_T;

typedef struct _SHORT_AUDIO_DESCRIPTOR_T
{
    UINT8 u1AudioCode; //In.
    BOOL afgSupport[1]; //Out.
    UINT8 au1Descriptor[3]; //Out. Be available only if (au1fgSupport[0]).
} SHORT_AUDIO_DESCRIPTOR_T;

// (aud_spectrum_mod) -- QingZ 2011-5-09
typedef enum
{
    AUD_DEC_SPECTRUM_MODE_OFF,
    AUD_DEC_SPECTRUM_MODE_ON
} AUD_DEC_SPECTRUM_MODE;
typedef struct _AUD_DEC_TRANSCO_INFO_T
{
    AUD_DEC_FMT_T       e_tranc_fmt;
    BOOL                b_is_enable;
} AUD_DEC_TRANSCO_INFO_T;

typedef enum
{
    AUD_DEC_DTS_MKV_DECODING_CORE_OFF,
    AUD_DEC_DTS_MKV_DECODING_CORE_ON
}AUD_DEC_DTS_MKV_DECODING_MODE;

typedef enum
{
    AUD_DEC_SACD_MODE_N3DB_OFF,
    AUD_DEC_SACD_MODE_N3DB_ON
} AUD_DEC_SACD_MODE;

typedef struct _AUD_DEC_WMA_INFO_T
{
    UINT16 ui2_version;
    UINT16 ui2_num_channels;
    UINT32 ui4_packet_count;
    UINT32 ui4_packet_size;
    UINT16 ui2_enc_option;
    UINT16 ui2_blockalign;
    UINT32 ui4_bytes_per_sec;
    UINT32 ui4_channel_mask;
    UINT16 ui2_adv_enc_option;
    UINT32 ui4_adv_enc_option2;
} AUD_DEC_WMA_INFO_T;

typedef struct _AUD_DEC_RA_COOK_INFO_T
{
    UINT32 u4_sample_rate;
    UINT16 ui2_sample_per_frame;
    UINT32 ui4_frame_size_byte;
    UINT16 ui2_region_num;        //Number of consecutive Modulated Lapped Transform coefficients that share the same quantizer value)
    UINT32 ui4_cpl_region_start; //Coupling start region:Starting point for the band of quantization bits
    UINT16 ui2_Q_bits_num;       //Number of quantization bits for each band in the joint stereo coupling information
} AUD_DEC_RA_COOK_INFO_T;

typedef struct _AUD_DEC_APE_INFO_T   //mtk70169 mark
{
    UINT32 ui4_file_versoin;
    UINT32 ui4_compress_level;
    UINT32 ui4_block_per_frame;
    UINT32 ui4_final_frame_block;
    UINT32 ui4_total_frame_num;
    UINT32 ui4_bits_per_sample;
    UINT32 ui4_channel_num_1;
    UINT32 ui4_input_sampling_rate;
    UINT32 ui4_mute_bank_numbers;//mtk70105 add
    UINT32 ui4_invalid_bytes;
} AUD_DEC_APE_INFO_T;

typedef struct _AUD_DEC_OPUS_INFO_T   // Risc dec opus
{
    /* Opus header part */
    UINT8  ui1_versoin;
    UINT8  ui1_channel_count;         /* Number of channels: 1..255 */
    UINT16 ui2_pre_skip;
    UINT32 ui4_input_sample_rate;
    INT16  i2_output_gain;            /* in dB S7.8 should be zero whenever possible */
    UINT8  ui1_mapping_family;
    /* The below three parameters are only used if channel_mapping != 0 */
    UINT8  ui1_stream_count;
    UINT8  ui1_coupled_count;
    UINT8  ui1_channel_mapping[255];  /* 255 means opus max channel count */

    /* Opus specail info */
    UINT32 ui1_CodecDelay;
    UINT32 ui1_SeekPreRoll;
} AUD_DEC_OPUS_INFO_T;

typedef struct _AUD_DEC_OPUS_PACKET_INFO_T   // Risc dec opus
{
    CHAR   ai1_HeaderID[4];        // set as "Opus"
    CHAR   ai1_ContainerID[4];     // set as "WebM" or "OggS" according to container
    UINT8  ui1_PacketFlag;         // bit0 is for BOS(begin of stream), True means begin of stream
                                   // bit1 is for EOS(end of stream), True means end of stream
                                   // bit2 is for packet error, True means packet lost or CRC error and so on
                                   // other bits not used now
    UINT32 ui4_PacketSize;         // bytes
    union{
        INT64 i8_GranulePos;      // for OggS
        INT32 i4_DiscardPadding;  // for WebM
    }u_info;

} AUD_DEC_OPUS_PACKET_INFO_T;

typedef enum
{
    AUD_DEC_ATMOS_DD     = 0,   // 0: Dolby Digital
    AUD_DEC_ATMOS_DDP    = 1,   // 1: Dolby Digital Plus
    AUD_DEC_ATMOS_TRUEHD = 2,   // 2: TrueHD
    AUD_DEC_ATMOS_MAT    = 3    // 3: MAT
}AUD_DEC_ATMOS_DECODER_TYPE_T;

typedef enum
{
    AUD_DEC_DTSX_SD     = 0,   // 0: Dolby Digital
    AUD_DEC_DTSX_HD    = 1,   // 1: Dolby Digital Plus
    AUD_DEC_DTSX_XLL = 2,   // 2: TrueHD
    AUD_DEC_DTSX_EX    = 3    // 3: MAT
}AUD_DEC_DTSX_DECODER_TYPE_T;


typedef struct AUD_DEC_PARAM_STR
{
    INT32 i4Argc;
    CHAR  szArgv[32][100];
}   AUD_DEC_PARAM_STR_T;
typedef struct _AUD_DEC_ATMOS_INFO_T   // Risc dec Atmos
{
    AUD_DEC_ATMOS_DECODER_TYPE_T  eAtmosDecType;
    AUD_DEC_PARAM_STR_T           *ptParamStr;
} AUD_DEC_ATMOS_INFO_T;

typedef struct _AUD_DEC_DTSX_INFO_T   // Risc dec Atmos
{
    AUD_DEC_DTSX_DECODER_TYPE_T  eAtmosDecType;
    AUD_DEC_PARAM_STR_T           *ptParamStr;
} AUD_DEC_DTSX_INFO_T;

typedef struct _AUD_DEC_FLAC_INFO_T
{
    UINT32 ui4_min_block_size;
    UINT32 ui4_max_block_size;
    UINT32 ui4_min_frame_size;
    UINT32 ui4_max_frame_size;
    UINT32 ui4_sampling_rate;
    UINT16 ui2_channel_num_1;
    UINT16 ui2_bits_per_sample_1;
    UINT16 ui2_sample_num_high12;
    UINT32 ui4_sample_num_low24;
    UINT16 ui2_frame_num_high12;
    UINT32 ui4_frame_num_low24;
    UINT16 ui2_stream_end;
} AUD_DEC_FLAC_INFO_T;

#if (CONFIG_DRV_SUPPORT_ALAC)
typedef struct _AUD_DEC_ALAC_INFO_T
{
    UINT32 ui4_frame_length;  /* setinfo_max_samples_per_frame  0x1000 = 4096 */
    UINT8  ui1_compatible_version;                      /* setinfo_7a   0x00 */
    UINT8  ui1_bit_depth;                       /* setinfo_sample_size   0x10 */
    UINT8  ui1_pb;                           /* setinfo_rice_historymult  0x28 */
    UINT8  ui1_mb;                         /* setinfo_rice_initialhistory 0x0a */
    UINT8  ui1_kb;                            /* setinfo_rice_kmodifier   0x0e */
    UINT8  ui1_num_channels;                             /* setinfo_7f   0x02 */
    UINT16 ui2_max_run;                                   /* setinfo_80   0x00ff */
    UINT32 ui4_max_frameBytes;                           /* setinfo_82   0x000020e7 */
    UINT32 ui4_avg_bitRate;                              /* setinfo_86    0x00069fe4 */
    UINT32 ui4_sample_rate;                         /* setinfo_8a_rate    0x0000ac44 */
} AUD_DEC_ALAC_INFO_T;
#endif

//AoTang: AAC decoder Downmix for MPEG DASH
typedef struct _AUD_DEC_AAC_INFO_T
{
    BOOL fgAACDecDownmixEn;
} AUD_DEC_AAC_INFO_T;

typedef enum
{
    AUD_DEC_SACD_INPUT_DSD_28M = 0, // 0: DSD-2.8M
    AUD_DEC_SACD_INPUT_DSD_56M = 1,       // 1: DSD- 5.6M
    AUD_DEC_SACD_INPUT_DSD_112M =2   // DSD 11.2M
}AUD_DEC_SACD_INPUT_SAMP_RATE_T;    // AoTang: DSD5.6M

/* SACD input format */
typedef enum
{
    AUD_DEC_SACD_INPUT_FMT_DST = 0, // 0: DST-coded
    AUD_DEC_SACD_INPUT_FMT_DSD          // 1: PlainDSD
}AUD_DEC_SACD_INPUT_FMT_T;

typedef struct _AUD_DEC_SACD_INPUT_T
{
    //AUD_DEC_AUD_TYPE_T eChNum;
    AUD_DEC_SACD_INPUT_FMT_T eDsdMode;
    BOOL fgTimeCodeEn;
    AUD_DEC_SACD_INPUT_SAMP_RATE_T eDsdSampRate; // AoTang: DSD5.6M
} AUD_DEC_SACD_INPUT_T;

/* SACD output format */
typedef enum
{
    AUD_DEC_SACD_OUTPUT_FMT_DSD = 0,       // 0: DSD output
    AUD_DEC_SACD_OUTPUT_FMT_PCM,           // 1: PCM output
    AUD_DEC_SACD_OUTPUT_FMT_DST            // 2: DST output
}AUD_DEC_SACD_OUTPUT_FMT_T;

typedef enum
{
    AUD_DEC_SACD_OUTPUT_CH_2CH = 0,       // 0: 2ch
    AUD_DEC_SACD_OUTPUT_CH_MULTI            // 1: Multi-Channels
}AUD_DEC_SACD_OUTPUT_CH_T;

typedef enum
{
    APLL_FS_STD = 0,       // 0: APLL standard setting
    APLL_FS_P1,            // 1: +1%
    APLL_FS_N1,		// 2 : -1%
    APLL_FS_PP1,            // 3: +0.1%
#if(CONFIG_CHIP_VER_CURR == CONFIG_CHIP_VER_MT8580)
    APLL_FS_PP2,            // 3: +0.2%
    APLL_FS_PP3,            // 3: +0.3%
    APLL_FS_PP4,            // 3: +0.4%
    APLL_FS_PP5,            // 3: +0.5%
    APLL_FS_PP6,            // 3: +0.6%
    APLL_FS_PP7,            // 3: +0.7%
    APLL_FS_PP8,            // 3: +0.8%
    APLL_FS_PP9,            // 3: +0.9%
#endif
    APLL_FS_NP1		// 4 : -0.1%
#if(CONFIG_CHIP_VER_CURR == CONFIG_CHIP_VER_MT8580)
    ,APLL_FS_NP2,          // 4 : -0.2%
    APLL_FS_NP3,          // 4 : -0.3%
    APLL_FS_NP4,          // 4 : -0.4%
    APLL_FS_NP5,          // 4 : -0.5%
    APLL_FS_NP6,          // 4 : -0.6%
    APLL_FS_NP7,         // 4 : -0.7%
    APLL_FS_NP8,         // 4 : -0.8%
    APLL_FS_NP9,          // 4 : -0.9%
    APLL_FS_PPP1,      //+0.01%
    APLL_FS_NPP1,     //-0.01%
    APLL_FS_PPP2,     ////+0.02%
    APLL_FS_NPP2,     //-0.02%
    APLL_FS_PPP3,     //+0.03%
    APLL_FS_NPP3,     //-0.03%
    APLL_FS_PPP4,     //+0.04%
    APLL_FS_NPP4,     //-0.04%
    APLL_FS_PPP5,     //+0.05%
    APLL_FS_NPP5     //-0.05
#endif
#if(CONFIG_CHIP_VER_CURR >= CONFIG_CHIP_VER_MT8560)
    ,APLL_FS_P2,       // +2%
    APLL_FS_N2,        //-2%
    APLL_FS_P3,         //+3%
    APLL_FS_N3         //-3%
#endif
}AUD_DEC_APLL_FS_CHG;

typedef enum
{
    APLL_CLK_RST = 0,		// 0: APLL standard setting
    APLL_CLK_ACC,		// 1: Accelerate clock of APLL
    APLL_CLK_DEC			// 2 : decelerate clock of APLL
}AUD_APLL_CTL_MODE;

typedef enum
{
    APLL_1 = 0,		// 0: APLL standard setting
    APLL_2,		// 1: Accelerate clock of APLL
    APLL_pwm,			// 2 : decelerate clock of APLL
    APLL_spdif
}AUD_APLL_TYPE;

typedef   struct  _AUD_SET_EXSPDIF_T // For Write Use
{
    UINT8 u1Address; // Address
    UINT8 u1Value; // value or read part
}  AUD_SET_EXSPDIF_T;

typedef   struct  _AUD_SET_EXSPDIF_INFO_T // For Read Use
{
    UINT8 u1CCBAddr;
    UINT8 u1ReadOutPart;
    UINT8 u1DataReadOut; // Read out data
}  AUD_SET_EXSPDIF_INFO_T;
#if 0
typedef enum
{
    AUD_ANALOG_TRIM_SET,
    AUD_ANALOG_TRIM_RESTORE
}AUD_ANALOG_TRIM_T;


typedef   struct  _AUD_SET_TRIM_INFO_T // For Read Use
{
    BOOL fgMultiCh;
    BOOL fgDownmix2Ch;
    AUD_ANALOG_TRIM_T eTrimType;

}  AUD_SET_TRIM_INFO_T;
#endif

/* Digital output format related to codec */
typedef enum
{
    AUD_DEC_DIGI_OUTPUT_FMT_UNKNOWN = 0,   // 0: Unknown
    AUD_DEC_DIGI_OUTPUT_FMT_BITSTREAM,     // 1: BITSTREAM output
    AUD_DEC_DIGI_OUTPUT_FMT_PCM            // 2: PCM output
}AUD_DEC_CODEC_OUTPUT_FMT_T;

typedef enum
{
    AUD_DEC_DIGI_OUTPUT_FMT_SET_UNKNOWN = 0,   // 0: Unknown
    AUD_DEC_DIGI_OUTPUT_FMT_Set_UI_OPTION,     // 1: Set UI select
    AUD_DEC_DIGI_OUTPUT_FMT_SET_DISC_INFO      // 2: set Disc Info such as SA/IA existance
}AUD_DEC_CODEC_OUTPUT_FMT_SET_TYPE_T;

typedef struct _AUD_DEC_DISC_INFO_T
{
    BOOL   fg_SA_IA_Exist;
} AUD_DEC_DISC_INFO_T;

typedef   struct  _AUD_DEC_CODEC_DIGI_OUT_INFO_T
{
    AUD_DEC_CODEC_OUTPUT_FMT_SET_TYPE_T eSetType;
    BOOL                       fgHDMIisOFF;
    AUD_DEC_CODEC_OUTPUT_FMT_T eDolbyDigiOut;
    AUD_DEC_CODEC_OUTPUT_FMT_T eDTSDigiOut;
    AUD_DEC_CODEC_OUTPUT_FMT_T eAACDigiOut;
    AUD_DEC_DISC_INFO_T        tDiscInfo;
    BOOL                       fgMixerEnable;
}  AUD_DEC_CODEC_DIGI_OUT_INFO_T;

typedef   struct  _AUD_EARC_INFO_T
{
    UINT8 earc_audio_format;
    /*
    0 means pcm, 1 means hbra, 2 means raw
    */
    UINT8 is_pcm_sample_rate;
    /*
    { 441,		0x00, "44.1 KHz" },
    { 480,		0x02, "48 KHz" },
    { 320,		0x03, "32 KHz" },
    { 3840,		0x05, "384 KHz" },
    { 882,		0x08, "88.2 KHz" },
    { 7680,		0x09, "768 KHz" },
    { 960,		0x0A, "96 KHz" },
    { 640,      0x0B, "64 KHz" },
    { 1764,		0x0C, "176.4 KHz" },
    { 3528,		0x0D, "352.8 KHz" },
    { 1920,		0x0E, "192 KHz" },
    { 15360,	0x15, "1536 KHz" },
    { 2560,		0x1B, "256 KHz" },
    { 14112,    0x1D, "1411.2 KHz" },
    { 1280,		0x2B, "128 KHz" },
    { 7056,		0x2D, "705.6 KHz" },
    { 10240,    0x35, "1024 KHz" },
    { 5120,		0x3B, "512 KHz" },
    */
    UINT8 is_pcm_sample_width;
    UINT8 is_pcm_channel_count;
    UINT8 speaker_alloc;
}   AUD_EARC_INFO_T;

typedef struct _AUD_DEC_SACD_OUTPUT_T
{
    AUD_DEC_SACD_OUTPUT_FMT_T eOutputModeI2S;
    AUD_DEC_SACD_OUTPUT_FMT_T eOutputModeHDMI;
    UINT32 u4SampleRateI2S;
    UINT32 u4SampleRateHDMI;
    AUD_DEC_SACD_OUTPUT_CH_T eOutputChI2S;
    AUD_DEC_SACD_OUTPUT_CH_T eOutputChHDMI;
} AUD_DEC_SACD_OUTPUT_T;

/* DVD-Audio input format */
typedef enum
{
    AUD_DEC_DVDA_INPUT_FMT_PCM = 0,     // 0: PCM
    AUD_DEC_DVDA_INPUT_FMT_MLP          // 1: MLP
}AUD_DEC_DVDA_INPUT_FMT_T;

typedef struct _AUD_DEC_DVDA_PCM_INFO_T
{
    UINT32               ui4_sample_rate;           /* audio_sampling_frequency */
    UINT8                ui1_bit_depth;             /* quantization_word_length  */
} AUD_DEC_DVDA_PCM_INFO_T;

typedef struct _AUD_DEC_DVDA_INFO_T
{
    AUD_DEC_DVDA_INPUT_FMT_T eDsdMode;
    AUD_DEC_DVDA_PCM_INFO_T  t_grp0_info;
    AUD_DEC_DVDA_PCM_INFO_T  t_grp1_info;
    UINT8 ui1_ats_dm_coeft[18];         //ats_dm_coeft
    BOOL b_stereo_prohibit;                //stereo_playback_mode ; 0:permitted;1: prohibited
    BOOL b_downmix_valid;               //describe down_mix_code is valid or not; 0:valid;1: invalid
    UINT8 ui1_channel_assignment;       //describe channel_assignment
} AUD_DEC_DVDA_INFO_T;
#if 1//CONFIG_DRV_HDMI_RX
typedef struct
{
        BYTE u1AudioChannelCount:3;//HDMI_RX_AUDIO_CHANNEL_COUNT_T
        BYTE u1DM_INH:1;// 1:Down mix Prohibites, 0:Permitted down mix
        BYTE u1AudioCodingType:4; //see HDMI_RX_AUDIO_CODING_TYPE_T
        BYTE u1LevelShiftValue:4;//HDMI_RX_AUD_LEVEL_TYPE_T
        BYTE u1SampleSize:2;//HDMI_RX_SAMPLE_SIZE_TYPE_T
        BYTE u1SpeakerPlacement;//HDMI_RX_SPEAKER_ALLOCATE_T
        BYTE u1AudinSampleRate;  // 0~6 : Out of range ; 7~0xF : 32/44.1/48/64/88.2/96/128/176.4/192 KHz
    }AUD_DEC_HDMI_IN_PCM_INFO_T;
#endif

typedef struct _AUD_DEC_WAV_MQA_INFO_T
{
  INT16		ui2_format_tag;
  INT16		ui2_channels;
  INT32		ui4_samples_per_sec;
  INT32		ui4_avg_bytes_per_sec;
  INT16		ui2_block_align;
  INT16		ui2_bits_per_sample;
  INT16		ui2_cb_size;
} AUD_DEC_WAV_MQA_INFO_T;

/**
 * Output mode of the decoder
 */
typedef enum _MQA_OUTPUT_MODE_E {
    /**
     * MQA audio with an original sample rate of 1x will be upsampled to 2x by the decoder
     * MQA audio with an original sample rate of 2x or higher will not be upsampled
     * 1X PCM will be upsampled to 2x
     * PCM of higher rates will be passed through losslessly
     */
    OUTPUT_UP_SAMPLE_ALL,
    /**
     * MQA audio with an original sample rate of 1x will be upsampled to 2x by the decoder
     * MQA audio with an original sample rate of 2x or higher will not be upsampled
     * PCM of all rates will be passed through losslessly
     */
    OUTPUT_UP_SAMPLE_MQA_ONLY,
    /**
     * MQA audio will not be upsampled and will be output at its original rate
     * PCM of all rates will be passed through losslessly
     */
    OUTPUT_ORIGINAL,
    /**
     * No rendering or upsampling will be performed.
     * This mode is used for decoder testing only
     */
    OUTPUT_BYPASS_RENDERING,
}MQA_OUTPUT_MODE_E;

/**
 * Power mode of the decoder
 * Low power mode should only be for on battery powered
 */
typedef enum _MQA_POWER_MODE_E {
    /** A complete full complexity decode will be performed */
    POWER_FULL_COMPLEXITY,
    /** A complete decode will be performed for all but the most complex of streams - this is recommended for embedded platforms */
    POWER_STANDARD_FALL_BACKS,
    /** a low complexity decode will be performed, this should be used to lower mips or for 1x DACs */
    POWER_LOW_COMPLEXITY,
    /** No Decode will be performed by MQA streams will be authenticated */
    POWER_AUTH_ONLY,
}MQA_POWER_MODE_E;

/**
 * Sample rate multipliers
 */
typedef enum _MQA_AUD_RATE_MULTIPLIER_E {
    /** Corresponds to sample rates of  44100 or  48000 */
    AUD_RATE1X,
    /** Corresponds to sample rates of  88200 or  96000 */
    AUD_RATE2X,
    /** Corresponds to sample rates of 176400 or 192000 */
    AUD_RATE4X,
    /** Corresponds to sample rates of 352800 or 384000 */
    AUD_RATE8X,
    /** Corresponds to samples rate of 705600 or 768000 */
    AUD_RATE16X,
    /** Number of valid rates */
    AUD_NUM_AUD_VALID_RATE_MULTIPLIERS,
    /** Corresponds to unspecified of invalid sample rate multiplier */
    AUD_RATE_INVALID = 15,
}MQA_AUD_RATE_MULTIPLIER_E;

typedef struct _MQA_DECODE_SETTING_T
{
	MQA_OUTPUT_MODE_E			e_output_mode;
	MQA_POWER_MODE_E			e_pwr_mode;
	BOOL 					    fg_output_mqb;
	MQA_AUD_RATE_MULTIPLIER_E	e_aud_rate_multi;
	INT16					    ui2_replay_gain;
	INT16					    ui2_output_gain;
}MQA_DECODE_SETTING_T;

typedef enum
{
    AUD_DEC_FILE_TYPE_OTHER = 0,
    AUD_DEC_FILE_TYPE_TS = 1,
    AUD_DEC_FILE_TYPE_INVALID
} AUD_DEC_FILE_TYPE_INFO_T;
typedef struct
{
    AUD_DEC_FMT_T        e_aud_fmt;
    AUD_DEC_AUD_TYPE_T   e_aud_type;
    UINT32               ui4_sample_rate;
    UINT32               ui4_data_rate;
    UINT8                ui1_bit_depth;
    union
    {
        AUD_DEC_PCM_INFO_T* __local_space__   pt_pcm_info;
#if 1//CONFIG_DRV_HDMI_RX
        AUD_DEC_HDMI_IN_PCM_INFO_T*  __local_space__  pt_hdmi_in_pcm_info;
#endif
        AUD_DEC_WMA_INFO_T* __local_space__   pt_wma_info;
        AUD_DEC_SACD_INPUT_T* __local_space__ pt_sacd_info;
        AUD_DEC_DVDA_INFO_T* __local_space__  pt_dvda_info;
        AUD_DEC_RA_COOK_INFO_T* __local_space__  pt_ra_cook_info;
        AUD_DEC_APE_INFO_T* __local_space__  pt_ape_info;   //mtk70169 mark
        AUD_DEC_FLAC_INFO_T* __local_space__  pt_flac_info;
#if (CONFIG_DRV_SUPPORT_ALAC)
        AUD_DEC_ALAC_INFO_T* __local_space__  pt_alac_info; // alac_set_info @ xiaobo 20121109
#endif
        AUD_DEC_AAC_INFO_T* __local_space__  pt_aac_info;   //AoTang: AAC decoder Downmix for MPEG DASH
#if CONFIG_DRV_SUPPORT_RISC_AUD_DEC
        AUD_DEC_OPUS_INFO_T*    __local_space__  pt_opus_info;
        AUD_DEC_WAV_MQA_INFO_T* __local_space__  pt_wav_mqa_info;
        AUD_DEC_ATMOS_INFO_T*   __local_space__  pt_atmos_info;
        AUD_DEC_DTSX_INFO_T*   __local_space__  pt_dtsx_info;
#endif
    } u_fmt_spec;
    UINT16               ui2_pid;               //Only use for BDMW currently
    UINT32               u4ChannelLayout;       //for detail channel layout
    AUD_DEC_FILE_TYPE_INFO_T e_aud_file_type;
    UINT8                u1DualMonoType;
#if CONFIG_DRV_SUPPORT_RISC_AUD_DEC
    MQA_DECODE_SETTING_T t_mqa_decode_setting;
#endif
} AUD_DEC_AUD_INFO_T;

typedef enum
{
    AUD_DEC_SEC_AUDIO_ON = 0,
    AUD_DEC_SEC_AUDIO_OFF
}AUD_DEC_SEC_AUDIO_TYPE_T;

/* Loudspeader modes. */
typedef enum
{
    AUD_DEC_LS_MODE_OFF = 0,
    AUD_DEC_LS_MODE_LARGE_FREQ_RANGE,
    AUD_DEC_LS_MODE_SMALL_FREQ_RANGE
}   AUD_DEC_LS_MODE_T;


/* Loudspeader channel types. */
typedef enum
{
    AUD_DEC_LS_FRONT_LEFT = 0,
    AUD_DEC_LS_FRONT_RIGHT,
    AUD_DEC_LS_REAR_LEFT,
    AUD_DEC_LS_REAR_RIGHT,
    AUD_DEC_LS_CENTER,
    AUD_DEC_LS_SUB_WOOFER,
    AUD_DEC_LS_SPK_AUX1,                  //back left
    AUD_DEC_LS_SPK_AUX2,                  //back right
    AUD_DEC_LS_SPK_DOWNMIX_LEFT,
    AUD_DEC_LS_SPK_DOWNMIX_RIGHT,
    AUD_DEC_LS_SPK_ALL,
    AUD_DEC_LS_AOUT_L_SINE_R_TRIANGLE
}   AUD_DEC_LS_T;

/* Loudspeader types. */
typedef enum
{
    AUD_DEC_LS_OUT_MODE_DEFAULT = 0, /*for analog pcm and raw delay*/
    AUD_DEC_LS_OUT_MODE_HDMI/* ,for hdmi pcm and raw delay
    AUD_DEC_LS_OUT_MODE_SPDIF for spdif pcm and raw delay, spdif pcm need get spdif out ch*/
}   AUD_DEC_LS_OUT_MODE_T;

#define AUD_DEV_LS_FLAG_NONE             ((UINT32) (0) )
#define AUD_DEC_LS_FLAG_FRONT_LEFT       MAKE_BIT_MASK_32(0)
#define AUD_DEC_LS_FLAG_FRONT_RIGHT      MAKE_BIT_MASK_32(1)
#define AUD_DEC_LS_FLAG_REAR_LEFT        MAKE_BIT_MASK_32(2)
#define AUD_DEC_LS_FLAG_REAR_RIGHT       MAKE_BIT_MASK_32(3)
#define AUD_DEC_LS_FLAG_CENTER           MAKE_BIT_MASK_32(4)
#define AUD_DEC_LS_FLAG_SUB_WOOFER       MAKE_BIT_MASK_32(5)


/* Sound Effects. */
typedef enum
{
    AUD_DEC_SE_TRIM = 0,
    AUD_DEC_SE_DELAY,
    AUD_DEC_SE_SUPERBASS,
    AUD_DEC_SE_EQUALIZER,
    AUD_DEC_SE_REVERB,
    AUD_DEC_SE_BASS,
    AUD_DEC_SE_TREBLE,
    AUD_DEC_SE_BALANCE,
    AUD_DEC_SE_POSTDRC,
    AUD_DEC_SE_VOLUME,
    AUD_DEC_SE_SURROUND,
    AUD_DEC_SE_PROLOG_II,
    AUD_DEC_SE_MP3BOOSTER,      // (aud_se_mp3booster_v2)
    AUD_DEC_SE_DBASS,           // (aud_se_dbass_v2)
    AUD_DEC_SE_SWAP,             // (aud_se_swap_v2)
    AUD_DEC_SE_TRIM_BY_DB   //spk_trim_by_db
}   AUD_DEC_SOUND_EFFECT_T;

/*Aud Chann Mode.*/
typedef enum
{
	AUD_DEC_CHANN_7_1_MODE = 0,
	AUD_DEC_CHANN_5_1_MODE,
	AUD_DEC_CHANN_2_MODE
}AUD_DEC_CHANN_MODE;

/*Downmix lr type.*/
typedef enum
{
    AUD_DEC_DM_LORO = 0,
    AUD_DEC_DM_LTRT
} AUD_DEC_DOWNMIX_LR_T;


typedef struct _AUD_SPDIF_DELAY_SETTING
{
    BOOL fgSpdifPCMDelay;
    BOOL fgSpdifRawDelay;
    UINT16 u2PCMDelay;
    UINT16 u2RawDelay;
}   AUD_SPDIF_DELAY_SETTING_T;

/* Downmix modes. */
typedef enum
{
    AUD_DEC_DM_OFF = 0,
    AUD_DEC_DM_LT_RT,
    AUD_DEC_DM_STEREO,
    AUD_DEC_DM_VIR_SURR,
    AUD_DEC_DM_MONO,
    AUD_DEC_DM_DOLBY_AUTO,
    AUD_DEC_DM_DOLBY_PL2COMPATIBLE
}   AUD_DEC_DOWNMIX_MODE_T;

typedef enum
{
   AUD_PLC_CTRL_TYPE_CB_REG,
   AUD_PLC_CTRL_TYPE_CB_UNREG,
   AUD_PLC_CTRL_TYPE_TIMER_TICKET,
   AUD_PLC_CTRL_TYPE_UNDEF
} AUD_PLC_CTRL_TYPE_T;

typedef struct _AUD_PLC_CTRL_T
{
    AUD_PLC_CTRL_TYPE_T eCtrlType;
    union
    {
        DRV_CB_REG_INFO_T   CallbackInfo;
        UINT32              u4TimerTicket_ms;
    } u;
} AUD_PLC_CTRL_T;


/* Dolby Dynamice Range Control. */
typedef enum
{
    AUD_DEC_DRC_OFF = 0,
    AUD_DEC_DRC_1_8,
    AUD_DEC_DRC_1_4,
    AUD_DEC_DRC_3_8,
    AUD_DEC_DRC_1_2,
    AUD_DEC_DRC_5_8,
    AUD_DEC_DRC_3_4,
    AUD_DEC_DRC_7_8,
    AUD_DEC_DRC_FULL
}   AUD_DEC_DRC_T;


/* Sample bits. */
typedef enum
{
    AUD_DEC_SAMPLE_BITS_16 = 0,
    AUD_DEC_SAMPLE_BITS_18,
    AUD_DEC_SAMPLE_BITS_20,
    AUD_DEC_SAMPLE_BITS_24
}   AUD_DEC_SAMPLE_BITS_T;


/* Sample frequency. */
typedef enum
{
    AUD_DEC_SAMPLE_FREQ_8 = 0,
    AUD_DEC_SAMPLE_FREQ_11_025,
    AUD_DEC_SAMPLE_FREQ_12,
    AUD_DEC_SAMPLE_FREQ_16,
    AUD_DEC_SAMPLE_FREQ_22_050,
    AUD_DEC_SAMPLE_FREQ_24,
    AUD_DEC_SAMPLE_FREQ_32,
    AUD_DEC_SAMPLE_FREQ_44_100,
    AUD_DEC_SAMPLE_FREQ_48,
    AUD_DEC_SAMPLE_FREQ_96
}   AUD_DEC_SAMPLE_FREQ_T;


/*The tuned volume types */
typedef enum
{
    AUD_DEC_ALL_CH = 0,
    AUD_DEC_INDIVIDUAL_CH
}   AUD_DEC_VOL_TYPE_T;


/* Dolby Digital compression mode. */
typedef enum
{
    AUD_DEC_CMPSS_MODE_RF_OFF = 0,
    AUD_DEC_CMPSS_MODE_RF_FULL,
    AUD_DEC_CMPSS_MODE_LINE_0,  // Off
    AUD_DEC_CMPSS_MODE_LINE_1,  // 1/8
    AUD_DEC_CMPSS_MODE_LINE_2,
    AUD_DEC_CMPSS_MODE_LINE_3,
    AUD_DEC_CMPSS_MODE_LINE_4,
    AUD_DEC_CMPSS_MODE_LINE_5,
    AUD_DEC_CMPSS_MODE_LINE_6,
    AUD_DEC_CMPSS_MODE_LINE_7,
    AUD_DEC_CMPSS_MODE_LINE_8,   // Full
    AUD_DEC_CMPSS_MODE_CUSTOM0_0,  // Off
    AUD_DEC_CMPSS_MODE_CUSTOM0_1,  // 1/8
    AUD_DEC_CMPSS_MODE_CUSTOM0_2,
    AUD_DEC_CMPSS_MODE_CUSTOM0_3,
    AUD_DEC_CMPSS_MODE_CUSTOM0_4,
    AUD_DEC_CMPSS_MODE_CUSTOM0_5,
    AUD_DEC_CMPSS_MODE_CUSTOM0_6,
    AUD_DEC_CMPSS_MODE_CUSTOM0_7,
    AUD_DEC_CMPSS_MODE_CUSTOM0_8,   // Full
    AUD_DEC_CMPSS_MODE_CUSTOM1_0,  // Off
    AUD_DEC_CMPSS_MODE_CUSTOM1_1,  // 1/8
    AUD_DEC_CMPSS_MODE_CUSTOM1_2,
    AUD_DEC_CMPSS_MODE_CUSTOM1_3,
    AUD_DEC_CMPSS_MODE_CUSTOM1_4,
    AUD_DEC_CMPSS_MODE_CUSTOM1_5,
    AUD_DEC_CMPSS_MODE_CUSTOM1_6,
    AUD_DEC_CMPSS_MODE_CUSTOM1_7,
    AUD_DEC_CMPSS_MODE_CUSTOM1_8 // Full
}   AUD_DEC_CMPSS_MODE_T;

typedef enum
{
    AUD_DEC_IEC_OUTPUT_CFG_PCM,
    AUD_DEC_IEC_OUTPUT_CFG_RAW,
    AUD_DEC_IEC_OUTPUT_CFG_RAW_HD,
    AUD_DEC_IEC_OUTPUT_CFG_RAW_REENCODE,
    AUD_DEC_IEC_OUTPUT_CFG_OFF,
    AUD_DEC_IEC_OUTPUT_CFG_PCM_STEREO
}   AUD_DEC_IEC_OUTPUT_CFG_T;


typedef enum
{
    AUD_DEC_HDMI_OUTPUT_OFF = 0,
    AUD_DEC_HDMI_OUTPUT_PCM,
    AUD_DEC_HDMI_OUTPUT_BITSTREAM,
    AUD_DEC_HDMI_OUTPUT_UNKNOWN
}   AUD_DEC_HDMI_OUTPUT_MODE_T;

typedef struct
{
    AUD_DEC_AUD_TYPE_T eChannel_Layout;
    UINT8 u1Front;
    UINT8 u1Middle;
    UINT8 u1Rear;
    UINT8 u1Sw;
    UINT8 u1Others;
} AUD_DEC_INPUT_CHANNEL_LAYOUT_T;

typedef enum
{
    AUD_DEC_SPEED_TYPE_SF_00_03X           = 3,       /* HBI_SpeedSlow5(1/32X) */
    AUD_DEC_SPEED_TYPE_SF_00_06X           = 6,       /* HBI_SpeedSlow4(1/16X) */
    AUD_DEC_SPEED_TYPE_SF_00_13X           = 13,     /* HBI_SpeedSlow3(1/8X) */
    AUD_DEC_SPEED_TYPE_SF_00_25X           = 25,     /* HBI_SpeedSlow2(1/4X) */
    AUD_DEC_SPEED_TYPE_SF_00_50X           = 50,     /* HBI_SpeedSlow1(1/2X) */
    AUD_DEC_SPEED_TYPE_SF_00_60X           = 60,
    AUD_DEC_SPEED_TYPE_SF_00_70X           = 70,
    AUD_DEC_SPEED_TYPE_SF_00_80X           = 80,
    AUD_DEC_SPEED_TYPE_SF_00_90X           = 90,
    AUD_DEC_SPEED_TYPE_NORMAL                = 100,
    AUD_DEC_SPEED_TYPE_FF_01_10X           = 110,
    AUD_DEC_SPEED_TYPE_FF_01_20X           = 120,
    AUD_DEC_SPEED_TYPE_FF_01_30X           = 130,
    AUD_DEC_SPEED_TYPE_FF_01_40X           = 140,
    AUD_DEC_SPEED_TYPE_FF_01_50X           = 150,
    AUD_DEC_SPEED_TYPE_FF_02_00X           = 200,    /* HBI_SpeedFast1(2X) */
    AUD_DEC_SPEED_TYPE_FF_04_00X           = 400,    /* HBI_SpeedFast2(4X) */
    AUD_DEC_SPEED_TYPE_FF_08_00X           = 800,    /* HBI_SpeedFast3(8X) */
    AUD_DEC_SPEED_TYPE_FF_16_00X           = 1600,   /* HBI_SpeedFast4(16X) */
    AUD_DEC_SPEED_TYPE_FF_32_00X           = 3200    /* HBI_SpeedFast5(32X) */
}AUD_DEC_PB_SPEED_TYPE_T;

/*
0: IEC select L/R as output
1: IEC select Ls/Rs as output
2: IEC select C/LFE as output
3 :IEC select Ch7/Ch8 as output
4: IEC select SPDIF /LINE in as output
5: IEC select Ch9/Ch10 as output
6: IEC select Ch11/Ch12 as output
7: IEC select microphone as output
*/
typedef enum
{
    AUD_DEC_SPDIF_OUTPUT_L_R = 0,
    AUD_DEC_SPDIF_OUTPUT_LS_RS,
    AUD_DEC_SPDIF_OUTPUT_C_LFE,
    AUD_DEC_SPDIF_OUTPUT_CH7_CH8,
    AUD_DEC_SPDIF_OUTPUT_LINE_IN,
    AUD_DEC_SPDIF_OUTPUT_CH9_CH10,
    AUD_DEC_SPDIF_OUTPUT_CH11_CH12,
    AUD_DEC_SPDIF_OUTPUT_MIC
}AUD_DEC_SPDIF_OUTPUT_T;


typedef enum
{
    AUD_DEC_SPDIF_INPUT_OFF = 0,
    AUD_DEC_SPDIF_INPUT_ON
}AUD_DEC_SPDIF_INPUT_T;

//(aud_output_level) ---zhengwen 2012/2/9
typedef struct
{
    UINT32 e_output_level_analog;
    UINT32 e_output_level_micin;
}AUD_DEC_OUTPUT_LEVEL_INFO_T;

/* Capability channels. */
#define AUD_DEC_CAP_TYPE_UNKNOWN     (((UINT32) 1) << AUD_DEC_TYPE_UNKNOWN)
#define AUD_DEC_CAP_TYPE_MONO        (((UINT32) 1) << AUD_DEC_TYPE_MONO)
#define AUD_DEC_CAP_TYPE_DUAL_MONO   (((UINT32) 1) << AUD_DEC_TYPE_DUAL_MONO)
#define AUD_DEC_CAP_TYPE_STEREO      (((UINT32) 1) << AUD_DEC_TYPE_STEREO)
#define AUD_DEC_CAP_TYPE_STEREO_DOLBY_SURROUND      (((UINT32) 1) << AUD_DEC_TYPE_STEREO_DOLBY_SURROUND)
#define AUD_DEC_CAP_TYPE_3_0         (((UINT32) 1) << AUD_DEC_TYPE_3_0)
#define AUD_DEC_CAP_TYPE_4_0         (((UINT32) 1) << AUD_DEC_TYPE_4_0)
#define AUD_DEC_CAP_TYPE_5_1         (((UINT32) 1) << AUD_DEC_TYPE_5_1)
#define AUD_DEC_CAP_TYPE_7_1         (((UINT32) 1) << AUD_DEC_TYPE_7_1)
#define AUD_DEC_CAP_TYPE_OTHERS      (((UINT32) 1) << AUD_DEC_TYPE_OTHERS)


/* Capability downmix mode. */
#define AUD_DEC_CAP_DM_OFF           (((UINT32) 1) << AUD_DEC_DM_OFF)
#define AUD_DEC_CAP_DM_LT_RT         (((UINT32) 1) << AUD_DEC_DM_LT_RT)
#define AUD_DEC_CAP_DM_STEREO        (((UINT32) 1) << AUD_DEC_DM_STEREO)
#define AUD_DEC_CAP_DM_VIR_SURR      (((UINT32) 1) << AUD_DEC_DM_VIR_SURR)


/* Capability sound effect. */
#define AUD_DEC_CAP_SE_TRIM          (((UINT32) 1) << AUD_DEC_SE_TRIM)
#define AUD_DEC_CAP_SE_DELAY         (((UINT32) 1) << AUD_DEC_SE_DELAY)
#define AUD_DEC_CAP_SE_SUPERBASS     (((UINT32) 1) << AUD_DEC_SE_SUPERBASS)
#define AUD_DEC_CAP_SE_EQUALIZER     (((UINT32) 1) << AUD_DEC_SE_EQUALIZER)
#define AUD_DEC_CAP_SE_REVERB        (((UINT32) 1) << AUD_DEC_SE_REVERB)
#define AUD_DEC_CAP_SE_BASS          (((UINT32) 1) << AUD_DEC_SE_BASS)
#define AUD_DEC_CAP_SE_TREBLE        (((UINT32) 1) << AUD_DEC_SE_TREBLE)
#define AUD_DEC_CAP_SE_BALANCE       (((UINT32) 1) << AUD_DEC_SE_BALANCE)
#define AUD_DEC_CAP_SE_POSTDRC       (((UINT32) 1) << AUD_DEC_SE_POSTDRC)
#define AUD_DEC_CAP_SE_VOLUME        (((UINT32) 1) << AUD_DEC_SE_VOLUME)
#define AUD_DEC_CAP_SE_SURROUND      (((UINT32) 1) << AUD_DEC_SE_SURROUND)


/* Capability format. */
#define AUD_DEC_CAP_FMT_MPEG           (((UINT32) 1) << AUD_DEC_FMT_MPEG)
#define AUD_DEC_CAP_FMT_AC3            (((UINT32) 1) << AUD_DEC_FMT_AC3)
#define AUD_DEC_CAP_FMT_PCM            (((UINT32) 1) << AUD_DEC_FMT_PCM)
#define AUD_DEC_CAP_FMT_MP3            (((UINT32) 1) << AUD_DEC_FMT_MP3)
#define AUD_DEC_CAP_FMT_AAC            (((UINT32) 1) << AUD_DEC_FMT_AAC)
#define AUD_DEC_CAP_FMT_DTS            (((UINT32) 1) << AUD_DEC_FMT_DTS)
#define AUD_DEC_CAP_FMT_WMA            (((UINT32) 1) << AUD_DEC_FMT_WMA)
#define AUD_DEC_CAP_FMT_RA             (((UINT32) 1) << AUD_DEC_FMT_RA)
#define AUD_DEC_CAP_FMT_HDCD           (((UINT32) 1) << AUD_DEC_FMT_HDCD)
#define AUD_DEC_CAP_FMT_MLP            (((UINT32) 1) << AUD_DEC_FMT_MLP)
#define AUD_DEC_CAP_FMT_MTS            (((UINT32) 1) << AUD_DEC_FMT_MTS)
#define AUD_DEC_CAP_FMT_EU_CANAL_PLUS  (((UINT32) 1) << AUD_DEC_FMT_EU_CANAL_PLUS)
#define AUD_DEC_CAP_FMT_TV_SYS         (((UINT32) 1) << AUD_DEC_FMT_TV_SYS)


/*  gain array*/
/*fixed point format :b0 ~b15 => fraction portion, b16~b31 => integer portion*/
typedef struct _AUD_DEC_GAIN_ARRAY_T
{
    UINT32              ui4_L;
    UINT32              ui4_R;
    UINT32              ui4_C;
    UINT32              ui4_LS;
    UINT32              ui4_RS;
    UINT32              ui4_LFE;
    UINT32              ui4_AUX1;
    UINT32              ui4_AUX2;
}AUD_DEC_GAIN_ARRAY_T;

/*  gain infomation*/
/* The linear gain converted to a fractional fixed point unsigned integer, as described
 * in [BD-ROM3] part 1 I.4. The value to pass is the linear gain multiplied by 8192, and
 * rounded to the closest integer
 *ui4_gain    b0 ~b15 => fraction portion, b16~b31 => integer portion */
typedef UINT32 AUD_DEC_MIX_GAIN_INFO_T;
typedef struct AUD_DEC_PANNING_INFO_T
{
    INT32 i4_0; // L -> L
    INT32 i4_1; // L -> R
    INT32 i4_2; // L -> C
    INT32 i4_3; // L -> LS
    INT32 i4_4; // L -> RS
    INT32 i4_5; // DOWNMIX 2CH L
    INT32 i4_6; // DOWNMIX 2CH R
    INT32 i4_7; // L -> LFE
    INT32 i4_8; // L -> CH6
    INT32 i4_9; // L -> CH7
}AUD_DEC_PANNING_INFO_T;

typedef enum _AUD_DEC_CLIP_DUAL_MONO_MODE_T
{
    AUD_DEC_CLIP_DUAL_MONO_STEREO = 0,
    AUD_DEC_CLIP_DUAL_MONO_L,
    AUD_DEC_CLIP_DUAL_MONO_R
}AUD_DEC_CLIP_DUAL_MONO_MODE_T;


typedef UINT32 AUD_DEC_WRITE_PTR_T;
typedef struct
{
    UINT32         u4WritePointer;  // btnsnd input buffer
    INT32           i4WriteLength;  // btnsnd input buffer
    UINT32   u4InputBufferBalance;  // input buffer remaining length
    UINT32     u4SRCBufferBalance;  // SRC buffer data remaining length
    UINT32    u4AoutBufferBalance;  // aout buffer data remaining length, it is an about value
}AUD_DEC_WRITE_INFO_T;

typedef struct
{
    UINT32         u4EffsndStrmBufSA;
    UINT32         u4EffsndStrmBufSize;
    BOOL           fgNonFixedLength;
    BOOL           fgLittleEndian;
}
AUD_DEC_STRM_BUF_INFO_T;

/*  bitstream au infomation*/
typedef struct _AUD_DEC_BITSTREAM_INFO_T
{
    /* empty*/

} AUD_DEC_BITSTREAM_INFO_T;

typedef struct _AUD_SUPPORT_INFO_T
{
    UINT32              ui4_fmt;
    BOOL                fgSupport;
}   AUD_SUPPORT_INFO_T;

/* capability info. */
typedef struct _AUD_DEC_CAPABILITY_INFO_T
{
    UINT32              ui4_fmt;
    UINT32              ui4_channel_type;
    UINT32              ui4_sound_effect;
    UINT32              ui4_downmix_mode;
    BOOL                b_is_outport_adj;
}   AUD_DEC_CAPABILITY_INFO_T;

#if UNIFORM_DRV_CALLBACK
#define AUD_RANGE_INFO_IBC_PARAM_BYTE_LEN 12
typedef struct _AUD_DEC_CB_INFO_T
{
    AUD_DEC_COND_T  e_nfy_cond;
    UINT32          ui4_data_1;
    UINT32          ui4_data_2;
    UINT8           ui1_data_4[AUD_RANGE_INFO_IBC_PARAM_BYTE_LEN];
} AUD_DEC_CB_INFO_T;


typedef struct _AUD_DEC_AUD_INFO_EX_T
{
    UINT8        ui1_aud_fmt;
    UINT8        ui1_aud_type;
    UINT32       ui4_sample_rate;
    UINT32       ui4_data_rate;
    UINT8        ui1_bit_depth;
    UINT8        ui1_PCM_Format;
    UINT16       ui2_BlockAlign;        // block align, only necessary for ADPCM
    BOOL         fg_DeEmphasis;
    UINT16       ui2_pid;               //Only use for BDMW currently
    UINT32       ui4_ChannelLayout;       //for detail channel layout
    UINT8        u1DualMonoType;
}   AUD_DEC_AUD_INFO_EX_T;

typedef struct _AUD_DEC_CB_INFO_EX_T
{
    AUD_DEC_COND_T  e_nfy_cond;
    AUD_DEC_AUD_INFO_EX_T t_data_1;
    UINT32          ui4_data_2;
} AUD_DEC_CB_INFO_EX_T;
typedef struct _AUD_DEC_AUD_INFO_DETECT_T
{
    UINT8        ui1_aud_fmt;
}   AUD_DEC_AUD_INFO_DETECT_T;

typedef struct _AUD_DEC_AUD_INFO_DETECT_EX_T
{
    AUD_DEC_COND_T  e_nfy_cond;
    AUD_DEC_AUD_INFO_DETECT_T t_data_1;
    UINT32          ui4_data_2;
} AUD_DEC_AUD_INFO_DETECT_EX_T;

/* Notify setting info. */
typedef struct _AUD_DEC_NFY_INFO_T
{
    x_drv_cb_nfy_fct   pf_aud_dec_nfy;
    VOID*               pv_tag;
}   AUD_DEC_NFY_INFO_T;

#else
/* Notify function */
typedef VOID (*x_aud_dec_nfy_fct) (VOID*       pv_nfy_tag,
                                   AUD_DEC_COND_T  e_nfy_cond,
                                   UINT32          ui4_data_1,
                                   UINT32          ui4_data_2 );

/* Notify setting info. */
typedef struct _AUD_DEC_NFY_INFO_T
{
    VOID*               pv_tag;
    x_aud_dec_nfy_fct   pf_aud_dec_nfy;
}   AUD_DEC_NFY_INFO_T;
#endif

/* MP3 setting info. */
typedef struct _AUD_DEC_FMT_MP3_T
{
    UINT8                  ui1_num_ch;
    AUD_DEC_SAMPLE_BITS_T  e_sample_bits;
    AUD_DEC_SAMPLE_FREQ_T  e_samle_freq;
}   AUD_DEC_FMT_MP3_T;

/* PCM setting info. */
typedef struct _AUD_DEC_FMT_PCM_T
{
    UINT8                  ui1_num_ch;
    AUD_DEC_SAMPLE_BITS_T  e_sample_bits;
    AUD_DEC_SAMPLE_FREQ_T  e_samle_freq;

    BOOL  b_signed_data;
    BOOL  b_big_endian;

}   AUD_DEC_FMT_PCM_T;

/* Decode format setting info. */
typedef struct _AUD_DEC_FMT_INFO_T
{
    AUD_DEC_FMT_T               e_fmt;

    VOID* __local_space__       pv_info;
}   AUD_DEC_FMT_INFO_T;

/* Sound Effect info. */
typedef struct _AUD_DEC_SE_INFO_T
{
    AUD_DEC_SOUND_EFFECT_T      e_se_type;

    VOID* __local_space__       pv_info;
}   AUD_DEC_SE_INFO_T;

/* Individual channel volume level setting. */
typedef struct _AUD_DEC_CH_VOLUME_T
{
    AUD_DEC_OUT_PORT_T  e_out_port;
    AUD_DEC_LS_T        e_ls;

    UINT8               ui1_level;
}   AUD_DEC_CH_VOLUME_T;

/* Volume level setting info. */
typedef struct _AUD_DEC_VOLUME_INFO_T
{
    AUD_DEC_VOL_TYPE_T            e_vol_type;

    union
    {
        UINT8                   ui1_level;
        AUD_DEC_CH_VOLUME_T     t_ch_vol;
    } u;
}   AUD_DEC_VOLUME_INFO_T;


/* Volume level setting info. */
typedef struct _AUD_EFFECT_VOLUME_INFO_T
{
    UINT32  u4Volume;
    BOOL    fgEnable;
}   AUD_EFFECT_VOLUME_INFO_T;

/* Individual channel trim level setting. */
typedef struct _AUD_DEC_CH_TRIM_T
{
    AUD_DEC_LS_OUT_MODE_T e_mode;
    AUD_DEC_LS_T    e_ls;
    UINT8           ui1_level;
}   AUD_DEC_CH_TRIM_T;

/* Individual channel trim db setting. */
//spk_trim_by_db
typedef struct _AUD_DEC_CH_TRIM_BY_DB_T
{
    AUD_DEC_LS_T    e_ls;
    INT32 i4Gain;
}   AUD_DEC_CH_TRIM_BY_DB_T;

/* Individual channel delay level setting. */
typedef struct _AUD_DEC_CH_DELAY_T
{
    AUD_DEC_LS_OUT_MODE_T e_mode;
    AUD_DEC_LS_T    e_ls;
    UINT16          ui2_time;
}   AUD_DEC_CH_DELAY_T;


/* Individual channel loudspeaker mode setting. */
typedef struct _AUD_DEC_CH_LS_MODE_T
{
    AUD_DEC_LS_T          e_ls;

    AUD_DEC_LS_MODE_T   e_mode;
}   AUD_DEC_CH_LS_MODE_T;


/* Memory buffer info. */
/* Unused */
typedef struct _AUD_DEC_MEM_BUFFER_INFO_T
{
    VOID*                  pv_tag;

    UINT8* __cross_space__ pui1_data;

    SIZE_T                 z_len;
}   AUD_DEC_MEM_BUFFER_INFO_T;

/* Channel Delay */
typedef enum
{
    AUD_DEC_CHNL_DELAY_TYPE_ALL = 0,
    AUD_DEC_CHNL_DELAY_TYPE_INDIVIDUAL_CH
} AUD_DEC_CHNL_DELAY_TYPE_T;

/* Copy Protection */
typedef enum
{
    AUD_DEC_COPY_PROTECT_NO_RESTRICT = 0,
    AUD_DEC_COPY_PROTECT_NEVER_COPY,
    AUD_DEC_COPY_PROTECT_COPY_ONCE
} AUD_DEC_COPY_PROTECT_T;


/* MTS */
typedef enum
{
    AUD_DEC_MTS_UNKNOWN = 0,
    AUD_DEC_MTS_MONO,
    AUD_DEC_MTS_STERRO,
    AUD_DEC_MTS_SUB_LANG,
    AUD_DEC_MTS_DUAL1,
    AUD_DEC_MTS_DUAL2,
    AUD_DEC_MTS_NICAM_MONO,
    AUD_DEC_MTS_NICAM_STEREO,
    AUD_DEC_MTS_NICAM_DUAL1,
    AUD_DEC_MTS_NICAM_DUAL2
} AUD_DEC_MTS_T;


/* Sound Effect User mode setting */
/* AUD_DEC_SET_TYPE_SE_EQ_USER_LVL/AUD_DEC_GET_TYPE_SE_EQ_USER_LVL ***********/
typedef struct _AUD_DEC_SE_QA_USER_LVL_T
{
    AUD_DEC_EQ_TYPE_T   e_eq_type;
    UINT8               ui1_band_idx;
    INT8                i1_level;
} AUD_DEC_SE_QA_USER_LVL_T;


/* AUD_DEC_GET_TYPE_SE_EQ_USER_INFO_BAND *************************************/
typedef struct _AUD_DEC_SE_QA_USER_INFO_BAND_T
{
    AUD_DEC_EQ_TYPE_T   e_eq_type;
    UINT8               ui1_band_idx;
    INT8                i1_max_lvl;
    INT8                i1_min_lvl;
    UINT32              ui4_freq_lower_bound;
    UINT32              ui4_freq_upper_bound;
} AUD_DEC_SE_QA_USER_INFO_BAND_T;


/* AUD_DEC_GET_TYPE_TV_AUD_SYS_MASK/AUD_DEC_SET_TYPE_TV_AUD_SYS_MASK *********/
typedef struct _AUD_DEC_TV_AUD_SYS_T
{
    UINT32              ui4_tv_sys_mask;
    UINT32              ui4_aud_sys_mask;
} AUD_DEC_TV_AUD_SYS_T;


/* AUD_DEC_GET_TYPE_AUD_CLIP/AUD_DEC_SET_TYPE_AUD_CLIP ***********************/
typedef enum
{
    AUD_DEC_AUD_CLIP_TYPE_UNKNOWN = 0,
    AUD_DEC_AUD_CLIP_TYPE_TONE,
    AUD_DEC_AUD_CLIP_TYPE_CLIP_BUFF
}   AUD_DEC_AUD_CLIP_TYPE_T;

/* audio presentation types, mono / stereo */
typedef enum
{
    AUD_DEC_CHANNEL_TYPE_MONO = 0,
    AUD_DEC_CHANNEL_TYPE_STEREO,
    AUD_DEC_CHANNEL_TYPE_UNKNOWN
}   AUD_DEC_CHANNEL_TYPE_T;

typedef struct _AUD_DEC_AUD_CLIP_BUFF_T
{
    AUD_DEC_FMT_T          e_fmt;
    UINT8* __cross_space__ pui1_clip_buff;
    SIZE_T                 z_clip_buff_size;
    SIZE_T                 z_clip_length;
    AUD_DEC_CHANNEL_TYPE_T e_PCM_channel_type;
    UINT32                 ui4_PCM_SampleRate;
    UINT8                  ui1_PCM_BitDepth;
    BOOL                   fgTTS;
} AUD_DEC_AUD_CLIP_BUFF_T;

#define AUD_CLIP_REPEAT_CNT_FOREVER    ((UINT32) 0)

typedef struct _AUD_DEC_AUD_CLIP_T
{
    AUD_DEC_AUD_CLIP_TYPE_T      e_type;
    UINT32                       ui4_out_port_mask;
    UINT32                       ui4_ch_mask;
    UINT32                       ui4_repeat_cnt;

    union
    {
        UINT32                   ui4_tone_freq; /* Hz */
        AUD_DEC_AUD_CLIP_BUFF_T  t_clip_buff;
    } u;
} AUD_DEC_AUD_CLIP_T;


/* AUD_DEC_GET_TYPE_AUD_CLIP_INFO ********************************************/
typedef struct _AUD_DEC_AUD_CLIP_INFO_T
{
    UINT32      ui4_duration;   /* msec */
    UINT32      ui4_time_position; /* msec */
} AUD_DEC_AUD_CLIP_INFO_T;


/* AUD_DEC_SET_TYPE_PL2_CTRL/AUD_DEC_GET_TYPE_PL2_CTRL ***********************/
typedef enum
{
    AUD_DEC_PL2_CTRL_SWITCH = 0,
    AUD_DEC_PL2_CTRL_MODE,
    AUD_DEC_PL2_CTRL_PANORAMA,
    AUD_DEC_PL2_CTRL_DIMENSION,
    AUD_DEC_PL2_CTRL_C_WIDTH
}   AUD_DEC_PL2_CTRL_T;

typedef enum
{
    AUD_DEC_PL2_SWITCH_ON = 0,
    AUD_DEC_PL2_SWITCH_OFF,
    AUD_DEC_PL2_SWITCH_AUTO
}   AUD_DEC_PL2_SWITCH_MODE_T;

typedef enum
{
    AUD_DEC_PL2_MODE_MODE_PROLGIC_EMULATION = 0,
    AUD_DEC_PL2_MODE_MODE_VIRTUAL,
    AUD_DEC_PL2_MODE_MODE_MUSIC,
    AUD_DEC_PL2_MODE_MODE_MOVIE,
    AUD_DEC_PL2_MODE_MODE_MATRIX,
    AUD_DEC_PL2_MODE_MODE_CUSTOM
}   AUD_DEC_PL2_MODE_MODE_T;

typedef enum
{
    AUD_DEC_PL2_PANORAMA_ON = 0,
    AUD_DEC_PL2_PANORAMA_OFF
}   AUD_DEC_PL2_PANORAMA_T;

typedef struct _AUD_DEC_PL2_VAL_MIN_MAX_T
{
    UINT8      ui1_curr_val;
    UINT8      ui1_min_val; /* Only used in AUD_DEC_GET_TYPE_PL2_CTRL */
    UINT8      ui1_max_val; /* Only used in AUD_DEC_GET_TYPE_PL2_CTRL */
} AUD_DEC_PL2_VAL_MIN_MAX_T;

typedef struct _AUD_DEC_PL2_CTRL_INFO_T
{
    AUD_DEC_PL2_CTRL_T    e_ctrl; /* IN */

    union
    {
        AUD_DEC_PL2_SWITCH_MODE_T   e_pl2_switch;
        AUD_DEC_PL2_MODE_MODE_T     e_pl2_mode;
        BOOL                        b_is_pl2_panorama_on;
        AUD_DEC_PL2_VAL_MIN_MAX_T   t_pl2_val;
    } u;

} AUD_DEC_PL2_CTRL_INFO_T;

typedef enum
{
    AUD_DEC_PL2_OUTPUT_AUTO = 0,
    AUD_DEC_PL2_OUTPUT_5CH
}   AUD_DEC_PL2_OUTPUT_CH_T;

/* AUD_DEC_GET_TYPE_AV_SYNC/AUD_DEC_SET_TYPE_AV_SYNC *************************/
typedef enum
{
    AUD_DEC_AV_SYNC_FREE_RUN = 0,
    AUD_DEC_AV_SYNC_AUD_SLAVE,
    AUD_DEC_AV_SYNC_AUD_MASTER
} AUD_DEC_AV_SYNC_INFO_T;


/* AUD_DEC_SET_TYPE_REENC_CTRL ***********************************************/
/* DDCO Config Bitmask */
typedef enum
{
    AUD_DEC_DDCO_AGC_BIT = 0,          //bit 10: AGC
    AUD_DEC_DDCO_INPUT,            // bit 11: input selection, 0: PCM, 1: WAV
    AUD_DEC_DDCO_LFE_FLTR_BIT,          //bit 12: LFE Filter
    AUD_DEC_DDCO_LFE_CHAN_BIT,          //bit 13: LFE Channel
    AUD_DEC_DDCO_DELAY_SRND_CHAN_BIT,   //bit 14: Delay Surround Channels
    AUD_DEC_DDCO_TEST_MODE_BIT          //bit 15: Test Mode
}   AUD_DEC_DDCO_CFG_BITMASK_T;

/* DDCO Config */
typedef struct
{
    AUD_DEC_DDCO_CFG_BITMASK_T e_bit_offset;
    BOOL                       b_val;
}   AUD_DEC_DDCO_CFG_T;


/* AUD_DEC_SET_TYPE_DOLBY_KARA_MODE ******************************************/
/* Dolby Digital karaoke mode. */
typedef enum
{
    AUD_DEC_AC3_KARA_DISABLE = 0x0001,
    AUD_DEC_AC3_KARA_AWARE   = 0x0002,
    AUD_DEC_AC3_KARA_NONE    = 0x0004,
    AUD_DEC_AC3_KARA_V1      = 0x0008,
    AUD_DEC_AC3_KARA_V2      = 0x0010,
    AUD_DEC_AC3_KARA_BOTH    = 0x0020,
    AUD_DEC_AC3_NO_MELODY    = 0x0080
}   AUD_DEC_DOLBY_KARA_MODE_T;


/* AUD_DEC_SET_TYPE_DTS_DRC **************************************************/
/* DTS DRC Setting*/
typedef enum
{
    AUD_DEC_DTS_DRC_OFF,
    AUD_DEC_DTS_DRC_MODE_0,
    AUD_DEC_DTS_DRC_MODE_1,
    AUD_DEC_DTS_DRC_MODE_2,
    AUD_DEC_DTS_DRC_MODE_3,
    AUD_DEC_DTS_DRC_MODE_4,
    AUD_DEC_DTS_DRC_MODE_5,
    AUD_DEC_DTS_DRC_MODE_6,
    AUD_DEC_DTS_DRC_MODE_7,
    AUD_DEC_DTS_DRC_MODE_8,
    AUD_DEC_DTS_DRC_MODE_9
}   AUD_DEC_DTS_DRC_MODE_T;


/* AUD_DEC_SET_TYPE_HDCD_CFG *************************************************/
/* HDCD Config Bitmask */
typedef enum
{
    AUD_DEC_HDCD_ENABLE_BIT,                //bit 0: hdcd enable/disable
    AUD_DEC_HDCD_AUTOLEVEL_BIT,             //bit 1: autolevel flag
    AUD_DEC_HDCD_DITHER_BIT,                //bit 2: dither on/off
    AUD_DEC_HDCD_HDCD_FLTR_ON_NONHDCD_BIT   //bit 3: do hdcd filter on non-hdcd
}   AUD_DEC_HDCD_CFG_BITMASK_T;


/* AUD_DEC_SET_TYPE_HDCD_DITHER_MODE *****************************************/
/* HDCD Dither Modes */
typedef enum
{
    AUD_DEC_HDCD_DITHER_OFF = 0,
    AUD_DEC_HDCD_DITHER_LVL1,
    AUD_DEC_HDCD_DITHER_LVL2,
    AUD_DEC_HDCD_DITHER_LVL3,
    AUD_DEC_HDCD_DITHER_LVL4,
    AUD_DEC_HDCD_DITHER_LVL5,
    AUD_DEC_HDCD_DITHER_LVL6,
    AUD_DEC_HDCD_DITHER_LVL7
}   AUD_DEC_HDCD_DITHER_MODE_T;


/* AUD_DEC_SET_TYPE_TRUEHD_CFG ***********************************************/
/* Dolby TrueHD Configuration */
typedef enum
{
    AUD_DEC_TRUEHD_DRC_MODE = 0,
    AUD_DEC_TRUEHD_LOSSLESS_DEC,
    AUD_DEC_TRUEHD_DIAG_SUPPLY,
    AUD_DEC_TRUEHD_BOOST_VAL,
    AUD_DEC_TRUEHD_CUT_VAL,
    AUD_DEC_TRUEHD_DIAG_NORM_REF
}   AUD_DEC_TRUEHD_OPTION_T;

/* Dolby TrueHD DRC Mode Definition */
typedef enum
{
    AUD_DEC_TRUEHD_DRC_OFF = 0,
    AUD_DEC_TRUEHD_DRC_ON,
    AUD_DEC_TRUEHD_DRC_FOLLOW
}   AUD_DEC_TRUEHD_DRC_MODE_T;

typedef struct _AUD_DEC_TRUEHD_CFG_T
{
    AUD_DEC_TRUEHD_OPTION_T       e_option_type;

    union
    {
        AUD_DEC_TRUEHD_DRC_MODE_T e_drv_mode;
        BOOL                      b_enable;
        UINT32                    ui4_val;
    } u;
}   AUD_DEC_TRUEHD_CFG_T;


/* AUD_DEC_SET_TYPE_SPEAKER_LAYOUT *******************************************/
/* Speaker Types */
typedef struct
{
    UINT8               ui1_total_spk_num;
   /*
    * ui8_spk_layout format definition:
    * ---------
    * bit0 ~ bit2 (2~5ch)
    * 0: LT/RT                    bit 3: Lsr(or CB) exist or not
    * 1: Mono                     bit 4: Rsr exist or not
    * 2: Stereo                   bit 5: subwoofer exist or not
    * 3: L/R/C
    * 4: L/R/S
    * 5: L/R/C/S
    * 6. L/R/LS/RS
    * 7: L/R/C/LS/RS (over 7 ch, bit 0~2 should be set as 7)
    *
    * bit 8: Le & Re  for high speaker (DTS Lh & Rh for speaker)
    * bit 9: Lse&Rse  for high speaker (DTS Lhr & Rhr for speaker)
    * bit 10:Lrse &Rrse  for high speaker
    * example: 5.1.2 -> 0x127
               5.1.4 -> 0x327
               7.1.2 -> 0x12f
               7.1.4 -> 0x32f
    * bit 12: Center Channel large(1)/small(0)
    * bit 13: Left Channel large(1)/small(0)
    * bit 14: Right Channel large(1)/small(0)
    * bit 15: Left Surround Channel large(1)/small(0)
    * bit 16: Right Surround Channel large(1)/small(0)
    * bit 17: Center Back Channel large(1)/small(0)
    * bit 18: No.7 Channel large(1)/small(0)
    * bit 19: Le & Re large(1)/small(0)
    * bit 20: Lse&Rse large(1)/small(0)
    * bit 21: Lrse &Rrse large(1)/small(0)

    *
    * bit32 ~ bit63
    * represent the channel set
    * 0: no remapping is required
    * Other config is followed the rule below:
    * bit 32: Center exist          bit 40: Overhead (Oh)
    * bit 33: LR                    bit 41: LC/RC
    * bit 34: LS/RS                 bit 42: LW/RW
    * bit 35: LFE                   bit 43: LSS/RSS
    * bit 36: CS (CB)               bit 44: LFE2
    * bit 37: Lh/Rh                 bit 45: LHS/RHS
    * bit 38: LSR/RSR               bit 46: CHR
    * bit 39: Center high (Ch)      bit 47: LHR/RHR
    */
    UINT64              ui8_spk_layout;
}AUD_DEC_SPEAKER_LAYOUT_T;

typedef struct
{
    BOOL               b_val;
   /*
    * ui4_codec_type format definition:
    * ---------
    * 0: MP3                    bit 8: TUREHD
    * 1: MPEG                   bit 9: DTSCD
    * 2: AC3                    bit 10: PCM
    * 3: EAC3                   bit 11:
    * 4: DTS                    bit 12:
    * 5: DTS_MA                 bit 13:
    * 6: LOSSLESS_AC3           bit 14:
    * 7: MLP                    bit 15:
    */
    UINT32              ui4_codec_type;
}AUD_DEC_SET_TYPE_TS_UNKNOWN_CODEC_FLAG;
/*
typedef enum
{
    AUD_DEC_SPK_L = 0,   AUD_DEC_SPK_C,       AUD_DEC_SPK_R,       AUD_DEC_SPK_LS,
    AUD_DEC_SPK_RS,      AUD_DEC_SPK_LFE1,    AUD_DEC_SPK_RLS,     AUD_DEC_SPK_CS,
    AUD_DEC_SPK_RRS,     AUD_DEC_SPK_LC,      AUD_DEC_SPK_RC,      AUD_DEC_SPK_VHL,
    AUD_DEC_SPK_VHC,     AUD_DEC_SPK_VHR,     AUD_DEC_SPK_TS,      AUD_DEC_SPK_LW,
    AUD_DEC_SPK_RW,      AUD_DEC_SPK_LSD,     AUD_DEC_SPK_RSD,     AUD_DEC_SPK_LFE2,
    AUD_DEC_SPK_LSS,     AUD_DEC_SPK_RSS,     AUD_DEC_SPK_LHS,     AUD_DEC_SPK_RHS,
    AUD_DEC_SPK_LHR,     AUD_DEC_SPK_RHR,     AUD_DEC_SPK_CHR
}   AUD_DEC_SPEAKER_LAYOUT_BITMASK_T;
*/

/* HDMI output types. */
typedef enum
{
    AUD_DEC_HDMI_OFF = 0,
    AUD_DEC_HDMI_RAW,
    AUD_DEC_HDMI_PCM,  // PCM Multi-channel
    AUD_DEC_HDMI_NON_PCM,
    AUD_DEC_HDMI_PCM_STEREO  // PCM Stereo @ 12/04/2008
}   AUD_DEC_HDMI_TYPE_T;


/* SPDIF LPCM output types. */
typedef enum
{
    AUD_DEC_SPDIF_LPCM_48K = 0,
    AUD_DEC_SPDIF_LPCM_96K,
    AUD_DEC_SPDIF_LPCM_192K,
    AUD_DEC_SPDIF_LPCM_48K_16BIT  // 48kHz, 16bit @ 01/16/2009
}   AUD_DEC_SPDIF_LPCM_TYPE_T;

#if 1 //CONFIG_DRV_AUDIO_IN
/* SPDIF AUDIO IN TYPE */
typedef enum
{
    AUD_DEC_SPDIF_INPUT_CD_DISC = (0x0),
    AUD_DEC_SPDIF_INPUT_LINE_IN = (0x1<<0),
    AUD_DEC_INPUT_IPOD = (0x1<<1)
}AUD_DEC_SPDIF_INPUT_MODE_T;
#define AUD_DEC_HDMI_INPUT (0x1<<2) //audio driver use only & LPCM decoder use only
#define AUD_DEC_SPOTIFY_INPUT (0x1<<3) //SpdifIn(linein)+PCM_NORMAL,for quick output
#endif

/* DTS Audio Presentation format */
typedef enum
{
    AUD_DEC_DTS_AUD_PRESENTATION_DEFAULT = 0,
    AUD_DEC_DTS_AUD_PRESENTATION_MODE1
}   AUD_DEC_DTS_AUD_PRESENTATION_TYPE_T;


/* Dolby DUAL MONO format */
typedef enum
{
    AUD_DEC_DOLBY_DM_STEREO = 0, // Stereo
    AUD_DEC_DOLBY_DM_DUAL1,  // L-MONO
    AUD_DEC_DOLBY_DM_DUAL2,  // R-MONO
    AUD_DEC_DOLBY_DM_DUAL3   // Mix-MONO
} AUD_DEC_DOLBY_DUAL_MONO_TYPE_T;

/* Bass Management mode. */
typedef enum
{
    AUD_DEC_BASS_MANAGEMENT_LFE = 0,
    AUD_DEC_BASS_MANAGEMENT_LFE_MAIN
}   AUD_DEC_BASS_MANAGEMENT_MODE_T;

/* Karaoke output mode */
typedef enum
{
     AUD_DEC_KARA_OUTPUT_FMT_STEREO = 0,
     AUD_DEC_KARA_OUTPUT_FMT_MIX,
     AUD_DEC_KARA_OUTPUT_FMT_LEFT,
     AUD_DEC_KARA_OUTPUT_FMT_RIGHT,
     AUD_DEC_KARA_OUTPUT_FMT_VOCALMUTE
} AUD_DEC_KARA_OUTPUT_T;

struct AUD_ARGS {
    INT32 i4Argc;
    CHAR  szArgv[4][64];
};



/* Neo6 output mode */
typedef enum
{
     AUD_DEC_NEO6_STATUS_UNKNOWN = 0,
     AUD_DEC_NEO6_STATUS_OFF,
     AUD_DEC_NEO6_STATUS_ON_CINEMA,
     AUD_DEC_NEO6_STATUS_ON_MUSIC
} AUD_DEC_NEO6_STATUS_T;

// UI_default
typedef struct _AUD_DEC_CH_DEFAULT_T
{
    AUD_DEC_CH_TRIM_T t_se_trim;
    AUD_DEC_CH_DELAY_T t_se_delay;
}   AUD_DEC_CH_DEFAULT_T;

typedef enum
{
     AUD_DEC_RESET_AOUT = 0,
     AUD_DEC_RESET_OTHERS
} AUD_DEC_RESET_T;

typedef enum
{
    SCC_AUD_NEO6_AUDIO_STREAM_DD = 1,
    SCC_AUD_NEO6_AUDIO_STREAM_DTS,
     SCC_AUD_NEO6_AUDIO_STREAM_TRUEHD,
    SCC_AUD_NEO6_AUDIO_STREAM_UNKNOWN
}SCC_AUD_NEO6_AUDIO_STREAM_TYPE;

typedef enum
{
    SCC_AUD_NEO6_AUDIO_DOWNMIX_LTRT,
    SCC_AUD_NEO6_AUDIO_DOWNMIX_LORO,
    SCC_AUD_NEO6_AUDIO_DOWNMIX_UNKNOWN
}SCC_AUD_NEO6_AUDIO_DOWNMIX_TYPE;


// UI_default
/* AUD_DEC_SET_TYPE_UI_DEFAULT *******************************************/
typedef struct
{
    AUD_DEC_SPEAKER_LAYOUT_T e_spk_layout;
    AUD_DEC_CH_DEFAULT_T t_ch_l;
    AUD_DEC_CH_DEFAULT_T t_ch_r;
    AUD_DEC_CH_DEFAULT_T t_ch_c;
    AUD_DEC_CH_DEFAULT_T t_ch_ls;
    AUD_DEC_CH_DEFAULT_T t_ch_rs;
    AUD_DEC_CH_DEFAULT_T t_ch_ext1;
    AUD_DEC_CH_DEFAULT_T t_ch_ext2;
    AUD_DEC_CH_DEFAULT_T t_ch_sub;
}   AUD_DEC_UI_DEFAULT_T;

// AAC_support_DSP
/* AAC Dual Mono mode. */
typedef enum
{
    AUD_DEC_AAC_DM_STEREO = 0,
    AUD_DEC_AAC_DM_L_MONO,
    AUD_DEC_AAC_DM_R_MONO,
    AUD_DEC_AAC_DM_M_MONO,
}   AUD_DEC_AAC_DM_MODE_T;


/* Neo6 channel number */
typedef enum
{
    AUD_DEC_NEO6_CHANNEL_NUM_1 = 1,
    AUD_DEC_NEO6_CHANNEL_NUM_2,
    AUD_DEC_NEO6_CHANNEL_NUM_3,
    AUD_DEC_NEO6_CHANNEL_NUM_4,
    AUD_DEC_NEO6_CHANNEL_NUM_5,
    AUD_DEC_NEO6_CHANNEL_NUM_6,
    AUD_DEC_NEO6_CHANNEL_NUM_7
}   AUD_DEC_NEO6_CHANNEL_NUM_T;

/* Neo6 mode  */
typedef enum
{
    AUD_DEC_NEO6_MODE_MUSIC = 0,
    AUD_DEC_NEO6_MODE_CINEMA

}   AUD_DEC_NEO6_MODE_T;

/* Neo6 CGAIN  */
typedef enum
{
    AUD_DEC_NEO6_CGAIN_ZERO = 0,
    AUD_DEC_NEO6_CGAIN_POINT3 = 0x2666,
    AUD_DEC_NEO6_CGAIN_POINT5 = 0x4000,
    AUD_DEC_NEO6_CGAIN_ONE = 0x7FFF
}   AUD_DEC_NEO6_CGAIN_T;

/* Neo6 struct */
typedef struct _AUD_DEC_NEO6_CFG_T
{
    BOOL b_enable;    //for UI setting CERT only
    AUD_DEC_NEO6_CHANNEL_NUM_T e_neo6_ch_no;
    AUD_DEC_NEO6_MODE_T e_neo6_mode;
    AUD_DEC_NEO6_CGAIN_T e_neo6_cgain;
} AUD_DEC_NEO6_CFG_T;

/* for test tone */
typedef enum
{
    AUD_DEC_TEST_TONE_PINK_NOISE,
    AUD_DEC_TEST_TONE_TRIANGLE_WAVE,
    AUD_DEC_TEST_TONE_SINE_WAVE,
    AUD_DEC_TEST_TONE_WHITE_NOISE,
    AUD_DEC_TEST_TONE_PINK_NOISE_DOLBY,  // pink noise with Dolby required level
    AUD_DEC_TT1_SINE_TT2_TRIANGLE
} AUD_DEC_TEST_TONE_TYPE_T;

// Test tone
typedef enum
{
    AUD_DEC_TESTTONE_OUTPUT_ALL = 0,
    AUD_DEC_TESTTONE_OUTPUT_ANALOG,
    AUD_DEC_TESTTONE_OUTPUT_SPDIF,
    AUD_DEC_TESTTONE_OUTPUT_HDMI
} AUD_DEC_TESTTONE_OUTPUT_T;

typedef struct _AUD_DEC_TT_INFO_T
{
    BOOL                b_testtone_enable;
    AUD_DEC_TEST_TONE_TYPE_T   e_testtone_type;
    UINT32              ui4_testtone_freq;
    AUD_DEC_TESTTONE_OUTPUT_T  t_testtone_output;
}   AUD_DEC_TT_INFO_T;

// for new re-encoder flow @ 01/14/2008
// make sure the definition is idential with SCC interfaces.
// SCC_AUD_REENCODER_FMT_T and SCC_AUD_REENCODER_CONFIG_T
typedef enum
{
    AUD_DEC_REENCODER_FMT_DTS = 0,
    AUD_DEC_REENCODER_FMT_DDCO
} AUD_DEC_REENCODER_FMT_T;

typedef struct _AUD_DEC_REENCODER_CONFIG_T
{
    AUD_DEC_REENCODER_FMT_T e_reencoder_fmt;
    BOOL                    b_enable;
} AUD_DEC_REENCODER_CONFIG_T;

typedef struct _AUD_DEC_REENCODER_CONFIG_EX_T
{
    AUD_DEC_REENCODER_CONFIG_T r_config;
    BOOL                       b_force_reinit; // flag for HDMI hot-plug
} AUD_DEC_REENCODER_CONFIG_EX_T;



/*
 *  Audio Encoder Interface define (Ripping / Skype)
 *  -- Water (AUD_RIPPING)
 */

/* Encoder Generic Command List (all command to encoder should contain with this base type) */
typedef enum
{
    // Encoder instance create & destroy
    AUD_ENCODER_CMD_CREATE = 1,                 // with AUD_ENCODER_CREATE_T para
    AUD_ENCODER_CMD_DESTROY,                    // with AUD_ENCODER_CREATE_T para

    // Encoder Flow Control Command
    AUD_ENCODER_CMD_START,                      // with AUD_ENCODER_CMD_PROC_T para
    AUD_ENCODER_CMD_FLUSH,                      // with AUD_ENCODER_CMD_PROC_T para
    AUD_ENCODER_CMD_STOP,                       // with AUD_ENCODER_CMD_PROC_T para

    // Encoder config command
    AUD_ENCODER_CMD_SET,                        // with set related para (ex. AUD_ENCODER_SET_RIP_MP3_CFG_T @ Ripping)
    AUD_ENCODER_CMD_GET,                        // with get related para (ex. AUD_ENCODER_GET_RIP_DATA_INFO_T @ Ripping)
} AUD_ENCODER_CMD_T;


/* Encoder generic encode format type list */
typedef enum
{
    AUD_ENCODER_FMT_NULL = 0,
    AUD_ENCODER_FMT_RIP_MP3,                    // ripping use mp3 encoder
    AUD_ENCODER_2ND_FMT_PCM,                    // Encoder 2n PCM
    AUD_ENCODER_FMT_RIP_PCM,                    // PCM Encoder -- Water (aud_pcmenc) 20100915 // (aud_porting) -- Water 2010-12-26
} AUD_ENCODER_FMT_T;

/* Encoder inst create and destroy para structure define */
typedef struct                                  // Create & Destroy Cmd need this type
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = Create / Destroy Cmd
    AUD_ENCODER_FMT_T               tEncType;   // with Encoder type (AUD_ENCODER_FMT_RIP_MP3/AUD_ENCODER_FMT_SKYPE...)
    // Other ... TBD
} AUD_ENCODER_CREATE_T;

/* Encoder basic command type (Cmd used normally) */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = Start / Flush / Stop
} AUD_ENCODER_CMD_PROC_T;

/* Encoder set config sub type list */
typedef enum                                    // Define Encoder Set cmd sub type
{
    AUD_ENCODER_SET_RIP_MP3_CFG = 1,
    AUD_ENCODER_SET_RIP_READ_PTR,
    AUD_ENCODER_2ND_SET_PCM_READ_PTR,           // (aud_porting) -- Water 2010-12-26
    AUD_ENCODER_2ND_SET_PCM_FROM_SRC,           // (aud_grace_primary) -- Water 2011-06-08
} AUD_ENCODER_SET_SUB_TYPE_T;

/* Encoder get config sub type list */
typedef enum                                    // Define Encoder get cmd sub type
{
    AUD_ENCODER_GET_RIP_DATA_INFO = 1,

    AUD_ENCODER_GET_PCM_SOURCE_INFO,  // Get pcm source infor: sample rate / channel count / bit length / ...


    // (aud_porting) -- Water 2010-12-26
    AUD_ENCODER_2ND_GET_PCM_SOURCE_INFO,        // Get pcm source infor: sample rate / channel count / bit length / ...
    AUD_ENCODER_2ND_GET_PCM_DATA_INFO,          // (aud_porting) -- Water 2010-12-26
} AUD_ENCODER_GET_SUB_TYPE_T;

/* Encoder set config basic item (all set config command should contain thouse basic type items) */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_SETCFG @ Ripping mode & use mp3 encoder
    AUD_ENCODER_SET_SUB_TYPE_T      tSetType;   // tSetType = Set sub type
} AUD_ENCODER_SET_BASE_T;

/* Encoder get config basic item (all get config command should contain thouse basic type items) */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_GET_RIP_DATAINFO @ Ripping mode
    AUD_ENCODER_GET_SUB_TYPE_T      tGetType;   // tGetType = Get sub type
} AUD_ENCODER_GET_BASE_T;

/*
 *  Ripping use MP3 encoder detailed structure define
 */
/* Ripping mode define 1X or high speed (fast) mode */
typedef enum
{
    AUD_ENCODER_RIP_NORMAL = 0,                 // 0. Normal speed (1X)
    AUD_ENCODER_RIP_HIGH_SPEED,                 // 1. High speed (Fast) may be >= 4X (aout is mute)
    // (aud_porting) -- Water 2010-12-26
    AUD_ENCODER_RIP_BG_MODE,                    // 2. Set as BG mode background ripping -- Water (aud_bgrip) 20101008
    AUD_ENCODER_RIP_LINE_IN,			// 3.For Line In Ripping Mode
} AUD_ENCODER_RIP_MODE_T;

/* Mp3 encoder bit rate define */
typedef enum
{
    AUD_RIP_MP3_BRATE_NONE = 0x00,              // 0x00
    AUD_RIP_MP3_BRATE_48K = 0x03,               // 0x03
    AUD_RIP_MP3_BRATE_56K,                      // 0x04
    AUD_RIP_MP3_BRATE_64K,                      // 0x05
    AUD_RIP_MP3_BRATE_80K,                      // 0x06
    AUD_RIP_MP3_BRATE_96K,                      // 0x07
    AUD_RIP_MP3_BRATE_112K,                     // 0x08
    AUD_RIP_MP3_BRATE_128K,                     // 0x09
    AUD_RIP_MP3_BRATE_160K,                     // 0x0A
    AUD_RIP_MP3_BRATE_192K,                     // 0x0B
    AUD_RIP_MP3_BRATE_224K,                     // 0x0C
    AUD_RIP_MP3_BRATE_256K,                     // 0x0D
    AUD_RIP_MP3_BRATE_320K,                     // 0x0E
} AUD_ENCODER_RIP_MP3_BITRATE_T;

/* Ripping use mp3 encoder type config setting */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_SETCFG @ Ripping mode & use mp3 encoder
    AUD_ENCODER_SET_SUB_TYPE_T      tSetType;   // tSetType = AUD_ENCODER_SET_RIP_MP3_CFG
    AUD_ENCODER_RIP_MODE_T          tRipMode;   // tRipMode = AUD_ENCODER_RIP_MODE_T
    AUD_ENCODER_RIP_MP3_BITRATE_T   tBitRate;   // tBitRate = AUD_ENCODER_RIP_MP3_BITRATE_T
} AUD_ENCODER_SET_RIP_MP3_CFG_T;

/* Ripping update read pointer (release fifo date used) */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_SET_RIP_READ_PTR @ Ripping mode
    AUD_ENCODER_SET_SUB_TYPE_T      tSetType;   // tSetType = AUD_ENCODER_SET_RIP_READ_PTR
    UINT32                          u4ReadPtr;  // target read pointer address (user space address)
} AUD_ENCODER_SET_RIP_RPTR_T;

/* Get Ripping bit stream buffer information and stats */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_GET_RIP_DATAINFO @ Ripping mode
    AUD_ENCODER_GET_SUB_TYPE_T      tGetType;   // tGetType = AUD_ENCODER_GET_RIP_DATA_INFO
    UINT32                          u4BufSa;    // bit stream buffer start address (user space address)
    UINT32                          u4BufEa;    // bit stream buffer end address (user space address)
    UINT32                          u4CurRPtr;  // bit stream current read pointer address  (user space address)
    UINT32                          u4CurWPtr;  // bit stream current write pointer address (user space address)
    BOOL                            fgEncodeDone;// FALSE: Still encoding, TRUE: No more data to encode
    BOOL                            fgUsable;
    UINT64                          u8StartPts;
} AUD_ENCODER_GET_RIP_DATA_INFO_T;


typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_GET_RIP_DATAINFO @ Ripping mode
    AUD_ENCODER_GET_SUB_TYPE_T      tGetType;   // tGetType = AUD_ENCODER_GET_RIP_DATA_INFO
    UINT32                          u4SampleRate;   // pcm sample rate: 8000/11025/16000/22050/32000/44100/48000....
    UINT32                          u4ChannelCnt;   // pcm output channel count: 1/2
    UINT32                          u4BitResolution;// pcm output bit resolution: 16/24
    BOOL                            fgSourceReady;  // PCM output source ready or not: TRUE/FALSE
} AUD_ENCODER_GET_PCM_SOURCE_INFO_T;


// (aud_porting) -- Water 2010-12-26
/* Get Encoder 2nd PCM source information and stats -- Water (aud_gracenote) */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_GET_RIP_DATAINFO @ Ripping mode
    AUD_ENCODER_GET_SUB_TYPE_T      tGetType;   // tGetType = AUD_ENCODER_GET_RIP_DATA_INFO
    UINT32                          u4SampleRate;   // pcm sample rate: 8000/11025/16000/22050/32000/44100/48000....
    UINT32                          u4ChannelCnt;   // pcm output channel count: 1/2
    UINT32                          u4BitResolution;// pcm output bit resolution: 16/24
    BOOL                            fgSourceReady;  // PCM output source ready or not: TRUE/FALSE
} AUD_ENCODER_2ND_GET_PCM_SOURCE_INFO_T;

// (aud_porting) -- Water 2010-12-26
/* Get Encoder 2nd PCM buffer information and stats -- Water (aud_gracenote) */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_GET_RIP_DATAINFO @ Ripping mode
    AUD_ENCODER_GET_SUB_TYPE_T      tGetType;   // tGetType = AUD_ENCODER_GET_RIP_DATA_INFO
    UINT32                          u4BufSa;    // bit stream buffer start address (user space address)
    UINT32                          u4BufEa;    // bit stream buffer end address (user space address)
    UINT32                          u4CurRPtr;  // bit stream current read pointer address  (user space address)
    UINT32                          u4CurWPtr;  // bit stream current write pointer address (user space address)
    BOOL                            fgEncodeDone;// FALSE: Still encoding, TRUE: No more data to encode
    BOOL                            fgUsable;   // Get info usable or not: TRUE(usable) / FALSE(disable) //[4TH_DECORDER]
} AUD_ENCODER_2ND_GET_PCM_DATA_INFO_T;

// (aud_porting) -- Water 2010-12-26
/* Encoder 2n update PCM read pointer (release fifo date used) -- Water (aud_gracenote) */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_SET_RIP_READ_PTR @ Ripping mode
    AUD_ENCODER_SET_SUB_TYPE_T      tSetType;   // tSetType = AUD_ENCODER_SET_RIP_READ_PTR
    UINT32                          u4ReadPtr;  // target read pointer address (user space address)
} AUD_ENCODER_2ND_SET_PCM_RPTR_T;

// (aud_grace_primary) -- Water 2011-06-08

typedef enum
{
    AUD_ENCODER_2ND_PCM_FROM_4TH_DEC = 0,
    AUD_ENCODER_2ND_PCM_FROM_PRI_DEC,
} AUD_ENCODER_2ND_PCM_FROM_SRC_T;

/* Encoder 2nd set pcm from source primary or 4th decoder */
typedef struct
{
    AUD_ENCODER_CMD_T               tEncCmd;    // tEncCmd = AUD_ENCODER_CMD_SET
    AUD_ENCODER_SET_SUB_TYPE_T      tSetType;   // tSetType = AUD_ENCODER_2ND_SET_PCM_FROM_SRC
    AUD_ENCODER_2ND_PCM_FROM_SRC_T  tPcmFromSrc;// Set target PCM from source 4th Decoder (default) or Primary Decoder
} AUD_ENCODER_2ND_SET_PCM_FROM_SRC_T;
#if UNIFORM_DRV_CALLBACK
// for watermark internal callback function
typedef struct
{
  x_drv_cb_nfy_fct pf_aud_aw_nfy;
  VOID *pvTag;
}AUD_DEC_WATERMARK_FCT_T;

// for watermark event callback function
typedef struct
{
  UINT8 ui1CmValue;
  UINT16 ui2ArSet;
  VOID*pvUser_data;
} AUD_DEC_WM_EVENT_CB_INFO_T;

typedef struct
{
    x_drv_cb_nfy_fct pf_aud_aw_event_nfy;
    VOID *pvTag;
} AUD_DEC_WATERMARK_EVENT_FCT_T;
#else
// for watermark internal callback function
typedef VOID (*x_aud_aw_fct) (VOID* pvParam);

typedef struct
{
    x_aud_aw_fct  pf_aud_aw_nfy;
    VOID *pvParam;
} AUD_DEC_WATERMARK_FCT_T;

// for watermark event callback function
typedef INT32 (*x_aud_aw_event_fct) (UINT8 ui1CmValue, UINT16 ui2ArSet, VOID*pvUser_data);

typedef struct
{
    x_aud_aw_event_fct  pf_aud_aw_event_nfy;
    VOID *pvParam;
} AUD_DEC_WATERMARK_EVENT_FCT_T;
#endif

typedef struct
{
    AUD_DEC_MUTE_TYPE_T eMuteType;
    AUD_DEC_MUTE_SRC_T eMuteSrc;
}   AUD_DEC_GLOBAL_MUTE_T;

typedef struct
{
    UINT32 u4DspAVer;
    UINT32 u4DspBVer;
    UINT32 u4DspCVer;
} AUD_DEC_DSP_VERSION_T;

// for max speaker config behavior control
typedef enum
{
    AUD_DEC_MAXSPEAKERCFG_DEFAULT,        // default mode, care both speaker setting and HDMI sink capability
    AUD_DEC_MAXSPEAKERCFG_SPEAKER_ONLY,   // only care speaker setting
    AUD_DEC_MAXSPEAKERCFG_HDMI_ONLY       // only care HDMI sink capability
} AUD_DEC_MAXSPEAKERCFG_OPTION_T;

typedef enum
{
    AUD_DEC_MUTE_CTRL_APP       = 0,
    AUD_DEC_MUTE_CTRL_PB        = 1,
    AUD_DEC_MUTE_CTRL_AWD       = 2,  // global mute for Audio Watermark
    AUD_DEC_MUTE_CTRL_BDDOT     = 3,  // mute SPDIF(PCM/RAW) and Analog
    AUD_DEC_MUTE_CTRL_WMDRM     = 4,  // mute SPDIF(PCM/RAW) and HDMI(PCM/RAW)
    AUD_DEC_MUTE_CTRL_AUDIN      = 5,  //  mute
    AUD_DEC_MUTE_CTRL_DIR_HW_ERR = 6,  // If DIR notifies mass intr, APP/PBMG/MPE/LPE/MPC/AIH's state will be not under control.(how to fix?)
    AUD_DEC_MUTE_CTRL_BT_APP     = 7,  // Add for Sony BT APP to mute HDMI in MSB11G and MSA3G
    AUD_DEC_MUTE_CTRL_RISC_OUT   = 8, // Add for mute Risc out
    // Temporarily, we mute the output to avoid noise.
    // add new type here
    AUD_DEC_MUTE_CTRL_ONLY_RAW  = 13, // Only Mute SPDIF & HDMI raw output
    AUD_DEC_MUTE_CTRL_FORCE     = 14, // force unmute and clear mute flag (currently not used)
    AUD_DEC_MUTE_CTRL_AU_PROC   = 15, // for abnormal AU process
    AUD_DEC_MUTE_CTRL_RESERVED  = 16,
    AUD_DEC_MUTE_CTRL_DRV_ALLOUT  = 12, //mute Analog & SPDIF(PCM/RAW) & HDMI(PCM/RAW) --(aud_efuse_DTS/Dolby)  --zhengwen 2011/12/15
} AUD_DEC_MUTE_CTRL_SOURCE_T;

/* PROLOGICII type */
typedef enum
{
    AUD_SE_PL2_CTRL_SWITCH = 0,
    AUD_SE_PL2_CTRL_MODE,
    AUD_SE_PL2_CTRL_PANORAMA,
    AUD_SE_PL2_CTRL_DIMENSION,
    AUD_SE_PL2_CTRL_C_WIDTH,
    AUD_SE_PL2_CTRL_OUTPUT_CH
}   AUD_SE_PL2_CTRL_T;

typedef enum
{
    AUD_DEC_PL2_STATUS_UNKNOWN = 0,
    AUD_DEC_PL2_STATUS_OFF,
    AUD_DEC_PL2_STATUS_PROLGIC_EMULATION,
    AUD_DEC_PL2_STATUS_VIRTUAL,
    AUD_DEC_PL2_STATUS_MUSIC,
    AUD_DEC_PL2_STATUS_MOVIE,
    AUD_DEC_PL2_STATUS_MATRIX,
    AUD_DEC_PL2_STATUS_CUSTOM
}   AUD_DEC_PL2_STATUS_T;

typedef enum
{
    AUD_DEC_AAC_FMT_INV = 0,
    AUD_DEC_AAC_FMT_AAC,
    AUD_DEC_AAC_FMT_HEAAC_V1,
    AUD_DEC_AAC_FMT_HEAAC_V2
}   AUD_DEC_AAC_FMT_T;

typedef enum
{
    AUD_SE_PL2_OUTPUT_AUTO = 0,
    AUD_SE_PL2_OUTPUT_5CH
}   AUD_SE_PL2_OUTPUT_CH_T;

/* switch operation value */
typedef enum
{
    AUD_SE_PL2_SWITCH_OFF = 0,
    AUD_SE_PL2_SWITCH_ON,
    AUD_SE_PL2_SWITCH_AUTO
}   AUD_SE_PL2_SWITCH_T;


/* mode operation value */
typedef enum
{
    AUD_SE_PL2_MODE_PROLGIC_EMULATION = 0,
    AUD_SE_PL2_MODE_VIRTUAL,
    AUD_SE_PL2_MODE_MUSIC,
    AUD_SE_PL2_MODE_MOVIE,
    AUD_SE_PL2_MODE_MATRIX,
    AUD_SE_PL2_MODE_CUSTOM
}   AUD_SE_PL2_MODE_T;

/* Panorama operation value */
typedef enum
{
    AUD_SE_PL2_PANORAMA_OFF = 0,
    AUD_SE_PL2_PANORAMA_ON

}   AUD_SE_PL2_PANORAMA_T;

/* Dimension operation value */
typedef enum
{
    AUD_SE_PL2_DIMENSION_0 = 0,
    AUD_SE_PL2_DIMENSION_1,
    AUD_SE_PL2_DIMENSION_2,
    AUD_SE_PL2_DIMENSION_3,
    AUD_SE_PL2_DIMENSION_4,
    AUD_SE_PL2_DIMENSION_5,
    AUD_SE_PL2_DIMENSION_6
}   AUD_SE_PL2_DIMENTION_T;

/* C width operation value */
typedef enum
{
    AUD_SE_PL2_C_WIDTH_0 = 0,
    AUD_SE_PL2_C_WIDTH_1,
    AUD_SE_PL2_C_WIDTH_2,
    AUD_SE_PL2_C_WIDTH_3,
    AUD_SE_PL2_C_WIDTH_4,
    AUD_SE_PL2_C_WIDTH_5,
    AUD_SE_PL2_C_WIDTH_6,
    AUD_SE_PL2_C_WIDTH_7
}   AUD_SE_PL2_C_WIDTH_T;

typedef struct AUD_SE_PL2_VAL_MIN_MAX_T
{
    UINT8      ui1_curr_val;
    UINT8      ui1_min_val; /* Only used in AUD_DRV_GET_TYPE_PL2_CTRL */
    UINT8      ui1_max_val; /* Only used in AUD_DRV_GET_TYPE_PL2_CTRL */
} AUD_SE_PL2_VAL_MIN_MAX_T;

typedef struct AUD_SE_PL2_CTRL_INFO_T
{
    AUD_SE_PL2_CTRL_T    e_ctrlID; /* IN */

    union
    {
        AUD_SE_PL2_SWITCH_T         e_pl2_switch;
        AUD_SE_PL2_MODE_T           e_pl2_mode;
        AUD_SE_PL2_PANORAMA_T       b_is_pl2_panorama_on;
        AUD_SE_PL2_VAL_MIN_MAX_T    t_pl2_dim_val;
        AUD_SE_PL2_VAL_MIN_MAX_T    t_pl2_c_width_val;
        AUD_SE_PL2_OUTPUT_CH_T      e_pl2_output_ch;
    } u_value;

} AUD_SE_PL2_CTRL_INFO_T;


/*
 *  Neo6 Coefficient Struct Type define
 */

/* neo6 type */
typedef enum
{
    AUD_NEO6_MODE_MUSIC = 0,
    AUD_NEO6_MODE_CINEMA
}   AUD_NEO6_MODE_T;

typedef enum
{
    AUD_NEO6_CGAIN_ZERO = 0,
    AUD_NEO6_CGAIN_POINT3 = 0x2666,
    AUD_NEO6_CGAIN_POINT5 = 0x4000,
    AUD_NEO6_CGAIN_ONE = 0x7FFF
} AUD_NEO6_CGAIN_T;

typedef struct
{
    AUD_NEO6_MODE_T u4Mode;
    AUD_NEO6_CGAIN_T u4Gain;
} AUD_SE_NEO6_COEF_T;

//for PHI 2010 module logo
typedef enum
{
    AUD_DEC_LOGO_ATMOS,
    AUD_DEC_LOGO_TRUEHD,
    AUD_DEC_LOGO_DD_PLUS,
    AUD_DEC_LOGO_DD,
    AUD_DEC_LOGO_DTS20,
    AUD_DEC_LOGO_DTS_ADO,
    AUD_DEC_LOGO_DTS_HD_MA,
    AUD_DEC_LOGO_DTS_HD_MA_ESS,
    AUD_DEC_LOGO_DTS_DIGI_SURR
}AUD_DEC_MODULE_LOGO_INFO_T;

typedef enum
{
    AUD_DEC_DIV_TYPE_LOGO_DOLBY,
    AUD_DEC_DIV_TYPE_LOGO_DTS,
    AUD_DEC_DIV_TYPE_ANALOG_OUTPUT_CHANNEL,
    AUD_DEC_DIV_TYPE_HDMI_OUTPUT_CHANNEL,
    AUD_DEC_DIV_TYPE_POST_PROCESS,
    AUD_DEC_DIV_TYPE_CODEC_SUPPORT
}AUD_DEC_DIV_TYPE_T;

typedef struct _AUD_DEC_DIV_INFO_T
{
    AUD_DEC_DIV_TYPE_T     e_type;
    UINT8                  u1_setting;
} AUD_DEC_DIV_INFO_T;


typedef enum// new add 2007/9/12
{
  HDMI_CLK_FS_16K= 0x00,
  HDMI_CLK_FS_22K,
  HDMI_CLK_FS_24K,
  HDMI_CLK_FS_32K,
  HDMI_CLK_FS_44K,
  HDMI_CLK_FS_48K,
  HDMI_CLK_FS_64K,
  HDMI_CLK_FS_88K,
  HDMI_CLK_FS_96K,
  HDMI_CLK_FS_176K,
  HDMI_CLK_FS_192K,
  HDMI_CLK_FS512_44K,//for DSD
  HDMI_CLK_FS_768K,
  HDMI_CLK_FS128_44k,
  HDMI_CLK_FS_UNKOWN
} HDMI_CLK_AUDIO_SAMPLING_T;

typedef struct _AUD_DEC_HDMI_CLK_INFO_T
{
    HDMI_CLK_AUDIO_SAMPLING_T e_fs;
    I2S_CLK_SAMPLE_FREQUENCY_T e_mclk;
} AUD_DEC_HDMI_CLK_INFO_T;

//for PHI 2010 module aout
typedef enum
{
    AUD_DEC_AOUT_STEREO_CHANNEL,
    AUD_DEC_AOUT_MULTI_CHANNEL
}AUD_DEC_MODULE_AOUT_CHANNEL_INFO_T;

//for PHI 2010 module ddco
typedef enum
{
    AUD_DEC_AOUT_DDCO
}AUD_DEC_MODULE_DDCO_INFO_T;

//for PHI 2010 module bass management
typedef enum
{
    AUD_DEC_BMANAGEMENT_STEREO_CHANNEL,
    AUD_DEC_BMANAGEMENT_MULTI_CHANNEL
}AUD_DEC_MODULE_BMANAGEMENT_CHANNEL_INFO_T;

typedef enum{
    AUD_DEC_WIFI_AUD_CTRL_ON = 0,
    AUD_DEC_WIFI_AUD_CTRL_OFF,
    AUD_DEC_WIFI_AUD_CTRL_STATUS
} AUD_DEC_WIFI_AUD_CRTL_TYPE_T;

typedef struct
{
    UINT8   u1OutputChNum; //Ex: 2ch output=2 ; 8ch output=8
    UINT32  u4OutputOrder; //Pair 0=L/R ;Pair 1=C/LFE ;Pair 2=SLB/SRB ;Pair 3=SL/SR; Pair 4=Ch9/Ch10
} AUD_DRV_WIFI_SETTING_T;

typedef struct{
    AUD_DEC_WIFI_AUD_CRTL_TYPE_T eCtrlID;
    union{
        AUD_DRV_WIFI_SETTING_T tWifiAudChSetting;
    }u_value;
} AUD_DEC_WIFI_AUD_CTRL_INFO_T;

//for PHI 2010 feature
typedef enum
{
    AUD_DEC_PROLOGICII,
    AUD_DEC_SACD,
    AUD_DEC_DISABLE_AAC_PCM_OUTPUT,
    AUD_DEC_MPEG_AAC,
    AUD_DEC_AAC_HEv1,
    AUD_DEC_AAC_HEv2,
    AUD_DEC_NEO6,
    AUD_DEC_AUDIOIN,            // (aud_efuse) -- Water 20101026, Add efuse HW audio feature bonding
    AUD_DEC_WMA,                // (aud_efuse) -- Water 20101026, Add efuse HW audio feature bonding
}AUD_DEC_FEATURE_INFO_T;

//for PHI 2010 module hdmi
typedef enum
{
     AUD_DEC_HDMI_DD_OUTPUT_2,
     AUD_DEC_HDMI_DD_OUTPUT_5_1,
     AUD_DEC_HDMI_DD_OUTPUT_7_1,
     AUD_DEC_HDMI_DTS_OUTPUT_2,
     AUD_DEC_HDMI_DTS_OUTPUT_5_1,
     AUD_DEC_HDMI_DTS_OUTPUT_7_1,
    AUD_DEC_HDMI_AAC_OUTPUT_2,
    AUD_DEC_HDMI_AAC_OUTPUT_5_1,
    AUD_DEC_HDMI_AAC_OUTPUT_7_1,
     AUD_DEC_HDMI_OTHER_CODEC_OUTPUT_2,
     AUD_DEC_HDMI_OTHER_CODEC_OUTPUT_5_1,
     AUD_DEC_HDMI_OTHER_CODEC_OUTPUT_7_1
}AUD_DEC_MODULE_HDMI_INFO_T;

//for PHI 2010 module analog
// (aud_spk_mod) -- QingZ 2010-11-30
typedef enum
{
     AUD_DEC_SPK_DD_OUTPUT_2,
     AUD_DEC_SPK_DD_OUTPUT_5_1,
     AUD_DEC_SPK_DD_OUTPUT_7_1,
     AUD_DEC_SPK_DTS_OUTPUT_2,
     AUD_DEC_SPK_DTS_OUTPUT_5_1,
     AUD_DEC_SPK_DTS_OUTPUT_7_1,
     AUD_DEC_SPK_OTHER_CODEC_OUTPUT_2,
     AUD_DEC_SPK_OTHER_CODEC_OUTPUT_5_1,
     AUD_DEC_SPK_OTHER_CODEC_OUTPUT_7_1
}AUD_DEC_MODULE_SPK_T;
//for PHI 2010 DD coefficient clev and slev
typedef struct
{
    UINT8 dd_clev;
    UINT8 dd_slev;
}AUD_DEC_DD_CLEV_SLEV;

//LID (aud_se_lid)structure
typedef struct {
    UINT32 u4LidMaxValue;      //max sample value
    UINT32 u4LidAverageValue;       //average sample value
}AUD_SE_LID_VALUE_COEF_T;
//for PHI 2010 TRUEHD gain
typedef struct
{
    UINT8 truehd_gain;
}AUD_DEC_TRUEHD_GAIN;

typedef enum
{
     AUD_DEC_CDDA_OUTPUT_PCM,
     AUD_DEC_CDDA_OUTPUT_RAW,
     AUD_DEC_HDCD_OUTPUT_PCM,
     AUD_DEC_HDCD_OUTPUT_RAW
}AUD_DEC_CD_OUTPUT_MODE_T;

typedef enum
{
	AUD_ASDATA_0,
	AUD_ASDATA_1,
	AUD_ASDATA_2,
	AUD_ASDATA_3,
	AUD_ASDATA_4,
	AUD_ASDATA_5
}AUD_ASDATA_SELECT;


typedef enum
{
	AUD_CH_1_2,
	AUD_CH_3_4,
	AUD_CH_5_6,
	AUD_CH_7_8,
	AUD_CH_9_10,
	AUD_CH_11_12
}AUD_ASDATA_CH;

typedef struct _AUD_SET_ASDATA_CH_T
{
    AUD_ASDATA_SELECT     aud_asdata_select;
    AUD_ASDATA_CH           aud_asdata_ch;
} AUD_ASDATA_CH_T;

typedef struct _AUD_SET_ASDATA_CH_ALL_T
{
    AUD_ASDATA_SELECT     aud_asdata_select[6];
    AUD_ASDATA_CH           aud_asdata_ch[6];
} AUD_ASDATA_CH_ALL_T;

typedef struct _AUD_SET_ALSA_VOL_MUTE_T
{
    BOOL     fgMute;
    UINT32   u4Vol;
} AUD_SET_ALSA_VOL_MUTE_T;

typedef enum{
    AUD_SET_ALSA_REG_FULL_STOP_CB,
    AUD_SET_ALSA_UNREG_FULL_STOP_CB,
    AUD_SET_ALSA_REG_OPEN_CB,
    AUD_SET_ALSA_UNREG_OPEN_CB,
    AUD_SET_ALSA_REG_STATE_CB,
    AUD_SET_ALSA_UNREG_STATE_CB,

    AUD_SET_ALSA_CTRL_NUM
}AUD_SET_ALSA_CTRL_TYPE;

//mtk07990, used to callback current alsa state, ex. start/pause/resume/stop..
//if needed we can extend other state, just like aout off, aout on, alsa card open, alsa card free.
typedef enum
{
     AUD_GET_ALSA_START,
     AUD_GET_ALSA_PAUSE_PUSH,
     AUD_GET_ALSA_PAUSE_RELEASE,
     AUD_GET_ALSA_STOP,
     AUD_GET_ALSA_PLAYBACK_HW_FREE,
     AUD_GET_ALSA_FIRST_AOUT_NOTIFY,

     AUD_GET_ALSA_STATE_NUM
}AUD_GET_ALSA_STATE;

typedef enum{
    AUD_SET_ESM_CB,
#if CONFIG_DRV_DSPB_TO_RISC
    AUD_SET_DSPB_CB,
#endif
    AUD_SET_COMMDRV_CB
}AUD_SET_DEC_MGR_CTRL_TYPE;

typedef struct _AUD_SET_COMMDRV_CTRL_T
{
    AUD_SET_DEC_MGR_CTRL_TYPE     eCtrlType;
    //used to callback alsa state, ex. alsa start/pause/resume/stop
    DRV_CB_REG_INFO_T tCallbackInfo;

} AUD_SET_COMMDRV_CTRL_T;

typedef struct _AUD_SET_ALSA_CTRL_T
{
    AUD_SET_ALSA_CTRL_TYPE     eCtrlType;
    union
    {
        DRV_CB_REG_INFO_T tAlsaFullStopCallbackInfo;
        DRV_CB_REG_INFO_T tAlsaOpenCallbackInfo;
        //used to callback alsa state, ex. alsa start/pause/resume/stop
        DRV_CB_REG_INFO_T tAlsaStateCallbackInfo;
    } u_value;
} AUD_SET_ALSA_CTRL_T;

typedef enum{
    AUD_SET_APLL_ADJ_LVL,
    AUD_SET_NON_SYNC_DURATION_THRESHOLD,
    AUD_SET_INCONVENIENT_NON_SYNC_THRESHOLD,

    AUD_SET_SYS_MSTR_CFG_NUM
}AUD_SYS_MSTR_CONFIG_TYPE;

typedef struct _AUD_SET_SYS_MSTR_CONFIG_T
{
    AUD_SYS_MSTR_CONFIG_TYPE     eCfgType;
    union
    {
        UINT32 u4AudApllLevelSetting;
        UINT32 u4NonSyncDurationThreshold;   // Unit: seconds
        UINT32 u4InconvenientNonSyncThreshld; // Unit: ms
    } u_value;
} AUD_SET_SYS_MSTR_CONFIG_T;
#if 0
typedef enum
{
    AUD_DEC_HDMI_OUTPUT_2,
    AUD_DEC_HDMI_OUTPUT_5_1,
    AUD_DEC_HDMI_OUTPUT_7_1
}AUD_DEC_MODULE_HDMI_CHANNEL_INFO_T;

typedef enum
{
    AUD_DEC_HDMI_DD,
    AUD_DEC_HDMI_DTS,
    AUD_DEC_HDMI_UNKNOWN
}AUD_DEC_MODULE_HDMI_CODEC_TYPE_INFO_T;

typedef struct
{
	AUD_DEC_MODULE_HDMI_CODEC_TYPE_INFO_T             hdmi_codec_type;
	AUD_DEC_MODULE_HDMI_CHANNEL_INFO_T                   hdmi_channel;
}AUD_DEC_MODULE_HDMI_INFO_T;
#endif


/* microphone ctrl */

enum MicOpCode
{
    MIC_SET_INIT,
    MIC_SET_UNINIT,
    MIC_SET_ON_OFF,
    MIC_SET_VOLUME1,
    MIC_SET_VOLIME2,
    MIC_SET_THRESHOLD,
    MIC_SET_ATT_MUSIC,
    MIC_SET_ATT_MUSIC_EX,
    MIC_SET_ECHO_VOLUME,
    MIC_SET_ECHO_FBGAIN,
    MIC_SET_ECHO_DELAY,
    MIC_SET_LEVEL_ORDER,
    MIC_SET_CH_MIX,
    MIC_SET_MIC_AUDIO_MIX
#if CONFIG_DRV_MIC_HLCANCEL_SUPPORT
    ,
    MIC_SET_HOWLING_CANCEL
#endif
};

struct MicThreshold
{
    // mute < unmute
    UINT32              u4ThresholdMute;
    UINT32              u4ThresholdUnmute;
};

#define  AUD_MIC_MIXING_TO_L_R           ((1 << 1) << 8)
#define  AUD_MIC_MIXING_TO_LS_RS         ((1 << 2) << 8)
#define  AUD_MIC_MIXING_TO_C             ((1 << 3) << 8)
#define  AUD_MIC_MIXING_TO_EXT_CH1_CH2   ((1 << 4) << 8)
#define  AUD_MIC_MIXING_TO_DMX_CH1_CH2   ((1 << 5) << 8)
#define  AUD_MIC_MIXING_TO_CH11_CH12     ((1 << 6) << 8)
#define  AUD_MIC_MIXING_TO_SUB           ((1 << 7) << 8)
#define  AUD_MIC_DEFAULT_MIXING   (AUD_MIC_MIXING_TO_L_R)

enum AudMicChannelMixType
{
    AUD_MIC_CHANNEL_MIX_AOUT1,
    AUD_MIC_CHANNEL_MIX_AOUT2
};

struct AudMicChannelMix
{
    enum AudMicChannelMixType eMixType;
    UINT32 u4ChannelMix;
};

struct AudMicInitPara
{
    x_drv_cb_nfy_fct vMicOpDoneNotify;
};

struct AudMicLevelOrder
{
    UINT32 u4LevelUpOrder;
    UINT32 u4LevelDownOrder;
};

union MicOpData
{
    struct AudMicInitPara rMicInitPara;
    BOOL                fgOn;
    UINT32              u4Volume1;
    UINT32              u4Volume2;
    struct MicThreshold rThreshold;
    UINT32              u4AttMusic;
    UINT32              u4EchoVolume;
    UINT32              u4EchoFBGain;
    UINT32              u4EchoDelayMS;
    struct AudMicLevelOrder rLevelOrder;
    struct AudMicChannelMix rChannelMix;
    BOOL                fgMicAudioMix;
#if CONFIG_DRV_MIC_HLCANCEL_SUPPORT
    BOOL                fgHowlingCancel;
#endif
};

struct MicCtrl
{
    enum  MicOpCode     eOpCode;  //select one operation
    union MicOpData     rOpData;  //the parameters of this operation
};

/* microphone ctrl end */


enum AudPath
{
    AUD_PATH_GENERAL,
    AUD_PATH_SKYPE
};

/*
 *  Audio Mini SCC level set config interface struct type (aud_mini_set_cfg) -- Water 2010-05-13
 */
#define AUD_MINI_SET_CFG_DTS_ENC_OPT        (1)     // DTS Encoder option code (encode follow side info or fixed 5.x)
#define AUD_MINI_SET_CFG_HDMI_DOWNSAMPLE    (2)     // HDMI downsample setting
#define AUD_MINI_SET_CFG_HDMI_DOLBY_MAX_CH  (3)     // HDMI Dolby Max channel config    // (aud_hdmi_dolby_max_ch)
#define AUD_MINI_SET_CFG_SPDIF_RAW_MUTE_CFG (4)     // SPDIF raw mute config
#define AUD_MINI_SET_CFG_CUS_FUNC0_CFG      (5)     // Customer function config (aud_cus_func) -- Water 20101020
#define AUD_MINI_SET_CFG_CUS_OPT1           (6)     // Set customer id (aud_cus_opt1) -- Water 20101020
#define AUD_MINI_SET_CFG_DEC_MUTE_FLAG      (7)     // Add for decoder mute select (aud_dec_mute) -- Water 2010-12-08
#define AUD_MINI_SET_CFG_AAC_RAW_VIA_SPDIF  (8)     // Add AAC raw output via SPDIF function enable setting (aud_aac_spdif) -- Water 2010-12-15
#define AUD_MINI_SET_CFG_HDMI_2CH_TYPE_SEL  (9)     // Add HDMI 2ch output type select Lo/Ro or Lt/Rt --> By User (aud_hdmi_2ch_type) -- Water 2011-10-25
#define AUD_MINI_SET_CFG_INFO_SHOW          (10)    // Show information for user's cli level (aud_info_show) -- Water 2011-10-25
#define AUD_MINI_SET_CFG_WMA_BD_FLAG        (11)         //Add wma bonding  --zhengwen 2011/12/26
#define AUD_MINI_SET_CFG_SPDIF_HW_CTRL          (12)   //CRTL 5014 BIT12
#define AUD_MINI_SET_CFG_128BITMOD_SWITCH_CTRL          (13)
#define AUD_MINI_SET_CFG_DTS_LFE_FORCE_FILTER  (14)    // Add for control if dts lfe channel need do force iir filter
#define AUD_MINI_SET_CFG_SOURCE_CH         (15)      // bingh:get true source channel,not Multi_Ch for Truehd/Lossless ac3
#define AUD_MINI_SET_CFG_DTS_OUT_6X_CH_REMAP_7X_CH (16)
#define AUD_MINI_SET_CFG_DTS_DTS_MONO_SRC_TO_3X_CH_OUT (17)
#define AUD_MINI_SET_CFG_DUAL_MONO_TYPE_DECIDE_BY_DSP  (18)
#define AUD_MINI_SET_CFG_MVS_MULTI_INPUT_CTRL  (19)    // Use for upper layer to select multi input for mvs
#define AUD_MINI_SET_CFG_AUDIN_BT_FS_SET          (20)    // BT line in path FS 44.1 and 48K set
#define AUD_MINI_SET_CFG_ADJ_APTS          (21)     // adjust audio driver received PTS -- Morning 2013-09-17

typedef struct _tagAudMiniSetCfg
{
    UINT32  u4SetCfgType;                   // Mini set config type id
    UINT32  u4OpCode;                       // Opeartion command code
    UINT32  u4Para[4];                      // Opeartion basic parameters
    VOID    *pvData;                        // More parameters use this pointer
    UINT32  u4DataSize;                     // More parameters size
} AUD_MINI_SET_CFG_T;

// (aud_dec_mute) -- Water 2010-12-08
typedef enum                                        // u4OpCode = This
{
    AUD_MSET_DEC_MUTE_CLR_ONE = 0,                  // Clear current audio type dec mute flag
    AUD_MSET_DEC_MUTE_SET_ONE,                      // Set current audio type dec mute flag
    AUD_MSET_DEC_MUTE_CLR_ALL,                      // Clear all audio type dec mute flag
} AUD_MSET_DEC_MUTE_OPT_T;

typedef enum                                            // u4Para[0] = This
{
    AUD_MSET_DEC_MUTE_OTHER = 0,                    // 0. Other undefined type
    AUD_MSET_DEC_MUTE_AC3,                          // 1. DD
    AUD_MSET_DEC_MUTE_EAC3,                         // 2. DD+
    AUD_MSET_DEC_MUTE_TRUE_HD,                      // 3. True HD
    AUD_MSET_DEC_MUTE_AAC,                          // 4. AAC
    AUD_MSET_DEC_MUTE_WMA,                          // 5. WMA
    AUD_MSET_DEC_MUTE_DTS,                           //6. DTS    //(aud_efuse_DTS/Dolby)  --zhengwen 2011/12/15
    AUD_MSET_DEC_MUTE_MP3,
} AUD_MSET_DEC_MUTE_TYPE_T;

//(aud_wma_efuse)  --zhengwen 2011/12/26
typedef enum
{
    AUD_MSET_WMA_BD_OFF = 0,                //disable wma
    AUD_MSET_WMA_BD_ON ,                      //enable wma
    AUD_MSET_WMA_BD_RESTORE,            //restore wma by GetIcFunc
} AUD_MSET_WMA_BD_OPT_T;


// (aud_aac_spdif) -- Water 2010-12-15
typedef enum
{
    AUD_MSET_AAC_RAW_VIA_SPDIF_OFF = 0,             // Disable aac raw output via spdif
    AUD_MSET_AAC_RAW_VIA_SPDIF_ON,                  // enable aac raw output via spdif
} AUD_MSET_AAC_RAW_VIA_SPDIF_CFG_T;

// (dts force lfe filter control flag) -- Bo Pan 2012-09-28
typedef enum {
    AUD_MSET_DTS_LFE_FORCE_FILTER_OFF = 0,             // Disable dts do lfe force iir filter in bm
    AUD_MSET_DTS_LFE_FORCE_FILTER_ON,                  // enable dts do lfe force iir filter in bm
} AUD_MSET_DTS_LFE_FORCE_FILTER_CFG_T;

// (aud_source_ch) -- bingh:get true source channel,not Multi_Ch for Truehd/Lossless ac3
typedef enum {
    AUD_MSET_SOURCE_CHANNEL_OFF = 0,             // Disable source channel
    AUD_MSET_SOURCE_CHANNEL_ON,                  // enable source channel
} AUD_MSET_SOURCE_CHANNEL_CFG_T;


typedef enum{
    AUD_SET_APLL_MODE_INTERNAL = 0,
    AUD_SET_APLL_MODE_EXTERNAL,
}AUD_SET_APLL_MODE;
// Add HDMI 2ch output type select Lo/Ro or Lt/Rt --> By User (aud_hdmi_2ch_type) -- Water 2011-10-25
#define AUD_MSET_HDMI_2CH_TYPE_OFF      (0)
#define AUD_MSET_HDMI_2CH_TYPE_LORO     (1)
#define AUD_MSET_HDMI_2CH_TYPE_LTRT     (2)

#define AUD_MSET_HDMI_2CH_TYPE_SET_FLAG_OFF     (0) // Disable User select HDMI 2ch downmix type
#define AUD_MSET_HDMI_2CH_TYPE_SET_FLAG_LORO    (1) // Enable User select HDMI 2ch downmix type as Lo/Ro
#define AUD_MSET_HDMI_2CH_TYPE_SET_FLAG_LTRT    (2) // Enable User select HDMI 2ch downmix type as Lt/Rt

#define AUD_MSET_INFO_SHOW_SPK          (1)         // Show current analog speaker setting
#define AUD_MSET_INFO_SHOW_A2H          (2)         // Analog data switch to HDMI (aud_info_show_a2h) -- Water 2011-10-27
// Add MVS Multi input control
#define AUD_MSET_MVS_MULTI_INPUT_OFF      (0)
#define AUD_MSET_MVS_MULTI_INPUT_ON     (1)
#define AUD_MSET_DUAL_MONO_DECIDE_BY_DSP_OFF      (0)
#define AUD_MSET_DUAL_MONO_DECIDE_BY_DSP_ON     (1)

typedef struct
{
    UINT32 REVERB:    1;      //bit0
    UINT32 EQ:        1;      //bit1
    UINT32 PAE:       1;      //bit2
    UINT32 DBASS:     1;      //bit3
    UINT32 NEO6:      1;      //bit4
    UINT32 POSTMIX:   1;      //bit5
    UINT32 RBASS:     1;      //bit6
    UINT32 PL2:       1;      //bit7
    UINT32 SWAP:      1;      //bit8
    UINT32 TVS:       1;      //bit9
    UINT32 LPF:       1;      //bit10
    UINT32 PEQ:      1;      //bit11
    UINT32 BEQ:      1;      //bit12
    UINT32 BASS:      1;      //bit13
    UINT32 PPBM:      1;      //bit14, postprocess bypass mode
    UINT32 TRIMOUT:   1;      //bit15, trim out bypass mode
    UINT32 DELAY:     1;      //bit16, Delay bypass
    UINT32 TVS_ARM2:  1;      //bit17
    UINT32 PAE_ARM2:  1;      //bit18
    UINT32 SURROUND_HALL:  1;  //bit19
    UINT32 PEQ_6BAND:  1;     //bit20
    UINT32 RELOCATIONMIX:  1; //bit21
    UINT32 AUTO_VOLUME: 1; //bit22
} AUDIO_SE_BYPASS_SWITCH_T;
typedef union _AUDIO_SE_BYPASS_SWITCH_UNION_T
{
    AUDIO_SE_BYPASS_SWITCH_T bit;//AUDIO_SE_DBG_SWITCH_T
    UINT32 dword;
    BOOL fgSeDbgMode;

} AUDIO_SE_BYPASS_SWITCH_UNION_T;

#define BIVL_CPS_INFO_CGMS_COPY_PERMITTED      (UINT32)(0)
#define BIVL_CPS_INFO_CGMS_NO_MORE_COPY        (UINT32)(1)
#define BIVL_CPS_INFO_CGMS_ONE_COPY_ALLOWED    (UINT32)(2)
#define BIVL_CPS_INFO_CGMS_NO_COPY_PERMITTED   (UINT32)(3)
#define BIVL_CPS_INFO_CGMS_RESERVED            (UINT32)(4)


//#if ((defined(CONFIG_DRV_SUPPORT_PARTY))&&(1==CONFIG_DRV_SUPPORT_PARTY))
#define AUD_SE_PARTY_CMPT_BUFFER_SA         0x8000    /* 0x10000 - 0x8000 */
#define AUD_SE_PARTY_CMPT_BUFFER_SZ         0x8000  /* Unit : DOWRD*/

#define AUD_SE_PARTY_MAX_BUFFER_STEP        0x1800  /*4096 Smp: 4096  * 2 channel * 24bit /32 bit = 0x1800 (DWORD) */
#define AUD_SE_PARTY_RISC_GET_BANK64        0x60    /* 64 Smp:  64 * 2(channel)* 24bit/32bit(DWORD) */
#define AUD_SE_PARTY_RISC_PUT_BANK64        0x40    /* 64 Smp:  64 * 2(channel)* 16bit/32bit(DWORD) */
#define AUD_SE_BANK_SAMPLE_COUNT            0x40    /* 64 Smp*/
#define AUD_SE_PARTY_BUF0_SIZE              0x140   //(AUD_SE_PARTY_CMPT_BUFFER_SZ/AUD_SE_PARTY_RISC_GET_BANK64) /*0x155*/
#define AUD_SE_PARTY_BUF1_SIZE              0x40    /* 0x40 bank */
#define AUD_SE_PARTY_BUF1_MARGIN            (2*AUD_SE_BANK_SAMPLE_COUNT) /* unit: sample */
#define AUD_SE_PARTY_GET_LOOP_SZ            (AUD_SE_PARTY_BUF0_SIZE*AUD_SE_PARTY_RISC_GET_BANK64)
#define AUD_SE_PARTY_PUT_LOOP_SZ            (AUD_SE_PARTY_BUF1_SIZE*AUD_SE_PARTY_RISC_PUT_BANK64)
#define AUD_SE_PARTY_CHANNEL_COUNT          2
//#endif //#if ((1==CONFIG_DRV_SUPPORT_PARTY) && (defined(CONFIG_DRV_SUPPORT_PARTY)))

typedef struct _AUD_SND_PRIVACY_CTRL_INFO_T // For Read Use
{
    BOOL fgSoundPrivacyEn;
    BOOL fgMute;
    AUD_DEC_MUTE_CTRL_SOURCE_T eSource;

    AUD_DEC_VOLUME_INFO_T t_VolInfo;
}  AUD_SND_PRIVACY_CTRL_INFO_T;

#define SET_ADSP_C_OFF 1

/* Android Ctrl Info define*/
typedef enum
{
    AUD_DRV_ANDROID_SET_STREAM_TYPE = 0,
    AUD_DRV_ANDROID_SET_TRACK_VOLUME = 1,
    AUD_DRV_ANDROID_SET_STREAM_VOLUME = 2,
    AUD_DRV_ANDROID_SET_STREAM_GLOBAL_MUTE = 3,

    AUD_DRV_ANDROID_GET_STREAM_TYPE = 10,
} AUD_DRV_ANDROID_CTRL_TYPE_T;


typedef enum
{
    AUD_DRV_ANDROID_STREAM_TYPE_DEFAULT = -1,
    AUD_DRV_ANDROID_STREAM_TYPE_VOICE_CALL = 0,
    AUD_DRV_ANDROID_STREAM_TYPE_SYSTEM = 1,
    AUD_DRV_ANDROID_STREAM_TYPE_RING = 2,
    AUD_DRV_ANDROID_STREAM_TYPE_MUSIC = 3,
    AUD_DRV_ANDROID_STREAM_TYPE_ALARM = 4,
    AUD_DRV_ANDROID_STREAM_TYPE_NOTIFICATION = 5,
    AUD_DRV_ANDROID_STREAM_TYPE_BLUETOOTH_SCO = 6,
    AUD_DRV_ANDROID_STREAM_TYPE_ENFORCED_AUDIBLE = 7,
    AUD_DRV_ANDROID_STREAM_TYPE_DTMF = 8,
    AUD_DRV_ANDROID_STREAM_TYPE_TTS = 9,
    AUD_DRV_ANDROID_STREAM_TYPE_FM = 10,
    AUD_DRV_ANDROID_STREAM_TYPE_MATV = 11,
    AUD_DRV_ANDROID_STREAM_TYPE_NUM

} AUD_DRV_ANDROID_STREAM_TYPE_T;

typedef struct _AUD_DRV_ANDROID_TRACK_VOLUME
{
    UINT32      u4LeftVolume;
    UINT32      u4RightVolume;
} AUD_DRV_ANDROID_TRACK_VOLUME_T;

typedef struct _AUD_DRV_ANDROID_STREAM_VOLUME
{
    AUD_DRV_ANDROID_STREAM_TYPE_T   eStreamType;
    UINT32                          u4StreamVolume;
} AUD_DRV_ANDROID_STREAM_VOLUME_T;

typedef struct _AUD_DRV_ANDROID_CTRL_INFO
{
    AUD_DRV_ANDROID_CTRL_TYPE_T      e_CtrlType;
    union
    {
        AUD_DRV_ANDROID_STREAM_TYPE_T   eStreamType;
        AUD_DRV_ANDROID_STREAM_VOLUME_T tStreamVolume;
        AUD_DRV_ANDROID_TRACK_VOLUME_T  tTrackVolume;
        BOOL                            fgStreamGlobalMute;
    } u_CtrlInfo;
} AUD_DRV_ANDROID_CTRL_INFO_T;

/* Upload Ctrl Info define*/
typedef enum
{
    AUD_DRV_UPLOAD_CTRL_TYPE_START = 0,
    AUD_DRV_UPLOAD_CTRL_TYPE_STOP = 1,
    AUD_DRV_UPLOAD_CTRL_TYPE_FILL_THIS_BUF = 2,
    AUD_DRV_UPLOAD_CTRL_TYPE_STOP_FILL_THIS_BUF= 3,
    AUD_DRV_UPLOAD_CTRL_TYPE_REG_NFY = 4,
    AUD_DRV_UPLOAD_CTRL_TYPE_UNREG_NFY = 5,
    AUD_DRV_UPLOAD_CTRL_TYPE_NUM
} AUD_DRV_UPLOAD_CTRL_TYPE_T;

typedef struct _AUD_DRV_UPLOAD_PCM_FMT
{
    UINT32      u4SampleRate; //48k: 48000
    UINT32      u4ChannelCnt;
    UINT32      u4OriBitDepth; // add original bit depth
    BOOL        fgUpsampleAbility; // Add for BT: if FALSE, please not set upsample
    UINT32      u4NeedLittleEndian;  // Zero: upload little endian data; Non-zero: upload big endian
#if (CONFIG_DRV_HDMI_RX && CONFIG_DRV_CUSTOM_JSN)
    BOOL        fgNeedMuteACP;
#endif
} AUD_DRV_UPLOAD_PCM_FMT_T;

/* Upload type define*/
typedef struct _AUD_DRV_UPLOAD_TYPE_T
{
	INT32		i4UploadPosition;
}AUD_DRV_UPLOAD_TYPE_T;

/* Upload position define*/
typedef enum
{
    AUD_DRV_UPLOAD_POSITION_BONDING = 0,
    AUD_DRV_UPLOAD_POSITION_AFTER_PRIMARY = 1,
    AUD_DRV_UPLOAD_POSITION_AFTER_PP1 = 2,
    AUD_DRV_UPLOAD_POSITION_AFTER_PP2 = 3,
    AUD_DRV_UPLOAD_POSITION_TYPE_NUM
} AUD_DRV_UPLOAD_POSITION_TYPE_T;

typedef struct _AUD_DRV_UPLOAD_DATA_INFO_T
{
    UINT32                      u4ThisAddr;
    UINT32                      u4UploadBufAddr;
    UINT32                      u4SizeInByte;
    AUD_DRV_UPLOAD_PCM_FMT_T    tDataFmt;
    BOOL                        fgFirstDataAfterReset;
} AUD_DRV_UPLOAD_DATA_INFO_T;

typedef struct _AUD_DRV_UPLOAD_CTRL_T
{
    AUD_DRV_UPLOAD_CTRL_TYPE_T e_upload_ctrl_type;
    union
    {
        AUD_DRV_UPLOAD_DATA_INFO_T t_Upload_Data_Info;
        DRV_CB_REG_INFO_T * pt_Upload_Callback_Info;
    } u_CtrlInfo;
} AUD_DRV_UPLOAD_CTRL_T;


typedef struct _AUDIO_IN_SPDIF_IN_CHANNEL_STATUS{
    BOOL fgAudinLocked;
    UINT32 ui4_channel_status_l[6];
    //UINT32 ui4_channel_status_r[6];
}AUDIO_IN_SPDIF_IN_CHANNEL_STATUS;

typedef struct _AUDIO_IN_INFO{
    BOOL fgAudinLocked;
}AUDIO_IN_INFO;

typedef struct _AUD_DRV_CONNECT_CTRL_INFO
{
    UINT16 u2ADRV_Comp_Id;
    UINT16 eType;
    UINT16 u2PktFltr_Comp_Id;

} AUD_DRV_CONNECT_CTRL_INFO_T;

typedef struct _AUD_DRV_UPLOAD_INFO_T
{
    BOOL fgDownsampleFlag; // 0:downsample by upload, 1:downsample by decode
    UINT32 eBitDepth;//0:16BIT,1:24BIT,2:32BIT
}AUD_DRV_UPLOAD_INFO_T;

typedef struct _AUD_DOWNLOAD_OUTPUT_PARA_EXT_T
{
    UINT32      u4SampleRate; //48k: 48000
    UINT32      u4ChannelCnt;
    UINT32      u4ChCfg0;
    UINT32      u4ChCfg1;
    UINT32      u4LittleEndian;
    UINT32      u4BitDepth;
} AUD_DOWNLOAD_OUTPUT_PARA_EXT_T;

typedef struct _AUD_DRV_DOWNLOAD_PCM_FMT
{
    UINT32      u4SampleRate; //48k: 48000
    UINT32      u4ChannelCnt;
    UINT32      u4ChCfg0;
    UINT32      u4ChCfg1;
    UINT32      u4LittleEndian;
    UINT32      u4BitDepth;
    AUD_DOWNLOAD_OUTPUT_PARA_EXT_T rExtPara;
} AUD_DRV_DOWNLOAD_PCM_FMT_T;

#include "x_timer.h"
typedef struct _AUD_DRV_DOWNLOAD_BUF_INFO
{
    UINT32          u4BufSize; //frame
    HAL_TIME_T      rKernelTime;
    UINT32          u4ReadPtr;
    UINT32          u4WritePtr;
} AUD_DRV_DOWNLOAD_BUF_INFO;

typedef enum
{
    DOWNLOAD_CMD_START,
    DOWNLOAD_CMD_OUTPUT_SETTING,
    DOWNLOAD_CMD_STOP,
    DOWNLOAD_CMD_GET_BUF_FREE_SIZE,
    DOWNLOAD_CMD_GET_DATA_SIZE,
    DOWNLOAD_CMD_GET_CUR_PCM_SETTING,
    DOWNLOAD_CMD_DATA_WRITE,
    DOWNLOAD_CMD_PAUSE,
    DOWNLOAD_CMD_HW_OUTPUT_SETTING,
    DOWNLOAD_CMD_GET_STATUS,
    DOWNLOAD_CMD_GET_BUF_INFO,
    DOWNLOAD_CMD_REG_NFY,
    DOWNLOAD_CMD_UNREG_NFY,
    DOWNLOAD_CMD_DATA_WRITE_WITHOUT_WAIT,
    DOWNLOAD_CMD_START_NEW,
    DOWNLOAD_CMD_STOP_NEW,
}AUD_DRV_DOWNLOAD_CMD_T;

typedef struct _AUD_DRV_DOWNLOAD_DATA_INFO
{
    UINT32 u4DownloadBufStartAddr;
    UINT32 u4DownloadDataSize;
    UINT32 u4RealWriteSize;
}AUD_DRV_DOWNLOAD_DATA_INFO_T;

typedef struct _AUD_DRV_SET_PARA
{
    AUD_DRV_DOWNLOAD_CMD_T eCmdType;
    void                   *pvSettingPara;
}AUD_DRV_SET_PARA_T;

typedef struct _AUD_DRV_DOWNLOAD_STATUS_INFO
{
    UINT32   u4Rdptr;//frame   // not use now
    UINT32   u4Wtptr;          // not use now
    UINT32   u4BufferSize;     // not use now
    UINT32   u4DlStatus;
}AUD_DRV_DOWNLOAD_STATUS_INFO_T;

#if (((defined CONFIG_AUD_DRV_PRIMARY_SMOOTH_INVOLVED)&&(CONFIG_AUD_DRV_PRIMARY_SMOOTH_INVOLVED)) || ((defined CONFIG_AUD_MW_PRIMARY_SMOOTH_INVOLVED)&&(CONFIG_AUD_MW_PRIMARY_SMOOTH_INVOLVED)))
#define PRIMARY_SMOOTH_MAX_LINEAR_NUM    128
typedef struct _AUD_DEC_PRIMARY_SMOOTH_LINEAR_T{
    unsigned int u4QVal;
    int u4RateFix;
    unsigned int u4SBNum;
    unsigned int u4InitGain;
    unsigned int u4TargetGain;
}AUD_DEC_PRIMARY_SMOOTH_LINEAR_T;

typedef struct _AUD_DEC_PRIMARY_SMOOTH_LINEAR_ARRAY_T{
    unsigned int u4LinearNum;
    AUD_DEC_PRIMARY_SMOOTH_LINEAR_T *ptLinearArray;
}AUD_DEC_PRIMARY_SMOOTH_LINEAR_ARRAY_T;

typedef enum
{
    SET_CURRENTGAIN=0,
    SET_PRIMARYSMOOTH,
    SET_FORCESTOPPRIMARYSMOOTH
}AUD_DEC_PRIMARY_SMOOTH_SET_PARAM_ENUM_T;

typedef struct _AUD_DEC_PRIMARY_SMOOTH_SET_PARAM_T{
    AUD_DEC_PRIMARY_SMOOTH_SET_PARAM_ENUM_T eAudPrimarySmoothType;
    union{
        unsigned int u4CurrentGain;
        AUD_DEC_PRIMARY_SMOOTH_LINEAR_ARRAY_T *ptAudPrimarySmoothLinearArray;
    }uParamval;
}AUD_DEC_PRIMARY_SMOOTH_SET_PARAM_T;
#endif
typedef enum
{
    RISC_DEC_FS_16K = 0,
    RISC_DEC_FS_22K,
    RISC_DEC_FS_24K,
    RISC_DEC_FS_32K,
    RISC_DEC_FS_44K,
    RISC_DEC_FS_48K,
    RISC_DEC_FS_64K,
    RISC_DEC_FS_88K,
    RISC_DEC_FS_96K,
    RISC_DEC_FS_176K,
    RISC_DEC_FS_192K,
    RISC_DEC_FS512_44K,//for DSD
    RISC_DEC_FS_768K,
    RISC_DEC_FS128_44k,
    RISC_DEC_FS_128K,
    RISC_DEC_FS_UNKOWN,
    RISC_DEC_FS_48K_MAX_CH,
    RISC_DEC_FS_FOLLOW   //Morning 20150115: follow previous Fs, for PP reset in ALSA
} RISC_DEC_AUDIO_SAMPLING_T;

typedef enum
{
    RISC_DEC_IEC_48K = 0,
    RISC_DEC_IEC_96K,
    RISC_DEC_IEC_192K,
    RISC_DEC_IEC_768K,
    RISC_DEC_IEC_44K,
    RISC_DEC_IEC_88K,
    RISC_DEC_IEC_176K,
    RISC_DEC_IEC_705K,
    RISC_DEC_IEC_16K,
    RISC_DEC_IEC_22K,
    RISC_DEC_IEC_24K,
    RISC_DEC_IEC_32K,
    RISC_DEC_IEC_128K

} RISC_DEC_IEC_FRAME_RATE_T;

typedef enum
{
    RISC_DEC_AVD_BITS_NONE = 0x00,
    RISC_DEC_AVD_LPCM      = 0x01,
    RISC_DEC_AVD_AC3       = 0x02,
    RISC_DEC_AVD_MPEG1_AUD = 0x03,
    RISC_DEC_AVD_MP3       = 0x04,
    RISC_DEC_AVD_MPEG2_AUD = 0x05,
    RISC_DEC_AVD_AAC       = 0x06,
    RISC_DEC_AVD_DTS       = 0x07,
    RISC_DEC_AVD_ATRAC     = 0x08,
    RISC_DEC_AVD_DSD       = 0x09,
    RISC_DEC_AVD_DOLBY_PLUS= 0x0A,
    RISC_DEC_AVD_DTS_HD    = 0x0B,
    RISC_DEC_AVD_MAT_MLP   = 0x0C,
    RISC_DEC_AVD_DST       = 0x0D,
    RISC_DEC_AVD_WMA       = 0x0E,
    RISC_DEC_AVD_CDDA      = 0x0F,
    RISC_DEC_AVD_SACD_PCM  = 0x10,
    RISC_DEC_AVD_APE       = 0x11,
    RISC_DEC_AVD_FLAC      = 0x12,
    RISC_DEC_AVD_VOBIS     = 0x13,
    RISC_DEC_AVD_AMR       = 0x14,
    RISC_DEC_AVD_AWB       = 0x15,
    RISC_DEC_AVD_ALAC      = 0x16,

    RISC_DEC_AVD_HDCD =0xfe,
    RISC_DEC_AVD_BITS_OTHERS=0xff
} RISC_DEC_AUDIO_BITSTREAM_TYPE_T;

typedef enum
{
    RISC_DEC_AUD_INPUT_1_0= 0,
    RISC_DEC_AUD_INPUT_1_1,
    RISC_DEC_AUD_INPUT_2_0,
    RISC_DEC_AUD_INPUT_2_1,
    RISC_DEC_AUD_INPUT_3_0, //C,L,R
    RISC_DEC_AUD_INPUT_3_1, //C,L,R
    RISC_DEC_AUD_INPUT_4_0, //L,R,RR,RL
    RISC_DEC_AUD_INPUT_4_1, //L,R,RR,RL
    RISC_DEC_AUD_INPUT_5_0,
    RISC_DEC_AUD_INPUT_5_1,
    RISC_DEC_AUD_INPUT_6_0,
    RISC_DEC_AUD_INPUT_6_1,
    RISC_DEC_AUD_INPUT_7_0,
    RISC_DEC_AUD_INPUT_7_1,
    RISC_DEC_AUD_INPUT_3_0_LRS, //LRS
    RISC_DEC_AUD_INPUT_3_1_LRS, //LRS
    RISC_DEC_AUD_INPUT_4_0_CLRS,//C,L,R,S
    RISC_DEC_AUD_INPUT_4_1_CLRS,//C,L,R,S
    //new layout added for DTS
    RISC_DEC_AUD_INPUT_6_1_Cs,
    RISC_DEC_AUD_INPUT_6_1_Ch,
    RISC_DEC_AUD_INPUT_6_1_Oh,
    RISC_DEC_AUD_INPUT_6_1_Chr,
    RISC_DEC_AUD_INPUT_7_1_Lh_Rh,
    RISC_DEC_AUD_INPUT_7_1_Lsr_Rsr,
    RISC_DEC_AUD_INPUT_7_1_Lc_Rc,
    RISC_DEC_AUD_INPUT_7_1_Lw_Rw,
    RISC_DEC_AUD_INPUT_7_1_Lsd_Rsd,
    RISC_DEC_AUD_INPUT_7_1_Lss_Rss,
    RISC_DEC_AUD_INPUT_7_1_Lhs_Rhs,
    RISC_DEC_AUD_INPUT_7_1_Cs_Ch,
    RISC_DEC_AUD_INPUT_7_1_Cs_Oh,
    RISC_DEC_AUD_INPUT_7_1_Cs_Chr,
    RISC_DEC_AUD_INPUT_7_1_Ch_Oh,
    RISC_DEC_AUD_INPUT_7_1_Ch_Chr,
    RISC_DEC_AUD_INPUT_7_1_Oh_Chr,
    RISC_DEC_AUD_INPUT_7_1_Lss_Rss_Lsr_Rsr,
    RISC_DEC_AUD_INPUT_6_0_Cs,
    RISC_DEC_AUD_INPUT_6_0_Ch,
    RISC_DEC_AUD_INPUT_6_0_Oh,
    RISC_DEC_AUD_INPUT_6_0_Chr,
    RISC_DEC_AUD_INPUT_7_0_Lh_Rh,
    RISC_DEC_AUD_INPUT_7_0_Lsr_Rsr,
    RISC_DEC_AUD_INPUT_7_0_Lc_Rc,
    RISC_DEC_AUD_INPUT_7_0_Lw_Rw,
    RISC_DEC_AUD_INPUT_7_0_Lsd_Rsd,
    RISC_DEC_AUD_INPUT_7_0_Lss_Rss,
    RISC_DEC_AUD_INPUT_7_0_Lhs_Rhs,
    RISC_DEC_AUD_INPUT_7_0_Cs_Ch,
    RISC_DEC_AUD_INPUT_7_0_Cs_Oh,
    RISC_DEC_AUD_INPUT_7_0_Cs_Chr,
    RISC_DEC_AUD_INPUT_7_0_Ch_Oh,
    RISC_DEC_AUD_INPUT_7_0_Ch_Chr,
    RISC_DEC_AUD_INPUT_7_0_Oh_Chr,
    RISC_DEC_AUD_INPUT_7_0_Lss_Rss_Lsr_Rsr,
    RISC_DEC_AUD_INPUT_8_0_Lh_Rh_Cs,
    RISC_DEC_AUD_INPUT_UNKNOWN = 0xFF

} RISC_DEC_AUD_CH_NUM_T;

typedef enum
{
    RISC_DEC_AUD_SACD_OUTPUT_STEREO= 0,
    RISC_DEC_AUD_SACD_OUTPUT_MULTI
} RISC_DEC_AUD_SACD_CH_NUM_T;

typedef enum
{
    RISC_DEC_AUD_DIGITAL_PCM= 0,
    RISC_DEC_AUD_DIGITAL_RAW,
    RISC_DEC_AUD_DIGITAL_REENCODE,
    RISC_DEC_AUD_DIGITAL_OFF,
    RISC_DEC_AUD_DIGITAL_PCM_STEREO
} RISC_DEC_AUD_DIGITAL_SETTING_T;


typedef struct RISC_DEC_AUD_CH_DELAY_SETTING_T
{
    UINT16 u2Ch_Delay_CH0;
    UINT16 u2Ch_Delay_CH1;
    UINT16 u2Ch_Delay_CH2;
    UINT16 u2Ch_Delay_CH3;
    UINT16 u2Ch_Delay_CH4;
    UINT16 u2Ch_Delay_CH5;
    UINT16 u2Ch_Delay_CH6;
    UINT16 u2Ch_Delay_CH7;
    UINT16 u2Ch_Delay_CH8;
    UINT16 u2Ch_Delay_CH9;
}   RISC_DEC_AUD_CH_DELAY_SETTING_T;

typedef enum
{
    RISC_DEC_AUD_IEC_PCM_CH_L_R = 0,
    RISC_DEC_AUD_IEC_PCM_CH_LS_RS,
    RISC_DEC_AUD_IEC_PCM_CH_C_SW,
    RISC_DEC_AUD_IEC_PCM_CH_7_8,
    RISC_DEC_AUD_IEC_PCM_CH_LINE_IN,
    RISC_DEC_AUD_IEC_PCM_CH_9_10,
    RISC_DEC_AUD_IEC_PCM_CH_11_12,
    RISC_DEC_AUD_IEC_MIC
}   RISC_DEC_AUD_IEC_CH_T;

typedef enum
{
    RISC_DEC_AUD_HDCD_1X= 0,
    RISC_DEC_AUD_HDCD_2X,
    RISC_DEC_AUD_HDCD_OFF
} RISC_DEC_AUD_HDCD_SETTING_T;

/* UI Setting for AVD. */
typedef struct RISC_DEC_AUD_UI_AVDCFG_T
{
    RISC_DEC_AUD_DIGITAL_SETTING_T			eAud_Iec_Ui_Select;
    RISC_DEC_IEC_FRAME_RATE_T			eAud_Iec_Max_Sampling_Rate;
    RISC_DEC_AUD_DIGITAL_SETTING_T			eAud_Hdmi_Ui_Select;
    UINT32					u4Aud_Speaker_Config;
    RISC_DEC_AUD_CH_DELAY_SETTING_T			rAud_Ui_Chan_Delay;
    RISC_DEC_AUD_CH_DELAY_SETTING_T		rAud_Ui_Hdmi_Chan_Delay;
    RISC_DEC_AUD_IEC_CH_T				eAud_IEC_Chan_Select;
    RISC_DEC_AUD_HDCD_SETTING_T			eAud_Hdcd_Select;
}   RISC_DEC_AUD_UI_AVDCFG_T;

typedef enum
{
    RISC_DEC_HDMI_MAX_2CH,
    RISC_DEC_HDMI_MAX_6CH,
    RISC_DEC_HDMI_MAX_8CH,
} RISC_DEC_AUD_HDMI_MAX_OUTPUT_CHANNEL_NUM;

typedef struct RISC_DEC_AUD_SOURCE_CFG_T
{
    UINT8                   u1Aud_DecId;
    RISC_DEC_AUDIO_SAMPLING_T                   u1Aud_Sampling_Rate;
    RISC_DEC_AUDIO_SAMPLING_T                   u1Aud_Sampling_Rate_2;    //For SACD aout 2 setting
    RISC_DEC_IEC_FRAME_RATE_T           u1Aud_Iec_Frame_Rate;
    RISC_DEC_AUDIO_BITSTREAM_TYPE_T        u1Aud_Codec_Fmt;
    RISC_DEC_AUDIO_BITSTREAM_TYPE_T        u1Aud_Codec_Fmt_2; //For SACD aout 2 setting
    RISC_DEC_AUD_CH_NUM_T              u1Aud_Input_Chan_Cnt;
    RISC_DEC_AUD_SACD_CH_NUM_T             u1Aud_Sacd_Scom_Input_Chan_Cnt;
    RISC_DEC_AUDIO_BITSTREAM_TYPE_T        u1Aud_Reencode_Fmt;
    BOOL                        fgReEncStatus;  // TRUE: ReEnc on; FALSE: ReEnc off
    RISC_DEC_AUD_UI_AVDCFG_T               rAud_Ui_Setting;
    BOOL                        fgNeo6Enable;
    RISC_DEC_AUD_HDMI_MAX_OUTPUT_CHANNEL_NUM    u1Hdmi_Max_Channel;
    BOOL                        fgHdmiEnableHdAudioOutput;
#if CONFIG_AUD_HDMI_CLK_SUPPORT
    I2S_CLK_SAMPLE_FREQUENCY_T eSampleFreq;
    BOOL                        fgAudin;
#endif
    // (aud_hdmi_downsample) -- Water 2010-05-13
    BOOL                        fgHdmiDownSampleEn;             // FALSE/TRUE: Disable/Enable hdmi downsample function
    RISC_DEC_AUDIO_SAMPLING_T            eHdmiDownSampleMaxSampleRate;   // if (fgHdmiDownSampleEn) {limit HDMI output sample rate}
    // (aud_aac_spdif) -- Water 2010-12-15
    BOOL                        fgAACRawViaSPDIFEn;             // support aac raw output via spdif or not
    BOOL                        fgIsPureDDP;
    RISC_DEC_AUDIO_SAMPLING_T            eInputSampleRate;
    BOOL                        fgIsLossAC3;
    BOOL                        fgAACType; // 0:mpeg4aac 1:mpeg2aac
    BOOL                        fgNewSpeedEnable;
}   RISC_DEC_AUD_SOURCE_CFG_T;

typedef enum
{
    GGMR_INFO_AUD_BUF_DELAY=0,
    GGMR_INFO_END
}AUD_GGMR_PARAM_ENUM_T;
typedef struct _AUD_GGMR_INFO_T
{
    AUD_GGMR_PARAM_ENUM_T eGGMRInfo;
    union {
        //audio driver buffer delay
        UINT64 u64GGMR_delay;
    }u_ggmrAudInfo;
} AUD_GGMR_INFO_T;

#endif /* _X_AUD_DEC_H_ */
