mae_interface.h
来自「AU1200嵌入式处理器媒体加速引擎(mae)的驱动」· C头文件 代码 · 共 661 行 · 第 1/2 页
H
661 行
uint32 lumshift:6; // 6-bits
uint32 icomp:1; // 1-bit
uint32 reserved7:19;
}intensity_comp;
uint32 fwd_y_bot_ptr;
uint32 fwd_cb_bot_ptr;
uint32 fwd_cr_bot_ptr;
uint32 bwd_y_bot_ptr;
uint32 bwd_cb_bot_ptr;
uint32 bwd_cr_bot_ptr;
struct pquant_struct
{
uint32 pquant:5; // 5-bits
uint32 reserved:27; // 27-bits
}pquant_reg;
uint32 regmask; // Indicates which registers are valid
}reg_info;
typedef struct Weighing_matrix_struct
{
uint8 wm[64];
}Weighing_matrix;
typedef struct motion_vector_struct
{
uint32 mv;
}motion_vector;
typedef struct data_block_struct
{
int16 blk_data[64];
}data_block;
typedef struct tag_bufq_t
{
uint32 *addr;
struct tag_bufq_t *next;
struct tag_bufq_t *prev;
} YUVQ_T, *PYUVQ_T;
typedef struct tag_dataq_t
{
uint32 *addr;
struct tag_dataq_t *next;
struct tag_dataq_t *prev;
} DATAQ_T, *PDATAQ_T;
typedef struct tag_feq_t
{
LONGLONG pts;
LONGLONG dts;
uint32 tnum;
uint32 state_change; // set by decoder to turn on/off modules
uint32 endframe_flag;
uint32 anchor_flag;
uint32 update_mode_flag;
uint32 interlacing_on;
uint32 interlaced_frame_done;
uint32 topfield_length;
#ifdef NEW_MAE_DRIVER
uint32 stream_type; // unkown - 0, mpeg1 - 1, mpeg2 - 2, mpeg4 - 3, H.263 - 4, divx - 5, wmv9 - 6
uint32 frametype[2]; // For field picture - field prediction, we set both frametype1 and frametype2
uint32 picture_structure; // 1 - top field, 2 - bottom field, 3 - frame picture
uint32 chroma_format; // 0 - 4:2:0, 1 - 4:2:2
uint32 dual_prime_field1;
uint32 nFlushMAE;
uint32 prog_frame; // Is this a progressive frame?
// WMV9 Stuff
unsigned char bOverlap; // Overlap Smoothing filter enabled?
unsigned char bDeblock; // DeBlocking filter enabled?
uint32 IntensityComp; // Intensity Compensation enabled?
uint32 LumScale; // Luminance Scale
uint32 LumShift; // Luminance Shift
uint32 StepSize; // Step Size for PQuant
// ~WMV9 Stuff
#else
uint32 frametype;
#endif
uint32 dummysubmit; // Added for trick mode support
uint32 list_entries;
uint32 sent_to_be; // internal flag set when buffer is processed by BE
reg_info fe_reglist;
reg_info fe_reglist_field;
#ifdef REG_DEBUG
reg_info mae_fe_reglist;
reg_info mae_fe_reglist_field;
#endif
uint32 * extra_info; // address ptr to head of contiguous block of extra info for cmodel
uint32 extra_info_size; // size (in bytes) of extra info
uint32 * descriptors; // address ptr to head of contiguous descriptors
uint32 desc_size; // size (in bytes) of descriptors
mae_desc * desc_ptr;
PDATAQ_T pdataq;
uint32 * buffer;
uint32 buffer_offset;
uint32 * pMB;
header_words * pHeader;
uint32 * pWM;
uint32 * pMV;
uint16 * pDataBlock;
uint32 * pWrapExtraInfo;
uint32 status;
uint32 start_time;
uint32 end_time;
PYUVQ_T pyuvq; // associated YUV_Q entry
uint32 * y; // address ptr to head of Y data
uint32 * u; // address ptr to head of Y data
uint32 * v; // address ptr to head of Y data
uint32 encoded_picture_linesize;
uint32 encoded_picture_height;
uint32 aspect;
uint32 chopped_picture_linesize;
uint32 chopped_picture_height;
uint32 in_frame_width; // decoder's In-Frame X boundary
uint32 in_frame_height; // decoder's In-Frame Y boundary
uint32 tweak_oof_region; // modify MAE-FE decoded output
//uint32 scf_hsr; // Horz Scale Ratio
//uint32 scf_vsr; // Vert Scale Ratio
//uint32 scf_dis; // SCF Disable
uint32 scf_coeffs[256]; // scf filter coefficients for 0x100-0x400
uint32 csc_coeffs[13]; // csc filter coefficients for 0x400-0x434
// the list below is for the source/destination/control registers
//REGLIST_T be_reglist[19]; // array of (address, value) structs
uint32 * rgb; // address ptr to head of rgb data
//uint32 start_time; // for debug, time clock is written before BE is enabled
uint32 total_time; // for debug, time clock is written when MAE completes
uint32 be_time; // for debug, time clock is written if be_time completes early
struct tag_feq_t *next;
struct tag_feq_t *prev;
} MAEQ_T, *PMAEQ_T;
typedef MAEQ_T wrap_context;
#ifdef UNDER_CE
typedef unsigned int * PUINT32;
typedef struct tag_rgbq_t
{
LONGLONG pts; // Presentation Time Stamp
LONGLONG dts; // Decode Time Stamp
uint32 tnum; // Temporal Number
uint32 ready_to_display; // set once the buffer is completed
uint32 start_time; // time clock is written when LCD is updated to display this frame
uint32 resync_clock;
int32 x;
int32 y;
int32 w;
int32 h;
PUINT32 addr; // address ptr for head of rgb data
struct tag_rgbq_t *next;
struct tag_rgbq_t *prev;
} RGBQ_T, *PRGBQ_T;
#ifndef UNDER_DRIVER_CE // do'nt define for the driver
#define IPB_FRAME_MODE (0)
typedef struct reg_data_struct
{
uint32 offset;
char szRegName[24];
}reg_data;
typedef struct tag_yuv_table
{
PYUVQ_T pyuvq;
char szBufName[4];
}YUV_TABLE;
#if 0
typedef struct tag_dispq_t
{
uint32 pts; // Presentation Time Stamp
uint32 dts; // Decode Time Stamp
uint32 tnum; // Temporal Number
uint32 ready_to_display; // set once the buffer is completed
uint32 start_time; // time clock is written when LCD is updated to display this frame
PUINT32 rgb; // address ptr for head of rgb data
struct tag_dispq_t *next;
struct tag_dispq_t *prev;
} DISPQ_T, *PDISPQ_T;
#endif
// KK - this is used in special cases where debug prints can cause the timing to change (and not show up a certain problem)
#define NUM_DUMP_ENTRIES 150
typedef struct tag_dumpq_t
{
uint32 numEntries;
char szDumpStr[NUM_DUMP_ENTRIES][80];
}DUMPQ_T, *PDUMPQ_T;
typedef struct tag_mae_master_t
{
// User memory pointer indicies
// we need these to help the decoder and cmodel point into the current working data locations.
// Because the decoder and cmodel are asynchronous
// the cmodel and decoder will point to different buffers at any given time.
uint32 decoder_maeq_offset;
uint32 decoder_desc_offset;
uint32 buffer_offset;
#ifndef MAE_HW
uint32 decoder_extra_info_offset;
#endif
uint32 cmodel_maeq_offset;
uint32 cmodel_desc_offset;
#ifndef MAE_HW
uint32 cmodel_extra_info_offset;
uint32 MAEConfig_offset;
#endif
uint32 yuv_region_offset; // KK
// Status of MAE hardware
uint32 state; // MAE_IDLE, MAE_FEBE_BUSY, MAE_FE_BUSY, FE_ENABLED, BE_ENABLED, LCD_ENABLED
uint32 video_out_linesize;
uint32 video_out_height;
uint32 initial_display_frame;
uint32 operating_mode;
uint32 operating_mode_status;
uint32 pipeline_be_delay;
uint32 pipeline_discard_delay;
uint32 playback_speed;
uint32 StillSleeping;
void (*wake_up_function)(void);
uint32 nFramesInSystem;
uint32 InterruptMask;
uint32 fe_regmask; // KK - this makes it easier to switch from decoder address space to cmodel
uint32 decoder_pmms;
uint32 cmodel_pmms;
// MAE Queue
PMAEQ_T sw_proc;
PMAEQ_T fe_wait;
PMAEQ_T fe_proc;
PMAEQ_T be_proc;
PMAEQ_T maeq_free;
// Display Queue
PRGBQ_T rgb_write;
PRGBQ_T rgb_timer;
PRGBQ_T rgb_draw;
PRGBQ_T rgb_free;
// Anchor Frames
PMAEQ_T b_anchor;
PMAEQ_T f_anchor;
struct fasync_struct *async_queue; // KK
// Descriptors memory usage
PUINT32 pDescRingStart;
PUINT32 pDescRingEnd;
PUINT32 pCurDescPtr;
PUINT32 inuse_base;
PUINT32 inuse_end;
PUINT32 inuse_bufferbase;
PUINT32 inuse_bufferend;
PDATAQ_T data_inuse;
PDATAQ_T data_free;
PYUVQ_T yuv_inuse;
PYUVQ_T yuv_free;
#ifndef MAE_HW
PUINT32 extra_info_inuse_base;
PUINT32 extra_info_inuse_end;
#endif
PDUMPQ_T pDumpPtr;
} MAE_MASTER_T, *PMAE_MASTER_T;
#endif // under_driver_ce
typedef struct au1xxxmae_ioctl_t
{
char magic;
unsigned long ksegbase;
unsigned long addrpmms;
} au1xxxmae_ioctl_t;
#endif //UNDER_CE
// ***************************************************************************
// declarations
// ***************************************************************************
#ifdef __cplusplus
extern "C" {
#endif
uint32 InitDescriptor(int);
wrap_context *WrapGetContext(uint32);
void WrapGetNextContext(uint32, wrap_context *);
uint32 *WrapGetMB(uint32);
uint32 *WrapSkipMVs(uint32 *, int, int);
int WrapGetNumWMs(int);
void WrapSetRegisters(reg_info *, unsigned char);
void WrapSubmitMBs (void);
uint32 request_mae_flush(void);
#ifdef UNDER_CE
int mae_ioctl(unsigned int, unsigned long);
int mae_init(void);
void mae_exit(void);
#endif //UNDER_CE
#ifdef __cplusplus
}
#endif
// ***************************************************************************
// data
// ***************************************************************************
extern mae_desc *desc_ptr;
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?