x264_coeff_last64_sse2

时间:2011-12-16 15:08:11

标签: ffmpeg libavcodec x264 libx264

x264 lib一如既往地在Windows上崩溃。现在,我正在努力修复它,我不明白一件事。在代码中我们只能看到函数签名:

int x264_coeff_last64_sse2( dctcoef *dct );

但是,* .h,* .c或* .asm源中没有实现。怎么可能???

(该函数被调用并崩溃,因此必须链接)

1 个答案:

答案 0 :(得分:1)

它们有点棘手:)它实际上是用我的git checkout定义为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;\
}

编辑:我认为这是您要查找的汇编代码x264\common\x86\quant-a.asm中的行(1317-1363):

%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

希望有所帮助!

相关问题