📄 sramtable.c
字号:
#include "defs.h"#include "mpegaud.h"#include "bitstr.h"#include "huff.h"#include "imdct.h"#include "mpeg3dec.h"#include "mpegdec.h"#include "mpegimdc.h"#include "mpegsub.h"#include "mpegtab.h"#include "../myhead.h"extern INT16 (*slen)[16];INT16 (*slen)[16];#define slen_size sizeof(INT16)*2*16const INT16 slen_tag[ 2 ][ 16 ] = { {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4}, {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3}};extern INT16 (*sfb_bt)[3][4];INT16 (*sfb_bt)[3][4];#define sfb_bt_size sizeof(INT16)*6*3*4const INT16 sfb_bt_tag[ 6 ][ 3 ][ 4 ] = { { {6, 5, 5, 5}, {9, 9, 9, 9}, {6, 9, 9, 9} }, { {6, 5, 7, 3}, {9, 9, 12, 6}, {6, 9, 12, 6} }, { {11, 10, 0, 0}, {18, 18, 0, 0}, {15, 18, 0, 0} }, { {7, 7, 7, 0}, {12, 12, 12, 0}, {6, 15, 12, 0} }, { {6, 6, 6, 3}, {12, 9, 9, 6}, {6, 12, 9, 6} }, { {8, 8, 5, 0}, {15, 12, 9, 0}, {6, 18, 9, 0} }};extern INT16 (*sfBandIndex_l)[3][23];INT16 (*sfBandIndex_l)[3][23];#define sfBandIndex_l_size sizeof(INT16)*2*3*23const INT16 sfBandIndex_l_tag[ 2 ][ 3 ][ 23 ] = { { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,330,394,464,540,576}, {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576} }, { {0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576}, {0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576}, {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576} }};extern INT16 (*sfBandIndex_s)[3][14];INT16 (*sfBandIndex_s)[3][14];#define sfBandIndex_s_size sizeof(INT16)*2*3*14const INT16 sfBandIndex_s_tag[ 2 ][ 3 ][ 14 ] = { { {0,4,8,12,18,24,32,42,56,74,100,132,174,192}, {0,4,8,12,18,26,36,48,62,80,104,136,180,192}, {0,4,8,12,18,26,36,48,62,80,104,134,174,192} }, { {0,4,8,12,16,22,30,40,52,66,84,106,136,192}, {0,4,8,12,16,22,28,38,50,64,80,100,126,192}, {0,4,8,12,16,22,30,42,58,78,104,138,180,192} }};extern INT16 *pretab;INT16 *pretab;#define pretab_size sizeof(INT16)*22const INT16 pretab_tag[ 22 ] = { 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0};extern ST_TYPE *tan_pos0;ST_TYPE *tan_pos0;#define tan_pos0_size sizeof(ST_TYPE)*MAX_POS1const ST_TYPE tan_pos0_tag[ MAX_POS1 ] = { 0x0000, 0x0D86, 0x176C, 0x2000, 0x2893, 0x3279, 0x4000};extern ST_TYPE *tan_pos1;ST_TYPE *tan_pos1;#define tan_pos1_size sizeof(ST_TYPE)*MAX_POS1const ST_TYPE tan_pos1_tag[ MAX_POS1 ] = { 0x4000, 0x3279, 0x2893, 0x2000, 0x176C, 0x0D86, 0x0000};extern ST_TYPE (*pow_io0)[MAX_POS2];ST_TYPE (*pow_io0)[MAX_POS2];#define pow_io0_size sizeof(ST_TYPE)*2*MAX_POS2const ST_TYPE pow_io0_tag[ 2 ][ MAX_POS2 ] = { 0x4000, 0x35D1, 0x4000, 0x2D41, 0x4000, 0x260D, 0x4000, 0x2000, 0x4000, 0x1AE8, 0x4000, 0x16A0, 0x4000, 0x1306, 0x4000, 0x1000, 0x4000, 0x0D74, 0x4000, 0x0B50, 0x4000, 0x0983, 0x4000, 0x0800, 0x4000, 0x06BA, 0x4000, 0x05A8, 0x4000, 0x04C1, 0x4000, 0x0400, 0x4000, 0x2D41, 0x4000, 0x2000, 0x4000, 0x16A0, 0x4000, 0x1000, 0x4000, 0x0B50, 0x4000, 0x0800, 0x4000, 0x05A8, 0x4000, 0x0400, 0x4000, 0x02D4, 0x4000, 0x0200, 0x4000, 0x016A, 0x4000, 0x0100, 0x4000, 0x00B5, 0x4000, 0x0080, 0x4000, 0x005A, 0x4000, 0x0040};extern ST_TYPE (*pow_io1)[MAX_POS2];ST_TYPE (*pow_io1)[MAX_POS2];#define pow_io1_size sizeof(ST_TYPE)*2*MAX_POS2const ST_TYPE pow_io1_tag[ 2 ][ MAX_POS2 ] = { 0x4000, 0x4000, 0x35D1, 0x4000, 0x2D41, 0x4000, 0x260D, 0x4000, 0x2000, 0x4000, 0x1AE8, 0x4000, 0x16A0, 0x4000, 0x1306, 0x4000, 0x1000, 0x4000, 0x0D74, 0x4000, 0x0B50, 0x4000, 0x0983, 0x4000, 0x0800, 0x4000, 0x06BA, 0x4000, 0x05A8, 0x4000, 0x04C1, 0x4000, 0x4000, 0x4000, 0x2D41, 0x4000, 0x2000, 0x4000, 0x16A0, 0x4000, 0x1000, 0x4000, 0x0B50, 0x4000, 0x0800, 0x4000, 0x05A8, 0x4000, 0x0400, 0x4000, 0x02D4, 0x4000, 0x0200, 0x4000, 0x016A, 0x4000, 0x0100, 0x4000, 0x00B5, 0x4000, 0x0080, 0x4000, 0x005A, 0x4000};extern void * table_apply_sram(int size);void init_sram_table(){ /* * hhtech previous optimizations */ slen = (INT16 (*)[16])table_apply_sram(slen_size); memcpy(slen, slen_tag, slen_size); sfb_bt = (INT16 (*)[3][4])table_apply_sram(sfb_bt_size); memcpy(sfb_bt, sfb_bt_tag, sfb_bt_size); sfBandIndex_l = (INT16 (*)[3][23])table_apply_sram(sfBandIndex_l_size); memcpy(sfBandIndex_l, sfBandIndex_l_tag, sfBandIndex_l_size); sfBandIndex_s = (INT16 (*)[3][14])table_apply_sram(sfBandIndex_s_size); memcpy(sfBandIndex_s, sfBandIndex_s_tag, sfBandIndex_s_size); pretab = (INT16 *)table_apply_sram(pretab_size); memcpy(pretab, pretab_tag, pretab_size); tan_pos0 = (ST_TYPE *)table_apply_sram(tan_pos0_size); memcpy(tan_pos0, tan_pos0_tag, tan_pos0_size); tan_pos1 = (ST_TYPE *)table_apply_sram(tan_pos1_size); memcpy(tan_pos1, tan_pos1_tag, tan_pos1_size); pow_io0 = (ST_TYPE (*)[MAX_POS2])table_apply_sram(pow_io0_size); memcpy(pow_io0, pow_io0_tag, pow_io0_size); pow_io1 = (ST_TYPE (*)[MAX_POS2])table_apply_sram(pow_io1_size); memcpy(pow_io1, pow_io1_tag, pow_io1_size);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -