mirror of https://github.com/mpv-player/mpv
rgb vs bgr fix for the unscaled converters.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27518 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b8d98f8959
commit
6dcd5a4e7a
|
@ -35,22 +35,22 @@
|
||||||
|
|
||||||
#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
|
#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
|
||||||
|
|
||||||
void (*rgb24to32)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb32to24)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb32to16)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb32to16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb32to15)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb32to15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb15to24)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb15to32)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb15to32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb16to15)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb16to15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb16to24)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb16to32)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb16to32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
//void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
//void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
//void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
//void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
|
@ -330,7 +330,7 @@ void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const ui
|
||||||
((uint16_t *)dst)[i] = bswap_16(((const uint16_t *)palette)[src[i]]);
|
((uint16_t *)dst)[i] = bswap_16(((const uint16_t *)palette)[src[i]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
void rgb32to24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
long num_pixels = src_size >> 2;
|
long num_pixels = src_size >> 2;
|
||||||
|
@ -349,7 +349,7 @@ void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
|
void rgb24to32(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
for (i=0; 3*i<src_size; i++)
|
for (i=0; 3*i<src_size; i++)
|
||||||
|
@ -393,7 +393,7 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
void rgb16to24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint16_t *end;
|
const uint16_t *end;
|
||||||
uint8_t *d = dst;
|
uint8_t *d = dst;
|
||||||
|
@ -467,7 +467,7 @@ void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rgb15tobgr24(const uint8_t *src, uint8_t *dst, long src_size)
|
void rgb15to24(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint16_t *end;
|
const uint16_t *end;
|
||||||
uint8_t *d = dst;
|
uint8_t *d = dst;
|
||||||
|
@ -517,7 +517,7 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rgb8tobgr8(const uint8_t *src, uint8_t *dst, long src_size)
|
void bgr8torgb8(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
long num_pixels = src_size;
|
long num_pixels = src_size;
|
||||||
|
|
|
@ -29,36 +29,36 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
/* A full collection of RGB to RGB(BGR) converters */
|
/* A full collection of RGB to RGB(BGR) converters */
|
||||||
extern void (*rgb24to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb24to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb24to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb32to24) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb32to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb32to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb32to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb32to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb15to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb15to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb15to24) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb15to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb15to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb16to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb16to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb16to24) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb16to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb16to32) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb24to16) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb24to15) (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb32tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
|
|
||||||
extern void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb24to32 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb32to24 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb16to24 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb16tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb16tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb16tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb15tobgr24(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb15to24 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb15tobgr16(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
|
extern void rgb15tobgr15(const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
extern void rgb8tobgr8 (const uint8_t *src, uint8_t *dst, long src_size);
|
extern void bgr8torgb8 (const uint8_t *src, uint8_t *dst, long src_size);
|
||||||
|
|
||||||
|
|
||||||
extern void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
extern void palette8torgb32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
#define SFENCE " # nop"
|
#define SFENCE " # nop"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void RENAME(rgb24to32)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
uint8_t *dest = dst;
|
uint8_t *dest = dst;
|
||||||
const uint8_t *s = src;
|
const uint8_t *s = src;
|
||||||
|
@ -142,7 +142,7 @@ static inline void RENAME(rgb24to32)(const uint8_t *src, uint8_t *dst, long src_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb32to24)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
uint8_t *dest = dst;
|
uint8_t *dest = dst;
|
||||||
const uint8_t *s = src;
|
const uint8_t *s = src;
|
||||||
|
@ -657,7 +657,7 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint8_t *s = src;
|
const uint8_t *s = src;
|
||||||
const uint8_t *end;
|
const uint8_t *end;
|
||||||
|
@ -720,7 +720,7 @@ static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint8_t *s = src;
|
const uint8_t *s = src;
|
||||||
const uint8_t *end;
|
const uint8_t *end;
|
||||||
|
@ -783,7 +783,7 @@ static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint8_t *s = src;
|
const uint8_t *s = src;
|
||||||
const uint8_t *end;
|
const uint8_t *end;
|
||||||
|
@ -846,7 +846,7 @@ static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint8_t *s = src;
|
const uint8_t *s = src;
|
||||||
const uint8_t *end;
|
const uint8_t *end;
|
||||||
|
@ -930,7 +930,7 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s
|
||||||
|
|
|
|
||||||
original bits
|
original bits
|
||||||
*/
|
*/
|
||||||
static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint16_t *end;
|
const uint16_t *end;
|
||||||
#ifdef HAVE_MMX
|
#ifdef HAVE_MMX
|
||||||
|
@ -1072,7 +1072,7 @@ static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb16to24)(const uint8_t *src, uint8_t *dst, long src_size)
|
static inline void RENAME(rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size)
|
||||||
{
|
{
|
||||||
const uint16_t *end;
|
const uint16_t *end;
|
||||||
#ifdef HAVE_MMX
|
#ifdef HAVE_MMX
|
||||||
|
@ -2707,19 +2707,19 @@ static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2
|
||||||
|
|
||||||
static inline void RENAME(rgb2rgb_init)(void){
|
static inline void RENAME(rgb2rgb_init)(void){
|
||||||
rgb15to16 = RENAME(rgb15to16);
|
rgb15to16 = RENAME(rgb15to16);
|
||||||
rgb15to24 = RENAME(rgb15to24);
|
rgb15tobgr24 = RENAME(rgb15tobgr24);
|
||||||
rgb15to32 = RENAME(rgb15to32);
|
rgb15to32 = RENAME(rgb15to32);
|
||||||
rgb16to24 = RENAME(rgb16to24);
|
rgb16tobgr24 = RENAME(rgb16tobgr24);
|
||||||
rgb16to32 = RENAME(rgb16to32);
|
rgb16to32 = RENAME(rgb16to32);
|
||||||
rgb16to15 = RENAME(rgb16to15);
|
rgb16to15 = RENAME(rgb16to15);
|
||||||
rgb24to16 = RENAME(rgb24to16);
|
rgb24tobgr16 = RENAME(rgb24tobgr16);
|
||||||
rgb24to15 = RENAME(rgb24to15);
|
rgb24tobgr15 = RENAME(rgb24tobgr15);
|
||||||
rgb24to32 = RENAME(rgb24to32);
|
rgb24tobgr32 = RENAME(rgb24tobgr32);
|
||||||
rgb32to16 = RENAME(rgb32to16);
|
rgb32to16 = RENAME(rgb32to16);
|
||||||
rgb32to15 = RENAME(rgb32to15);
|
rgb32to15 = RENAME(rgb32to15);
|
||||||
rgb32to24 = RENAME(rgb32to24);
|
rgb32tobgr24 = RENAME(rgb32tobgr24);
|
||||||
rgb24tobgr15 = RENAME(rgb24tobgr15);
|
rgb24to15 = RENAME(rgb24to15);
|
||||||
rgb24tobgr16 = RENAME(rgb24tobgr16);
|
rgb24to16 = RENAME(rgb24to16);
|
||||||
rgb24tobgr24 = RENAME(rgb24tobgr24);
|
rgb24tobgr24 = RENAME(rgb24tobgr24);
|
||||||
rgb32tobgr32 = RENAME(rgb32tobgr32);
|
rgb32tobgr32 = RENAME(rgb32tobgr32);
|
||||||
rgb32tobgr16 = RENAME(rgb32tobgr16);
|
rgb32tobgr16 = RENAME(rgb32tobgr16);
|
||||||
|
|
Loading…
Reference in New Issue