2 * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #if COMPILE_TEMPLATE_ALTIVEC
23 #include "swscale_altivec_template.c"
26 #if COMPILE_TEMPLATE_ALTIVEC
27 static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
28 const int16_t **lumSrc, int lumFilterSize,
29 const int16_t *chrFilter, const int16_t **chrUSrc,
30 const int16_t **chrVSrc, int chrFilterSize,
31 const int16_t **alpSrc,
32 uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
33 uint8_t *aDest, int dstW, int chrDstW)
35 yuv2yuvX_altivec_real(lumFilter, lumSrc, lumFilterSize,
36 chrFilter, chrUSrc, chrVSrc, chrFilterSize,
37 dest, uDest, vDest, dstW, chrDstW);
41 * vertical scale YV12 to RGB
43 static inline void RENAME(yuv2packedX)(SwsContext *c, const int16_t *lumFilter,
44 const int16_t **lumSrc, int lumFilterSize,
45 const int16_t *chrFilter, const int16_t **chrUSrc,
46 const int16_t **chrVSrc, int chrFilterSize,
47 const int16_t **alpSrc, uint8_t *dest,
50 /* The following list of supported dstFormat values should
51 match what's found in the body of ff_yuv2packedX_altivec() */
52 if (!(c->flags & SWS_BITEXACT) && !c->alpPixBuf &&
53 (c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA ||
54 c->dstFormat==PIX_FMT_BGR24 || c->dstFormat==PIX_FMT_RGB24 ||
55 c->dstFormat==PIX_FMT_RGBA || c->dstFormat==PIX_FMT_ARGB))
56 ff_yuv2packedX_altivec(c, lumFilter, lumSrc, lumFilterSize,
57 chrFilter, chrUSrc, chrVSrc, chrFilterSize,
60 yuv2packedXinC(c, lumFilter, lumSrc, lumFilterSize,
61 chrFilter, chrUSrc, chrVSrc, chrFilterSize,
62 alpSrc, dest, dstW, dstY);
67 static void RENAME(sws_init_swScale)(SwsContext *c)
69 enum PixelFormat srcFormat = c->srcFormat;
71 c->yuv2yuvX = RENAME(yuv2yuvX );
72 c->yuv2packedX = RENAME(yuv2packedX );