⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mat32.cpp

📁 这是我本人编写的一个32位定点小数运算的函数库。对于没有浮点运算器的场合
💻 CPP
📖 第 1 页 / 共 3 页
字号:

	#pragma warning(disable:4405)
	inline long VectorMul32(const long v1[],const long v2[],int n)
	{
		long x1=0,x2=0;
		_asm mov esi,n
		_asm mov ebx,v1
		_asm mov ecx,v2

	loop:
		_asm dec esi
		_asm jl ret
		_asm mov eax,[ebx+esi*4]
		_asm imul DWORD PTR [ecx+esi*4]
		_asm add x1,eax
		_asm adc x2,edx
		_asm jmp loop

	ret:
		_asm mov eax,x1
		_asm mov ebx,x2
		_asm add eax,eax
		_asm adc ebx,ebx
		_asm mov x2,ebx

		return x2;
	}
#else
	extern "C" long VectorMul32(const long v1[],const long v2[],int n);
	extern "C" long VectorMul32_C(const long v1[],const long v2[],int n);
#endif

void FixMiniMfcc32(long mini[],const long mfcc[39],int n)
{
	for (int i=0;i<n;i++) {
//		mini[i]=VectorMul32(mfcc,Fix_MiniMfcc_Matrix32[i],39);
		mini[i]=VectorMul32_C(mfcc,Fix_MiniMfcc_Matrix32[i],39);
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////

long Fix_fisher_matrix32[39][39]= {

	384144022, -852591809, -91547656, -569443943, 185183098, 420891763, 791223170, 786185174, 402090543, -43828422, -5032434, 2703489, 497047975, 714431302, 480843064, 355438609, 16596763, -115788452, 197350097, -159901417, 89715210, 597595307, 290545948, -88339316, 33585571, 65154010, -170095736, -67288607, -69199868, 29608431, 173831929, -16603376, -90014138, 75833231, -59309202, 58760307, -6551048, 193416551, -38682407, 
	97051443, -515883553, 924313469, -825572170, -96644494, -339199336, -978900355, -393006686, -190553525, -179933574, 422474458, 287646845, -303772298, 649963843, 235733575, 86092619, -168092564, -41129250, 50533941, -38503737, 39887576, 110953179, 2981953, -153109141, 67607939, -2084213, -113427079, -15974636, -45449343, 55072218, -316154689, -170252717, -38196861, 34588231, -59343992, 37693277, -326176995, -536956810, -173496277, 
	1105290506, -384017320, 600853040, -125626719, -153334412, 2152337, -127046635, -7626143, -138267452, 178508075, -42291898, -95347629, 93127132, -278766999, 18999088, -427841019, -74914322, 67844807, -215832843, 208805419, -240921895, -769164217, -244063663, 270512073, 326928616, 27325870, -412684079, -15802021, -166173572, 157254644, 587841436, 242919055, -206598878, 303282673, 4005937, 35303772, 241568288, 796868905, 217241593, 
	-684211912, -395323821, 123166348, -185707513, 164815075, 74705373, -379818989, -17338331, 106947692, -208512716, 123250100, 207010552, 729289742, -838212259, -786889547, 93527852, 145056078, 201793240, -91555173, 403207235, -117185605, 562677223, 563330058, 274210040, 270999551, 80778671, -644028198, -72626822, -303770151, 206930665, 170744492, 8660930, -226847287, 208795970, -114330096, 100752417, -199907319, 81717551, 8851885, 
	-215323889, 779212294, -381171904, -312935611, 35355741, -195311275, -540053482, -304553982, 10209459, -209141499, 312783141, 219487861, 420949745, 808083064, 137627073, 46926168, -256050917, 24952471, 6054916, 218858649, -125749125, 224691214, 360296217, 97069912, 9448456, -192157480, 140691962, 188774980, 52745205, 108272690, 612921898, -85370634, 122627544, -216165703, 52673049, -159909577, 554615569, 1001575636, -198739947, 
	-453280110, -156466517, 387833399, -891482738, 80532999, 30057899, 470077728, 518497042, 368639190, -251453154, 67152028, 180734157, -934861908, -215804926, -825314472, -179662561, -200437103, 252142498, -155880468, 233087875, 37307374, -128256098, -273902948, -57222707, -259360189, -177886807, 337507120, 216872226, 230096430, -98888829, 154675731, -55289757, 250826090, -320002980, 105639445, -77975130, 346998998, 364125180, -74079595, 
	-1129539891, -723839427, 407392680, 138519567, -214306626, -316837589, -101855363, -44092778, -295972638, 152216647, -110041571, -114435752, 270988814, -60384233, 575267920, 6155053, 180720198, -245547574, 143646899, -359514531, 18591067, -132222070, -201459950, -44442388, -239042846, 64736968, 371413739, -83667680, 150110181, -148701645, 207773123, 678617718, -9709417, -129699636, 62800582, -56210598, 272494200, 459789134, 746018639, 
	-704660251, -587414086, 288224518, 1051715084, 331738979, 482509511, 56756919, -94264223, -7416183, 67900641, -84952090, 36961844, -481586092, 614549691, 50887202, -188496450, -270035330, 81556919, -101440684, 159306779, -22787592, -243082263, -72982660, -14347466, 253016523, 6576905, -338598041, -41022305, -130769298, 71312993, 258462542, -645323130, -78010349, 262594300, 39407399, -38466800, 81468443, 248908387, -743033636, 
	-666100034, 498106685, -534811474, -706794850, 336609472, -34140050, 112240380, 117048811, 483005580, -225161512, 224092066, 179372652, -163899172, -38179252, 620000004, -241155970, 55096270, -137727574, -21009368, -231629733, -89142689, -713647470, -513197051, 77867328, 375032249, 176001103, -522568670, -366075094, -291834437, 153924541, 62229566, 46222009, -288097815, 622557657, -23805285, 188657512, -265540647, -113923577, 98442154, 
	85127111, -477510168, -336010323, -383162621, -138434741, -363581866, -208884660, -105024834, -71437546, 31210024, -32370523, -117240151, 342323926, -805413741, 298787990, 23209144, 397387554, -185475370, 246254097, -349421358, 131813405, -135279872, -243183195, -16527527, -158366825, 131457353, 478470094, -161401219, 119850633, -171980583, 135390684, -927770917, 109652448, 115972922, 146547291, 28697468, 355455788, 196430115, -1063440344, 
	86058474, 715178627, 656146449, 105427274, -98554681, 113420637, 45119276, -23049800, -189425237, 1634488, -27181773, -41232759, -631720969, -251796752, -23333268, 631710232, 340086248, -229230994, 321993698, -464526482, 472654708, 735437988, -180048679, -430892593, -184037844, 373640680, -356334108, -270527104, -236313395, -82674683, 471280319, -83715139, -282464966, 366435872, -70266308, 337389008, 17834637, 506825468, 11739584, 
	-365600500, 874335082, 1240438095, -134716373, -280615982, 79447231, 527282398, 489342804, -169038530, 175469600, -145897461, -155655627, 848348383, 13967491, 234898204, -104255606, -47419015, -55513955, 15190956, 64110547, -198118680, -284769216, 93269939, 264784734, 143920918, -131630653, 29591036, 103316942, 43209089, -67046156, -200213765, -328348101, 116060539, -39665525, 3731682, -119667881, 4318955, -264885665, -388758964, 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -