Tackling the Giant Impressive work by zapped!
forumer.com/viewtopic.php?p=44061#44061" target="_blank">http://camerahacks.10.forumer.com/viewtopic.php?p=44061#44061
I would really like to play with 12 bit images. Perhaps sailpix (having demonstrated the grea-*test*-('") understanding of raw format) can verify whether a simple register value will actually create an expanded 12 bit raw image. I suspect that more firmware coding will be needed to take advantage of an additional 4 bits and doubt that any of the current raw to jpg routines has 12 bit intelligence.
zapped- 06-09-2007
I've still got more digging in the firmware, but I believe that I'll need to rewrite the part of firmware that saves/processes the data so it deals with it properly. In other words, it probably takes the data from two 12-bit pixels and assumes it is the data for three 8-bit pixels. I'd like to be proven wrong, but we'll see.
sailpix- 06-09-2007
Interesting... I'm glad your digging has found a few nuggets zapped!
There is no "bit depth" field in the RAW file header... So, they could be assuming 8-bits per sample - or maybe the decoder needs to do some calculations between image dimensions and the raw output size to compute the sample bit depth.
My recollection is that the compression scheme assumes 8 bit samples. But it has now been a couple years since I had my head inside that code...
It would be interesting to simply "turn on" 12-bit mode and then look at the resulting RAW file. The Decomp_Test.EXE app in my released code (SourceForge) will dump header values. Or, I'll be glad to dig into any files that you come up with.
Also, the RAW file header structure may be helpful. From diagnostic information in the Foxy2 TWAIN driver I was able to associate a name with most fields in this structure. But, the meaning of the field values was still mostly cryptic. The RAW header is in camera memory I believe (and recall from a brief excursion into 6410 firmware). Having this partially documented structure at hand (i.e. from my compression source code) could be helpful as you claw your way through the firmware! For example, I never knew what the GAIN field in the header meant - you may be able to tie it directly to the gain value set for the imager.
I don't expect that any of the SMaL-based camera driver code is expecting 12-bit Bayer samples. If there's a std. RAW format for it then maybe... but I wouldn't bet on that offhand. The first step would be to get 12-bit data from the imager and compress it into a RAW file. Then we could decompress this data on the PC and write it to an Adobe DNG file. From there you could use industry viewers and/or apps (PhotoShop) to process the 12-bit per sample RAW data. I think that Canon EOS Digital SLR cameras write out 12-bit samples in their RAW data.
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.