[FFmpeg-devel] [PATCH] Add x86-optimized versions of exponent_min().

Ronald S. Bultje rsbultje
Fri Jan 28 23:08:16 CET 2011


Hi Justin,

On Fri, Jan 28, 2011 at 5:04 PM, Justin Ruggles
<justin.ruggles at gmail.com> wrote:
> ---
> ?libavcodec/Makefile ? ? ? ? | ? ?6 +++-
> ?libavcodec/ac3dsp.c ? ? ? ? | ? 51 ++++++++++++++++++++++++++++++++++++
> ?libavcodec/ac3dsp.h ? ? ? ? | ? 44 +++++++++++++++++++++++++++++++
> ?libavcodec/ac3enc.c ? ? ? ? | ? 35 +++++--------------------
> ?libavcodec/x86/Makefile ? ? | ? ?4 +++
> ?libavcodec/x86/ac3dsp.asm ? | ? 60 +++++++++++++++++++++++++++++++++++++++++++
> ?libavcodec/x86/ac3dsp_mmx.c | ? 47 +++++++++++++++++++++++++++++++++
> ?libavcodec/x86/x86util.asm ?| ? 10 +++++++
> ?8 files changed, 227 insertions(+), 30 deletions(-)
> ?create mode 100644 libavcodec/ac3dsp.c
> ?create mode 100644 libavcodec/ac3dsp.h
> ?create mode 100644 libavcodec/x86/ac3dsp.asm
> ?create mode 100644 libavcodec/x86/ac3dsp_mmx.c
>
>
> On 01/28/2011 04:09 PM, Ronald S. Bultje wrote:
>> [..]
>>> > + ? ?if (mm_flags & AV_CPU_FLAG_SSE2) {
>> HAVE_SSE2 also
>
> There is no such thing. And HAVE_SSE is handled by av_get_cpu_flags().
>
>>> > +%macro PMINUB_MMX 3 ; dst, src, tmp
>>> > + ? ?mova ? ? %3, %1
>>> > + ? ?psubusb ?%3, %2
>>> > + ? ?psubb ? ?%1, %3
>>> > +%endmacro
>> [..]
>>> > +%ifidn %1, mmx
>>> > + ? ?PMINUB_MMX ? ?m0, [expq+offsetq], m1
>>> > +%else ; mmxext/sse2
>>> > + ? ?pminub ? ? ? ?m0, [expq+offsetq]
>>> > +%endif
>> Since you're using it under %if .. anyway, the point of having this
>> macro is sort of lost. Maybe I'd integrate this in the source, or
>> otherwise also template pminub on >= mmx2 so that the %if is no longer
>> necessary.
>
> New patch attached. I hope this is what you mean.

Yes, looks good. Thanks!

Ronald



More information about the ffmpeg-devel mailing list