📄 vp.h
字号:
/* Copyright 1996, ESS Technology, Inc. *//* SCCSID @(#)vp.h 4.5 11/17/03 *//* * $Log$ */#ifndef _VP_H_#define _VP_H_/************************************************************ * vp.h * prefix: VP_ * most macros are named something like VP_macros. * Most macros start with a parameter ncmdq; * value of ncmdq can be either 0 or NCMDQ_VP_macros, which is a constant, * parameter 0 should be used when we do not want a VP_cmdq_wait to * be issued in the beginning of that macros, probably because we * have already issued VP_cmdq_wait somewhere else before. * This mechanism is used to avoid and manage cmdq overflow problem. * Macros that start with VP_cmdq_ does not have VP_cmdq_wait in it. ************************************************************//************************************************************ * compile option ************************************************************/#undef CMDQ_DEBUG/************************************************************ * microcode entry pt address rom code ************************************************************/#define setBase 0x1003#define rx_0 0x1033#define rx_1 0x1028#define rx_2 0x101d#define rx_3 0x1017#define clr_pcstack 0x1052#define check 0x1015#define do_nothing 0x1058#define loading 0x1005#define longnop 0x104e#define setMode 0x1001#define r_rr14 0x104c#define r_rr15 0x104d#define r_rr10 0x1048#define r_rr11 0x1049#define r_rr12 0x104a#define r_rr13 0x104b#define r_rr7 0x1045#define r_rr6 0x1044#define r_rr5 0x1043#define r_rr4 0x1042#define r_rr3 0x1041#define r_rr2 0x1040#define r_rr1 0x103f#define r_rr0 0x103e#define r_rr9 0x1047#define r_rr8 0x1046#define idct_dc_no_mismatch 0x105a#define idct 0x105d#define idct_join 0x10c9#define idct_no_mismatch 0x105d#define move_Y 0x115d#define dm_add_8 0x1173#define extract_Y 0x115b#define Do_Avg 0x1177#define mpeg_inter_no_mismatch 0x118c#define mpeg_inter_join 0x118d#define intra_postidct 0x120f#define select_Y 0x1231#define select_U 0x122b#define select_V 0x122e#define mpeg1_inter 0x1189#define mpeg_intra_no_mismatch 0x11df#define intra_quant 0x1200#define fourfour_join 0x11e1#define mpeg_intra_join 0x11e0#define set_iquant 0x1234#define clearalldp 0x124d#define ClearRLA_DP 0x1258#define set_DP 0x124a#define save_DC 0x1266#define restore_DC 0x126f#define mismatch_ctl_mpeg1 0x127e/* * Only works for chips after 3210T */#define Frame_int 0x113d#define Restore_UV_from_fifth 0x117f#define Save_UV_in_fifth 0x117c#define dpcm 0x11d5#define mpeg1_intra 0x11dc#define kcross_fade 0x12bb#define karaoke 0x12dd#define mpg_audio_synth32 0x1334#define mpg_audio_synwindow18 0x16a3#define mpg_audio_average 0x1744#if 0 /* volume_128 replace this two entries */#define mpg_volume_stereoint 0x175c#define interleave 0x1770#endif#include "uc3208.map"/************************************************************ * Number of cmdq entries needed for each VP operation ************************************************************/#define NCMDQ_VP_cbus 1#define NCMDQ_VP_data 1#define NCMDQ_VP_ucode NCMDQ_VP_cbus#define NCMDQ_VP_mcmd NCMDQ_VP_cbus#define NCMDQ_VP_block 1#define NCMDQ_VP_block_twice 2#define NCMDQ_VP_endio (NCMDQ_VP_block*2)#define NCMDQ_VP_xfer 4#define NCMDQ_VP_xfer_2d 3#define NCMDQ_VP_read NCMDQ_VP_block_twice#define NCMDQ_VP_cmdq_reset 2/************************************************************ * Following are commands to VP via Cbus (see BUSCON_CMDQUE_VPCBUSWR) ************************************************************/#define VPCMD_WAIT 0x8000 /* VP's Wait bit */#define VPCMD_W_DPCM 0x4000 /* Write to DPCM memory */#define VPCMD_W_DP 0x4800 /* Write to DP memory */#define VPCMD_R_DPCM 0x5000 /* Read from DPCM memory */#define VPCMD_R_DP 0x5800 /* Read from DP memory */#define VPCMD_W_INTRA 0x6000 /* Write RUN/AMPL intra */#define VPCMD_W_INTER 0x6800 /* Write RUN/AMPL inter */#define VPCMD_R_INTRA 0x7000 /* Read RUN/AMPL intra */#define VPCMD_R_INTER 0x7800 /* Read RUN/AMPL inter *//* house keeping command */#define VPCMD_MV 0x0300 /* motion vector housekeep cmd */#define VPCMD_BFRAME_ON 0x0282 /* Bframe Compression housekeep cmd */#define VPCMD_BFRAME_OF 0x0280 /* Bframe Compression housekeep cmd *//* Following are VP DMA controls (see BUSCON_CMDQUE_VPDMAX) */#define VPDMA_VP2MEM 0x0 /* From VP to reference memory */#define VPDMA_MEM2VP 0x4000 /* From reference memory to VP */#define VPDMA_INC2 0x1000 /* Increment Y position by 2 when DMAing*/#define VPDMA_INC1 0x0000 /* Increment Y position by 1 when DMAing*/#define VPDMA_RLA 0x2000 /* Transfer RLA data */#define VPDMA_BREAK 0x8000 /* Send break to VP at the end of a line*/#define VPDMA_WIDTH0 0x0000 /* Use width0 for y increments */#define VPDMA_WIDTH1 0x0200 /* Use width1 for y increments */#define VPDMA_WIDTH2 0x0400 /* Use width2 for y increments */#define VPDMA_WIDTH3 0x0600 /* Use width3 for y increments */#define VPDMA_USEDX 0x0800 /* Use dx for y increments */#ifdef MPEG1/* mpeg1 way of using width register */#define VPDMA_WIDTH44 VPDMA_WIDTH1 /* width1 is hardwired to 44 */#define VPDMA_WIDTH33 VPDMA_WIDTH2 /* width2 is hardwired to 33 */#endif#ifdef JPEG_DEC#define JPEG_VPDMA_WIDTH VPDMA_WIDTH3 /* For JPEG_DEC */ #endif#ifndef FAKE/************************************************************ * Following are commands to VP via dmay (see BUSCON_CMDQUE_DMAY) ************************************************************/#define VPDMA_YPOS_BFRAME_COMP_ON 0x8000#define VPDMA_YPOS_BFRAME_COMP_OF 0x0000#if 0#define VPDMA_YPOS_BFRAME_COMP 0x8000#endif/* Following are used with BUSCON_CMDQUE_VPSTATWAIT */#define VPSTAT_DH 0x2000/* should have been appended in initialization */#define VPUCODE 0x1000 /* append to all vpucode addresses *//************************************************************ * enty type that can go into cmdq ************************************************************/#define VP_cmdq_cmd(a) mvd[buscon_cmdque_vpcbuswr] = (a)#define VP_cmdq_dmax(x) mvd[buscon_cmdque_vpdmax] = (x)#define VP_cmdq_dmay(y) mvd[buscon_cmdque_vpdmay] = (y)#define VP_cmdq_vpstat(y) mvd[buscon_cmdque_vpstatwait] = (y)#define VP_cmdq_deltas(dx, dy) \ mvd[buscon_cmdque_vpdeltas] = ((0x80 - (dy)) << 9) | (0x200 - (dx))/* the -2 term leave some leeway so that read and write pointer won't * overlap; or else hardware might have problem * (according to Duat Tran) */#define MAX_CMDQUE_NUMENTRIES (64-2)#if 0#define VP_cmdq_wait_timeout(n) do {\ int way_too_much = 0; \ while ((mvd[buscon_cmdque_numentries]&0x3f) > (MAX_CMDQUE_NUMENTRIES-(n))) { \ if (way_too_much++ >= 150000) { \ EPRINTF(("VP_cmdq_wait timeout\n")); \ break; \ } \ } \} while (0)#define VP_cmdq_wait(n) VP_cmdq_wait_timeout(n)#else#define VP_cmdq_wait(n) \ do {} while((mvd[buscon_cmdque_numentries]&0x3f)>(MAX_CMDQUE_NUMENTRIES-(n)))#endif#define VP_cmdq_wait_empty while (!(mvd[buscon_cmdque_status]&1));/************************************************************ * command going into vp thru dbus ************************************************************/#define VP_data(ncmdq, a) \do { \ if (ncmdq) VP_cmdq_wait(ncmdq); \ mvd[buscon_cmdque_vpdbuswrlow] = (a); \} while(0)/* vp_data to be faded out */#define vp_data(a) VP_data(NCMDQ_VP_data, a)#define vp_data_only(a) VP_data(0, a)/************************************************************ * command going into vp thru cbus * vp_ucode: for datapath * vp_mcmd: for io ************************************************************/#define VP_cbus(ncmdq, a) \do { \ if(ncmdq) VP_cmdq_wait(ncmdq); \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -