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

📄 idctaan.asm

📁 这是G.723和G.729的音频编解码的源代码
💻 ASM
📖 第 1 页 / 共 2 页
字号:
; esi - input and output data pointer; the input data is tranposed and each 16 bit element in the 8x8 matrix is left aligned:; e.g. in 11...1110000 format; If the iDCT is of I macroblock then 0.5 needs to be added to the DC Component ; (element[0][0] of the matrix).nolistinclude iammx.inc                   ; IAMMX Emulator MacrosMMWORD	TEXTEQU	<DWORD>.list.586.model flat_DATA SEGMENT PARA PUBLIC USE32 'DATA'x0005000200010001  	DQ 0005000200010001hx0040000000000000   DQ 40000000000000hx5a825a825a825a82	DW 5a82h, 5a82h, 5a82h, 5a82h  ; 23170x539f539f539f539f 	DW 539fh, 539fh, 539fh, 539fh  ; 21407x4546454645464546	DW 4546h, 4546h, 4546h, 4546h  ; 17734x61f861f861f861f8	DW 61f8h, 61f8h, 61f8h, 61f8h  ; 25080scratch1	DQ 0scratch3	DQ 0scratch5	DQ 0scratch7	DQ 0; for debug onlyx0	DQ 0preSC DW 16384, 22725, 21407, 19266,  16384, 12873, 8867, 4520	  DW 22725, 31521, 29692, 26722,  22725, 17855, 12299, 6270	  DW 21407, 29692, 27969, 25172,  21407, 16819, 11585, 5906	  DW 19266, 26722, 25172, 22654,  19266, 15137, 10426, 5315	  DW 16384, 22725, 21407, 19266,  16384, 12873, 8867, 4520	  DW 12873, 17855, 16819, 15137,  25746, 20228, 13933, 7103	  DW 17734, 24598, 23170, 20853,  17734, 13933, 9597, 4892	  DW 18081, 25080, 23624, 21261,  18081, 14206, 9785, 4988_DATA ENDS_TEXT SEGMENT PARA PUBLIC USE32 'CODE'COMMENT ^void idct8x8aan (    int16 *src_result);^public  _idct8x8aan_idct8x8aan proc nearpush	ebplea	ecx, [preSC]mov	ebp, esppush	esi			  mov	esi, DWORD PTR [ebp+8]	  ; source;slot; column 0: even part; use V4, V12, V0, V8 to produce V22..V25movq mm0, mmword ptr [ecx+8*12]		; maybe the first mul can be done together						; with the dequantization in iHuff module ?;slotpmulhw mm0, mmword ptr [esi+8*12]	; V12;slotmovq mm1, mmword ptr [ecx+8*4];slotpmulhw mm1, mmword ptr [esi+8*4]	; V4;slotmovq mm3, mmword ptr [ecx+8*0]psraw mm0, 1						; t64=t66pmulhw mm3, mmword ptr [esi+8*0]	; V0;slotmovq mm5, mmword ptr [ecx+8*8]movq mm2, mm1						; duplicate V4pmulhw mm5, mmword ptr [esi+8*8]	; V8psubsw mm1, mm0						; V16pmulhw mm1, mmword ptr x5a825a825a825a82	; 23170 ->V18paddsw mm2, mm0						; V17movq mm0, mm2						; duplicate V17psraw mm2, 1						; t75=t82psraw mm0, 2  						; t72movq mm4, mm3						; duplicate V0paddsw mm3, mm5						; V19psubsw mm4, mm5						; V20 ;mm5 free;moved from the block belowmovq mm7, mmword ptr [ecx+8*10]psraw mm3, 1						; t74=t81movq mm6, mm3						; duplicate t74=t81psraw mm4, 2						; t77=t79psubsw mm1, mm0						; V21 ; mm0 freepaddsw mm3, mm2						; V22movq mm5, mm1						; duplicate V21paddsw mm1, mm4						; V23movq mmword ptr [esi+8*4], mm3		; V22psubsw mm4, mm5						; V24; mm5 freemovq mmword ptr [esi+8*12], mm1		; V23psubsw mm6, mm2						; V25; mm2 freemovq mmword ptr [esi+8*0], mm4		; V24;slot; keep mm6 alive all along the next block;movq mmword ptr [esi+8*8], mm6		; V25; column 0: odd part; use V2, V6, V10, V14 to produce V31, V39, V40, V41;moved above;movq mm7, mmword ptr [ecx+8*10]pmulhw mm7, mmword ptr [esi+8*10]	; V10;slotmovq mm0, mmword ptr [ecx+8*6];slotpmulhw mm0, mmword ptr [esi+8*6]	; V6;slotmovq mm5, mmword ptr [ecx+8*2]movq mm3, mm7						; duplicate V10pmulhw mm5, mmword ptr [esi+8*2]	; V2;slotmovq mm4, mmword ptr [ecx+8*14]psubsw mm7, mm0						; V26pmulhw mm4, mmword ptr [esi+8*14]	; V14paddsw mm3, mm0						; V29 ; free mm0movq mm1, mm7						; duplicate V26psraw mm3, 1						; t91=t94pmulhw mm7, mmword ptr x539f539f539f539f ; V33psraw mm1, 1						; t96movq mm0, mm5						; duplicate V2psraw mm4, 2						; t85=t87paddsw mm5, mm4						; V27psubsw mm0, mm4						; V28 ; free mm4movq mm2, mm0						; duplicate V28psraw mm5, 1						; t90=t93pmulhw mm0, mmword ptr x4546454645464546 ; V35psraw mm2, 1						; t97movq mm4, mm5						; duplicate t90=t93psubsw mm1, mm2						; V32 ; free mm2pmulhw mm1, mmword ptr x61f861f861f861f8 ; V36psllw mm7, 1						; t107paddsw mm5, mm3						; V31psubsw mm4, mm3						; V30 ; free mm3pmulhw mm4, mmword ptr x5a825a825a825a82 ; V34nop ;slotpsubsw mm0, mm1						; V38psubsw mm1, mm7						; V37 ; free mm7							  psllw mm1, 1						; t114;move from the next blockmovq mm3, mm6                       ; duplicate V25;move from the next blockmovq mm7, mmword ptr [esi+8*4]		; V22psllw mm0, 1						; t110psubsw mm0, mm5						; V39 (mm5 still needed for next block)psllw mm4, 2						; t112;move from the next blockmovq mm2, mmword ptr [esi+8*12]     ; V23psubsw mm4, mm0						; V40paddsw mm1, mm4						; V41; free mm0;move from the next blockpsllw mm2, 1						; t117=t125; column 0: output butterfly;move above;movq mm3, mm6                       ; duplicate V25;movq mm7, mmword ptr [esi+8*4]		; V22;movq mm2, mmword ptr [esi+8*12]     ; V23;psllw mm2, 1						; t117=t125psubsw mm6, mm1						; tm6paddsw mm3, mm1						; tm8; free mm1movq mm1, mm7						; duplicate V22paddsw mm7, mm5						; tm0movq mmword ptr [esi+8*8], mm3     ; tm8; free mm3psubsw mm1, mm5						; tm14; free mm5movq mmword ptr [esi+8*6], mm6		; tm6; free mm6movq mm3, mm2						; duplicate t117=t125movq mm6, mmword ptr [esi+8*0]		; V24paddsw mm2, mm0						; tm2movq mmword ptr [esi+8*0], mm7      ; tm0; free mm7psubsw mm3, mm0						; tm12; free mm0movq mmword ptr [esi+8*14], mm1		; tm14; free mm1psllw mm6, 1						; t119=t123movq mmword ptr [esi+8*2], mm2		; tm2; free mm2movq mm0, mm6						; duplicate t119=t123movq mmword ptr [esi+8*12], mm3      ; tm12; free mm3paddsw mm6, mm4						; tm4;moved from next blockmovq mm1, mmword ptr [ecx+8*5]psubsw mm0, mm4						; tm10; free mm4;moved from next blockpmulhw mm1, mmword ptr [esi+8*5]	; V5;slotmovq mmword ptr [esi+8*4], mm6		; tm4; free mm6;slotmovq mmword ptr [esi+8*10], mm0     ; tm10; free mm0;slot; column 1: even part; use V5, V13, V1, V9 to produce V56..V59;moved to prev block;movq mm1, mmword ptr [ecx+8*5];pmulhw mm1, mmword ptr [esi+8*5]	; V5movq mm7, mmword ptr [ecx+8*13]psllw mm1, 1						; t128=t130pmulhw mm7, mmword ptr [esi+8*13]	; V13movq mm2, mm1						; duplicate t128=t130movq mm3, mmword ptr [ecx+8*1];slotpmulhw mm3, mmword ptr [esi+8*1]	; V1;slotmovq mm5, mmword ptr [ecx+8*9]psubsw mm1, mm7						; V50pmulhw mm5, mmword ptr [esi+8*9]	; V9paddsw mm2, mm7						; V51pmulhw mm1, mmword ptr x5a825a825a825a82	; 23170 ->V52movq mm6, mm2						; duplicate V51psraw mm2, 1						; t138=t144movq mm4, mm3						; duplicate V1psraw mm6, 2  						; t136paddsw mm3, mm5						; V53psubsw mm4, mm5						; V54 ;mm5 freemovq mm7, mm3						; duplicate V53;moved from next blockmovq mm0, mmword ptr [ecx+8*11]psraw mm4, 1						; t140=t142psubsw mm1, mm6						; V55 ; mm6 freepaddsw mm3, mm2						; V56movq mm5, mm4						; duplicate t140=t142paddsw mm4, mm1						; V57movq mmword ptr [esi+8*5], mm3		; V56psubsw mm5, mm1						; V58; mm1 freemovq mmword ptr [esi+8*13], mm4		; V57psubsw mm7, mm2						; V59; mm2 freemovq mmword ptr [esi+8*9], mm5		; V58;slot; keep mm7 alive all along the next block;movq mmword ptr [esi+8*1], mm7		; V59;moved above;movq mm0, mmword ptr [ecx+8*11]pmulhw mm0, mmword ptr [esi+8*11]	; V11;slotmovq mm6, mmword ptr [ecx+8*7];slotpmulhw mm6, mmword ptr [esi+8*7]	; V7;slotmovq mm4, mmword ptr [ecx+8*15]movq mm3, mm0						; duplicate V11pmulhw mm4, mmword ptr [esi+8*15]	; V15;slotmovq mm5, mmword ptr [ecx+8*3]psllw mm6,1						; t146=t152pmulhw mm5, mmword ptr [esi+8*3]	; V3paddsw mm0, mm6						; V63; note that V15 computation has a correction step:; this is a 'magic' constant that rebiases the results to be closer to the expected result; this magic constant can be refined to reduce the error even more; by doing the correction step in a later stage when the number is actually multiplied by 16paddw mm4, mmword ptr x0005000200010001psubsw mm3, mm6						; V60 ; free mm6psraw mm0, 1						; t154=t156movq mm1, mm3						; duplicate V60pmulhw mm1, mmword ptr x539f539f539f539f ; V67movq mm6, mm5						; duplicate V3psraw mm4, 2						; t148=t150;slotpaddsw mm5, mm4						; V61psubsw mm6, mm4						; V62 ; free mm4movq mm4, mm5						; duplicate V61psllw mm1, 1						; t169paddsw mm5, mm0						; V65 -> resultpsubsw mm4, mm0						; V64 ; free mm0pmulhw mm4, mmword ptr x5a825a825a825a82 ; V68psraw mm3, 1						; t158psubsw mm3, mm6						; V66movq mm2, mm5					; duplicate V65pmulhw mm3, mmword ptr x61f861f861f861f8 ; V70psllw mm6, 1						; t165pmulhw mm6, mmword ptr x4546454645464546 ; V69psraw mm2, 1						; t172;moved from next blockmovq mm0, mmword ptr [esi+8*5]		; V56psllw mm4, 1						; t174;moved from next blockpsraw mm0, 1						; t177=t188nop ; slotpsubsw mm6, mm3						; V72psubsw mm3, mm1						; V71 ; free mm1psubsw mm6, mm2						; V73 ; free mm2;moved from next blockpsraw mm5, 1						; t178=t189psubsw mm4, mm6						; V74;moved from next blockmovq mm1, mm0						; duplicate t177=t188paddsw mm3, mm4						; V75;moved from next blockpaddsw mm0, mm5						; tm1;location ;  5 - V56; 13 - V57;  9 - V58;  X - V59, mm7;  X - V65, mm5;  X - V73, mm6;  X - V74, mm4;  X - V75, mm3                              ; free mm0, mm1 & mm2                        ;move above;movq mm0, mmword ptr [esi+8*5]		; V56;psllw mm0, 1						; t177=t188 ! new !!;psllw mm5, 1						; t178=t189 ! new !!;movq mm1, mm0						; duplicate t177=t188;paddsw mm0, mm5						; tm1movq mm2, mmword ptr [esi+8*13]     ; V57psubsw mm1, mm5						; tm15; free mm5movq mmword ptr [esi+8*1], mm0      ; tm1; free mm0psraw mm7, 1						; t182=t184 ! new !!;save the store as used directly in the transpose;movq mmword ptr [esi+8*15], mm1		; tm15; free mm1movq mm5, mm7                       ; duplicate t182=t184psubsw mm7, mm3						; tm7paddsw mm5, mm3						; tm9; free mm3;slotmovq mm0, mmword ptr [esi+8*9]		; V58movq mm3, mm2						; duplicate V57movq mmword ptr [esi+8*7], mm7		; tm7; free mm7psubsw mm3, mm6						; tm13paddsw mm2, mm6						; tm3 ; free mm6; moved up from the transpose movq mm7, mm3                  ; moved up from the transpose punpcklwd mm3, mm1movq mm6, mm0						; duplicate V58movq mmword ptr [esi+8*3], mm2		; tm3; free mm2paddsw mm0, mm4						; tm5psubsw mm6, mm4						; tm11; free mm4; moved up from the transpose punpckhwd mm7, mm1movq mmword ptr [esi+8*5], mm0		; tm5; free mm0; moved up from the transpose movq mm2, mm5 ; transpose - M4 part;  ---------       ---------

⌨️ 快捷键说明

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