#ifndef __TYPE1_DEC_COMP_CORE_STRUCT_H__
#define __TYPE1_DEC_COMP_CORE_STRUCT_H__

#include "OMX_Types.h"

typedef struct __type1_dec_pcm_attr
{
    OMX_U32 u4Version;    // the struct version. the struct can be changed by request but will has diffrent version
    OMX_U32 u4Size;    // the struct size
    OMX_PTR pvPcmData;
    OMX_U32 u4SampleNumPerChannel;
    OMX_U32 u4BitsPerSample;
    OMX_U32 u4NeedBytesPerSample;
    OMX_U32 u4SampleIsLittleEnd;
    pcm_access_mode eAccessMode;
    OMX_U32 u4ChannelConfig0;    //[15:12/Lsr][11:8/C][7:4/R][3:0/L]
    OMX_U32 u4ChannelConfig1;    //[15:12/Rsr][11:8/LFE][7:4/Rs][3:0/Ls]
    OMX_U32 u4ChannelConfig2;    //[15:12/Ch12][11:8/Ch11][7:4/Ch10][3:0/Ch9]
    OMX_U32 u4ChannelConfig3;    //[15:12/Ch16][11:8/Ch15][7:4/Ch14][3:0/Ch13]
    OMX_U32 u4ChannelNum;
    OMX_U32 u4SampleRate;
}type1_dec_pcm_attr;

typedef struct __S_IEC1_INFO
{
    UINT32    *iec_queue_pointer;
    UINT32     iec_burst_info;
    UINT32     iec_nsnum;
    UINT32     iec_next_length;
    UINT32     iec_nsadr;
    UINT32    iec_next_uadr;
    UINT32    iec_control_info;
    UINT32    iec_start_blk;
    UINT32    *iec_end_blk;
    UINT32    iec_ch1_status0;
    UINT32    iec_ch1_status1;
    UINT32    iec_ch1_status2;
    UINT32    iec_ch2_status0;
    UINT32    iec_ch2_status1;
    UINT32    iec_ch2_status2;
    UINT32    Reserved;
}S_IEC1_INFO;

typedef struct __S_IEC2_INFO
{
    UINT32    *iec_queue_pointer;
    UINT32     iec_burst_info;
    UINT32     iec_nsnum;
    UINT32     iec_next_length;
    UINT32     iec_nsadr;
    UINT32    iec_next_uadr;
    UINT32    iec_control_info;
    UINT32    iec_start_blk;
    UINT32    *iec_end_blk;
    UINT32    iec_ch1_status0;
    UINT32    iec_ch1_status1;
    UINT32    iec_ch1_status2;
    UINT32    iec_ch2_status0;
    UINT32    iec_ch2_status1;
    UINT32    iec_ch2_status2;
    UINT32    Reserved;
}S_IEC2_INFO;

typedef struct __S_AOUT1_DOWNMIX
{
    UINT32      down_coeff[8][8];
}S_AOUT1_DOWNMIX;

typedef struct __S_AOUT2_DOWNMIX
{
    UINT32      down_coeff[8][8];
}S_AOUT2_DOWNMIX;

typedef struct __S_DECODING_INFO
{
    UINT32              decoding_info;
    UINT32              pts_stch;
    UINT32              pts_stcl;
    UINT32              decoding_channel_config0;
    UINT32              decoding_channel_config1;
    UINT32              decoding_channel_num_1;
    UINT32              decoding_channel_flag;
    S_IEC1_INFO         *iec1_queue_pointer;
    S_IEC2_INFO         *iec2_queue_pointer;
    S_AOUT1_DOWNMIX     *aout1_coef_pointer;
    S_AOUT2_DOWNMIX     *aout2_coef_pointer;
    UINT32              drc_info;
    UINT32              volum_info;
    UINT32              reserved1;
    UINT32              reserved2;
    UINT32              reserved3;
}S_DECODING_INFO;

typedef struct __S_SIDEINFO
{
    S_DECODING_INFO  s_info;
    S_IEC1_INFO      s_iec1_info;
    S_IEC2_INFO      s_iec2_info;
    S_AOUT1_DOWNMIX  s_aout1_dmx;
    S_AOUT2_DOWNMIX  s_aout2_dmx;
    UINT32           reserved[16]; //176 + 16, aligned as 192*4 byte
}S_SIDEINFO;

typedef struct __type1_dec_sideinfo_attr
{
    OMX_PTR pvSideinfoData;
    OMX_U32 u4SideinfoNum;
}type1_dec_sideinfo_attr;

typedef struct __type1_dec_output_header
{
    OMX_U32 u4Version;    // the struct version. the struct can be changed by request but will has diffrent version
    OMX_U32 u4Size;    // the struct size
    OMX_U32 u4IsMeetDecInfoChg;
    OMX_U32 u4Pcmattrnum;    // the output pcm frame num. if there is no pcm data output, it can be 0.
    type1_dec_pcm_attr *ptPcmAttrArray;    // the pcm attr array header pointer. if the pcmattrnum=0, the pcmattrarrayptr=NULL
    type1_dec_sideinfo_attr *ptSideinfoAttrArray;
}type1_dec_output_header;

#endif

