as tradition... forgot to attach patch ^^'

--
Keiji Costantini
>From 4221a85c04622cf664fdc1e35d30b5194379995e Mon Sep 17 00:00:00 2001
From: Keiji Costantini <[EMAIL PROTECTED]>
Date: Wed, 11 Jun 2008 01:49:30 +0200
Subject: [PATCH] Split sws_getContext_altivec_unscyv2packyuv from sws_getContext

---
 swscale.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/swscale.c b/swscale.c
index 5afd1c5..6e0bd38 100644
--- a/swscale.c
+++ b/swscale.c
@@ -1941,6 +1941,19 @@ static inline void sws_getContext_setcpuflag(int *flags) 
{
 #endif
 }
 
+static inline void sws_getContext_altivec_unscyv2packyuv(SwsContext *c, int 
*srcFormat, int *dstFormat) {
+    if ((c->flags & SWS_CPU_CAPS_ALTIVEC) &&
+        ((*srcFormat == PIX_FMT_YUV420P &&
+         (*dstFormat == PIX_FMT_YUYV422 || dstFormat == PIX_FMT_UYVY422)))) {
+      // unscaled YV12 -> packed YUV, we want speed
+      if (*dstFormat == PIX_FMT_YUYV422)
+          c->swScale= yv12toyuy2_unscaled_altivec;
+      else
+          c->swScale= yv12touyvy_unscaled_altivec;
+    }
+}
+
+
 SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int 
dstH, int dstFormat, int flags,
                            SwsFilter *srcFilter, SwsFilter *dstFilter, double 
*param){
 
@@ -2113,15 +2126,7 @@ SwsContext *sws_getContext(int srcW, int srcH, int 
srcFormat, int dstW, int dstH
         }
 
 #ifdef HAVE_ALTIVEC
-        if ((c->flags & SWS_CPU_CAPS_ALTIVEC) &&
-            ((srcFormat == PIX_FMT_YUV420P &&
-             (dstFormat == PIX_FMT_YUYV422 || dstFormat == PIX_FMT_UYVY422)))) 
{
-          // unscaled YV12 -> packed YUV, we want speed
-          if (dstFormat == PIX_FMT_YUYV422)
-              c->swScale= yv12toyuy2_unscaled_altivec;
-          else
-              c->swScale= yv12touyvy_unscaled_altivec;
-        }
+        sws_getContext_altivec_unscyv2packyuv(&c, &srcFormat, &dstFormat);
 #endif
 
         /* simple copy */
-- 
1.5.3.7

_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to