Commit c4148af9 authored by arpi's avatar arpi

uyvy->uv12 added


git-svn-id: file:///var/local/repositories/mplayer/trunk/postproc@2802 b3059339-0415-0410-9bf9-f77b7e298cf2
parent fa55808e
......@@ -813,3 +813,41 @@ asm( EMMS" \n\t"
:::"memory");
#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)
*/
void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
{
int y;
const int chromWidth= width>>1;
for(y=0; y<height; y+=2)
{
int i;
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];
}
ydst += lumStride;
src += srcStride;
for(i=0; i<chromWidth; i++)
{
ydst[2*i+0] = src[4*i+1];
ydst[2*i+1] = src[4*i+3];
}
udst += chromStride;
vdst += chromStride;
ydst += lumStride;
src += srcStride;
}
}
......@@ -813,3 +813,41 @@ asm( EMMS" \n\t"
:::"memory");
#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)
*/
void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int srcStride)
{
int y;
const int chromWidth= width>>1;
for(y=0; y<height; y+=2)
{
int i;
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];
}
ydst += lumStride;
src += srcStride;
for(i=0; i<chromWidth; i++)
{
ydst[2*i+0] = src[4*i+1];
ydst[2*i+1] = src[4*i+3];
}
udst += chromStride;
vdst += chromStride;
ydst += lumStride;
src += srcStride;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment