yuv422p -> yuy2 (untested)

Originally committed as revision 5589 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
pull/126/head
Michael Niedermayer 23 years ago
parent 74d3583521
commit b1ec5875a6
  1. 23
      postproc/rgb2rgb.c
  2. 3
      postproc/rgb2rgb.h
  3. 35
      postproc/rgb2rgb_template.c

@ -360,6 +360,29 @@ void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, u
#endif #endif
} }
/**
*
* width should be a multiple of 16
*/
void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
{
#ifdef CAN_COMPILE_X86_ASM
// ordered per speed fasterst first
if(gCpuCaps.hasMMX2)
yuv422ptoyuy2_MMX2(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
else if(gCpuCaps.has3DNow)
yuv422ptoyuy2_3DNow(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
else if(gCpuCaps.hasMMX)
yuv422ptoyuy2_MMX(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
else
yuv422ptoyuy2_C(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
#else
yuv422ptoyuy2_C(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride);
#endif
}
/** /**
* *
* 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

@ -28,6 +28,9 @@ extern void palette8torgb24(const uint8_t *src, uint8_t *dst, unsigned num_pixel
extern void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, extern void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height, unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int dstStride); unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
extern void yuv422ptoyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int dstStride);
extern void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, extern void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
unsigned int width, unsigned int height, unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int srcStride); unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);

@ -638,14 +638,9 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, unsign
} }
} }
/** static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
*
* 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 ill fix it)
*/
static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height, unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int dstStride) unsigned int lumStride, unsigned int chromStride, unsigned int dstStride, int vertLumPerChroma)
{ {
int y; int y;
const int chromWidth= width>>1; const int chromWidth= width>>1;
@ -696,7 +691,7 @@ static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc,
dst[4*i+3] = vsrc[i]; dst[4*i+3] = vsrc[i];
} }
#endif #endif
if(y&1) if((y&(vertLumPerChroma-1))==(vertLumPerChroma-1) )
{ {
usrc += chromStride; usrc += chromStride;
vsrc += chromStride; vsrc += chromStride;
@ -711,6 +706,30 @@ asm( EMMS" \n\t"
#endif #endif
} }
/**
*
* 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 ill fix it)
*/
static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
{
//FIXME interpolate chroma
RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2);
}
/**
*
* width should be a multiple of 16
*/
static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int dstStride)
{
RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1);
}
/** /**
* *
* 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…
Cancel
Save