📄 idct_ap922_sse.asm
字号:
pshufw mm5, mm5, 11011101b
pmaddwd mm7, mm5
paddd mm3, half11
pmaddwd mm0, [eax+16]
paddd mm3, mm4
pmaddwd mm1, [eax+24]
movq mm4, mm3
pmaddwd mm2, [eax+48]
paddd mm6, mm7
pmaddwd mm5, [eax+56]
paddd mm3, mm6
paddd mm0, half11
psrad mm3, 11
paddd mm0, mm1
psubd mm4, mm6
movq mm7, mm0
paddd mm2, mm5
paddd mm0, mm2
psrad mm4, 11
psubd mm7, mm2
psrad mm0, 11
psrad mm7, 11
packssdw mm3, mm0
packssdw mm7, mm4
pshufw mm7, mm7, 10110001b
movq [esi+112], mm3
movq mm0, [esi+5*16] ; x5
movq [esi+120], mm7
; col 0-3
movq mm1, tan_3 ; tan_3
movq mm2, mm0 ; x5
movq mm3, [esi+3*16] ; x3
pmulhw mm0, mm1 ; x5 * tan_3
movq mm4, [esi+7*16] ; x7
pmulhw mm1, mm3 ; x3 * tan_3
movq mm5, tan_1 ; tan_1
movq mm6, mm4 ; x7
pmulhw mm4, mm5 ; x7 * tan_1
paddsw mm0, mm2 ; x5 * tan_3
pmulhw mm5, [esi+1*16] ; x1 * tan_1
paddsw mm1, mm3 ; x3 * tan_3
movq mm7, [esi+6*16] ; x6
paddsw mm0, mm3 ; x5 * tan_3 + x3 : tm765
movq mm3, tan_2 ; tan_2
psubsw mm2, mm1 ; x5 - x3 * tan_3 : tm465
pmulhw mm7, mm3 ; x6 * tan_2
movq mm1, mm0 ; tm765
pmulhw mm3, [esi+2*16] ; x2 * tan_2
psubsw mm5, mm6 ; x1 * tan_1 - x7 : tp465
paddsw mm4, [esi+1*16] ; x1 + x7 * tan_1 : tp765
paddsw mm0, mm4 ; tp765 + tm765 : t7
paddsw mm0, one ; t7 + round
psubsw mm4, mm1 ; tp765 - tm765 : tp65
paddsw mm7, [esi+2*16] ; x2 + x6 * tan_2 : tm03
movq mm6, mm5 ; tp465
psubsw mm3, [esi+6*16] ; x2 * tan_2 - x6 : tm12
psubsw mm5, mm2 ; tp465 - tm465 : tm65
paddsw mm5, one ; tm65 + round
paddsw mm6, mm2 ; tp465 + tm465 : t4
movq [esi+7*16], mm0 ; temporal save t7
movq mm1, mm4 ; tp65
movq mm2, cos_4 ; cos_4
paddsw mm4, mm5 ; tp65 + tm65
movq mm0, cos_4 ; cos_4
pmulhw mm2, mm4 ; (tp65 + tm65) * cos_4
movq [esi+3*16], mm6 ; temporal save t4
psubsw mm1, mm5 ; tp65 - tm65
movq mm6, [esi] ; x0
pmulhw mm0, mm1 ; (tp65 - tm65) * cos_4
movq mm5, [esi+4*16] ; x4
paddsw mm4, mm2 ; (tp65 + tm65) * cos_4 : t6
por mm4, one ; t6 |= round
paddsw mm5, mm6 ; x0 + x4 : tp03
psubsw mm6, [esi+4*16] ; x0 - x4 : tp12
paddsw mm0, mm1 ; (tp65 - tm65) * cos_4 : t5
por mm0, one ; t5 + round
movq mm2, mm5 ; tp03
paddsw mm5, mm7 ; tp03 + tm03 : t0
movq mm1, mm6 ; x6
paddsw mm5, half06 ; t0 + half
psubsw mm2, mm7 ; tp03 - tm03 : t3
movq mm7, [esi+7*16] ; t7
paddsw mm6, mm3 ; tp12 + tm12 : t1
paddsw mm6, half06 ; t1 + half
paddsw mm7, mm5 ; t7 + (t0 + half)
psraw mm7, 6 ; (t0 + t7 + half) >> 6 : y0
psubsw mm1, mm3 ; tp12 - tm12 : t2
paddsw mm2, half06a ; t3 + half
movq mm3, mm6 ; t1 + half
paddsw mm1, half06a ; t2 + half
paddsw mm6, mm4 ; (t1 + half) + t6
movq [esi], mm7 ; save y0
psraw mm6, 6 ; (t1 + t6 + half) >> 6 : y1
movq mm7, mm1 ; t2 + half
paddsw mm1, mm0 ; t2 + half + t5
movq [esi+1*16], mm6 ; save y1
psraw mm1, 6 ; (t2 + half + t5) >> 6 : y2
movq mm6, [esi+3*16] ; t4
psubsw mm7, mm0 ; t2 + half - t5
paddsw mm6, mm2 ; t4 + t3 + half
psubsw mm2, [esi+3*16] ; t3 + half - t4
psraw mm7, 6 ; (t2 + half - t5) >> 6 ; y5
movq [esi+2*16], mm1 ; save y2
psraw mm6, 6 ; (t3 + half + t4) >> 6 ; y3
psubsw mm5, [esi+7*16] ; t0 + half - t7
psraw mm2, 6 ; (t3 + half - t4) >> 6 ; y4
movq [esi+3*16], mm6 ; save y3
psubsw mm3, mm4 ; t1 + half - t6
movq [esi+4*16], mm2 ; save y4
psraw mm3, 6 ; (t1 + half - t6) >> 6 ; y6
movq [esi+5*16], mm7 ; save y5
psraw mm5, 6 ; (t0 + half - t7) >> 6 ; y7
movq [esi+6*16], mm3 ; save y6
movq [esi+7*16], mm5 ; save y7
; col 4-7
movq mm0, [esi+5*16+8] ; x5
add esi, 8
movq mm1, tan_3 ; tan_3
movq mm2, mm0 ; x5
movq mm3, [esi+3*16] ; x3
pmulhw mm0, mm1 ; x5 * tan_3
movq mm4, [esi+7*16] ; x7
pmulhw mm1, mm3 ; x3 * tan_3
movq mm5, tan_1 ; tan_1
movq mm6, mm4 ; x7
pmulhw mm4, mm5 ; x7 * tan_1
paddsw mm0, mm2 ; x5 * tan_3
pmulhw mm5, [esi+1*16] ; x1 * tan_1
paddsw mm1, mm3 ; x3 * tan_3
movq mm7, [esi+6*16] ; x6
paddsw mm0, mm3 ; x5 * tan_3 + x3 : tm765
movq mm3, tan_2 ; tan_2
psubsw mm2, mm1 ; x5 - x3 * tan_3 : tm465
pmulhw mm7, mm3 ; x6 * tan_2
movq mm1, mm0 ; tm765
pmulhw mm3, [esi+2*16] ; x2 * tan_2
psubsw mm5, mm6 ; x1 * tan_1 - x7 : tp465
paddsw mm4, [esi+1*16] ; x1 + x7 * tan_1 : tp765
paddsw mm0, mm4 ; tp765 + tm765 : t7
paddsw mm0, one ; t7 + round
psubsw mm4, mm1 ; tp765 - tm765 : tp65
paddsw mm7, [esi+2*16] ; x2 + x6 * tan_2 : tm03
movq mm6, mm5 ; tp465
psubsw mm3, [esi+6*16] ; x2 * tan_2 - x6 : tm12
psubsw mm5, mm2 ; tp465 - tm465 : tm65
paddsw mm5, one ; tm65 + round
paddsw mm6, mm2 ; tp465 + tm465 : t4
movq [esi+7*16], mm0 ; temporal save t7
movq mm1, mm4 ; tp65
movq mm2, cos_4 ; cos_4
paddsw mm4, mm5 ; tp65 + tm65
movq mm0, cos_4 ; cos_4
pmulhw mm2, mm4 ; (tp65 + tm65) * cos_4
movq [esi+3*16], mm6 ; temporal save t4
psubsw mm1, mm5 ; tp65 - tm65
movq mm6, [esi] ; x0
pmulhw mm0, mm1 ; (tp65 - tm65) * cos_4
movq mm5, [esi+4*16] ; x4
paddsw mm4, mm2 ; (tp65 + tm65) * cos_4 : t6
por mm4, one ; t6 |= round
paddsw mm5, mm6 ; x0 + x4 : tp03
psubsw mm6, [esi+4*16] ; x0 - x4 : tp12
paddsw mm0, mm1 ; (tp65 - tm65) * cos_4 : t5
por mm0, one ; t5 |= round
movq mm2, mm5 ; tp03
paddsw mm5, mm7 ; tp03 + tm03 : t0
movq mm1, mm6 ; x6
paddsw mm5, half06 ; t0 + half
psubsw mm2, mm7 ; tp03 - tm03 : t3
movq mm7, [esi+7*16] ; t7
paddsw mm6, mm3 ; tp12 + tm12 : t1
paddsw mm6, half06 ; t1 + half
paddsw mm7, mm5 ; t7 + (t0 + half)
psraw mm7, 6 ; (t0 + t7 + half) >> 6 : y0
psubsw mm1, mm3 ; tp12 - tm12 : t2
paddsw mm2, half06a ; t3 + half
movq mm3, mm6 ; t1 + half
paddsw mm1, half06a ; t2 + half
paddsw mm6, mm4 ; (t1 + half) + t6
movq [esi], mm7 ; save y0
psraw mm6, 6 ; (t1 + t6 + half) >> 6 : y1
movq mm7, mm1 ; t2 + half
paddsw mm1, mm0 ; t2 + half + t5
movq [esi+1*16], mm6 ; save y1
psraw mm1, 6 ; (t2 + half + t5) >> 6 : y2
movq mm6, [esi+3*16] ; t4
psubsw mm7, mm0 ; t2 + half - t5
paddsw mm6, mm2 ; t4 + t3 + half
psubsw mm2, [esi+3*16] ; t3 + half - t4
psraw mm7, 6 ; (t2 + half - t5) >> 6 ; y5
movq [esi+2*16], mm1 ; save y2
psraw mm6, 6 ; (t3 + half + t4) >> 6 ; y3
psubsw mm5, [esi+7*16] ; t0 + half - t7
psraw mm2, 6 ; (t3 + half - t4) >> 6 ; y4
movq [esi+3*16], mm6 ; save y3
psubsw mm3, mm4 ; t1 + half - t6
movq [esi+4*16], mm2 ; save y4
psraw mm3, 6 ; (t1 + half - t6) >> 6 ; y6
movq [esi+5*16], mm7 ; save y5
psraw mm5, 6 ; (t0 + half - t7) >> 6 ; y7
movq [esi+6*16], mm3 ; save y6
movq [esi+7*16], mm5 ; save y7
;-------------------------------------------------------------------
; 屻巒枛
pop eax
pop esi
ret 4
;-------------------------------------------------------------------
_idct_ap922_sse@4 ENDP
;-------------------------------------------------------------------
; 廔椆
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -