From 07a2e66440b57a0d7edd71ed82afce9b2f68f5fe Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Wed, 1 May 2002 20:38:19 +0000 Subject: planar yv12 logo format CVS patchset: 1825 CVS date: 2002/05/01 20:38:19 --- misc/Makefile.am | 4 +-- misc/xine-logoconv.c | 78 ++++++++++++++++++++++++++++++++++++++++++++----- misc/xine_logo.yv12.gz | Bin 0 -> 29869 bytes misc/xine_logo.zyuy2 | Bin 39431 -> 0 bytes 4 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 misc/xine_logo.yv12.gz delete mode 100644 misc/xine_logo.zyuy2 (limited to 'misc') diff --git a/misc/Makefile.am b/misc/Makefile.am index 73dfd9844..b8712a15d 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -2,10 +2,10 @@ SUBDIRS = fonts EXTRA_DIST = autogen.sh upload.pl SlackBuild.in SlackBuild build_rpms.sh \ xine-lib.spec.in xine-lib.spec \ - xine_logo.png xine_logo.zyuy2 xine-fontconv.c + xine_logo.png xine_logo.yv12.gz xine-fontconv.c datadir = $(XINE_SKINDIR) -data_DATA = xine_logo.png xine_logo.zyuy2 +data_DATA = xine_logo.png xine_logo.yv12.gz bin_SCRIPTS = xine-config diff --git a/misc/xine-logoconv.c b/misc/xine-logoconv.c index 8f0d31e88..9965f7b5f 100644 --- a/misc/xine-logoconv.c +++ b/misc/xine-logoconv.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2002 the xine project * - * This file is part of xine, a unix video player. + * This file is part of xine, a free video player. * * xine is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,7 +75,7 @@ static void save_image (char *oldname, ImlibImage *img) { if (extension) *extension = 0; - snprintf (filename, 1023, "%s.zyuy2", oldname); + snprintf (filename, 1023, "%s.yv12.gz", oldname); if (!(fp = gzopen (filename ,"w"))) { printf ("failed to create file '%s'\n", filename); @@ -89,7 +89,7 @@ static void save_image (char *oldname, ImlibImage *img) { wr16 (fp, h); /* - * convert yuv to yuy2 + * convert yuv to yv12 */ for (py=0; pyrgb_data[(px+py*w)*3]; + g = img->rgb_data[(px+py*w)*3+1]; + b = img->rgb_data[(px+py*w)*3+2]; +#else + r = img->rgb_data[(px+py*w)*3+2]; + g = img->rgb_data[(px+py*w)*3+1]; + b = img->rgb_data[(px+py*w)*3]; +#endif + + y = (LUMARED*r) + (LUMAGREEN*g) + (LUMABLUE*b); + // u = (b-y) / (2 - 2*LUMABLUE); + // v = (r-y) / (2 - 2*LUMABLUE); + u = (b-y) / (2 - 2*LUMABLUE); + v = (r-y) / (2 - 2*LUMABLUE); + + cy = y; + cu = u + 128.0; + cv = v + 128.0; + + gzwrite (fp, &cu, 1); /* printf ("%f %f %f => %f %f %f\n",r,g,b,y,u,v); @@ -133,6 +161,42 @@ static void save_image (char *oldname, ImlibImage *img) { } } + for (py=0; pyrgb_data[(px+py*w)*3]; + g = img->rgb_data[(px+py*w)*3+1]; + b = img->rgb_data[(px+py*w)*3+2]; +#else + r = img->rgb_data[(px+py*w)*3+2]; + g = img->rgb_data[(px+py*w)*3+1]; + b = img->rgb_data[(px+py*w)*3]; +#endif + + y = (LUMARED*r) + (LUMAGREEN*g) + (LUMABLUE*b); + // u = (b-y) / (2 - 2*LUMABLUE); + // v = (r-y) / (2 - 2*LUMABLUE); + u = (b-y) / (2 - 2*LUMABLUE); + v = (r-y) / (2 - 2*LUMABLUE); + + cy = y; + cu = u + 128.0; + cv = v + 128.0; + + gzwrite (fp, &cv, 1); + + /* + printf ("%f %f %f => %f %f %f\n",r,g,b,y,u,v); + */ + + } + } printf ("\ndone.\n"); gzclose(fp); } diff --git a/misc/xine_logo.yv12.gz b/misc/xine_logo.yv12.gz new file mode 100644 index 000000000..a5a56cf61 Binary files /dev/null and b/misc/xine_logo.yv12.gz differ diff --git a/misc/xine_logo.zyuy2 b/misc/xine_logo.zyuy2 deleted file mode 100644 index 90e052d72..000000000 Binary files a/misc/xine_logo.zyuy2 and /dev/null differ -- cgit v1.2.3