📄 mae_fe.h
字号:
/* <LIC_AMD_STD> * Copyright (C) 2003-2005 Advanced Micro Devices, Inc. All Rights Reserved. * * Unless otherwise designated in writing, this software and any related * documentation are the confidential proprietary information of AMD. * THESE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY * UNLESS OTHERWISE NOTED IN WRITING, EXPRESS OR IMPLIED WARRANTY OF ANY * KIND, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, * NONINFRINGEMENT, TITLE, FITNESS FOR ANY PARTICULAR PURPOSE AND IN NO * EVENT SHALL AMD OR ITS LICENSORS BE LIABLE FOR ANY DAMAGES WHATSOEVER. * * AMD does not assume any responsibility for any errors which may appear * in the Materials nor any responsibility to support or update the * Materials. AMD retains the right to modify the Materials at any time, * without notice, and is not obligated to provide such modified * Materials to you. AMD is not obligated to furnish, support, or make * any further information available to you. * </LIC_AMD_STD> *//* <CTL_AMD_STD> * File Id and RCS Info: * $Source: /home/cvs/travis/mae/env/mae_fe.h,v $ * $Id: mae_fe.h,v 1.47 2004/05/10 19:56:18 eswartz Exp $ * </CTL_AMD_STD> *//* <DOC_AMD_STD> * </DOC_AMD_STD> */#ifndef __mae_fe_h__#define __mae_fe_h__#include "types.h"#ifdef HAVE_MAE #include "vpi_routines.h" #define printf log_printf #define __inline inline#else #include <stdio.h> #include <stdlib.h> #define log_printf printf#endif#define MAE_IBLOCKMV 0x4000#define MB_SIZE 16// Windows compiler doesn't like ull#ifdef WINNT_ONLY #define UINT64(x) x#else #define UINT64(x) (x ## ull)#endif // Some prints only for RTL Simulation#ifdef HAVE_MAE extern char rtl_printf_huge_buf[];#endifextern int RTL_printf(const char *, ...);enum random_stuff { ENABLED = 1, DISABLED = 0, ENABLE = 1, DISABLE = 0};enum motion_compensation_precision { FULL_PEL = 0, HALF_PEL = 1, QUARTER_PEL = 2};enum macro_block_mode { MBM_INTRA = 0, MBM_FORWARD = 1, MBM_BACKWARD = 2, MBM_BIDIRECTIONAL = 3};enum macro_block_type { MBT_16x16 = 0, MBT_16x8 = 2, MBT_8x8 = 3};#define CBP_Y0 0x80#define CBP_Y1 0x40#define CBP_Y2 0x20#define CBP_Y3 0x10#define CBP_CB0 0x08#define CBP_CR0 0x04#define CBP_CB1 0x02#define CBP_CR1 0x01#define WM_INTRA_Y 0x1#define WM_INTRA_C 0x2#define WM_INTER_Y 0x4#define WM_INTER_C 0x8 #define S_HACK_MIDE_SHIFT 16#define S_HACK_BLK3_SHIFT 17#define S_HACK_BLK0_SHIFT 18#define S_HACK_ENUM_SHIFT 19typedef struct mae_fe_config_struct { // MAE CONFIGURATION REGISTER SUPPORT uint32 bc; // 1-bit uint32 iqmul1; // 2-bits uint32 mcprec; // 2-bits uint32 xfrmtyp; // 2-bits uint32 mis; // 1-bit uint32 mcprecuv; // 2-bits uint32 loopfilt; // 1-bit uint32 smooth; // 1-bit uint32 satiq; // 1-bit // MAE FRONT END CURRENT FRAME Y REGISTER uint32 cur_y_frame_ptr; // 32-bits // MAE FRONT END FORWARD REFERENCE FRAME Y REGISTER uint32 fwd_y_top_ptr; // 32-bits // MAE FRONT END BACKWARD REFERENCE FRAME Y REGISTER uint32 bwd_y_top_ptr; // 32-bits // MAE FRONT END CURRENT FRAME Cb REGISTER uint32 cur_cb_frame_ptr; // 32-bits // MAE FRONT END FORWARD REFERENCE FRAME Cb REGISTER uint32 fwd_cb_top_ptr; // 32-bits // MAE FRONT END BACKWARD REFERENCE FRAME Cb REGISTER uint32 bwd_cb_top_ptr; // 32-bits // MAE FRONT END CURRENT FRAME Cr REGISTER uint32 cur_cr_frame_ptr; // 32-bits // MAE FRONT END FORWARD REFERENCE FRAME Cr REGISTER uint32 fwd_cr_top_ptr; // 32-bits // MAE FRONT END BACKWARD REFERENCE FRAME Cr REGISTER uint32 bwd_cr_top_ptr; // 32-bits // MAE FRONT END PICTURE SIZE REGISTER uint32 height; // 16-bits uint32 linesiz; // 16-bits // MAE INTENSITY COMPENSATION REGISTER uint32 icomp; // 1-bit uint32 lumshift; // 6-bits uint32 lumscale; // 6-bits // MAE FRONT END FORWARD BOTTOM FIELD REFERENCE Y REGISTER uint32 fwd_y_bot_ptr; // MAE FRONT END BACKWARD BOTTOM FIELD REFERENCE Y REGISTER uint32 bwd_y_bot_ptr; // MAE FRONT END FORWARD BOTTOM FIELD REFERENCE Cb REGISTER uint32 fwd_cb_bot_ptr; // MAE FRONT END BACKWARD BOTTOM FIELD REFERENCE Cb REGISTER uint32 bwd_cb_bot_ptr; // MAE FRONT END FORWARD BOTTOM FIELD REFERENCE Cr REGISTER uint32 fwd_cr_bot_ptr; // MAE FRONT END BACKWARD BOTTOM FIELD REFERENCE Cr REGISTER uint32 bwd_cr_bot_ptr; // MPEG/WMV9 uint32 codstyl; uint32 pquant;#ifndef HAVE_MAE#ifdef REF_MPEG4 int nFrameType; // {IFRAME, PFRAME, BFRAME} int nFrameNum; // Frame number int nMB; // MacroBlock number int nRefType; int nWidthLuma; // offsets for the Y & CbCr blocks in memory int nWidthChroma; int nFrameWidthY; int uv_height; int uv_linesiz; unsigned char bUsingFieldMVs; // Interlacing? unsigned char bFieldDCT; // Interlacing? unsigned char bPureIntra; unsigned char bTrueInterP; // Where to send data unsigned char *xCurYMBRef; unsigned char *xCurCbMBRef; unsigned char *xCurCrMBRef;#endif#endif} mae_fe_config;typedef struct mae_fe_mb_struct { // MAE HEADER WORD 0 uint32 mbmode; // 3-bits uint32 mbtype; // 3-bits uint32 cbp; // 8-bits uint32 bblk; // 1-bit uint32 wtchgmsk; // 4-bits uint32 dcluma; // 6-bits uint32 dcchroma; // 6-bits // MAE HEADER WORD 1 uint32 rnd; // 1-bit uint32 ps; // 1-bit uint32 dctt; // 1-bit uint32 fp; // 1-bit uint32 ft; // 1-bit uint32 fb; // 1-bit uint32 bt; // 1-bit uint32 bb; // 1-bit uint32 iqmul2; // 9-bits uint32 iqadd2; // 8-bits uint32 iqdiv3; // 3-bits // MAE HEADER WORD 2 uint32 xpos; // 11-bits uint32 ypos; // 11-bits // MAE HEADER WORD 3 uint32 xformsize; // 16-bits uint32 iqadd1; // 6-bits // MOTION VECTORS uint32 mv[8]; // WEIGHING MATRICES uint8 wm0[64]; uint8 wm1[64]; uint8 wm2[64]; uint8 wm3[64]; // DATA int16 blk_data0[64]; int16 blk_data1[64]; int16 blk_data2[64]; int16 blk_data3[64]; int16 blk_data4[64]; int16 blk_data5[64]; int16 blk_data6[64]; int16 blk_data7[64]; uint32 mv_uv[2]; uint32 res2; uint32 mv_uv1[2]; uint32 picture_level_mbmode; // Required so asic_gen packed tests continue to work //uint32 res5; uint32 res6; uint32 res7;} mae_fe_mb;typedef struct mae_frontend_struct { mae_fe_config cfg; mae_fe_mb mb;} mae_frontend;void mae_fe_swap(mae_frontend *, int num);int64 mae_abs64(int64);int is_pos(int64 a);int64 add(char*, int64 a, int64 b);int64 mult(char*, int64 a, int64 b);int64 double_to_fixed(double num);double fixed_to_double(int64 num);int64 gen_con_int(short exp, short sub);void perform_iquant(mae_fe_config * mae_fe_cfg, mae_fe_mb * mb_in, int64 *fixed_point_block, int block_number, int8 *w_matrix, uint32 blk_mbmode);void interlaced_to_prog(uint8 * dst, uint8 * src, uint32 h, uint32 w, uint32 tff);void prog_to_interlaced(uint8 * dst, uint8 * src, uint32 h, uint32 w, uint32 tff);int64 fixed_sign_extend(int64 in);void check_param_size(mae_fe_config * mae_fe_cfg, mae_fe_mb * mb_in);void print_macroblock_data(mae_fe_config *mae_fe_cfg, mae_fe_mb *mb_in, int mb_num);void check_valid_cfg_changes(mae_fe_config *mae_fe_cfg, mae_fe_mb *mb_in, int mb_num);#if __cplusplus extern "C" {#endifvoid fe_process_mb(mae_fe_config * mae_fe_cfg, mae_fe_mb * mb_in, uint8 *cur_y_frame, uint8 *cur_cb_frame, uint8 *cur_cr_frame, uint32 mb_num);void cmodel_init_global();void cmodel_check_global();__inline int mae_clip(int a, int amin, int amax);#if __cplusplus }#endif#endif/**************************************************************************** * Revision History: * $Log: mae_fe.h,v $ * Revision 1.47 2004/05/10 19:56:18 eswartz * Moved where mae_clip is defined * * Revision 1.46 2004/04/29 18:13:02 nathans * changes for accessing via c++ for mp4 player * * Revision 1.45 2004/04/22 20:54:19 eswartz * Fixes for mpeg4 ref code * * Revision 1.44 2004/04/21 21:16:26 eswartz * fix cmodel global init (again) * * Revision 1.43 2004/04/21 19:07:51 eswartz * Fixes for inconsistancies between Ref interaction and RTL interaction with cmodel * * Revision 1.42 2004/04/20 19:44:12 eswartz * Changes for mpeg2 ref code * * Revision 1.41 2004/04/20 17:41:05 eswartz * DMV support & changes for mpeg4 ref code * * Revision 1.40 2004/04/16 06:40:32 nathans * fix prototyping stuff AGAIN. remembering to check in this time * * Revision 1.39 2004/04/13 21:42:41 eswartz * Added some checks to make sure no cfg regs change on a non-frame boundary. * * Revision 1.38 2004/04/13 13:32:55 eswartz * intermediate checker fixes for the new mpeg mcomp * * Revision 1.37 2004/04/13 01:35:41 eswartz * More changes for wmv9 merge * * Revision 1.36 2004/04/12 01:56:25 eswartz * Fixes mpeg mcomp to match reference code. * * Revision 1.35 2004/04/09 21:29:34 cckuo * adding hack switch for wmv9 advanced profile * * Revision 1.34 2004/03/31 15:31:38 nathans * add field for mp4 player edits * * Revision 1.33 2004/03/26 17:17:19 hvasudev * Prefixed IBLOCKMV with a MAE_ tag * * Revision 1.32 2004/03/24 06:58:16 eswartz * Updates for dct type interlacing. * * Revision 1.31 2004/03/19 22:24:17 rsartin * * Convert RTL_printf to a function so we can compile on Windows. * * Revision 1.30 2004/03/19 19:18:56 nathans * readd harish's changes that got removed * remove crazy ifdefs in mae_fe.c * * Revision 1.29 2004/03/15 04:18:12 eswartz * Added mvs for chroma bottom 8x4s * * Revision 1.28 2004/03/09 06:20:04 nathans * fix -pedantic errors so insure works better * * Revision 1.27 2004/03/04 22:20:29 eswartz * Merged code with SW * * Revision 1.26 2004/02/27 15:50:37 nathans * proto changes * * Revision 1.25 2004/02/25 23:37:22 cckuo * add pquant to cfg struct * * Revision 1.24 2004/02/19 23:29:05 eswartz * Added support for wmv9 Overlap Smoothing filter * * Revision 1.23 2004/01/30 01:42:38 eswartz * Added function to check for input/cfg/hdr overflow * * Revision 1.22 2004/01/22 01:42:52 eswartz * Added code to write an elf file for prototyping * * Revision 1.21 2004/01/21 00:39:46 eswartz * Added defines to help SW guys integrate into media player * * Revision 1.20 2004/01/05 17:11:15 eswartz * Added codstyl bit ****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -