diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-16 12:04:24 -0400 |
---|---|---|
committer | Ronald Bultje <rbultje@dhcp-172-22-79-135.mtv.corp.google.com> | 2011-06-27 18:05:16 -0700 |
commit | dc179ec81902e3c9d327f9e818454f2849308000 (patch) | |
tree | d3a4df3cd24326fbf3aa95005035b7ba9fd28fe4 /libswscale/ppc/swscale_altivec.c | |
parent | 0d994b2f45c08794899057ee7ca54f48218c0a53 (diff) | |
download | ffmpeg-dc179ec81902e3c9d327f9e818454f2849308000.tar.gz |
swscale: split yuv2packedX_altivec in smaller functions.
This will likely lead to a considerable performance boost,
since it removes a branch from the inner loop. Part of the
Great Evil Plan to simplify swscale.
Diffstat (limited to 'libswscale/ppc/swscale_altivec.c')
-rw-r--r-- | libswscale/ppc/swscale_altivec.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c index 47fe54c088..7161fe7963 100644 --- a/libswscale/ppc/swscale_altivec.c +++ b/libswscale/ppc/swscale_altivec.c @@ -414,10 +414,14 @@ void ff_sws_init_swScale_altivec(SwsContext *c) /* The following list of supported dstFormat values should * match what's found in the body of ff_yuv2packedX_altivec() */ - if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf && - (c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA || - c->dstFormat==PIX_FMT_BGR24 || c->dstFormat==PIX_FMT_RGB24 || - c->dstFormat==PIX_FMT_RGBA || c->dstFormat==PIX_FMT_ARGB)) { - c->yuv2packedX = ff_yuv2packedX_altivec; + if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf) { + switch (c->dstFormat) { + case PIX_FMT_ABGR: c->yuv2packedX = ff_yuv2abgr_X_altivec; break; + case PIX_FMT_BGRA: c->yuv2packedX = ff_yuv2bgra_X_altivec; break; + case PIX_FMT_ARGB: c->yuv2packedX = ff_yuv2argb_X_altivec; break; + case PIX_FMT_RGBA: c->yuv2packedX = ff_yuv2rgba_X_altivec; break; + case PIX_FMT_BGR24: c->yuv2packedX = ff_yuv2bgr24_X_altivec; break; + case PIX_FMT_RGB24: c->yuv2packedX = ff_yuv2rgb24_X_altivec; break; } + } } |