[FFmpeg-devel] [PATCH V6 2/2] libswscale/x86/yuv2rgb: add ssse3 version

Fu, Ting ting.fu at intel.com
Thu Jan 9 19:47:26 EET 2020



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Michael Niedermayer
> Sent: Thursday, January 9, 2020 06:17 AM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V6 2/2] libswscale/x86/yuv2rgb: add
> ssse3 version
> 
> On Wed, Jan 08, 2020 at 10:25:59AM +0800, Ting Fu wrote:
> > Tested using this command:
> > /ffmpeg -pix_fmt yuv420p -s 1920*1080 -i ArashRawYuv420.yuv \ -vcodec
> > rawvideo -s 1920*1080 -pix_fmt rgb24 -f null /dev/null
> >
> > The fps increase from 389 to 640 on Intel(R) Core(TM) i7-8700K CPU @
> > 3.70GHz
> >
> > Signed-off-by: Ting Fu <ting.fu at intel.com>
> > ---
> >  libswscale/x86/yuv2rgb.c          |   7 +-
> >  libswscale/x86/yuv2rgb_template.c |  58 +++++++++++-
> >  libswscale/x86/yuv_2_rgb.asm      | 145 ++++++++++++++++++++++++++----
> >  3 files changed, 191 insertions(+), 19 deletions(-)
> >
> > diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index
> > f3d2bb526e..7015266a7e 100644
> > --- a/libswscale/x86/yuv2rgb.c
> > +++ b/libswscale/x86/yuv2rgb.c
> > @@ -61,13 +61,18 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) =
> > 0x0707070707070707ULL;  #define COMPILE_TEMPLATE_MMXEXT 1  #endif
> /*
> > HAVE_MMXEXT */
> >
> > +//SSSE3 versions
> > +#if HAVE_SSSE3
> > +#define COMPILE_TEMPLATE_SSSE3 1
> > +#endif
> > +
> >  #include "yuv2rgb_template.c"
> >
> >  av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c)  {
> >      int cpu_flags = av_get_cpu_flags();
> >
> > -    if (EXTERNAL_MMX(cpu_flags)) {
> > +    if (EXTERNAL_MMX(cpu_flags) || EXTERNAL_SSSE3(cpu_flags)) {
> 
> I would expect that EXTERNAL_SSSE3 implies EXTERNAL_MMX

Hi Michael,

You are right, the the EXTERNAL_SSSE3 does imply EXTERNAL_MMX.
While, I found two issues when thinking what you said.
And I have adjusted the if clause to solve them in PATCH V7.

Thank you
Ting Fu
[...]



More information about the ffmpeg-devel mailing list