sRaw - Feature Requests - CHDK Forum  

sRaw

  • 9 Replies
  • 4299 Views
sRaw
« on: 17 / September / 2008, 19:37:06 »
Advertisements
Is it possible to save photos in the sRaw format like the one in 1D3 and 40D? sRaw is about quarter size of Raw format, so it is possible to obtain faster continuous shooting speed.

*

Offline reyalp

  • ******
  • 12159
Re: sRaw
« Reply #1 on: 17 / September / 2008, 20:27:07 »
Currently, CHDK just saves the sensor data directly to disk. Although they are named .crw, they aren't actually in the official CRW format.

sRaw appears to just be a reduced resolution image, so you still get the dynamic range of RAW but you get less pixels. Fine if your final product is going to be web or something like that. The advantage would be less with powershots, since they only get 10bpp vs 12 or 14 for the DSLRs, but it still might be worthwhile in some situations.

It would be possible to save a subset of the raw pixels from CHDK, but the CPU and memory system is pretty slow, so proper downsampling might not be any faster than saving the whole file. Saving every Nth pixel (with some gymnastics to account for encoding) should be doable, but would further impact quality. Similarly (and probably a bit easier) you could just save a sub-image (AKA "digital zoom")

Alternately, it might be possible to hijack whatever canon uses to produce the lower resolution jpeg, if that happens before the 10bpp is converted. Where we currently get the raw, it always appears to be full res regardless of what size you selected in the canon menu (on my a540 anyway)
Don't forget what the H stands for.

*

Offline dzsemx

  • ****
  • 302
  • [SX40HS][A650][A630]
Re: sRaw
« Reply #2 on: 05 / November / 2008, 18:08:29 »
an sRAW would be really nice, but Raw data is not byte/word aligned(pretty strange) so it's hard to process it :( (see: custom curves, processing takes a lot of time)
« Last Edit: 05 / November / 2008, 18:10:44 by dzsemx »

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: sRaw
« Reply #3 on: 05 / November / 2008, 18:54:04 »
an sRAW would be really nice, but Raw data is not byte/word aligned(pretty strange)
Maybe for reducing RAW buffer size (10 bits per pixel instead of 16).
BTW, Digic uses big-endian byte order to store RAW data.

Quote
custom curves, processing takes a lot of time

If we change RAW address buffer like:

char *hook_raw_image_addr()
{
 //   return (char*)(0x10400000+0x164000+0xBF0); // old value
  return (char*)(0x400000+0x164000+0xBF0); // new value
}

, then RAW processing is two times faster (at least, on my A710 applying curve time is 4s instead of 8s).
« Last Edit: 05 / November / 2008, 19:02:30 by ewavr »


*

Offline dzsemx

  • ****
  • 302
  • [SX40HS][A650][A630]
Re: sRaw
« Reply #4 on: 06 / November / 2008, 02:58:06 »
wtf? there are two raw buffers??? or what

*

Offline fe50

  • ******
  • 3107
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: sRaw
« Reply #5 on: 06 / November / 2008, 03:25:12 »
wtf? there are two raw buffers??? or what

No, it's the same buffer, you can access it cached or uncached...

Adding support of a new camera#Memory layout
Quote
0x10000000-0x1fffffff      - same as 0x0-0x0fffffff but with no caching

See also The difference between malloc() and umalloc().

*

Offline dzsemx

  • ****
  • 302
  • [SX40HS][A650][A630]
Re: sRaw
« Reply #6 on: 06 / November / 2008, 08:34:56 »
:D sorry i didn't read these threads:D

*

Offline reyalp

  • ******
  • 12159
Re: sRaw
« Reply #7 on: 07 / November / 2008, 00:14:15 »

If we change RAW address buffer like:

char *hook_raw_image_addr()
{
 //   return (char*)(0x10400000+0x164000+0xBF0); // old value
  return (char*)(0x400000+0x164000+0xBF0); // new value
}

, then RAW processing is two times faster (at least, on my A710 applying curve time is 4s instead of 8s).
I suspect you'll want to flush the cache and write buffer before saving it, at the very least.
Don't forget what the H stands for.


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: sRaw
« Reply #8 on: 07 / November / 2008, 06:09:22 »
I suspect you'll want to flush the cache and write buffer before saving it, at the very least.

Sorry, I don't know fuction which flushes the cache.
However, I don't see artifacts on output image - maybe they are out of cropped area?

*

Offline reyalp

  • ******
  • 12159
Re: sRaw
« Reply #9 on: 07 / November / 2008, 17:43:29 »
Don't forget what the H stands for.

 

Related Topics