One thing is for sure: Canon's CR2 are compressed... so it's out there.
Etiquette, expectations, entitlement...
@autoexec_bin | #magiclantern | Discord | Reddit | Server issues
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: 1% on May 24, 2013, 05:30:13 PM
But for 14 bit we don't do this?
Quote from: 1% on May 24, 2013, 05:15:44 PM
sized_used isn't static so I can try that... the frames come out smaller when I open them so 12 bit should be helping.buffer_size_compressed = (size_used * raw_bitdepth) / 14;
This doesn't make sense to me actually... why are we multiplying this out? The *12/14 calculation is to find width normally.
Quote from: 1% on May 24, 2013, 05:21:12 PM
It does work... when its 13 I get normal 14 bit I believe. You just have it set to if bit depth = 12 do this otherwise do that.
{
.name = "Bit Depth",
.priv = &raw_bitdepth,
.min = 12,
.max = 13,
.choices = CHOICES("12 Bit", "14 Bit", ),
.help2 = "Bit Depth",
},
if (r != buffer_size_compressed) goto abort;
Quote from: trsaunders on May 23, 2013, 11:59:58 PM
I'm wondering: how is the RAW data (on the camera, before it is copied) aligned? is it 14bits with two zeros packed in 16 bits, or is each pixel packed tightly together?
/**
* 14-bit encoding:
hi lo
aaaaaaaaaaaaaabb
bbbbbbbbbbbbcccc
ccccccccccdddddd
ddddddddeeeeeeee
eeeeeeffffffffff
ffffgggggggggggg
gghhhhhhhhhhhhhh
*/
Quote from: scrax on May 23, 2013, 10:25:37 PM
I think that quick way to share the code without any risk is, once installed hg, register yourself on bitbucket, go to magic lantern source and fork the repo, you will have your fork on bitbucket pubblic so any change you made will not screw anything in the ML source.
Once done the fork you have to download it on your pc (I use a GUI for managing those forks, SourceTree), make your changes and with "hg pull" update it on bitbucket.
When you are done with all your work you can submit from the fork page on bitbucket a pull request to the ML source, that way it will be reviewed before merging it.
Quote from: jordancolburn on May 23, 2013, 09:57:26 PM
Here's a really good Mercurial tutorial http://hginit.com/
I think most of the devs use it and I use it at work and for my own projects like my resume in LaTex and others. Merging is a little strange at first, but it will make your life SO much easier in the long run.
Quote from: scrax on May 23, 2013, 09:15:51 PM
why don't you open a fork on bitbucket instead of google drive? It will be easier to follow (and learn from) your changes
static int raw_bitdepth = 12;
raw_info.bits_per_pixel=12;
raw_info.white_level *= 0.25f;
raw_info.black_level *= 0.25f;
static void FAST reverse_bytes_order(char* buf, int count)
{
long* buf32 = (long*) buf;
int i;
for (i = 0; i < count/4; i++)
{
long x = buf32[i];
buf[4*i+3] = x;
buf[4*i+2] = x >> 8;
buf[4*i+1] = x >> 16;
buf[4*i] = x >>24;
}
/*
short* buf16 = (short*) buf;
int i;
for (i = 0; i < count/2; i++)
{
short x = buf16[i];
buf[2*i+1] = x;
buf[2*i] = x >> 8;
}
*/
}
Quote from: chmee on May 23, 2013, 07:36:30 PM
Open the DNG-File in a Hex-Editor (recommending HxD).
Search for the BitsPerSample-Tag 0102 - think it will be on Position ~1BC
(there will be two entries, because the thumbnail needs this tag as well)0201 0300 0100 0000 0E00 0000
0102 (or in little-endian 0201) and later on there is 000E (14Bit) -> 0E00. change that.
You find the Whitelevel and blacklevel with the tag-id's C61A and C61D, some bytes after the BitPerSampleTag. Example:
1AC6 0400 0100 0000 F807 0000 <-->07F8 = 2040
1DC6 0400 0100 0000 2E2D 0000 <--> 2D2E = 11566
Lower both. For Example Blacklevel to 1000 and Whitelevel to 4000.
mfg chmee
Quote from: 1% on May 23, 2013, 06:52:57 PM
I think DNG supports all bit depths but the DNG meta data will say it X bit.
Quote from: RenatoPhoto on May 23, 2013, 02:13:14 PM
Are you compiling in windows cygwin?
* - enable modules in Makefile.user (CONFIG_MODULES = y, CONFIG_TCC = y, CONFIG_PICOC = n, CONFIG_CONSOLE = y)
[ CC ] raw_rec.o
raw_rec.c:20:20: fatal error: module.h: No such file or directory
compilation terminated.
make: *** [raw_rec.o] Error 1
Quote from: 1% on May 23, 2013, 02:59:37 AM
Nope.. feel free to try, I'm not the best coder... guy should have really provided source... may 14th is hella old and slow.
struct raw12_pixblock
{
unsigned int c_hi: 8;
unsigned int b: 12;
unsigned int a: 12;
unsigned int f_hi: 4;
unsigned int e: 12;
unsigned int d: 12;
unsigned int c_lo: 4;
unsigned int h: 12;
unsigned int g: 12;
unsigned int f_lo: 8;
} __attribute__((packed));
int raw_get_pixel(int x, int y) {
struct raw12_pixblock * p = (void*)raw_info.buffer + y * raw_info.pitch + (x/8)*12;
switch (x%8) {
case 0: return p->a;
case 1: return p->b;
case 2: return p->c_lo | (p->c_hi << 8);
case 3: return p->d;
case 4: return p->e;
case 5: return p->f_lo | (p->f_hi << 8);
case 6: return p->g;
case 7: return p->h;
}
return p->a;
}
Page created in 0.147 seconds with 13 queries.