attached is a simple program that extracts the image, but does not properly do the colorspace conversion. i tried the algo that you found, and another that i found, but they both seem to take the blue data out of the 0-255 range, so i guess you have to clamp the values. also, this code uses the same Cr and Cb for all 4 pixels, it should probably be interpolated with the next Cr and Cb values.
allan On Sat, Aug 30, 2008 at 8:52 PM, m. allan noah <kitno455 at gmail.com> wrote: > thanks daniel- now this begins to make sense: > > http://wiki.multimedia.cx/index.php?title=YCbCr_4:2:0 says: > > "Since 6 bytes, or 48 bits represent 4 pixels, an average of 12 bits > are required to represent a single pixel in this scheme." > > so the 48 bit depth in the set window command is for each 2x2 block. > > i guess they dont put all 4 Y samples together cause they are on > different scanlines. > > if you look at the slope on the edge of the taillight you can see that > each pair Y samples are switched, as you have stated. > > allan > > On Sat, Aug 30, 2008 at 5:54 PM, Daniel Gl?ckner <daniel-gl at gmx.net> wrote: >> The picture is in YCbCr 4:2:0 format. >> >> 0. byte: Y(1,0) >> 1. byte: Y(0,0) >> 2. byte: Cr(0.5,0.5) >> 3. byte: Cb(0.5,0.5) >> >> 4. byte: Y(3,0) >> 5. byte: Y(2,0) >> 6. byte: Cr(2.5,0.5) >> 7. byte: Cb(2.5,0.5) >> : >> : >> 4796. byte: Y(2399,0) >> 4797. byte: Y(2398,0) >> 4798. byte: Cr(2398.5,0.5) >> 4799. byte: Cb(2398.5,0.5) >> >> 4800. byte: Y(1,1) >> 4801. byte: Y(0,1) >> >> 4802. byte: Y(3,1) >> 4803. byte: Y(2,1) >> : >> : >> 7198. byte: Y(2399,1) >> 7199. byte: Y(2398,1) >> >> repeat for the following 7200 byte blocks >> >> The chroma offset is guessed. >> It would need some sharp colorful edges to verify that. >> >> Daniel >> >> -- >> sane-devel mailing list: sane-devel at lists.alioth.debian.org >> http://lists.alioth.debian.org/mailman/listinfo/sane-devel >> Unsubscribe: Send mail with subject "unsubscribe your_password" >> to sane-devel-request at lists.alioth.debian.org >> > > > > -- > "The truth is an offense, but not a sin" > -- "The truth is an offense, but not a sin" -------------- next part -------------- A non-text attachment was scrubbed... Name: i260.c Type: text/x-csrc Size: 1652 bytes Desc: not available Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20080830/bd28e8f0/attachment-0001.c