diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-05 00:45:55 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-05 00:45:55 +0000 |
commit | b9606b37f4fdfea92752f0f04734927ddfaf8508 (patch) | |
tree | c78ee988181cd43f74b5c815accd75d3817d9844 /postproc/rgb2rgb.c | |
parent | b65bc437aff92464e7958e387b7d3f674e8ff398 (diff) | |
download | mpv-b9606b37f4fdfea92752f0f04734927ddfaf8508.tar.bz2 mpv-b9606b37f4fdfea92752f0f04734927ddfaf8508.tar.xz |
yv12 <-> yuy2 in C
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2702 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc/rgb2rgb.c')
-rw-r--r-- | postproc/rgb2rgb.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c index 7e978fd54f..9c5c688b78 100644 --- a/postproc/rgb2rgb.c +++ b/postproc/rgb2rgb.c @@ -259,3 +259,30 @@ void palette8torgb15(uint8_t *src, uint8_t *dst, int src_size, uint8_t *palette) for(i=0; i<src_size; i++) ((uint16_t *)dst)[i] = ((uint16_t *)palette)[ src[i] ]; } + +void yv12toyuy2(uint8_t *ysrc, uint8_t *usrc, uint8_t *vsrc, uint8_t *dst, int src_size) +{ + int i; + src_size>>=1; + for(i=0; i<src_size; i++) + { + dst[4*i+0] = ysrc[2*i+0]; + dst[4*i+1] = usrc[i]; + dst[4*i+2] = ysrc[2*i+1]; + dst[4*i+3] = vsrc[i]; + } + +} + +void yuy2toyv12(uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int src_size) +{ + int i; + src_size>>=1; + for(i=0; i<src_size; 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]; + } +}
\ No newline at end of file |