aboutsummaryrefslogtreecommitdiffstats
path: root/postproc/rgb2rgb_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2001-11-05 00:45:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2001-11-05 00:45:55 +0000
commitd9d58d172eaa22c85864efd97fdce980616fe6b5 (patch)
tree33091000634cd8b1a73f0561934d5ce9f01837c1 /postproc/rgb2rgb_template.c
parent9b2c28e6edbb43e00e0b2d99b95567189cd46e91 (diff)
downloadffmpeg-d9d58d172eaa22c85864efd97fdce980616fe6b5.tar.gz
yv12 <-> yuy2 in C
Originally committed as revision 2702 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc/rgb2rgb_template.c')
-rw-r--r--postproc/rgb2rgb_template.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c
index 7e978fd54f..9c5c688b78 100644
--- a/postproc/rgb2rgb_template.c
+++ b/postproc/rgb2rgb_template.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