[FFmpeg-devel] [PATCH] x86: convert DNxHDenc inline asm to yasm

Ronald S. Bultje rsbultje at gmail.com
Wed Mar 26 16:54:03 CET 2014


Hi,

On Tue, Mar 25, 2014 at 11:21 PM, Timothy Gu <timothygu99 at gmail.com> wrote:

> +; void get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels,
> +;                              int line_size)
> +INIT_XMM sse2
> +cglobal get_pixels_8x4_sym, 3,3,5
>

cglobal get_pixels_8x4_sym, 3, 3, 5, block, pixels, linesize


> +    movsxdifnidn r2,    r2d
>

Change argument type to intptr_t or ptrdiff_t and remove this instruction.


> +    pxor      m4,       m4
> +    movq      m0,       [r1]
>

[blockq]


> +    add       r1,       r2
>

add pixelsq, linesizeq


> +    movq      m1,       [r1]
> +    movq      m2,       [r1+r2]
> +    movq      m3,       [r1+r2*2]
> +    punpcklbw m0,       m4
> +    punpcklbw m1,       m4
> +    punpcklbw m2,       m4
> +    punpcklbw m3,       m4
> +    movdqa    [r0    ], m0
> +    movdqa    [r0+16 ], m1
> +    movdqa    [r0+32 ], m2
> +    movdqa    [r0+48 ], m3
> +    movdqa    [r0+64 ], m3
> +    movdqa    [r0+80 ], m2
> +    movdqa    [r0+96 ], m1
> +    movdqa    [r0+112], m0
>

We typically use mova (which expands to movdqa for xmm, and to movq for
mmx; likewise, movh expands to movq for xmm and to movd for mmx), but I
don't particularly care since you're only using this for xmm, not mmx, so
ignore this if you don't care.

Ronald


More information about the ffmpeg-devel mailing list