Then we have to stick to the original int thing
But the color level is still 2^14 >> 2^12 or >> 2^10, right? Mighty developers
But the color level is still 2^14 >> 2^12 or >> 2^10, right? Mighty developers
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: KMikhail on May 25, 2013, 12:08:01 PM
int x; // 14 bit number, in a 16/32 bit format
x = (x +2) / 4; // rounding closer to normal rounding, not CPU binary world.
// x is 12 bits now
2 => 1; 3 => 1; 4 => 1; 5 => 1; 6 => 2; 7 => 2; 8 => 2;
Double is 64 bit, and by now is totally fine on modern CPU. But for raw handling in our Canons we need more integer performance for packing all this raw data into something more space efficient. Floats, though, are nice to have at times too.
Quote from: KMikhail on May 25, 2013, 11:18:34 AM
Why don't you just divide by 4? Which would be similar to bit shift by 2 bits >>
Bit shift was handy since the 80286 era, when x*320 was = x << 8 + x << 6. But since then mul and div became very cheap.
Granted, if your integer isn't right alinged (least mening bits) you have to bit shift more to the right, and then back to the left. Masking would do the job too, but would require either a register or mem op.
BTW, according to spec ARM9 has 16 32bit MAD units, should be more than capable of basic integer math, no?
EDIT:
I see, you probably are trying to get a better rounding. For that purpose you can ADD/SUB something, prior to dividing. But dividing and then multiplying a double number won't give you the result, it is caled a floating number, for a reason. There is a set of specialty rounding operations for doubles. However, I doubt double operations are fast on such hardware.
Quote from: Mayo on May 24, 2013, 05:32:16 PM
It's just the compression ratio, it's the same for width and the whole image buffer. (to tell fwrite how much to write).
@mucher: not sure if you're serious, but all your assumptions are wrong...
Quote from: mucher on May 24, 2013, 10:58:34 AM
buffer_size_compressed = (buffer_size_used * 12) / 14;
I don't know what is this, but if it changes to:
buffer_size_compressed = buffer_size_used / 14;
buffer_size_compressed = buffer_size_compressed * 12;
It might have higher accuracy, I heard that some CPU cannot multiply too many times, or very soon it will have accuracy problem.
HA, I have been messing around. I quit.
Quote from: noisyboy on May 05, 2013, 05:34:02 AM
Surely if the Blackmagic Pocket Camera is going to be writing 1080p Cinema DNG to an SD card then the write and read speeds of cards we have already shouldn't be a problem?
Quote from: g3gg0 on April 26, 2013, 10:56:53 PM
i am still working on YUV422 videos (continuous 12.5 fps works already).
i think it is able to record in RAW also, but first i want to get YUV422 working flawless.
will test it on 7D as soon it works on 5D3
Page created in 0.088 seconds with 13 queries.