2001-11-04 21:36:24 +02:00
|
|
|
/*
|
2008-07-04 16:49:45 +03:00
|
|
|
* software RGB to RGB converter
|
|
|
|
* pluralize by software PAL8 to RGB converter
|
|
|
|
* software YUV to YUV converter
|
|
|
|
* software YUV to RGB converter
|
|
|
|
* Written by Nick Kurshev.
|
|
|
|
* palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at)
|
|
|
|
* lot of big-endian byte order fixes by Alex Beregszaszi
|
2006-09-06 13:24:19 +03:00
|
|
|
*
|
2006-10-07 18:33:14 +03:00
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
2010-03-27 13:31:02 +02:00
|
|
|
* FFmpeg 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.
|
2006-09-06 13:24:19 +03:00
|
|
|
*
|
2006-10-07 18:33:14 +03:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2006-09-06 13:24:19 +03:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2010-03-27 13:31:02 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2006-09-06 13:24:19 +03:00
|
|
|
*
|
2010-03-27 13:31:02 +02:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2007-07-05 13:18:58 +03:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-10-29 20:28:06 +02:00
|
|
|
*/
|
|
|
|
|
2002-06-22 11:49:45 +03:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2013-04-18 16:54:45 +03:00
|
|
|
#include "libavutil/attributes.h"
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb24tobgr32_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2001-10-28 12:17:57 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint8_t *dest = dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
2011-05-25 06:23:39 +03:00
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2009-09-07 19:29:32 +03:00
|
|
|
#if HAVE_BIGENDIAN
|
2012-02-21 22:09:31 +03:00
|
|
|
/* RGB24 (= R, G, B) -> RGB32 (= A, B, G, R) */
|
|
|
|
*dest++ = 255;
|
|
|
|
*dest++ = s[2];
|
|
|
|
*dest++ = s[1];
|
|
|
|
*dest++ = s[0];
|
|
|
|
s += 3;
|
2009-09-07 19:29:32 +03:00
|
|
|
#else
|
2012-02-21 22:09:31 +03:00
|
|
|
*dest++ = *s++;
|
|
|
|
*dest++ = *s++;
|
|
|
|
*dest++ = *s++;
|
|
|
|
*dest++ = 255;
|
2009-09-07 19:29:32 +03:00
|
|
|
#endif
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2001-10-28 12:17:57 +02:00
|
|
|
}
|
2001-10-28 12:28:08 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb32tobgr24_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2001-10-28 12:28:08 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint8_t *dest = dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
2011-05-25 06:23:39 +03:00
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2009-07-26 15:26:32 +03:00
|
|
|
#if HAVE_BIGENDIAN
|
2012-02-21 22:09:31 +03:00
|
|
|
/* RGB32 (= A, B, G, R) -> RGB24 (= R, G, B) */
|
2007-04-28 14:44:49 +03:00
|
|
|
s++;
|
2012-02-21 22:09:31 +03:00
|
|
|
dest[2] = *s++;
|
|
|
|
dest[1] = *s++;
|
|
|
|
dest[0] = *s++;
|
|
|
|
dest += 3;
|
2004-09-21 20:23:49 +03:00
|
|
|
#else
|
2012-02-21 22:09:31 +03:00
|
|
|
*dest++ = *s++;
|
|
|
|
*dest++ = *s++;
|
|
|
|
*dest++ = *s++;
|
2007-04-28 14:44:49 +03:00
|
|
|
s++;
|
2004-09-21 20:23:49 +03:00
|
|
|
#endif
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2001-10-28 12:28:08 +02:00
|
|
|
}
|
2001-10-28 12:45:42 +02:00
|
|
|
|
2001-10-29 20:28:06 +02:00
|
|
|
/*
|
2012-02-21 22:09:31 +03:00
|
|
|
* original by Strepto/Astral
|
|
|
|
* ported to gcc & bugfixed: A'rpi
|
2012-07-08 20:16:20 +03:00
|
|
|
* MMXEXT, 3DNOW optimization by Nick Kurshev
|
2012-02-21 22:09:31 +03:00
|
|
|
* 32-bit C version, and and&add trick by Michael Niedermayer
|
|
|
|
*/
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb15to16_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2001-10-28 12:45:42 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
register uint8_t *d = dst;
|
|
|
|
register const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
register const uint8_t *end = s + src_size;
|
|
|
|
const uint8_t *mm_end = end - 3;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < mm_end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register unsigned x = *((const uint32_t *)s);
|
|
|
|
*((uint32_t *)d) = (x & 0x7FFF7FFF) + (x & 0x7FE07FE0);
|
|
|
|
d += 4;
|
|
|
|
s += 4;
|
2002-06-22 11:49:45 +03:00
|
|
|
}
|
2009-08-17 00:11:28 +03:00
|
|
|
if (s < end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register unsigned short x = *((const uint16_t *)s);
|
|
|
|
*((uint16_t *)d) = (x & 0x7FFF) + (x & 0x7FE0);
|
2002-06-22 11:49:45 +03:00
|
|
|
}
|
2001-10-28 12:45:42 +02:00
|
|
|
}
|
2001-11-04 21:36:24 +02:00
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb16to15_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2002-06-30 00:26:15 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
register uint8_t *d = dst;
|
|
|
|
register const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
register const uint8_t *end = s + src_size;
|
|
|
|
const uint8_t *mm_end = end - 3;
|
2011-05-25 06:23:39 +03:00
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < mm_end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register uint32_t x = *((const uint32_t *)s);
|
|
|
|
*((uint32_t *)d) = ((x >> 1) & 0x7FE07FE0) | (x & 0x001F001F);
|
|
|
|
s += 4;
|
|
|
|
d += 4;
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
2009-08-17 00:11:28 +03:00
|
|
|
if (s < end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register uint16_t x = *((const uint16_t *)s);
|
|
|
|
*((uint16_t *)d) = ((x >> 1) & 0x7FE0) | (x & 0x001F);
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb32to16_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2001-11-04 21:36:24 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
2011-05-25 06:23:39 +03:00
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register int rgb = *(const uint32_t *)s;
|
|
|
|
s += 4;
|
|
|
|
*d++ = ((rgb & 0xFF) >> 3) +
|
|
|
|
((rgb & 0xFC00) >> 5) +
|
|
|
|
((rgb & 0xF80000) >> 8);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2001-11-04 21:36:24 +02:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb32tobgr16_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2002-06-30 00:26:15 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register int rgb = *(const uint32_t *)s;
|
|
|
|
s += 4;
|
|
|
|
*d++ = ((rgb & 0xF8) << 8) +
|
|
|
|
((rgb & 0xFC00) >> 5) +
|
|
|
|
((rgb & 0xF80000) >> 19);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb32to15_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2001-11-04 21:36:24 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register int rgb = *(const uint32_t *)s;
|
|
|
|
s += 4;
|
|
|
|
*d++ = ((rgb & 0xFF) >> 3) +
|
|
|
|
((rgb & 0xF800) >> 6) +
|
|
|
|
((rgb & 0xF80000) >> 9);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2001-11-04 21:36:24 +02:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb32tobgr15_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2002-06-30 00:26:15 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-21 22:09:31 +03:00
|
|
|
register int rgb = *(const uint32_t *)s;
|
|
|
|
s += 4;
|
|
|
|
*d++ = ((rgb & 0xF8) << 7) +
|
|
|
|
((rgb & 0xF800) >> 6) +
|
|
|
|
((rgb & 0xF80000) >> 19);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb24tobgr16_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2001-11-05 19:35:28 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2007-04-28 14:44:49 +03:00
|
|
|
const int b = *s++;
|
|
|
|
const int g = *s++;
|
|
|
|
const int r = *s++;
|
2012-02-21 22:09:31 +03:00
|
|
|
*d++ = (b >> 3) | ((g & 0xFC) << 3) | ((r & 0xF8) << 8);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2001-11-05 19:35:28 +02:00
|
|
|
}
|
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb24to16_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2002-06-30 00:26:15 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2007-04-28 14:44:49 +03:00
|
|
|
const int r = *s++;
|
|
|
|
const int g = *s++;
|
|
|
|
const int b = *s++;
|
2012-02-21 22:09:31 +03:00
|
|
|
*d++ = (b >> 3) | ((g & 0xFC) << 3) | ((r & 0xF8) << 8);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb24tobgr15_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2001-11-05 19:35:28 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2007-04-28 14:44:49 +03:00
|
|
|
const int b = *s++;
|
|
|
|
const int g = *s++;
|
|
|
|
const int r = *s++;
|
2012-02-21 22:09:31 +03:00
|
|
|
*d++ = (b >> 3) | ((g & 0xF8) << 2) | ((r & 0xF8) << 7);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-22 11:49:45 +03:00
|
|
|
}
|
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb24to15_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2002-06-30 00:26:15 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint16_t *d = (uint16_t *)dst;
|
|
|
|
const uint8_t *s = src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint8_t *end = s + src_size;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2007-04-28 14:44:49 +03:00
|
|
|
const int r = *s++;
|
|
|
|
const int g = *s++;
|
|
|
|
const int b = *s++;
|
2012-02-21 22:09:31 +03:00
|
|
|
*d++ = (b >> 3) | ((g & 0xF8) << 2) | ((r & 0xF8) << 7);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb15tobgr24_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2002-06-22 11:49:45 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint8_t *d = dst;
|
|
|
|
const uint16_t *s = (const uint16_t *)src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint16_t *end = s + src_size / 2;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-15 13:46:47 +03:00
|
|
|
register uint16_t bgr = *s++;
|
2012-02-23 04:33:21 +03:00
|
|
|
*d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
|
|
|
|
*d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
|
2011-11-08 18:16:59 +03:00
|
|
|
*d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-22 11:49:45 +03:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void rgb16tobgr24_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2002-06-22 11:49:45 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint8_t *d = (uint8_t *)dst;
|
|
|
|
const uint16_t *s = (const uint16_t *)src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint16_t *end = s + src_size / 2;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-15 13:46:47 +03:00
|
|
|
register uint16_t bgr = *s++;
|
2012-02-23 04:33:21 +03:00
|
|
|
*d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
|
|
|
|
*d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
|
2011-11-08 18:16:59 +03:00
|
|
|
*d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-22 11:49:45 +03:00
|
|
|
}
|
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb15to32_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2002-06-22 11:49:45 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint8_t *d = dst;
|
|
|
|
const uint16_t *s = (const uint16_t *)src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint16_t *end = s + src_size / 2;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-15 13:46:47 +03:00
|
|
|
register uint16_t bgr = *s++;
|
2009-07-26 15:26:32 +03:00
|
|
|
#if HAVE_BIGENDIAN
|
2009-02-28 10:01:52 +02:00
|
|
|
*d++ = 255;
|
2011-11-08 18:16:59 +03:00
|
|
|
*d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
|
2012-02-23 04:33:21 +03:00
|
|
|
*d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
|
|
|
|
*d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
|
2004-09-21 20:23:49 +03:00
|
|
|
#else
|
2012-02-23 04:33:21 +03:00
|
|
|
*d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
|
|
|
|
*d++ = ((bgr&0x03E0)>>2) | ((bgr&0x03E0)>> 7);
|
2011-11-08 18:16:59 +03:00
|
|
|
*d++ = ((bgr&0x7C00)>>7) | ((bgr&0x7C00)>>12);
|
2009-02-28 10:01:52 +02:00
|
|
|
*d++ = 255;
|
2003-02-15 15:04:17 +02:00
|
|
|
#endif
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-22 11:49:45 +03:00
|
|
|
}
|
2001-11-05 19:35:28 +02:00
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb16to32_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2002-06-22 11:49:45 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
uint8_t *d = dst;
|
|
|
|
const uint16_t *s = (const uint16_t *)src;
|
2012-02-15 13:46:47 +03:00
|
|
|
const uint16_t *end = s + src_size / 2;
|
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
while (s < end) {
|
2012-02-15 13:46:47 +03:00
|
|
|
register uint16_t bgr = *s++;
|
2009-07-26 15:26:32 +03:00
|
|
|
#if HAVE_BIGENDIAN
|
2009-02-28 10:01:52 +02:00
|
|
|
*d++ = 255;
|
2011-11-08 18:16:59 +03:00
|
|
|
*d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
|
2012-02-23 04:33:21 +03:00
|
|
|
*d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
|
|
|
|
*d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
|
2004-09-21 20:23:49 +03:00
|
|
|
#else
|
2012-02-23 04:33:21 +03:00
|
|
|
*d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
|
|
|
|
*d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
|
2011-11-08 18:16:59 +03:00
|
|
|
*d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
|
2009-02-28 10:01:52 +02:00
|
|
|
*d++ = 255;
|
2004-09-21 20:23:49 +03:00
|
|
|
#endif
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2001-11-05 19:35:28 +02:00
|
|
|
}
|
2001-11-04 21:36:24 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
static inline void shuffle_bytes_2103_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
2001-11-07 01:54:41 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
int idx = 15 - src_size;
|
|
|
|
const uint8_t *s = src - idx;
|
|
|
|
uint8_t *d = dst - idx;
|
|
|
|
|
|
|
|
for (; idx < 15; idx += 4) {
|
2015-06-23 05:09:11 +02:00
|
|
|
register unsigned v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00;
|
2012-02-21 22:09:31 +03:00
|
|
|
v &= 0xff00ff;
|
|
|
|
*(uint32_t *)&d[idx] = (v >> 16) + g + (v << 16);
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2001-11-07 01:54:41 +02:00
|
|
|
}
|
|
|
|
|
2015-06-23 04:36:02 +02:00
|
|
|
static inline void shuffle_bytes_0321_c(const uint8_t *src, uint8_t *dst,
|
|
|
|
int src_size)
|
|
|
|
{
|
|
|
|
int idx = 15 - src_size;
|
|
|
|
const uint8_t *s = src - idx;
|
|
|
|
uint8_t *d = dst - idx;
|
|
|
|
|
|
|
|
for (; idx < 15; idx += 4) {
|
|
|
|
register unsigned v = *(const uint32_t *)&s[idx], g = v & 0x00ff00ff;
|
|
|
|
v &= 0xff00ff00;
|
|
|
|
*(uint32_t *)&d[idx] = (v >> 16) + g + (v << 16);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-10 03:19:59 +02:00
|
|
|
#if !HAVE_BIGENDIAN
|
2018-03-24 21:17:32 +02:00
|
|
|
#define DEFINE_SHUFFLE_BYTES(name, a, b, c, d) \
|
|
|
|
static void shuffle_bytes_##name (const uint8_t *src, \
|
|
|
|
uint8_t *dst, int src_size) \
|
|
|
|
{ \
|
|
|
|
int i; \
|
|
|
|
\
|
|
|
|
for (i = 0; i < src_size; i += 4) { \
|
|
|
|
dst[i + 0] = src[i + a]; \
|
|
|
|
dst[i + 1] = src[i + b]; \
|
|
|
|
dst[i + 2] = src[i + c]; \
|
|
|
|
dst[i + 3] = src[i + d]; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFINE_SHUFFLE_BYTES(1230_c, 1, 2, 3, 0)
|
|
|
|
DEFINE_SHUFFLE_BYTES(3012_c, 3, 0, 1, 2)
|
|
|
|
DEFINE_SHUFFLE_BYTES(3210_c, 3, 2, 1, 0)
|
2018-06-10 03:19:59 +02:00
|
|
|
#endif
|
2018-03-24 21:17:32 +02:00
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void rgb24tobgr24_c(const uint8_t *src, uint8_t *dst, int src_size)
|
2002-04-13 03:48:21 +03:00
|
|
|
{
|
2007-04-28 14:44:49 +03:00
|
|
|
unsigned i;
|
2012-02-21 22:09:31 +03:00
|
|
|
|
|
|
|
for (i = 0; i < src_size; i += 3) {
|
2012-02-15 13:46:47 +03:00
|
|
|
register uint8_t x = src[i + 2];
|
2012-02-21 22:09:31 +03:00
|
|
|
dst[i + 1] = src[i + 1];
|
|
|
|
dst[i + 2] = src[i + 0];
|
|
|
|
dst[i + 0] = x;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-04-13 03:48:21 +03:00
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yuvPlanartoyuy2_c(const uint8_t *ysrc, const uint8_t *usrc,
|
|
|
|
const uint8_t *vsrc, uint8_t *dst,
|
2011-05-26 19:57:26 +03:00
|
|
|
int width, int height,
|
|
|
|
int lumStride, int chromStride,
|
|
|
|
int dstStride, int vertLumPerChroma)
|
2001-11-05 02:45:55 +02:00
|
|
|
{
|
2012-02-15 13:46:47 +03:00
|
|
|
int y, i;
|
2011-05-25 06:23:39 +03:00
|
|
|
const int chromWidth = width >> 1;
|
2012-02-21 22:09:31 +03:00
|
|
|
|
|
|
|
for (y = 0; y < height; y++) {
|
2011-05-25 06:23:39 +03:00
|
|
|
#if HAVE_FAST_64BIT
|
2012-02-21 22:09:31 +03:00
|
|
|
uint64_t *ldst = (uint64_t *)dst;
|
2007-04-28 14:44:49 +03:00
|
|
|
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
|
2009-08-17 00:11:28 +03:00
|
|
|
for (i = 0; i < chromWidth; i += 2) {
|
2012-02-15 13:46:47 +03:00
|
|
|
uint64_t k = yc[0] + (uc[0] << 8) +
|
2014-10-17 16:31:35 +03:00
|
|
|
(yc[1] << 16) + ((unsigned) vc[0] << 24);
|
2012-02-15 13:46:47 +03:00
|
|
|
uint64_t l = yc[2] + (uc[1] << 8) +
|
2014-10-17 16:31:35 +03:00
|
|
|
(yc[3] << 16) + ((unsigned) vc[1] << 24);
|
2007-04-28 14:44:49 +03:00
|
|
|
*ldst++ = k + (l << 32);
|
2012-02-21 22:09:31 +03:00
|
|
|
yc += 4;
|
|
|
|
uc += 2;
|
|
|
|
vc += 2;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-06-22 11:49:45 +03:00
|
|
|
|
|
|
|
#else
|
2012-02-21 22:09:31 +03:00
|
|
|
int *idst = (int32_t *)dst;
|
2007-04-28 14:44:49 +03:00
|
|
|
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
|
2012-02-21 22:09:31 +03:00
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
2009-07-26 15:26:32 +03:00
|
|
|
#if HAVE_BIGENDIAN
|
2012-02-21 22:09:31 +03:00
|
|
|
*idst++ = (yc[0] << 24) + (uc[0] << 16) +
|
|
|
|
(yc[1] << 8) + (vc[0] << 0);
|
2004-05-02 17:26:28 +03:00
|
|
|
#else
|
2007-04-28 14:44:49 +03:00
|
|
|
*idst++ = yc[0] + (uc[0] << 8) +
|
2012-02-21 22:09:31 +03:00
|
|
|
(yc[1] << 16) + (vc[0] << 24);
|
2007-04-28 14:44:49 +03:00
|
|
|
#endif
|
|
|
|
yc += 2;
|
|
|
|
uc++;
|
|
|
|
vc++;
|
|
|
|
}
|
|
|
|
#endif
|
2012-02-21 22:09:31 +03:00
|
|
|
if ((y & (vertLumPerChroma - 1)) == vertLumPerChroma - 1) {
|
2007-04-28 14:44:49 +03:00
|
|
|
usrc += chromStride;
|
|
|
|
vsrc += chromStride;
|
|
|
|
}
|
|
|
|
ysrc += lumStride;
|
|
|
|
dst += dstStride;
|
|
|
|
}
|
2001-11-05 02:45:55 +02:00
|
|
|
}
|
|
|
|
|
2002-04-13 05:21:12 +03:00
|
|
|
/**
|
2008-07-04 16:49:45 +03:00
|
|
|
* Height should be a multiple of 2 and width should be a multiple of 16.
|
|
|
|
* (If this is a problem for anyone then tell me, and I will fix it.)
|
2002-04-13 05:21:12 +03:00
|
|
|
*/
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yv12toyuy2_c(const uint8_t *ysrc, const uint8_t *usrc,
|
|
|
|
const uint8_t *vsrc, uint8_t *dst,
|
2012-02-21 22:09:31 +03:00
|
|
|
int width, int height, int lumStride,
|
|
|
|
int chromStride, int dstStride)
|
2002-04-13 05:21:12 +03:00
|
|
|
{
|
2007-04-28 14:44:49 +03:00
|
|
|
//FIXME interpolate chroma
|
2011-05-25 06:23:39 +03:00
|
|
|
yuvPlanartoyuy2_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
|
|
|
|
chromStride, dstStride, 2);
|
2003-10-10 01:25:53 +03:00
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yuvPlanartouyvy_c(const uint8_t *ysrc, const uint8_t *usrc,
|
|
|
|
const uint8_t *vsrc, uint8_t *dst,
|
2011-05-26 19:57:26 +03:00
|
|
|
int width, int height,
|
|
|
|
int lumStride, int chromStride,
|
|
|
|
int dstStride, int vertLumPerChroma)
|
2003-10-10 01:25:53 +03:00
|
|
|
{
|
2012-02-15 13:46:47 +03:00
|
|
|
int y, i;
|
2011-05-25 06:23:39 +03:00
|
|
|
const int chromWidth = width >> 1;
|
2012-02-21 22:09:31 +03:00
|
|
|
|
|
|
|
for (y = 0; y < height; y++) {
|
2008-10-05 19:47:55 +03:00
|
|
|
#if HAVE_FAST_64BIT
|
2012-02-21 22:09:31 +03:00
|
|
|
uint64_t *ldst = (uint64_t *)dst;
|
2007-04-28 14:44:49 +03:00
|
|
|
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
|
2009-08-17 00:11:28 +03:00
|
|
|
for (i = 0; i < chromWidth; i += 2) {
|
2012-02-15 13:46:47 +03:00
|
|
|
uint64_t k = uc[0] + (yc[0] << 8) +
|
2014-10-17 16:31:35 +03:00
|
|
|
(vc[0] << 16) + ((unsigned) yc[1] << 24);
|
2012-02-15 13:46:47 +03:00
|
|
|
uint64_t l = uc[1] + (yc[2] << 8) +
|
2014-10-17 16:31:35 +03:00
|
|
|
(vc[1] << 16) + ((unsigned) yc[3] << 24);
|
2007-04-28 14:44:49 +03:00
|
|
|
*ldst++ = k + (l << 32);
|
2012-02-21 22:09:31 +03:00
|
|
|
yc += 4;
|
|
|
|
uc += 2;
|
|
|
|
vc += 2;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2003-10-10 01:25:53 +03:00
|
|
|
|
|
|
|
#else
|
2012-02-21 22:09:31 +03:00
|
|
|
int *idst = (int32_t *)dst;
|
2007-04-28 14:44:49 +03:00
|
|
|
const uint8_t *yc = ysrc, *uc = usrc, *vc = vsrc;
|
2012-02-21 22:09:31 +03:00
|
|
|
|
2009-08-17 00:11:28 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
2009-07-26 15:26:32 +03:00
|
|
|
#if HAVE_BIGENDIAN
|
2012-02-21 22:09:31 +03:00
|
|
|
*idst++ = (uc[0] << 24) + (yc[0] << 16) +
|
|
|
|
(vc[0] << 8) + (yc[1] << 0);
|
2004-05-02 17:26:28 +03:00
|
|
|
#else
|
2007-04-28 14:44:49 +03:00
|
|
|
*idst++ = uc[0] + (yc[0] << 8) +
|
2012-02-21 22:09:31 +03:00
|
|
|
(vc[0] << 16) + (yc[1] << 24);
|
2007-04-28 14:44:49 +03:00
|
|
|
#endif
|
|
|
|
yc += 2;
|
|
|
|
uc++;
|
|
|
|
vc++;
|
|
|
|
}
|
|
|
|
#endif
|
2012-02-21 22:09:31 +03:00
|
|
|
if ((y & (vertLumPerChroma - 1)) == vertLumPerChroma - 1) {
|
2007-04-28 14:44:49 +03:00
|
|
|
usrc += chromStride;
|
|
|
|
vsrc += chromStride;
|
|
|
|
}
|
|
|
|
ysrc += lumStride;
|
2012-02-21 22:09:31 +03:00
|
|
|
dst += dstStride;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2003-10-10 01:25:53 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-07-04 16:49:45 +03:00
|
|
|
* Height should be a multiple of 2 and width should be a multiple of 16
|
|
|
|
* (If this is a problem for anyone then tell me, and I will fix it.)
|
2003-10-10 01:25:53 +03:00
|
|
|
*/
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yv12touyvy_c(const uint8_t *ysrc, const uint8_t *usrc,
|
|
|
|
const uint8_t *vsrc, uint8_t *dst,
|
2012-02-21 22:09:31 +03:00
|
|
|
int width, int height, int lumStride,
|
|
|
|
int chromStride, int dstStride)
|
2003-10-10 01:25:53 +03:00
|
|
|
{
|
2007-04-28 14:44:49 +03:00
|
|
|
//FIXME interpolate chroma
|
2011-05-25 06:23:39 +03:00
|
|
|
yuvPlanartouyvy_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
|
|
|
|
chromStride, dstStride, 2);
|
2002-04-13 05:21:12 +03:00
|
|
|
}
|
|
|
|
|
2008-09-05 03:25:39 +03:00
|
|
|
/**
|
|
|
|
* Width should be a multiple of 16.
|
|
|
|
*/
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yuv422ptouyvy_c(const uint8_t *ysrc, const uint8_t *usrc,
|
|
|
|
const uint8_t *vsrc, uint8_t *dst,
|
2012-02-21 22:09:31 +03:00
|
|
|
int width, int height, int lumStride,
|
|
|
|
int chromStride, int dstStride)
|
2008-09-05 03:25:39 +03:00
|
|
|
{
|
2011-05-25 06:23:39 +03:00
|
|
|
yuvPlanartouyvy_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
|
|
|
|
chromStride, dstStride, 1);
|
2008-09-05 03:25:39 +03:00
|
|
|
}
|
|
|
|
|
2002-04-13 05:21:12 +03:00
|
|
|
/**
|
2007-11-22 12:27:58 +02:00
|
|
|
* Width should be a multiple of 16.
|
2002-04-13 05:21:12 +03:00
|
|
|
*/
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yuv422ptoyuy2_c(const uint8_t *ysrc, const uint8_t *usrc,
|
|
|
|
const uint8_t *vsrc, uint8_t *dst,
|
2012-02-21 22:09:31 +03:00
|
|
|
int width, int height, int lumStride,
|
|
|
|
int chromStride, int dstStride)
|
2002-04-13 05:21:12 +03:00
|
|
|
{
|
2011-05-25 06:23:39 +03:00
|
|
|
yuvPlanartoyuy2_c(ysrc, usrc, vsrc, dst, width, height, lumStride,
|
|
|
|
chromStride, dstStride, 1);
|
2002-04-13 05:21:12 +03:00
|
|
|
}
|
|
|
|
|
2001-11-05 20:50:58 +02:00
|
|
|
/**
|
2008-07-04 16:49:45 +03:00
|
|
|
* Height should be a multiple of 2 and width should be a multiple of 16.
|
|
|
|
* (If this is a problem for anyone then tell me, and I will fix it.)
|
2001-11-05 20:50:58 +02:00
|
|
|
*/
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yuy2toyv12_c(const uint8_t *src, uint8_t *ydst,
|
|
|
|
uint8_t *udst, uint8_t *vdst,
|
2012-02-21 22:09:31 +03:00
|
|
|
int width, int height, int lumStride,
|
|
|
|
int chromStride, int srcStride)
|
2001-11-05 02:45:55 +02:00
|
|
|
{
|
2011-05-26 19:57:26 +03:00
|
|
|
int y;
|
2011-05-25 06:23:39 +03:00
|
|
|
const int chromWidth = width >> 1;
|
2012-02-21 22:09:31 +03:00
|
|
|
|
|
|
|
for (y = 0; y < height; y += 2) {
|
2011-05-26 19:57:26 +03:00
|
|
|
int i;
|
2012-02-21 22:09:31 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
|
|
|
ydst[2 * i + 0] = src[4 * i + 0];
|
|
|
|
udst[i] = src[4 * i + 1];
|
|
|
|
ydst[2 * i + 1] = src[4 * i + 2];
|
|
|
|
vdst[i] = src[4 * i + 3];
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
|
|
|
ydst += lumStride;
|
|
|
|
src += srcStride;
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
|
|
|
ydst[2 * i + 0] = src[4 * i + 0];
|
|
|
|
ydst[2 * i + 1] = src[4 * i + 2];
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
|
|
|
udst += chromStride;
|
|
|
|
vdst += chromStride;
|
|
|
|
ydst += lumStride;
|
|
|
|
src += srcStride;
|
|
|
|
}
|
2001-11-05 20:26:49 +02:00
|
|
|
}
|
2001-11-11 01:28:10 +02:00
|
|
|
|
2011-05-26 19:57:26 +03:00
|
|
|
static inline void planar2x_c(const uint8_t *src, uint8_t *dst, int srcWidth,
|
|
|
|
int srcHeight, int srcStride, int dstStride)
|
2002-06-28 02:48:53 +03:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
int x, y;
|
2007-04-27 02:07:11 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
dst[0] = src[0];
|
2007-04-27 02:07:11 +03:00
|
|
|
|
2007-04-28 14:44:49 +03:00
|
|
|
// first line
|
2012-02-21 22:09:31 +03:00
|
|
|
for (x = 0; x < srcWidth - 1; x++) {
|
|
|
|
dst[2 * x + 1] = (3 * src[x] + src[x + 1]) >> 2;
|
|
|
|
dst[2 * x + 2] = (src[x] + 3 * src[x + 1]) >> 2;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2012-02-21 22:09:31 +03:00
|
|
|
dst[2 * srcWidth - 1] = src[srcWidth - 1];
|
2007-04-27 02:07:11 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
dst += dstStride;
|
2002-06-28 02:48:53 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 1; y < srcHeight; y++) {
|
2011-05-25 06:23:39 +03:00
|
|
|
const int mmxSize = 1;
|
2010-09-13 17:33:08 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
dst[0] = (src[0] * 3 + src[srcStride]) >> 2;
|
|
|
|
dst[dstStride] = (src[0] + 3 * src[srcStride]) >> 2;
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (x = mmxSize - 1; x < srcWidth - 1; x++) {
|
|
|
|
dst[2 * x + 1] = (src[x + 0] * 3 + src[x + srcStride + 1]) >> 2;
|
|
|
|
dst[2 * x + dstStride + 2] = (src[x + 0] + 3 * src[x + srcStride + 1]) >> 2;
|
|
|
|
dst[2 * x + dstStride + 1] = (src[x + 1] + 3 * src[x + srcStride]) >> 2;
|
|
|
|
dst[2 * x + 2] = (src[x + 1] * 3 + src[x + srcStride]) >> 2;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2012-02-21 22:09:31 +03:00
|
|
|
dst[srcWidth * 2 - 1] = (src[srcWidth - 1] * 3 + src[srcWidth - 1 + srcStride]) >> 2;
|
|
|
|
dst[srcWidth * 2 - 1 + dstStride] = (src[srcWidth - 1] + 3 * src[srcWidth - 1 + srcStride]) >> 2;
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
dst += dstStride * 2;
|
|
|
|
src += srcStride;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2007-04-27 02:07:11 +03:00
|
|
|
|
2007-04-28 14:44:49 +03:00
|
|
|
// last line
|
2012-02-21 22:09:31 +03:00
|
|
|
dst[0] = src[0];
|
2007-04-27 02:07:11 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (x = 0; x < srcWidth - 1; x++) {
|
|
|
|
dst[2 * x + 1] = (src[x] * 3 + src[x + 1]) >> 2;
|
|
|
|
dst[2 * x + 2] = (src[x] + 3 * src[x + 1]) >> 2;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2012-02-21 22:09:31 +03:00
|
|
|
dst[2 * srcWidth - 1] = src[srcWidth - 1];
|
2002-06-28 02:48:53 +03:00
|
|
|
}
|
|
|
|
|
2001-11-11 01:28:10 +02:00
|
|
|
/**
|
2008-07-04 16:49:45 +03:00
|
|
|
* Height should be a multiple of 2 and width should be a multiple of 16.
|
|
|
|
* (If this is a problem for anyone then tell me, and I will fix it.)
|
|
|
|
* Chrominance data is only taken from every second line, others are ignored.
|
2007-11-22 12:27:58 +02:00
|
|
|
* FIXME: Write HQ version.
|
2001-11-11 01:28:10 +02:00
|
|
|
*/
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void uyvytoyv12_c(const uint8_t *src, uint8_t *ydst,
|
|
|
|
uint8_t *udst, uint8_t *vdst,
|
2012-02-21 22:09:31 +03:00
|
|
|
int width, int height, int lumStride,
|
|
|
|
int chromStride, int srcStride)
|
2001-11-11 01:28:10 +02:00
|
|
|
{
|
2011-05-26 19:57:26 +03:00
|
|
|
int y;
|
2011-05-25 06:23:39 +03:00
|
|
|
const int chromWidth = width >> 1;
|
2012-02-21 22:09:31 +03:00
|
|
|
|
|
|
|
for (y = 0; y < height; y += 2) {
|
2011-05-26 19:57:26 +03:00
|
|
|
int i;
|
2012-02-21 22:09:31 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
|
|
|
udst[i] = src[4 * i + 0];
|
|
|
|
ydst[2 * i + 0] = src[4 * i + 1];
|
|
|
|
vdst[i] = src[4 * i + 2];
|
|
|
|
ydst[2 * i + 1] = src[4 * i + 3];
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
|
|
|
ydst += lumStride;
|
|
|
|
src += srcStride;
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
|
|
|
ydst[2 * i + 0] = src[4 * i + 1];
|
|
|
|
ydst[2 * i + 1] = src[4 * i + 3];
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
|
|
|
udst += chromStride;
|
|
|
|
vdst += chromStride;
|
|
|
|
ydst += lumStride;
|
|
|
|
src += srcStride;
|
|
|
|
}
|
2001-11-11 01:28:10 +02:00
|
|
|
}
|
|
|
|
|
2001-11-26 03:15:08 +02:00
|
|
|
/**
|
2008-07-04 16:49:45 +03:00
|
|
|
* Height should be a multiple of 2 and width should be a multiple of 2.
|
|
|
|
* (If this is a problem for anyone then tell me, and I will fix it.)
|
|
|
|
* Chrominance data is only taken from every second line,
|
2007-11-22 12:27:58 +02:00
|
|
|
* others are ignored in the C version.
|
|
|
|
* FIXME: Write HQ version.
|
2001-11-26 03:15:08 +02:00
|
|
|
*/
|
2013-04-15 04:01:04 +03:00
|
|
|
void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
|
2011-05-26 19:57:26 +03:00
|
|
|
uint8_t *vdst, int width, int height, int lumStride,
|
2013-04-15 04:01:04 +03:00
|
|
|
int chromStride, int srcStride, int32_t *rgb2yuv)
|
2001-11-26 03:15:08 +02:00
|
|
|
{
|
2013-04-15 04:01:04 +03:00
|
|
|
int32_t ry = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = rgb2yuv[BY_IDX];
|
|
|
|
int32_t ru = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = rgb2yuv[BU_IDX];
|
|
|
|
int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = rgb2yuv[BV_IDX];
|
2011-05-26 19:57:26 +03:00
|
|
|
int y;
|
2011-05-25 06:23:39 +03:00
|
|
|
const int chromWidth = width >> 1;
|
2012-02-15 13:46:47 +03:00
|
|
|
|
|
|
|
for (y = 0; y < height; y += 2) {
|
2011-05-26 19:57:26 +03:00
|
|
|
int i;
|
2012-02-21 22:09:31 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
|
|
|
unsigned int b = src[6 * i + 0];
|
|
|
|
unsigned int g = src[6 * i + 1];
|
|
|
|
unsigned int r = src[6 * i + 2];
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2013-04-15 04:01:04 +03:00
|
|
|
unsigned int Y = ((ry * r + gy * g + by * b) >> RGB2YUV_SHIFT) + 16;
|
|
|
|
unsigned int V = ((rv * r + gv * g + bv * b) >> RGB2YUV_SHIFT) + 128;
|
|
|
|
unsigned int U = ((ru * r + gu * g + bu * b) >> RGB2YUV_SHIFT) + 128;
|
2007-04-28 14:44:49 +03:00
|
|
|
|
|
|
|
udst[i] = U;
|
|
|
|
vdst[i] = V;
|
2012-02-21 22:09:31 +03:00
|
|
|
ydst[2 * i] = Y;
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
b = src[6 * i + 3];
|
|
|
|
g = src[6 * i + 4];
|
|
|
|
r = src[6 * i + 5];
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2013-04-15 04:01:04 +03:00
|
|
|
Y = ((ry * r + gy * g + by * b) >> RGB2YUV_SHIFT) + 16;
|
2012-02-21 22:09:31 +03:00
|
|
|
ydst[2 * i + 1] = Y;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
|
|
|
ydst += lumStride;
|
|
|
|
src += srcStride;
|
|
|
|
|
2012-02-23 04:33:21 +03:00
|
|
|
if (y+1 == height)
|
2011-05-05 03:20:20 +03:00
|
|
|
break;
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (i = 0; i < chromWidth; i++) {
|
|
|
|
unsigned int b = src[6 * i + 0];
|
|
|
|
unsigned int g = src[6 * i + 1];
|
|
|
|
unsigned int r = src[6 * i + 2];
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2013-04-15 04:01:04 +03:00
|
|
|
unsigned int Y = ((ry * r + gy * g + by * b) >> RGB2YUV_SHIFT) + 16;
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
ydst[2 * i] = Y;
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
b = src[6 * i + 3];
|
|
|
|
g = src[6 * i + 4];
|
|
|
|
r = src[6 * i + 5];
|
2007-04-28 14:44:49 +03:00
|
|
|
|
2013-04-15 04:01:04 +03:00
|
|
|
Y = ((ry * r + gy * g + by * b) >> RGB2YUV_SHIFT) + 16;
|
2012-02-21 22:09:31 +03:00
|
|
|
ydst[2 * i + 1] = Y;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
|
|
|
udst += chromStride;
|
|
|
|
vdst += chromStride;
|
|
|
|
ydst += lumStride;
|
|
|
|
src += srcStride;
|
|
|
|
}
|
2001-11-26 03:15:08 +02:00
|
|
|
}
|
2002-03-25 18:35:24 +02:00
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void interleaveBytes_c(const uint8_t *src1, const uint8_t *src2,
|
2012-02-21 22:09:31 +03:00
|
|
|
uint8_t *dest, int width, int height,
|
|
|
|
int src1Stride, int src2Stride, int dstStride)
|
2009-08-17 00:11:28 +03:00
|
|
|
{
|
2011-05-26 19:57:26 +03:00
|
|
|
int h;
|
2002-03-25 18:35:24 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (h = 0; h < height; h++) {
|
2011-05-26 19:57:26 +03:00
|
|
|
int w;
|
2012-02-21 22:09:31 +03:00
|
|
|
for (w = 0; w < width; w++) {
|
|
|
|
dest[2 * w + 0] = src1[w];
|
|
|
|
dest[2 * w + 1] = src2[w];
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
|
|
|
dest += dstStride;
|
2010-09-13 17:33:08 +03:00
|
|
|
src1 += src1Stride;
|
|
|
|
src2 += src2Stride;
|
2007-04-28 14:44:49 +03:00
|
|
|
}
|
2002-03-25 18:35:24 +02:00
|
|
|
}
|
2002-06-30 00:26:15 +03:00
|
|
|
|
2013-11-19 16:17:26 +03:00
|
|
|
static void deinterleaveBytes_c(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
|
|
|
|
int width, int height, int srcStride,
|
|
|
|
int dst1Stride, int dst2Stride)
|
|
|
|
{
|
|
|
|
int h;
|
|
|
|
|
|
|
|
for (h = 0; h < height; h++) {
|
|
|
|
int w;
|
|
|
|
for (w = 0; w < width; w++) {
|
|
|
|
dst1[w] = src[2 * w + 0];
|
|
|
|
dst2[w] = src[2 * w + 1];
|
|
|
|
}
|
2013-11-19 16:17:26 +03:00
|
|
|
src += srcStride;
|
2013-11-19 16:17:26 +03:00
|
|
|
dst1 += dst1Stride;
|
|
|
|
dst2 += dst2Stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void vu9_to_vu12_c(const uint8_t *src1, const uint8_t *src2,
|
|
|
|
uint8_t *dst1, uint8_t *dst2,
|
2011-05-26 19:57:26 +03:00
|
|
|
int width, int height,
|
|
|
|
int srcStride1, int srcStride2,
|
|
|
|
int dstStride1, int dstStride2)
|
2002-06-30 00:26:15 +03:00
|
|
|
{
|
2012-02-15 13:46:47 +03:00
|
|
|
int x, y;
|
|
|
|
int w = width / 2;
|
|
|
|
int h = height / 2;
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 0; y < h; y++) {
|
|
|
|
const uint8_t *s1 = src1 + srcStride1 * (y >> 1);
|
|
|
|
uint8_t *d = dst1 + dstStride1 * y;
|
2012-02-15 13:46:47 +03:00
|
|
|
for (x = 0; x < w; x++)
|
|
|
|
d[2 * x] = d[2 * x + 1] = s1[x];
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 0; y < h; y++) {
|
|
|
|
const uint8_t *s2 = src2 + srcStride2 * (y >> 1);
|
|
|
|
uint8_t *d = dst2 + dstStride2 * y;
|
2012-02-15 13:46:47 +03:00
|
|
|
for (x = 0; x < w; x++)
|
|
|
|
d[2 * x] = d[2 * x + 1] = s2[x];
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static inline void yvu9_to_yuy2_c(const uint8_t *src1, const uint8_t *src2,
|
|
|
|
const uint8_t *src3, uint8_t *dst,
|
2011-05-26 19:57:26 +03:00
|
|
|
int width, int height,
|
|
|
|
int srcStride1, int srcStride2,
|
|
|
|
int srcStride3, int dstStride)
|
2002-06-30 00:26:15 +03:00
|
|
|
{
|
2012-02-15 13:46:47 +03:00
|
|
|
int x, y;
|
|
|
|
int w = width / 2;
|
|
|
|
int h = height;
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 0; y < h; y++) {
|
|
|
|
const uint8_t *yp = src1 + srcStride1 * y;
|
|
|
|
const uint8_t *up = src2 + srcStride2 * (y >> 2);
|
|
|
|
const uint8_t *vp = src3 + srcStride3 * (y >> 2);
|
|
|
|
uint8_t *d = dst + dstStride * y;
|
2012-02-15 13:46:47 +03:00
|
|
|
for (x = 0; x < w; x++) {
|
2012-02-21 22:09:31 +03:00
|
|
|
const int x2 = x << 2;
|
|
|
|
d[8 * x + 0] = yp[x2];
|
|
|
|
d[8 * x + 1] = up[x];
|
|
|
|
d[8 * x + 2] = yp[x2 + 1];
|
|
|
|
d[8 * x + 3] = vp[x];
|
|
|
|
d[8 * x + 4] = yp[x2 + 2];
|
|
|
|
d[8 * x + 5] = up[x];
|
|
|
|
d[8 * x + 6] = yp[x2 + 3];
|
|
|
|
d[8 * x + 7] = vp[x];
|
2009-08-16 03:32:04 +03:00
|
|
|
}
|
2002-06-30 00:26:15 +03:00
|
|
|
}
|
|
|
|
}
|
2007-04-12 00:00:25 +03:00
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void extract_even_c(const uint8_t *src, uint8_t *dst, int count)
|
2009-03-19 05:45:29 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
dst += count;
|
|
|
|
src += count * 2;
|
|
|
|
count = -count;
|
|
|
|
while (count < 0) {
|
|
|
|
dst[count] = src[2 * count];
|
2009-03-19 05:45:29 +02:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void extract_even2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1,
|
|
|
|
int count)
|
2009-03-19 05:45:29 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
dst0 += count;
|
|
|
|
dst1 += count;
|
|
|
|
src += count * 4;
|
|
|
|
count = -count;
|
|
|
|
while (count < 0) {
|
|
|
|
dst0[count] = src[4 * count + 0];
|
|
|
|
dst1[count] = src[4 * count + 2];
|
2009-03-19 05:45:29 +02:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void extract_even2avg_c(const uint8_t *src0, const uint8_t *src1,
|
|
|
|
uint8_t *dst0, uint8_t *dst1, int count)
|
2009-03-22 01:45:20 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
dst0 += count;
|
|
|
|
dst1 += count;
|
|
|
|
src0 += count * 4;
|
|
|
|
src1 += count * 4;
|
|
|
|
count = -count;
|
|
|
|
while (count < 0) {
|
|
|
|
dst0[count] = (src0[4 * count + 0] + src1[4 * count + 0]) >> 1;
|
|
|
|
dst1[count] = (src0[4 * count + 2] + src1[4 * count + 2]) >> 1;
|
2009-03-22 01:45:20 +02:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void extract_odd2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1,
|
|
|
|
int count)
|
2009-03-19 05:45:29 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
dst0 += count;
|
|
|
|
dst1 += count;
|
|
|
|
src += count * 4;
|
|
|
|
count = -count;
|
2009-03-22 01:52:34 +02:00
|
|
|
src++;
|
2012-02-21 22:09:31 +03:00
|
|
|
while (count < 0) {
|
|
|
|
dst0[count] = src[4 * count + 0];
|
|
|
|
dst1[count] = src[4 * count + 2];
|
2009-03-19 05:45:29 +02:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void extract_odd2avg_c(const uint8_t *src0, const uint8_t *src1,
|
|
|
|
uint8_t *dst0, uint8_t *dst1, int count)
|
2009-03-22 01:45:20 +02:00
|
|
|
{
|
2012-02-21 22:09:31 +03:00
|
|
|
dst0 += count;
|
|
|
|
dst1 += count;
|
|
|
|
src0 += count * 4;
|
|
|
|
src1 += count * 4;
|
|
|
|
count = -count;
|
2009-03-22 01:52:34 +02:00
|
|
|
src0++;
|
|
|
|
src1++;
|
2012-02-21 22:09:31 +03:00
|
|
|
while (count < 0) {
|
|
|
|
dst0[count] = (src0[4 * count + 0] + src1[4 * count + 0]) >> 1;
|
|
|
|
dst1[count] = (src0[4 * count + 2] + src1[4 * count + 2]) >> 1;
|
2009-03-22 01:45:20 +02:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void yuyvtoyuv420_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
2011-05-26 19:57:26 +03:00
|
|
|
const uint8_t *src, int width, int height,
|
|
|
|
int lumStride, int chromStride, int srcStride)
|
2009-03-19 05:45:29 +02:00
|
|
|
{
|
2011-05-26 19:57:26 +03:00
|
|
|
int y;
|
2016-01-27 17:19:38 +02:00
|
|
|
const int chromWidth = AV_CEIL_RSHIFT(width, 1);
|
2009-03-19 05:45:29 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 0; y < height; y++) {
|
2011-05-25 06:23:39 +03:00
|
|
|
extract_even_c(src, ydst, width);
|
2012-02-21 22:09:31 +03:00
|
|
|
if (y & 1) {
|
2011-05-25 06:23:39 +03:00
|
|
|
extract_odd2avg_c(src - srcStride, src, udst, vdst, chromWidth);
|
2012-02-21 22:09:31 +03:00
|
|
|
udst += chromStride;
|
|
|
|
vdst += chromStride;
|
2009-03-19 05:45:29 +02:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
src += srcStride;
|
|
|
|
ydst += lumStride;
|
2009-03-19 05:45:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void yuyvtoyuv422_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
2011-05-26 19:57:26 +03:00
|
|
|
const uint8_t *src, int width, int height,
|
|
|
|
int lumStride, int chromStride, int srcStride)
|
2009-03-19 05:45:29 +02:00
|
|
|
{
|
2011-05-26 19:57:26 +03:00
|
|
|
int y;
|
2016-01-27 17:19:38 +02:00
|
|
|
const int chromWidth = AV_CEIL_RSHIFT(width, 1);
|
2009-03-19 05:45:29 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 0; y < height; y++) {
|
2011-05-25 06:23:39 +03:00
|
|
|
extract_even_c(src, ydst, width);
|
|
|
|
extract_odd2_c(src, udst, vdst, chromWidth);
|
2009-03-19 05:45:29 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
src += srcStride;
|
|
|
|
ydst += lumStride;
|
|
|
|
udst += chromStride;
|
|
|
|
vdst += chromStride;
|
2009-03-19 05:45:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void uyvytoyuv420_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
2011-05-26 19:57:26 +03:00
|
|
|
const uint8_t *src, int width, int height,
|
|
|
|
int lumStride, int chromStride, int srcStride)
|
2009-03-19 05:45:29 +02:00
|
|
|
{
|
2011-05-26 19:57:26 +03:00
|
|
|
int y;
|
2016-01-27 17:19:38 +02:00
|
|
|
const int chromWidth = AV_CEIL_RSHIFT(width, 1);
|
2009-03-19 05:45:29 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 0; y < height; y++) {
|
2011-05-25 06:23:39 +03:00
|
|
|
extract_even_c(src + 1, ydst, width);
|
2012-02-21 22:09:31 +03:00
|
|
|
if (y & 1) {
|
2011-05-25 06:23:39 +03:00
|
|
|
extract_even2avg_c(src - srcStride, src, udst, vdst, chromWidth);
|
2012-02-21 22:09:31 +03:00
|
|
|
udst += chromStride;
|
|
|
|
vdst += chromStride;
|
2009-03-19 05:45:29 +02:00
|
|
|
}
|
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
src += srcStride;
|
|
|
|
ydst += lumStride;
|
2009-03-19 05:45:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-25 06:23:39 +03:00
|
|
|
static void uyvytoyuv422_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
2011-05-26 19:57:26 +03:00
|
|
|
const uint8_t *src, int width, int height,
|
|
|
|
int lumStride, int chromStride, int srcStride)
|
2009-03-19 05:45:29 +02:00
|
|
|
{
|
2011-05-26 19:57:26 +03:00
|
|
|
int y;
|
2016-01-27 17:19:38 +02:00
|
|
|
const int chromWidth = AV_CEIL_RSHIFT(width, 1);
|
2009-03-19 05:45:29 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
for (y = 0; y < height; y++) {
|
2011-05-25 06:23:39 +03:00
|
|
|
extract_even_c(src + 1, ydst, width);
|
|
|
|
extract_even2_c(src, udst, vdst, chromWidth);
|
2009-03-19 05:45:29 +02:00
|
|
|
|
2012-02-21 22:09:31 +03:00
|
|
|
src += srcStride;
|
|
|
|
ydst += lumStride;
|
|
|
|
udst += chromStride;
|
|
|
|
vdst += chromStride;
|
2009-03-19 05:45:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-18 16:54:45 +03:00
|
|
|
static av_cold void rgb2rgb_init_c(void)
|
2011-05-25 06:23:39 +03:00
|
|
|
{
|
|
|
|
rgb15to16 = rgb15to16_c;
|
|
|
|
rgb15tobgr24 = rgb15tobgr24_c;
|
|
|
|
rgb15to32 = rgb15to32_c;
|
|
|
|
rgb16tobgr24 = rgb16tobgr24_c;
|
|
|
|
rgb16to32 = rgb16to32_c;
|
|
|
|
rgb16to15 = rgb16to15_c;
|
|
|
|
rgb24tobgr16 = rgb24tobgr16_c;
|
|
|
|
rgb24tobgr15 = rgb24tobgr15_c;
|
|
|
|
rgb24tobgr32 = rgb24tobgr32_c;
|
|
|
|
rgb32to16 = rgb32to16_c;
|
|
|
|
rgb32to15 = rgb32to15_c;
|
|
|
|
rgb32tobgr24 = rgb32tobgr24_c;
|
|
|
|
rgb24to15 = rgb24to15_c;
|
|
|
|
rgb24to16 = rgb24to16_c;
|
|
|
|
rgb24tobgr24 = rgb24tobgr24_c;
|
2015-06-23 04:36:02 +02:00
|
|
|
#if HAVE_BIGENDIAN
|
|
|
|
shuffle_bytes_0321 = shuffle_bytes_2103_c;
|
|
|
|
shuffle_bytes_2103 = shuffle_bytes_0321_c;
|
|
|
|
#else
|
|
|
|
shuffle_bytes_0321 = shuffle_bytes_0321_c;
|
2011-05-25 06:23:39 +03:00
|
|
|
shuffle_bytes_2103 = shuffle_bytes_2103_c;
|
2018-03-24 21:17:32 +02:00
|
|
|
shuffle_bytes_1230 = shuffle_bytes_1230_c;
|
|
|
|
shuffle_bytes_3012 = shuffle_bytes_3012_c;
|
|
|
|
shuffle_bytes_3210 = shuffle_bytes_3210_c;
|
2015-06-22 22:23:22 +02:00
|
|
|
#endif
|
2011-05-25 06:23:39 +03:00
|
|
|
rgb32tobgr16 = rgb32tobgr16_c;
|
|
|
|
rgb32tobgr15 = rgb32tobgr15_c;
|
|
|
|
yv12toyuy2 = yv12toyuy2_c;
|
|
|
|
yv12touyvy = yv12touyvy_c;
|
|
|
|
yuv422ptoyuy2 = yuv422ptoyuy2_c;
|
|
|
|
yuv422ptouyvy = yuv422ptouyvy_c;
|
|
|
|
yuy2toyv12 = yuy2toyv12_c;
|
|
|
|
planar2x = planar2x_c;
|
2013-04-15 04:01:04 +03:00
|
|
|
ff_rgb24toyv12 = ff_rgb24toyv12_c;
|
2011-05-25 06:23:39 +03:00
|
|
|
interleaveBytes = interleaveBytes_c;
|
2013-11-19 16:17:26 +03:00
|
|
|
deinterleaveBytes = deinterleaveBytes_c;
|
2011-05-25 06:23:39 +03:00
|
|
|
vu9_to_vu12 = vu9_to_vu12_c;
|
|
|
|
yvu9_to_yuy2 = yvu9_to_yuy2_c;
|
|
|
|
|
|
|
|
uyvytoyuv420 = uyvytoyuv420_c;
|
|
|
|
uyvytoyuv422 = uyvytoyuv422_c;
|
|
|
|
yuyvtoyuv420 = yuyvtoyuv420_c;
|
|
|
|
yuyvtoyuv422 = yuyvtoyuv422_c;
|
2007-04-12 00:00:25 +03:00
|
|
|
}
|