summaryrefslogtreecommitdiffstats
path: root/postproc/swscale.c
diff options
context:
space:
mode:
Diffstat (limited to 'postproc/swscale.c')
-rw-r--r--postproc/swscale.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/postproc/swscale.c b/postproc/swscale.c
index 67a75a93af..891352121c 100644
--- a/postproc/swscale.c
+++ b/postproc/swscale.c
@@ -1909,6 +1909,18 @@ SwsContext *sws_getContext(int srcW, int srcH, int origSrcFormat, int dstW, int
}
}
+#ifdef HAVE_ALTIVEC
+ if ((c->flags & SWS_CPU_CAPS_ALTIVEC) &&
+ ((srcFormat == IMGFMT_YV12 &&
+ (dstFormat == IMGFMT_YUY2 || dstFormat == IMGFMT_UYVY)))) {
+ // unscaled YV12 -> packed YUV, we want speed
+ if (dstFormat == IMGFMT_YUY2)
+ c->swScale= yv12toyuy2_unscaled_altivec;
+ else
+ c->swScale= yv12touyvy_unscaled_altivec;
+ }
+#endif
+
/* simple copy */
if( srcFormat == dstFormat
|| (isPlanarYUV(srcFormat) && isGray(dstFormat))