2 ; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 ; Use of this source code is governed by a BSD-style license and patent
5 ; grant that can be found in the LICENSE file in the root of the source
6 ; tree. All contributing project authors may be found in the AUTHORS
7 ; file in the root of the source tree.
11 %include "vpx_ports/x86_abi_support.asm"
12 %include "asm_enc_offsets.asm"
15 ; void vp8_fast_quantize_b_ssse3 | arg
20 global sym
(vp8_fast_quantize_b_ssse3
)
21 sym
(vp8_fast_quantize_b_ssse3
):
30 %ifidn __OUTPUT_FORMAT__
,x64
38 mov rdi
, arg
(0) ; BLOCK *b
39 mov rsi
, arg
(1) ; BLOCKD *d
41 %ifidn __OUTPUT_FORMAT__
,x64
42 mov rdi
, rcx
; BLOCK *b
43 mov rsi
, rdx
; BLOCKD *d
45 ;mov rdi, rdi ; BLOCK *b
46 ;mov rsi, rsi ; BLOCKD *d
50 mov rax
, [rdi
+ vp8_block_coeff
]
51 mov rcx
, [rdi
+ vp8_block_round
]
52 mov rdx
, [rdi
+ vp8_block_quant_fast
]
56 movdqa xmm4
, [rax
+ 16]
60 movdqa xmm3
, [rcx
+ 16]
77 pmulhw xmm5
, [rdx
+ 16]
79 mov rax
, [rsi
+ vp8_blockd_qcoeff
]
80 mov rdi
, [rsi
+ vp8_blockd_dequant
]
81 mov rcx
, [rsi
+ vp8_blockd_dqcoeff
]
89 movdqa
[rax
+ 16], xmm5
92 movdqa xmm3
, [rdi
+ 16]
98 pcmpeqw xmm1
, xmm4
;non zero mask
99 pcmpeqw xmm5
, xmm4
;non zero mask
101 pshufb xmm1
, [GLOBAL(zz_shuf
)]
107 xor dx, ax ;flip the bits for bsr
110 movdqa
[rcx
], xmm2
;store dqcoeff
111 movdqa
[rcx
+ 16], xmm3
;store dqcoeff
113 sub edi, edx ;check for all zeros in bit mask
116 and eax, edi ;if the bit mask was all zero,
118 mov [rsi
+ vp8_blockd_eob
], eax
125 %ifidn __OUTPUT_FORMAT__
,x64
138 db 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15