21 |
; * along with this program ; if not, write to the Free Software |
; * along with this program ; if not, write to the Free Software |
22 |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
; * |
; * |
24 |
; * $Id: quantize_mpeg_mmx.asm,v 1.14 2008-12-04 14:41:50 Isibaar Exp $ |
; * $Id: quantize_mpeg_mmx.asm,v 1.15 2008-12-04 18:30:36 Isibaar Exp $ |
25 |
; * |
; * |
26 |
; *************************************************************************/ |
; *************************************************************************/ |
27 |
|
|
187 |
QUANT_MMX(7) |
QUANT_MMX(7) |
188 |
|
|
189 |
; calculate DC |
; calculate DC |
190 |
XVID_MOVSX _EAX, word [_EAX] ; data[0] |
movsx _EAX, word [_EAX] ; data[0] |
191 |
mov TMP0, prm4 ; dcscalar |
mov TMP0, prm4 ; dcscalar |
192 |
mov _EDX, _EAX |
mov _EDX, _EAX |
193 |
shr TMP0, 1 ; TMP0 = dcscalar/2 |
shr TMP0, 1 ; TMP0 = dcscalar/2 |
194 |
sar _EDX, 31 ; TMP1 = sign extend of _EAX (ready for division too) |
sar _EDX, 31 ; TMP1 = sign extend of _EAX (ready for division too) |
195 |
|
|
196 |
xor TMP0, _EDX ; adjust TMP0 according to the sign of data[0] |
xor TMP0, _EDX ; adjust TMP0 according to the sign of data[0] |
197 |
sub TMP0, _EDX |
sub TMP0, _EDX |
198 |
add _EAX, TMP0 |
add _EAX, TMP0 |