[FFmpeg-devel] [WIP] [PATCH] Convert ff_put_pixels_clamped_mmx() to yasm

James Almer jamrial at gmail.com
Thu May 22 04:07:10 CEST 2014


On 21/05/14 10:25 PM, Timothy Gu wrote:
> Also adds some changes:
> - use macros
> - pass the +64 as argument to macro instead of add blockq, 64
> - save some registers by passing memory address to packuswb
> - add SSE2 version
> 
> Tricks stolen from ff_put_signed_pixels_clamped_*().
> 
> Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
> ---
> I actually have ff_put_signed_pixels_clamped_mmx() and similar functions
> converted to yasm long before James submitted his patch, but I forgot
> about it. When I saw the patch, I was like "Dammit." So here it is, my
> yasm ff_put_pixels_clamped_mmx(), written something like 2 months ago.
> 
> I am not happy with the changes of all the files that directly
> references ff_put_pixels_clamped_mmx(), but I cannot find another way
> to fix --disable-yasm. Any ideas?
> ---
>  libavcodec/dct-test.c           |  6 ++---
>  libavcodec/x86/cavsdsp.c        |  7 ++---
>  libavcodec/x86/dsputil.asm      | 45 ++++++++++++++++++++++++++++++++
>  libavcodec/x86/dsputil_init.c   |  3 ++-
>  libavcodec/x86/dsputil_mmx.c    | 58 -----------------------------------------
>  libavcodec/x86/dsputil_x86.h    |  2 ++
>  libavcodec/x86/idct_mmx_xvid.c  |  2 ++
>  libavcodec/x86/idct_sse2_xvid.c |  4 ++-
>  libavcodec/x86/simple_idct.c    |  5 ++--
>  9 files changed, 64 insertions(+), 68 deletions(-)

The reason i didn't attempt to port this one was because it's mainly used as 
part of other inline asm functions (Like ff_idct_xvid_<opt>_put).
This patch is now making said functions depend on both Yasm and inline asm, 
instead of only the latter.
There's little to no gain with it as is, and in fact it makes builds with 
--disable-yasm lose the optimized xvid idct functions.

If we also port all three ff_idct_xvid_<opt> functions and 
ff_add_pixels_clamped_mmx then this will be a good change. Otherwise i 
personally think it's not a good idea to commit this alone.


More information about the ffmpeg-devel mailing list