--- trunk/xvidcore/src/quant/x86_asm/quantize_mpeg_xmm.asm 2006/07/08 14:19:04 1712 +++ trunk/xvidcore/src/quant/x86_asm/quantize_mpeg_xmm.asm 2006/07/10 08:09:59 1713 @@ -20,7 +20,7 @@ ; * along with this program ; if not, write to the Free Software ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; * -; * $Id: quantize_mpeg_xmm.asm,v 1.5 2004-08-29 10:02:38 edgomez Exp $ +; * $Id: quantize_mpeg_xmm.asm,v 1.6 2006-07-10 08:09:59 syskin Exp $ ; * ; ***************************************************************************/ @@ -165,223 +165,12 @@ SECTION .text -cglobal quant_mpeg_intra_xmm cglobal quant_mpeg_inter_xmm cglobal dequant_mpeg_intra_3dne cglobal dequant_mpeg_inter_3dne ;----------------------------------------------------------------------------- ; -; uint32_t quant_mpeg_intra_xmm(int16_t * coeff, -; const int16_t const * data, -; const uint32_t quant, -; const uint32_t dcscalar, -; const uint16_t *mpeg_matrices); -; -;----------------------------------------------------------------------------- - -ALIGN 16 -quant_mpeg_intra_xmm: - mov eax, [esp + 8] ; data - mov ecx, [esp + 12] ; quant - mov edx, [esp + 4] ; coeff - push esi - push edi - push ebx - nop - mov edi, [esp + 12 + 20] ; mpeg_quant_matrices - mov esi, -14 - pxor mm0, mm0 - pxor mm3, mm3 - cmp ecx, byte 1 - je near .q1loop - cmp ecx, byte 19 - jg near .lloop - nop6 - -ALIGN 16 -.loop - movq mm1, [eax + 8*esi+112] ; mm0 = [1st] - psubw mm0, mm1 ;-mm1 - movq mm4, [eax + 8*esi + 120] ; - psubw mm3, mm4 ;-mm4 - pmaxsw mm0, mm1 ;|src| - pmaxsw mm3,mm4 - nop2 - psraw mm1, 15 ;sign src - psraw mm4, 15 - psllw mm0, 4 ;level << 4 ; - psllw mm3, 4 - paddw mm0, [edi + 128 + 8*esi+112] - paddw mm3, [edi + 128 + 8*esi+120] - movq mm5, [edi + 384 + 8*esi+112] - movq mm7, [edi + 384 + 8*esi+120] - pmulhuw mm5, mm0 - pmulhuw mm7, mm3 - mov esp, esp - movq mm2, [edi + 8*esi+112] - movq mm6, [edi + 8*esi+120] - pmullw mm2, mm5 - pmullw mm6, mm7 - psubw mm0, mm2 - psubw mm3, mm6 - nop4 - movq mm2, [quantd + ecx * 8 - 8] - movq mm6, [mmx_divs + ecx * 8 - 8] - paddw mm5, mm2 - paddw mm7, mm2 - mov esp, esp - pmulhuw mm0, [edi + 256 + 8*esi+112] - pmulhuw mm3, [edi + 256 + 8*esi+120] - paddw mm5, mm0 - paddw mm7, mm3 - pxor mm0, mm0 - pxor mm3, mm3 - pmulhuw mm5, mm6 ; mm0 = (mm0 / 2Q) >> 16 - pmulhuw mm7, mm6 ; (level + quantd) / quant (0> 16 - pmulhuw mm7, mm6 ; (level + quantd) / quant (0