16
16
* You should have received a copy of the GNU Lesser General Public
17
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef SWSCALE_INTERNAL_H
22
#define SWSCALE_INTERNAL_H
21
#ifndef FFMPEG_SWSCALE_INTERNAL_H
22
#define FFMPEG_SWSCALE_INTERNAL_H
24
26
#ifdef HAVE_ALTIVEC_H
25
27
#include <altivec.h>
166
uint32_t oy __attribute__((aligned(4)));
167
uint32_t oc __attribute__((aligned(4)));
168
uint32_t zero __attribute__((aligned(4)));
169
uint32_t cy __attribute__((aligned(4)));
170
uint32_t crv __attribute__((aligned(4)));
171
uint32_t rmask __attribute__((aligned(4)));
172
uint32_t cbu __attribute__((aligned(4)));
173
uint32_t bmask __attribute__((aligned(4)));
174
uint32_t cgu __attribute__((aligned(4)));
175
uint32_t cgv __attribute__((aligned(4)));
176
uint32_t gmask __attribute__((aligned(4)));
180
uint64_t sparc_coeffs[10] __attribute__((aligned(8)));
166
184
//FIXME check init (where 0)
168
186
SwsFunc yuv2rgb_get_func_ptr (SwsContext *c);
169
187
int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation);
171
char *sws_format_name(int format);
189
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation);
190
SwsFunc yuv2rgb_init_altivec (SwsContext *c);
191
void altivec_yuv2packedX (SwsContext *c,
192
int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
193
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
194
uint8_t *dest, int dstW, int dstY);
196
const char *sws_format_name(int format);
173
198
//FIXME replace this with something faster
174
#define isPlanarYUV(x) ((x)==PIX_FMT_YUV410P || (x)==PIX_FMT_YUV420P \
175
|| (x)==PIX_FMT_YUV411P || (x)==PIX_FMT_YUV422P \
176
|| (x)==PIX_FMT_YUV444P || (x)==PIX_FMT_NV12 \
177
|| (x)==PIX_FMT_NV21)
178
#define isYUV(x) ((x)==PIX_FMT_UYVY422 || (x)==PIX_FMT_YUYV422 || isPlanarYUV(x))
179
#define isGray(x) ((x)==PIX_FMT_GRAY8 || (x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE)
180
#define isGray16(x) ((x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE)
181
#define isRGB(x) ((x)==PIX_FMT_BGR32 || (x)==PIX_FMT_RGB24 \
182
|| (x)==PIX_FMT_RGB565 || (x)==PIX_FMT_RGB555 \
183
|| (x)==PIX_FMT_RGB8 || (x)==PIX_FMT_RGB4 || (x)==PIX_FMT_RGB4_BYTE \
184
|| (x)==PIX_FMT_MONOBLACK)
185
#define isBGR(x) ((x)==PIX_FMT_RGB32 || (x)==PIX_FMT_BGR24 \
186
|| (x)==PIX_FMT_BGR565 || (x)==PIX_FMT_BGR555 \
187
|| (x)==PIX_FMT_BGR8 || (x)==PIX_FMT_BGR4 || (x)==PIX_FMT_BGR4_BYTE \
188
|| (x)==PIX_FMT_MONOBLACK)
199
#define isPlanarYUV(x) ( \
200
(x)==PIX_FMT_YUV410P \
201
|| (x)==PIX_FMT_YUV420P \
202
|| (x)==PIX_FMT_YUV411P \
203
|| (x)==PIX_FMT_YUV422P \
204
|| (x)==PIX_FMT_YUV444P \
205
|| (x)==PIX_FMT_YUV440P \
206
|| (x)==PIX_FMT_NV12 \
207
|| (x)==PIX_FMT_NV21 \
210
(x)==PIX_FMT_UYVY422 \
211
|| (x)==PIX_FMT_YUYV422 \
214
#define isGray(x) ( \
216
|| (x)==PIX_FMT_GRAY16BE \
217
|| (x)==PIX_FMT_GRAY16LE \
219
#define isGray16(x) ( \
220
(x)==PIX_FMT_GRAY16BE \
221
|| (x)==PIX_FMT_GRAY16LE \
225
|| (x)==PIX_FMT_RGB24 \
226
|| (x)==PIX_FMT_RGB565 \
227
|| (x)==PIX_FMT_RGB555 \
228
|| (x)==PIX_FMT_RGB8 \
229
|| (x)==PIX_FMT_RGB4 \
230
|| (x)==PIX_FMT_RGB4_BYTE \
231
|| (x)==PIX_FMT_MONOBLACK \
235
|| (x)==PIX_FMT_BGR24 \
236
|| (x)==PIX_FMT_BGR565 \
237
|| (x)==PIX_FMT_BGR555 \
238
|| (x)==PIX_FMT_BGR8 \
239
|| (x)==PIX_FMT_BGR4 \
240
|| (x)==PIX_FMT_BGR4_BYTE \
241
|| (x)==PIX_FMT_MONOBLACK \
190
244
static inline int fmt_depth(int fmt)