[FFmpeg-devel] [PATCH] VP8: avoid conditional and division for chroma MV

Luca Barbato lu_zero
Thu Jun 24 13:53:37 CEST 2010


On 06/23/2010 08:16 PM, Stefan Gehrer wrote:
> On 06/23/2010 08:07 PM, M?ns Rullg?rd wrote:
>> That's just one compiler on the primary target.  Is it just as clever
>> when targeting things like ARM?

That happens on -O2, -O3 is similar, on amd64 clang and gcc generate the
same code for the INT_BIT version, here the naive version generates
different code on the synthetic test.

arm

uvmv_test_old:
        cmp     r0, #0
        mvnlt   r3, #1
        movge   r3, #2
        add     r0, r3, r0
        add     r3, r0, #3
        cmp     r0, #0
        movlt   r0, r3
        mov     r0, r0, asr #2
        bx      lr

uvmv_test_new:
        add     r0, r0, r0, asr #31
        add     r0, r0, #2
        mov     r0, r0, asr #2
        bx      lr


ppc

uvmv_test_old:
        mr 0,3
        srawi 3,3,31
        rlwinm 3,3,0,0,29
        addi 3,3,2
        add 3,3,0
        srawi 3,3,2
        addze 3,3
        blr

uvmv_test_new:
        srawi 0,3,31
        addi 3,3,2
        add 3,3,0
        srawi 3,3,2
        blr

ppc64

uvmv_test_old:
        mr 0,3
        nor 3,3,3
        sradi 3,3,63
        rlwinm 3,3,0,29,29
        addi 3,3,-2
        add 3,3,0
        srawi 3,3,2
        addze 3,3
        extsw 3,3
        blr

uvmv_test_new:
        srawi 0,3,31
        addi 3,3,2
        add 3,3,0
        srawi 3,3,2
        extsw 3,3
        blr

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero




More information about the ffmpeg-devel mailing list