<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: GL860 driver code</title>
	<atom:link href="http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/</link>
	<description>they got a skin and they put me in</description>
	<pubDate>Thu, 20 Nov 2008 11:41:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: O Lorin</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16798</link>
		<dc:creator>O Lorin</dc:creator>
		<pubDate>Tue, 08 Apr 2008 18:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16798</guid>
		<description>My last info on the  0503:F191,

with the log I did and Daniel's log/source, I succeeded in having a 640x480 color image. It is also Bayer. 
Quite amazingly, the first image produced by the cam is a 640x480 view of what is the bottom left quarter of the normal image, sometimes the next image is normal apart to be vertically flipped and the next ones are normal.

@dsd : I made a C program to map the USBsnif log to a shorter log and a C code with some anotation. It can help to understand a log. I'll send you the source code and  a "copy_to_files" version for my webcam model. Today I 
tried to understand the syntek driver to integrate my work in however it seems to me quite difficult and the USB is differently managed...
USBsniff and USBsnoop seems to be the same program, they're was just on link to donwload it. 
Affichageb.exe comes from this link : http://www.cppfrance.com/codes/EXPLOITER-WEBCAM_24541.aspx .
I forced the application to quit after it has connected the webcam.</description>
		<content:encoded><![CDATA[<p>My last info on the  0503:F191,</p>
<p>with the log I did and Daniel&#8217;s log/source, I succeeded in having a 640&#215;480 color image. It is also Bayer.<br />
Quite amazingly, the first image produced by the cam is a 640&#215;480 view of what is the bottom left quarter of the normal image, sometimes the next image is normal apart to be vertically flipped and the next ones are normal.</p>
<p>@dsd : I made a C program to map the USBsnif log to a shorter log and a C code with some anotation. It can help to understand a log. I&#8217;ll send you the source code and  a &#8220;copy_to_files&#8221; version for my webcam model. Today I<br />
tried to understand the syntek driver to integrate my work in however it seems to me quite difficult and the USB is differently managed&#8230;<br />
USBsniff and USBsnoop seems to be the same program, they&#8217;re was just on link to donwload it.<br />
Affichageb.exe comes from this link : <a href="http://www.cppfrance.com/codes/EXPLOITER-WEBCAM_24541.aspx" rel="nofollow">http://www.cppfrance.com/codes/EXPLOITER-WEBCAM_24541.aspx</a> .<br />
I forced the application to quit after it has connected the webcam.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dsd&#8217;s weblog &#187; Blog Archive &#187; GL860: more devices, colour images</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16797</link>
		<dc:creator>dsd&#8217;s weblog &#187; Blog Archive &#187; GL860: more devices, colour images</dc:creator>
		<pubDate>Tue, 08 Apr 2008 16:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16797</guid>
		<description>[...] got a seemingly different image format as well. He also took an image that came back from mine and decoded the Bayer colour space, so I can now get images back in [...]</description>
		<content:encoded><![CDATA[<p>[...] got a seemingly different image format as well. He also took an image that came back from mine and decoded the Bayer colour space, so I can now get images back in [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sur3</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16764</link>
		<dc:creator>Sur3</dc:creator>
		<pubDate>Tue, 08 Apr 2008 10:13:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16764</guid>
		<description>ok, improved interpolation-loops, image has size height-1 and width-1 now, and some ugly variable errors corrected, i hope its correect now ;-) :
http://homepages.uni-paderborn.de/neuron/gentoo/gl860/improvedunbayer.c

greets
simon</description>
		<content:encoded><![CDATA[<p>ok, improved interpolation-loops, image has size height-1 and width-1 now, and some ugly variable errors corrected, i hope its correect now ;-) :<br />
<a href="http://homepages.uni-paderborn.de/neuron/gentoo/gl860/improvedunbayer.c" rel="nofollow">http://homepages.uni-paderborn.de/neuron/gentoo/gl860/improvedunbayer.c</a></p>
<p>greets<br />
simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sur3</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16763</link>
		<dc:creator>Sur3</dc:creator>
		<pubDate>Tue, 08 Apr 2008 09:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16763</guid>
		<description>oha, i see two off-by-one error in the two loops ;-)</description>
		<content:encoded><![CDATA[<p>oha, i see two off-by-one error in the two loops ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Drake</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16761</link>
		<dc:creator>Daniel Drake</dc:creator>
		<pubDate>Mon, 07 Apr 2008 23:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16761</guid>
		<description>woohoo, that looks like me!
Great work, thanks! I'll try and merge it into the code soon.
RGB is great, can write it to PPM like that, and I'll figure out how to convert it to YUY2 so that we can display it with Xlib.</description>
		<content:encoded><![CDATA[<p>woohoo, that looks like me!<br />
Great work, thanks! I&#8217;ll try and merge it into the code soon.<br />
RGB is great, can write it to PPM like that, and I&#8217;ll figure out how to convert it to YUY2 so that we can display it with Xlib.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sur3</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16759</link>
		<dc:creator>Sur3</dc:creator>
		<pubDate>Mon, 07 Apr 2008 17:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16759</guid>
		<description>ok, it is a simple bayer-pattern:
--------------------
&#124;green &#124;    red  &#124;
&#124;---------&#124;---------&#124;
&#124;blue    &#124; green&#124;
---------------------
i developed a simple assembler-algorithm to interpolate some color ( http://homepages.uni-paderborn.de/neuron/pix/0503_halved4colorinterpolation.png )
here is a transkription to C:

static void unbayer2RGB (unsigned char *bayer, unsigned char *RGB) {
	int x,y,z;

	for (z = 0,y = 0; y &#60; IMG_HEIGHT; y+=2){
	 for (x=0; x &#60; IMG_WIDTH; x+=2,z+=3){
		RGB[z] = bayer[x+1];		                                         		//Rot
		RGB[z+1] = ((bayer[x]+bayer[x+1+IMG_WIDTH])/2); 	//Grün
		RGB[z+2] = bayer[x+IMG_WIDTH];		                          	//Blau
	}}
}

but the resulting picture is only half as with and half as height that could be better with an other interpolation algorithm...
perhaps first of all you test it, i don't know if you can output RGBs, or do you need YUY2?

greets
Sur3</description>
		<content:encoded><![CDATA[<p>ok, it is a simple bayer-pattern:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
|green |    red  |<br />
|&#8212;&#8212;&#8212;|&#8212;&#8212;&#8212;|<br />
|blue    | green|<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
i developed a simple assembler-algorithm to interpolate some color ( <a href="http://homepages.uni-paderborn.de/neuron/pix/0503_halved4colorinterpolation.png" rel="nofollow">http://homepages.uni-paderborn.de/neuron/pix/0503_halved4colorinterpolation.png</a> )<br />
here is a transkription to C:</p>
<p>static void unbayer2RGB (unsigned char *bayer, unsigned char *RGB) {<br />
	int x,y,z;</p>
<p>	for (z = 0,y = 0; y &lt; IMG_HEIGHT; y+=2){<br />
	 for (x=0; x &lt; IMG_WIDTH; x+=2,z+=3){<br />
		RGB[z] = bayer[x+1];		                                         		//Rot<br />
		RGB[z+1] = ((bayer[x]+bayer[x+1+IMG_WIDTH])/2); 	//Grün<br />
		RGB[z+2] = bayer[x+IMG_WIDTH];		                          	//Blau<br />
	}}<br />
}</p>
<p>but the resulting picture is only half as with and half as height that could be better with an other interpolation algorithm&#8230;<br />
perhaps first of all you test it, i don&#8217;t know if you can output RGBs, or do you need YUY2?</p>
<p>greets<br />
Sur3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Drake</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16758</link>
		<dc:creator>Daniel Drake</dc:creator>
		<pubDate>Mon, 07 Apr 2008 11:12:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16758</guid>
		<description>The windows software I used to capture sniff logs from said it was capturing in YUY2, so that makes some sense. But the data that comes back for me is not straight YUY2, the colours are all wrong if I just render imgbuf with YUY2 space. Last time I checked I did not have green skin.

I added a sample image (rendered as greyscale) to the git repo if you want to play with the kind of data that I get...</description>
		<content:encoded><![CDATA[<p>The windows software I used to capture sniff logs from said it was capturing in YUY2, so that makes some sense. But the data that comes back for me is not straight YUY2, the colours are all wrong if I just render imgbuf with YUY2 space. Last time I checked I did not have green skin.</p>
<p>I added a sample image (rendered as greyscale) to the git repo if you want to play with the kind of data that I get&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sur3</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16756</link>
		<dc:creator>Sur3</dc:creator>
		<pubDate>Sun, 06 Apr 2008 23:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16756</guid>
		<description>lol, i'm to tired i think, cause as you see all the grey2realyuv(imgbuf, framebuffer, IMG_SIZE); does is memcpy(framebuffer, imgbuf, IMG_SIZE);
so the picture from my camera seem already to be kind of yuv :-D
sorry for the previous comment</description>
		<content:encoded><![CDATA[<p>lol, i&#8217;m to tired i think, cause as you see all the grey2realyuv(imgbuf, framebuffer, IMG_SIZE); does is memcpy(framebuffer, imgbuf, IMG_SIZE);<br />
so the picture from my camera seem already to be kind of yuv :-D<br />
sorry for the previous comment</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sur3</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16755</link>
		<dc:creator>Sur3</dc:creator>
		<pubDate>Sun, 06 Apr 2008 23:42:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16755</guid>
		<description>lol, i got some right colors very simple ( http://homepages.uni-paderborn.de/neuron/pix/farbe.png )
i just changed the display_frame() i'm sorry, i know this code is ugly and i should nopaste it, but here it is XD :

static void grey2realyuv (unsigned char *grey, unsigned char *YUV, int num) {
        int i, j;
        int y0, y1, u0, u1, v0, v1;
        int gval;

        for (i = 0, j = 0; i &#60; num; i += 1, j += 4)
        {
                //gval = grey[i];
                //GREY2YUV (gval, y0, u0 , v0);
                //gval = grey[i + 1];
                //GREY2YUV (gval, y1, u1 , v1);
                YUV[i] = grey[i];
                YUV[i + 1] = 0;
                YUV[i + 2] = 0;
                //YUV[j + 3] = (v0+v1)/2;
        }
}

static void display_frame(void)
{
        unsigned char rowbuf[IMG_WIDTH];
        int i;

        if (adaptor &#60; 0)
                return;

        for (i = 0; i &#60; IMG_HEIGHT / 2; i++) {
                int offset = i * IMG_WIDTH;
                int swap_offset = IMG_SIZE - (IMG_WIDTH * (i + 1));

                /* copy top row into buffer */
        //      memcpy(rowbuf, imgbuf + offset, IMG_WIDTH);

                /* copy lower row over upper row */
        //      memcpy(imgbuf + offset, imgbuf + swap_offset, IMG_WIDTH);

                /* copy buffer over lower row */
        //      memcpy(imgbuf + swap_offset, rowbuf, IMG_WIDTH);
        }

        //grey2yuy2(imgbuf, framebuffer, IMG_SIZE);
        grey2realyuv(imgbuf, framebuffer, IMG_SIZE);

        xv_image = XvCreateImage(display, info[adaptor].base_id, FORMAT,
                        framebuffer, IMG_WIDTH, IMG_HEIGHT);
        XvPutImage(display, info[adaptor].base_id, window, gc, xv_image,
                        0, 0, IMG_WIDTH, IMG_HEIGHT, 0, 0, IMG_WIDTH, IMG_HEIGHT);
        XFlush(display);
}</description>
		<content:encoded><![CDATA[<p>lol, i got some right colors very simple ( <a href="http://homepages.uni-paderborn.de/neuron/pix/farbe.png" rel="nofollow">http://homepages.uni-paderborn.de/neuron/pix/farbe.png</a> )<br />
i just changed the display_frame() i&#8217;m sorry, i know this code is ugly and i should nopaste it, but here it is XD :</p>
<p>static void grey2realyuv (unsigned char *grey, unsigned char *YUV, int num) {<br />
        int i, j;<br />
        int y0, y1, u0, u1, v0, v1;<br />
        int gval;</p>
<p>        for (i = 0, j = 0; i &lt; num; i += 1, j += 4)<br />
        {<br />
                //gval = grey[i];<br />
                //GREY2YUV (gval, y0, u0 , v0);<br />
                //gval = grey[i + 1];<br />
                //GREY2YUV (gval, y1, u1 , v1);<br />
                YUV[i] = grey[i];<br />
                YUV[i + 1] = 0;<br />
                YUV[i + 2] = 0;<br />
                //YUV[j + 3] = (v0+v1)/2;<br />
        }<br />
}</p>
<p>static void display_frame(void)<br />
{<br />
        unsigned char rowbuf[IMG_WIDTH];<br />
        int i;</p>
<p>        if (adaptor &lt; 0)<br />
                return;</p>
<p>        for (i = 0; i &lt; IMG_HEIGHT / 2; i++) {<br />
                int offset = i * IMG_WIDTH;<br />
                int swap_offset = IMG_SIZE - (IMG_WIDTH * (i + 1));</p>
<p>                /* copy top row into buffer */<br />
        //      memcpy(rowbuf, imgbuf + offset, IMG_WIDTH);</p>
<p>                /* copy lower row over upper row */<br />
        //      memcpy(imgbuf + offset, imgbuf + swap_offset, IMG_WIDTH);</p>
<p>                /* copy buffer over lower row */<br />
        //      memcpy(imgbuf + swap_offset, rowbuf, IMG_WIDTH);<br />
        }</p>
<p>        //grey2yuy2(imgbuf, framebuffer, IMG_SIZE);<br />
        grey2realyuv(imgbuf, framebuffer, IMG_SIZE);</p>
<p>        xv_image = XvCreateImage(display, info[adaptor].base_id, FORMAT,<br />
                        framebuffer, IMG_WIDTH, IMG_HEIGHT);<br />
        XvPutImage(display, info[adaptor].base_id, window, gc, xv_image,<br />
                        0, 0, IMG_WIDTH, IMG_HEIGHT, 0, 0, IMG_WIDTH, IMG_HEIGHT);<br />
        XFlush(display);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sur3</title>
		<link>http://www.reactivated.net/weblog/archives/2008/03/gl860-driver-code/#comment-16754</link>
		<dc:creator>Sur3</dc:creator>
		<pubDate>Sun, 06 Apr 2008 18:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.reactivated.net/weblog/?p=178#comment-16754</guid>
		<description>@Jack Malmost:
Well, I capture the pictures in usermode, that's what libusb normaly was for (an usb usermode-interface), perhaps the files have the wrong permission or you need to be in the usb group, but i think you wont get a pic in usermode either.

@dsd:
I'm right, I only see the upper left corner, and the picture is streched vertically, i think this is because of the bayer-filter, i'll try different bayer-filters-patterns the week..
...and i forgot to mention: great work!

thanks&#38;greet
Sur3</description>
		<content:encoded><![CDATA[<p>@Jack Malmost:<br />
Well, I capture the pictures in usermode, that&#8217;s what libusb normaly was for (an usb usermode-interface), perhaps the files have the wrong permission or you need to be in the usb group, but i think you wont get a pic in usermode either.</p>
<p>@dsd:<br />
I&#8217;m right, I only see the upper left corner, and the picture is streched vertically, i think this is because of the bayer-filter, i&#8217;ll try different bayer-filters-patterns the week..<br />
&#8230;and i forgot to mention: great work!</p>
<p>thanks&amp;greet<br />
Sur3</p>
]]></content:encoded>
	</item>
</channel>
</rss>
