[x265] primitives: add count_nonzero

chen chenm003 at 163.com
Sat Feb 15 07:59:16 CET 2014


At 2014-02-15 13:23:56,"Satoshi Nakagawa" <nakagawa424 at oki.com> wrote:
># HG changeset patch
># User Satoshi Nakagawa <nakagawa424 at oki.com>
># Date 1392440540 -32400
>#      Sat Feb 15 14:02:20 2014 +0900
># Node ID dcdb5c276c7827fa540348018ddd72618b558feb
># Parent  d77a549b8061f038b2d263c4508e256b4a335208
>primitives: add count_nonzero
>
>+;-----------------------------------------------------------------------------
>+; int  count_nonzero(const int32_t *quantCoeff, int numCoeff);
>+;-----------------------------------------------------------------------------
>+INIT_XMM sse2
>+cglobal count_nonzero, 2,3,4
>+    pxor        m0, m0
>+    pxor        m1, m1
>+    mov         r2d, r1d
>+    shr         r1d, 3
>+
>+.loop
>+    movdqu      m2, [r0] ; TODO: movdqa
>+    movdqu      m3, [r0 + 16] ; TODO: movdqa
for x264 code style, we need write as movu here
 
>+    add         r0, 32
>+    packssdw    m2, m3
>+    pcmpeqw     m2, m0
>+    psrlw       m2, 15
>+    packsswb    m2, m2
>+    psadbw      m2, m0
>+    paddd       m1, m2
>+    dec         r1d
>+    jnz        .loop
>+
>+    movd        r1d, m1
>+    sub         r2d, r1d
>+    mov         eax, r2d
>+
>+    RET
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140215/00fa337d/attachment.html>


More information about the x265-devel mailing list