mirror of https://github.com/mpv-player/mpv
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6485 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
fd68aff8f7
commit
b9cda21184
|
@ -214,6 +214,23 @@ void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, cons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bgr24torgb24(const uint8_t *src, uint8_t *dst, unsigned src_size)
|
||||||
|
{
|
||||||
|
#ifdef CAN_COMPILE_X86_ASM
|
||||||
|
// ordered per speed fasterst first
|
||||||
|
if(gCpuCaps.hasMMX2)
|
||||||
|
bgr24torgb24_MMX2(src, dst, src_size);
|
||||||
|
else if(gCpuCaps.has3DNow)
|
||||||
|
bgr24torgb24_3DNow(src, dst, src_size);
|
||||||
|
else if(gCpuCaps.hasMMX)
|
||||||
|
bgr24torgb24_MMX(src, dst, src_size);
|
||||||
|
else
|
||||||
|
bgr24torgb24_C(src, dst, src_size);
|
||||||
|
#else
|
||||||
|
bgr24torgb24_C(src, dst, src_size);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size)
|
void rgb32to16(const uint8_t *src, uint8_t *dst, unsigned src_size)
|
||||||
{
|
{
|
||||||
#ifdef CAN_COMPILE_X86_ASM
|
#ifdef CAN_COMPILE_X86_ASM
|
||||||
|
@ -432,6 +449,26 @@ void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void yvu9toyv12(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
|
||||||
|
uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
||||||
|
unsigned int width, unsigned int height,
|
||||||
|
unsigned int lumStride, unsigned int chromStride)
|
||||||
|
{
|
||||||
|
#ifdef CAN_COMPILE_X86_ASM
|
||||||
|
// ordered per speed fasterst first
|
||||||
|
if(gCpuCaps.hasMMX2)
|
||||||
|
yvu9toyv12_MMX2(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
|
||||||
|
else if(gCpuCaps.has3DNow)
|
||||||
|
yvu9toyv12_3DNow(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
|
||||||
|
else if(gCpuCaps.hasMMX)
|
||||||
|
yvu9toyv12_MMX(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
|
||||||
|
else
|
||||||
|
yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
|
||||||
|
#else
|
||||||
|
yvu9toyv12_C(ysrc, usrc, vsrc, ydst, udst, vdst, width, height, lumStride, chromStride);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* height should be a multiple of 2 and width should be a multiple of 2 (if this is a
|
* height should be a multiple of 2 and width should be a multiple of 2 (if this is a
|
||||||
|
|
|
@ -244,6 +244,17 @@ static inline void RENAME(rgb15to16)(const uint8_t *src,uint8_t *dst,unsigned sr
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void RENAME(bgr24torgb24)(const uint8_t *src, uint8_t *dst, unsigned src_size)
|
||||||
|
{
|
||||||
|
unsigned j,i,num_pixels=src_size/3;
|
||||||
|
for(i=0,j=0; j<num_pixels; i+=3,j+=3)
|
||||||
|
{
|
||||||
|
dst[j+0] = src[i+2];
|
||||||
|
dst[j+1] = src[i+1];
|
||||||
|
dst[j+2] = src[i+0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, unsigned src_size)
|
static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, unsigned src_size)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MMX
|
#ifdef HAVE_MMX
|
||||||
|
@ -853,6 +864,16 @@ asm volatile( EMMS" \n\t"
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc,
|
||||||
|
uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
|
||||||
|
unsigned int width, unsigned int height, unsigned int lumStride, unsigned int chromStride)
|
||||||
|
{
|
||||||
|
/* Y Plane */
|
||||||
|
memcpy(ydst, ysrc, width*height);
|
||||||
|
|
||||||
|
/* XXX: implement upscaling for U,V */
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* height should be a multiple of 2 and width should be a multiple of 16 (if this is a
|
* height should be a multiple of 2 and width should be a multiple of 16 (if this is a
|
||||||
|
|
Loading…
Reference in New Issue