Magic Lantern Cinema Camera - Dual ISO without aliasing & without quality loss!

Started by theBilalFakhouri, September 18, 2018, 10:00:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Thanks for info. Initially I used these numbers(check numbers below) in adtg_gui and it will look nice without stripes
Adding the very same numbers in crop_rec.c will give a distorted image with heavy lines:
Here is what comes out with only one set of registers(distortion):

Both sets of registers as shown below through adtg_gui
MLV file here(proof of concept, still an amplified line in the middle):
Lower white level in post to around 3500 and image comes back.

8882   0x45
8884   0x48
8886   0x49
8888   0x48

8882   0x47
8884   0x45
8886   0x45
8888   0x48

Not having my camera with me but will try to add the missing register 21 in there later and see if it behaves the same as when doing changes in adtg_gui. The issue here is that if I only change the adtg2 registers it looks only half done so keeping lowering adtg4 will end up with reduced bitrate behaving the same as you suggest on your 6D. Will try your suggestion of course later Levas.


Wow! Absolutely working now:
1920x2400 23.976fps.
Effectively 1920x799(might have to skip top 60 as before, noticed black bar at the top image)

Test files:
Import them to Mlv App and set white level to 3000 both the dualiso and non dualiso file. Really great looking footage.

adtg_new[13] = (struct adtg_new) {6, 0x8882, 45};
                adtg_new[14] = (struct adtg_new) {6, 0x8884, 48};
                adtg_new[15] = (struct adtg_new) {6, 0x8886, 49};
                adtg_new[16] = (struct adtg_new) {6, 0x8888, 48};

adtg_new[17] = (struct adtg_new) {6, 0x8882, 47};
                adtg_new[18] = (struct adtg_new) {6, 0x8884, 45};
                adtg_new[19] = (struct adtg_new) {6, 0x8886, 45};
                adtg_new[20] = (struct adtg_new) {6, 0x8888, 48};

and this:
    /* expand this as required */
    struct adtg_new adtg_new[21] = {{0}};

Thanks a lot for feedback!

reduced bitrate files:

non dualiso


non dualiso



Quote from: Danne on October 17, 2018, 03:13:10 PM
Some progress:
Dualiso MLV:

1920x2368 after 0.33 set in Mlv App we got 1920x789(not bad)

This was achieved after step by step "schooling" from Bilal. Register settled like so after tested in adtg_gui:
   switch (reg)
        case 0xC0F0713c:
            return 0x97e;
        case 0xC0F06804:
            return 0x97e011b;

        case 0xC0F06008:
        case 0xC0F0600C:
            return 0x1800180;

        case 0xC0F06010:
            return 0x180;

        case 0xC0F06014:
            return 0xa27;


cmos_new[1] = 0x280;

So this will work with fps 23.976 if I remember correctly and 1920x2368. Now question is if there are more variables/registers to include to go even higher?

Impressive, nice aspect ratio already.

Is this continuous? How many MB/s?


Quote from: Danne on October 18, 2018, 11:35:08 AM
Test files:
Import them to Mlv App and set white level to 3000 both the dualiso and non dualiso file. Really great looking footage.

Thanks a lot for feedback!
Hm... loaded M18_1111.MLV and got a lot of vertical stripes. Correction makes it even worse. Your clips from yesterday were cleaner...
5D3.113 | EOSM.202


Yes, found them also. Didn't mess with with analog gain numbers yesterday. A1ex points out these registers are to be tweaked for stripes so one idea is that maybe it could be fine tuned with even more passes. Might be talking out of my famous ass here but would be worth a try if no one opposes :).

With reduced gain I could film a lot longer. Lowering vertical resolution a bit and went continuos.


Stripe free @masc!
Set them uniform as suggested by Bilal and clean now:

adtg_new[13] = (struct adtg_new) {6, 0x8882, 46};
                adtg_new[14] = (struct adtg_new) {6, 0x8884, 46};
                adtg_new[15] = (struct adtg_new) {6, 0x8886, 46};
                adtg_new[16] = (struct adtg_new) {6, 0x8888, 46};

adtg_new[17] = (struct adtg_new) {6, 0x8882, 46};
                adtg_new[18] = (struct adtg_new) {6, 0x8884, 46};
                adtg_new[19] = (struct adtg_new) {6, 0x8886, 46};
                adtg_new[20] = (struct adtg_new) {6, 0x8888, 46};


Quote from: a1ex on October 18, 2018, 09:13:30 AM if one is going to implement stripe correction directly in the camera, these are the registers that will have to be touched.

Why we want to do that if there are no vertical stripes anymore when using uniformed values  :-\ ?


Quote from: theBilalFakhouri on October 18, 2018, 01:53:02 PM
Why we want to do that if there are no vertical stripes anymore when using uniformed values  :-\ ?
Could it be that easy  :o


Here is a version to test:

Branch here:

1 - Only useful with 1x3_10bit binning mode. You select 1x3_10bit binning in Crop mode menu. Set resolution so you get 1920x2368. Canon fps menu set to 24 frames per second.
Reason. I redefined white level to 3000 in raw.c. This due to not knowing how to create a crop_rec.h header file so raw.c don´t know what´s going on in crop_rec. Can´t make exceptions here yet. The win here is that full res preview will ook ok and mlv files will have correctly white level 3000 coming out of the camera.
Recommened to import the files in Mlv app. Set Transformation Height stretch to 0.33 if not already when imported.

2 - Liveview will look a little distorted. Strange colors and a little stripy but MLV will look beautiful hopefully.
Reason. I compensate darkened liveview with digital gain trick. A1ex idea of course. Bilal handed me the register:
/* correct liveview brightness */
case 0xC0F42744: return 0x4040404;

Happy testing. Please report bugs and good stuff too. sound should work too but as this is bleeding edge a lot of stuff could happen. Use and play with this at own free will.
Thanks again to A1ex, Bilal, Levas, Mlv App gang and others for great energy and open sourcery...

Oh yea, very special thanks to Bilal. Without his patience nothing.

Decided to run these analog gain numbers:
                adtg_new[14] = (struct adtg_new) {6, 0x8884, 40};
                adtg_new[15] = (struct adtg_new) {6, 0x8886, 40};
                adtg_new[16] = (struct adtg_new) {6, 0x8888, 40};

adtg_new[17] = (struct adtg_new) {6, 0x8882, 40};
                adtg_new[18] = (struct adtg_new) {6, 0x8884, 40};
                adtg_new[19] = (struct adtg_new) {6, 0x8886, 40};
                adtg_new[20] = (struct adtg_new) {6, 0x8888, 40};


Noticing one tiny thing:

You're doing this for clean for dynamic range...
In order to get good recording times, your lowering analog gain registers to mimic 10 bit output.

Do you get the contradiction, dual-iso and 10 bit  ;D

But 10 bit dual-iso is probably still better then normal 14 bit I guess  8)


Doing it for continuous action and dualiso. Nothing more depressing than early stops ;)
But hey. Maybe nothing or very little gained here. Wouldn't be the first time that happens  :P


I don't think it's so much difference, the data that you will loss in 10-bit at 100 iso, it can be restored when using 100/800 Dual ISO .. depending on my real world tests also :D

Updated first to post to try 1x3 Binning in 700D, 6D and 5D3 .


Quote from: Danne on October 18, 2018, 04:42:42 PM
Doing it for continuous action and dualiso. Nothing more depressing than early stops ;)
But hey. Maybe nothing or very little gained here. Wouldn't be the first time that happens  :P


I disagree. Can't you go even further with vertical resolution at 1x3, to say 1920x3240, so that the final result is Full HD (1920x1080)?  Don't worry about early stops.  These can be eliminated with somewhat lower fps for now and possibly card spanning in the near future.  Why am I asking?  The idea here is to use almost the full sensor area for a crop factor of 1,0 at 16:9 aspect ratio and get the advantage of 14-stops dynamic range (Dual ISO) in aliasing free RAW video.  This will blow the 5D3 out of the water and turn it into one of the best 35mm FHD cameras ever made.  To say nothing of the full-frame vision!  Do you think this might be possible?

I wish, we had this miracle on the 100D at 1736x976 resolution ...



5D3 can already do 3072x1920 in 1x1 @24 FPS so it can do also 1920x3072 in 1x3 resized to 1920x1024 (I have tested it in 700D I can do 2306x1736 in 1x1 and also 1736x2306 in 1x3 so same thing here). Write speed will be very high 1920x3072 @24 10-bit lossless about ~120MB/s in 5D3


In that case, we are very close, Bilal.  With card spanning, the 5D3 should be able to provide continuous recording at 120 MB/s.  I remember A1ex saying that card spanning can be implemented with crop recording on the 5D3.


I have just checked the test footage that you linked above.  Gorgeous quality!  Congratulations!  And also MLVApp does a hell of a job with such footage.  The processing latitude is amazing.  I pushed the Exposure slider to the right by 4 stops and did not notice any quality degradation.


The other way to get the data rate down is to shoot 1280x2368 with 1.5x anamorphics. Preferably 14 bit lossless 1280x2412 for 2.39:1 output.

Lars Steenhoff



Check out SLRmagic for new anamorphic lenses. An Isco Star + a front focus element is a good option. Iscorama 36 is the bomb, costs a bomb too.

I've been doing some tests on the build you posted. Nothing conclusive yet. Definitely less noise than 3x3 but there's some vertical fixed pattern noise. Getting pink frames at the end of every recording and had one in the middle of a 100/800 dual ISO recording.


Thanks for tip.
Yes, noticed stripes on the right hand of the image. Not sure why, maybe a1ex knows.
I could upload a build with a little less height to see if that makes it less prone to random pink frames etc. Noticed this too when including audio.
Will post a little later.


Updated to a new version. Seems corruption free but needs testing. New resolution is 1920x2352

Oh, and canon menu set to 24fps or it will not work I suppose.
Please report any findings.


Can you upload one with a little less width and 14bit lossless? 1320x2412 would do nicely. I'm trying to figure out whether there's any increase in dynamic range. So far 10bit 1x3 dual ISO looks about the same DR as 3x3 14bit lossless (no dual ISO).

The vertical stripes are hidden in the shadows up to 1600 ISO, beyond that it's visible on the graded shots.


You can lower width in Resolution tab. Something like 1312x2352 will work.
Well, more height right now will mean lower fps or corruption. Feel free to play with code and see if you can get more out of this. I am unfortunately out of time atm but will test more when I get the opportunity.

Will upload a 14bit version. Wait a minute...

14bit version. Not tested so needs verifying: