그들은 조금 까다되고 있습니다 : 그것은 실제로 내 자식 체크 아웃으로 quant.c
라인 (356)에 매크로로 정의합니다. 여기
은 정의입니다 :
#define last(num)\
static int x264_coeff_last##num(dctcoef *l)\
{\
int i_last = num-1;\
while(i_last >= 0 && l[i_last] == 0)\
i_last--;\
return i_last;\
}
편집 : 난 당신이 찾고 있던이있다 어셈블리 코드 선 (1,317에서 1,363 사이) x264\common\x86\quant-a.asm
의 생각 :
%ifndef ARCH_X86_64
cglobal coeff_last64, 1, 5-mmsize/16
pxor m2, m2
LAST_MASK 16, r2d, r0+SIZEOF_DCTCOEF* 32, r4d
LAST_MASK 16, r3d, r0+SIZEOF_DCTCOEF* 48, r4d
shl r3d, 16
or r2d, r3d
xor r2d, -1
jne .secondhalf
LAST_MASK 16, r1d, r0+SIZEOF_DCTCOEF* 0, r4d
LAST_MASK 16, r3d, r0+SIZEOF_DCTCOEF*16, r4d
shl r3d, 16
or r1d, r3d
not r1d
BSR eax, r1d, 0x1f
RET
.secondhalf:
BSR eax, r2d, 0x1f
add eax, 32
RET
%else
cglobal coeff_last64, 1,4
pxor m2, m2
LAST_MASK 16, r1d, r0+SIZEOF_DCTCOEF* 0
LAST_MASK 16, r2d, r0+SIZEOF_DCTCOEF*16
LAST_MASK 16, r3d, r0+SIZEOF_DCTCOEF*32
LAST_MASK 16, r0d, r0+SIZEOF_DCTCOEF*48
shl r2d, 16
shl r0d, 16
or r1d, r2d
or r3d, r0d
shl r3, 32
or r1, r3
not r1
BSR rax, r1, 0x3f
RET
%endif
%endmacro
%ifndef ARCH_X86_64
INIT_MMX mmx2
COEFF_LAST
%endif
INIT_XMM sse2
COEFF_LAST
INIT_XMM sse2, lzcnt
COEFF_LAST
희망하는 데 도움이 !
asm 사용을 제외 할 때 호출되는 함수라고 생각합니다. 문제가있는 것은 asm으로 작성되었습니다 (적어도 그렇게 생각합니다). 그리고 sse2 접미사가 있습니다. – moose
업데이트 된 어셈블리가 찾고 있던 어셈블리입니까? – mevatron
흠, 만약 그렇다면 ... x264_coeff_last64_sse2()와 coeff_last64 사이의 관계는 무엇입니까? – moose