aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/ppc
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2011-06-02 20:04:04 -0700
committerRonald S. Bultje <rsbultje@gmail.com>2011-06-03 09:52:09 -0700
commit67d80a54217f93a50b7a52449fad12215b43c9e8 (patch)
tree37c01444c09f02f73142deb344b4bb7ac985acb0 /libswscale/ppc
parenta3e9bb5deed0f43c84ee3006962f7bd27ae4f811 (diff)
downloadffmpeg-67d80a54217f93a50b7a52449fad12215b43c9e8.tar.gz
swscale: split out ppc _template.c files from main swscale.c.
Diffstat (limited to 'libswscale/ppc')
-rw-r--r--libswscale/ppc/swscale_altivec.c (renamed from libswscale/ppc/swscale_altivec_template.c)20
-rw-r--r--libswscale/ppc/yuv2rgb_altivec.c1
-rw-r--r--libswscale/ppc/yuv2rgb_altivec.h34
3 files changed, 50 insertions, 5 deletions
diff --git a/libswscale/ppc/swscale_altivec_template.c b/libswscale/ppc/swscale_altivec.c
index 3c31c3e130..acfdc94cd8 100644
--- a/libswscale/ppc/swscale_altivec_template.c
+++ b/libswscale/ppc/swscale_altivec.c
@@ -21,6 +21,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
+#include "config.h"
+#include "libswscale/swscale.h"
+#include "libswscale/swscale_internal.h"
+#include "libavutil/cpu.h"
+#include "yuv2rgb_altivec.h"
+
#define vzero vec_splat_s32(0)
static inline void
@@ -214,10 +221,10 @@ yuv2yuvX_altivec_real(SwsContext *c,
}
}
-static inline void hScale_altivec_real(int16_t *dst, int dstW,
- const uint8_t *src, int srcW,
- int xInc, const int16_t *filter,
- const int16_t *filterPos, int filterSize)
+static void hScale_altivec_real(int16_t *dst, int dstW,
+ const uint8_t *src, int srcW,
+ int xInc, const int16_t *filter,
+ const int16_t *filterPos, int filterSize)
{
register int i;
DECLARE_ALIGNED(16, int, tempo)[4];
@@ -394,8 +401,11 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW,
}
}
-static void RENAME(sws_init_swScale)(SwsContext *c)
+void ff_sws_init_swScale_altivec(SwsContext *c)
{
+ if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
+ return;
+
c->yuv2yuvX = yuv2yuvX_altivec_real;
/* The following list of supported dstFormat values should
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 4b2bdafca0..476db22489 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -95,6 +95,7 @@ adjustment.
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#include "libavutil/cpu.h"
+#include "yuv2rgb_altivec.h"
#undef PROFILE_THE_BEAST
#undef INC_SCALING
diff --git a/libswscale/ppc/yuv2rgb_altivec.h b/libswscale/ppc/yuv2rgb_altivec.h
new file mode 100644
index 0000000000..b54a856905
--- /dev/null
+++ b/libswscale/ppc/yuv2rgb_altivec.h
@@ -0,0 +1,34 @@
+/*
+ * AltiVec-enhanced yuv2yuvX
+ *
+ * Copyright (C) 2004 Romain Dolbeau <romain@dolbeau.org>
+ * based on the equivalent C code in swscale.c
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef PPC_YUV2RGB_ALTIVEC_H
+#define PPC_YUV2RGB_ALTIVEC_H 1
+
+void ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter,
+ const int16_t **lumSrc, int lumFilterSize,
+ const int16_t *chrFilter, const int16_t **chrUSrc,
+ const int16_t **chrVSrc, int chrFilterSize,
+ const int16_t **alpSrc, uint8_t *dest,
+ int dstW, int dstY);
+
+#endif /* PPC_YUV2RGB_ALTIVEC_H */