crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView

Started by a1ex, April 01, 2017, 11:15:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Levas

@Alex

Here is the source crop_rec.c file with 96 fps preset in it, it's the preset called HD:
https://drive.google.com/file/d/1n-hUn8Oo815K4meJhvbAXrj4Fbcft6Zy/view?usp=sharing

Here are the most important pieces of the 96fps source, I used Preset HD for 96 fps:


            case CROP_PRESET_HD:
                cmos_new[6] = 0x400;
                cmos_new[7] = 0xb + delta_head3;
                break;


    if (is_6D)
    {

        switch (crop_preset)
        {
            case CROP_PRESET_HD:
            case CROP_PRESET_2K:
            case CROP_PRESET_ULTRA_HD:
            case CROP_PRESET_4K:
            case CROP_PRESET_5K:
            case CROP_PRESET_FullRes:
            case CROP_PRESET_HD2:
            case CROP_PRESET_3x3_1X:
        /* all modes may want to override shutter speed */
        /* ADTG[0x8061]: shutter blanking for 3x3 mode  */
        /* ADTG[0x805F]: shutter blanking for zoom mode  */
            adtg_new[0] = (struct adtg_new) {6, 0x8061, shutter_blanking};
            adtg_new[1] = (struct adtg_new) {6, 0x805F, shutter_blanking};
        /* adjust vertical resolution */
        /* assuming FPS timer B was overridden before this */
                int fps_timer_b = (shamem_read(0xC0F06014) & 0xFFFF) + 1;
                int readout_end = shamem_read(0xC0F06804) >> 16;    /* fixme: D5 only */

                /* PowerSaveTiming registers */
                /* after readout is finished, we can turn off the sensor until the next frame */
                /* we could also set these to 0; it will work, but the sensor will run a bit hotter */
                /* to be tested to find out exactly how much */
                adtg_new[2]  = (struct adtg_new) {6, 0x8172, nrzi_encode(readout_end + 1) }; /* PowerSaveTiming ON (6D/700D) */
                adtg_new[3]  = (struct adtg_new) {6, 0x8178, nrzi_encode(readout_end + 1) }; /* PowerSaveTiming ON (5D3/6D/700D) */
                adtg_new[4]  = (struct adtg_new) {6, 0x8196, nrzi_encode(readout_end + 1) }; /* PowerSaveTiming ON (5D3) */

                adtg_new[5]  = (struct adtg_new) {6, 0x8173, nrzi_encode(fps_timer_b - 1) }; /* PowerSaveTiming OFF (6D/700D) */
                adtg_new[6]  = (struct adtg_new) {6, 0x8179, nrzi_encode(fps_timer_b - 1) }; /* PowerSaveTiming OFF (5D3/6D/700D) */
                adtg_new[7]  = (struct adtg_new) {6, 0x8197, nrzi_encode(fps_timer_b - 1) }; /* PowerSaveTiming OFF (5D3) */

                adtg_new[8] = (struct adtg_new) {6, 0x82B6, nrzi_encode(readout_end - 1) }; /* PowerSaveTiming ON? (700D); 2 units below the "ON" timing from above */

                /* ReadOutTiming registers */
                /* these shouldn't be 0, as they affect the image */
                adtg_new[9] = (struct adtg_new) {6, 0x82F8, nrzi_encode(readout_end + 1) }; /* ReadOutTiming */
                adtg_new[10] = (struct adtg_new) {6, 0x82F9, nrzi_encode(fps_timer_b - 1) }; /* ReadOutTiming end? */
            break;



            case CROP_PRESET_HD:
            adtg_new[11] = (struct adtg_new) {6, 0x8000, 6};
            adtg_new[12] = (struct adtg_new) {6, 0x800C, 4};
        break;


static inline uint32_t reg_override_HD(uint32_t reg, uint32_t old_val)
{
    switch (reg)
    {
        /* raw resolution (end line/column) */
        /* case 0xC0F06804: return 0x33f01ec; // 1440 x 360 6d 96fps; */
        case 0xC0F06804: return 0x186018a;
       
        case 0xC0F08184: return 0x1;
        case 0xC0F08188: return 0x1;
        case 0xC0F08194: return 0x1;
        case 0xC0F08198: return 0x1;
       
        case 0xC0F06824: return 0x202;
        case 0xC0F06828: return 0x202;
        case 0xC0F0682C: return 0x202;
        case 0xC0F06830: return 0x202;
       
        case 0xC0F06010: return 0x204;
        case 0xC0F06008: return 0x2040204;
        case 0xC0F0600C: return 0x2040204;

        case 0xC0F06014: return 0x203;

        case 0xC0F0713c: return 0x187; // Same as 6804 res +1 ?; */


    }

    return 0;
}

theBilalFakhouri

Quote from: Levas on September 16, 2018, 12:41:17 AM
Did think about this solution for aliasing too, it's just a matter of setting the line skipping factor to 0 (register 800c) in non zoom mode and expand the vertical resolution.

Of course there are no aliasing! another example (1280x720):
https://drive.google.com/open?id=1S2lM18EpDPSnRx06_j6W1orh54jjn3IS

The remaining aliasing in 1x3 is also can shown in 1x1 mode, so this depending on the subject too. But it's 90% better than 3x3 if not 100% you must try it on 6D :D

This is the most hated moire pattern has gone:


Quote from: Levas on September 16, 2018, 12:41:17 AM
But I must say, the 1x3 files look a lot better, much more detail.
Can you share some sample DNG's of these examples. Both an 1x3 file and 3x3 dng file from the same subject ?
Curious how much the difference in detail is in a raw editor.
I can't see much more details except for aliasing areas the image now smoother, Here is two samples.

@a1ex
Quote from: a1ex on September 15, 2018, 05:41:10 PM
Now to figure out how to use the Eeko routines in LiveView and compress the footage to 3x3 (or at least 2x3) before writing it to card.

Is this means the files size will be reduced ? lower write speeds?

dfort

Interesting developments. Wonder how 1x3 performs with that moving patter we used a while back on the focus pixel discussion.

Speaking of focus pixels, I don't see any on these tests. Are they gone or is our focus pixel removal tool working with 1x3? Taking a close look at some of the tests I shot in 1x3 and processed in mlv_dump with the --no-fixfp option I don't see any focus pixels.

Haven't had much luck with the EOSM yet. Maybe we need to add Danne's mv1080 crop_rec settings? As I recall there was a problem handling the EOSM exception so the module can't handle both mv720 and mv1080.

theBilalFakhouri

Another benefit for using 1x3 Binning is:
There is no aliasing in Dual ISO video! Take a look:
3x3" border="0

1x3" border="0

1x3 Dual ISO" border="0

Video:


Example: (1280x720 Upscaled to 1080p)

YouTube did horrible compression in the details so here is the original file (encoded via Grass Valley HQX maybe you should install Grass Valley codecs):
https://drive.google.com/open?id=17ob5AOkirAwq3TRwBGGY1qIyNfZwfj-f

I am not sure about the image details which is better normal 3x3 or 1x3 Dual ISO I will make more tests in future. Even if it was aliasing in some cases using 1x3 + Dual ISO it's a lot better than normal 3x3 aliasing. This huge!

Danne

Hey man. Is this seriously working with dualiso as good as it looks? I mean, is this already working on the 5D mark III already or only 700D? I could test this of course but the way my life swings atm I have a hard time finding time to even recharge my cam batteries. To me it seems this image quality is somewhere touching some sort of pinnacle in terms of file quality. The nonexistent aliasing on the keyboard footage is insane.
Thanks so much for sharing your findings Bilal!
Personally I like to test this on eosm, 100D and a 5d mark III. Will find time soon.

dfort

So no aliasing and greatly increased dynamic range -- Fantastic!

It makes total sense that dual iso works better in 1x3 sampling mode. You loose up to half the vertical resolution with dual iso and that is a very big deal with 3x3 sampling and pretty much unusable with 5x3 sampling but since the vertical resolution is going to be resized anyway in 1x3 mode there should be no quality loss when using dual iso.

Now how long are your recording times? I can only get a second or so. Need some more experimenting with the sd_uhs module.

12georgiadis

Insane work for 96fps and remove aliasing 1x3, even for dual iso !!
This is fantastic and if the bitrate remains the same, it means that all camera could benefit of these function !
No need for expansive vaf anymore !



Envoyé de mon iPhone en utilisant Tapatalk

theBilalFakhouri

@Danne
Yes it's that good and YouTube did horrible compression in the details so here is the original file (encoded via Grass Valley HQX maybe you should install Grass Valley codecs):
https://drive.google.com/open?id=17ob5AOkirAwq3TRwBGGY1qIyNfZwfj-f
In 5D3 3x3 Binning mode using Dual ISO the aliasing will be more visible than 1x3 which work a lot nicer even maybe more than 1x1 mode!

@dfort
In 1736x738 @ 23.976 FPS 2.35:1 (Actually 1736x2214 in 1x3) I can get Max 2 seconds or a bit less. So I am using 1280x544 (1280x1632 in 1x3) 2.35:1 aspect ratio to get continuous recording times using sd_uhs of course :D.

Levas

Smart idea, the extra vertical lines with 1x3 mode are indeed a good use for dual iso  8)

Now I have take a look at it again for the 6d, I see why I stopped before, 6d isn't fast enough, only 25.6 Mhz. instead of the 32Mhz of most other cams.
1824 is the maximum horizontal resolution. This needs an A timer value of 515.
25600000 Hz / (515+1) / 25FPS = 1984, so that leaves a value of 1984-1= 1983 for the B timer.
With a little safety margin to prevent corrupted frames, that probably gives about 1900 vertical resolution at max.
After scaling correction, 1824 x 636 resolution is left... ::)

Luckily I know my ways to get rid of color moire, so still going strong on 3x3  ;D



12georgiadis

Quote from: Levas on September 17, 2018, 01:04:59 AM
Luckily I know my ways to get rid of color moire, so still going strong on 3x3  ;D
And what is your method ? =)

Levas

I use Rawtherapee as a raw editor to develop the DNG's.
Most of the color moire is already gone by using LMMSE method for debayering, which RawTherapee can do.
I saw it recently also be used in MLV APP, but that version was compiled by somebody on this forum, under development, not sure if it has already LMMSE debayering option in the current build ?

To get rid of some more color moire there's a second trick that can be done in RawTherapee, by the use of 'defringe', which in most raw editors only removes purple glow, but in RawTherapee you can adjust it to remove more colors than only purple.

The LMMSE debayering can give a pixelated look on some patterns, in that case, AMAZE debayering including defringe can also be an option.
And be gentle with the defringe, dragging the colors too high and you will notice unsaturated lines around colored subjects.

Made a quick tutorial 2 years ago:
https://www.youtube.com/watch?v=MweH3RAssXs

12georgiadis

Thank you Levas ! Yes LMMSE available on RawTherapee. I tried with a dual iso footage from 5DmkIII but it wasn't working well.

IDA_ML

Oh my God, am I dreaming?  Or are we all in the middle of new extremely exciting times for Magic Lantern?  You guys are WIZARDS !!!  Thank you so much for your amazing work!

Recently, I shot a lot of landscape footage at 2520x1304@18fps and 14-bits lossless on the 100D.  Beautiful footage, excellent fine detail, huge dynamic range, smooth transitions.  Bilal, could you please answer the following question for me:  Would it be possible to achieve the following goal on the Rebel cameras (700D, 100D, EOS-M and maybe other Rebel models too)? 

Resolution: 2560x1440 (this resolution would provide very good quality on Vimeo and Youtube)
Bit depth: 10-bit with lossless compression
Frame rate: 24 ps
Recording: Continuous or at least 10-12 sec. recording time
Preview: WySiWyG, even if it is slow


And what about D4 cameras (7D, 5D2)?  If the answer to that question is YES, then this would be a real break through for these cameras and a revolutionary achievement for the ML community !!!

masc

Quote from: Levas on September 17, 2018, 09:36:25 AM
I saw it recently also be used in MLV APP, but that version was compiled by somebody on this forum, under development, not sure if it has already LMMSE debayering option in the current build ?
Yes, it is included in MLVApp v1.0.
5D3.113 | EOSM.202

Levas

Quote from: 12georgiadis on September 17, 2018, 10:49:32 AM
I tried with a dual iso footage from 5DmkIII but it wasn't working well.

LMMSE has little effect on dual_iso, because it's already altered to bring both iso's to the same level.
But I see the defringe option does work very well. Did bring the threshold for defringing to zero in this case (13 by default).
Example of dual iso, with amaze debayering and without defringing. (click to expand to full res)

And here the same, with defringe option in Rawtherapee, all colors lifted a little as seen in the youtube video and this time, threshold set to a value of zero.(click to expand to full res)


12georgiadis

Thank you for the example Levas. I can see the improvement for defringing but my concern is also aliasing and I can't get rid off in my try. On the other hand, this 1X3 binning mode seem to be the solution, especially if it's done before going in post, isn't it ?

Levas

Quote from: theBilalFakhouri on September 16, 2018, 01:39:12 PM
I can't see much more details except for aliasing areas the image now smoother, Here is two samples.
Checked out your samples, removed the aliasing in the 3x3 samples and rescaled the 1x3 samples and must conclude you're right, can't see much more detail, probably none, in the 1x3 samples.
By the way, this 1x3 method could, besides dual iso, also be good for low light shooting.
The final image is rescaled to 1/3 of it's original size, that should give about 1.33 stops of noise reduction. So shooting iso 3200 with iso 1250 results...

Levas

@12georgiadis
You're right that the options I mentioned only work for color aliasing, it doesn't work for annoying moire patterns.
Shooting 1x3 should fix this in 99%(I guess, because even camera's that don't do binning and lineskipping can suffer from moire patterns, since the pixels on the CMOS are pretty straight aligned in rows and columns)
The problem for now is that shooting in 1x3 takes up 3x the amount of resolution and thus 3x the amount of data to be recorded.

Levas

Quote from: a1ex on September 15, 2018, 02:09:40 PM
If you weren't able to lower timer A, I'd expect the horizontal resolution to be full width (1824 iirc).
You may also use other line skipping factors on the Y direction: 3, 5, 7, 9...

Alex, you're right, I could have gone full width with these settings, 1824 pixels wide.
Did try to set lineskipping to 6 instead of 4, but that gave me a weird preview, which I can record (so it's not corrupted, it's just not what you would expect)

I've got the original DNG frame here:
https://drive.google.com/open?id=1RxwkrQ69UVU69oFhsfIVOFs7EaRy2fML

The weird thing is, all other options work, lineskipping value 2,3,4 even a value of 5 works, of course colors are a bit weird  :P, but that is expected with an uneven value.
Could it be caused by your automated shutter blanking and shutter speed registers ?

12georgiadis

Quote from: Levas on September 17, 2018, 02:20:10 PM
@12georgiadis
You're right that the options I mentioned only work for color aliasing, it doesn't work for annoying moire patterns.
Shooting 1x3 should fix this in 99%(I guess, because even camera's that don't do binning and lineskipping can suffer from moire patterns, since the pixels on the CMOS are pretty straight aligned in rows and columns)
The problem for now is that shooting in 1x3 takes up 3x the amount of resolution and thus 3x the amount of data to be recorded.
Ok, good to know...

theBilalFakhouri

Quote from: dfort on September 16, 2018, 08:51:49 PM
..but since the vertical resolution is going to be resized anyway in 1x3 mode there should be no quality loss when using dual iso.
Quote from: Levas on September 17, 2018, 02:11:37 PM
Checked out your samples, removed the aliasing in the 3x3 samples and rescaled the 1x3 samples and must conclude you're right, can't see much more detail, probably none, in the 1x3 samples.
I can confirm There is no quality loss when using Dual ISO in 1x3! (@Levas No much details in normal 1x3 but the details has been restored when using Dual ISO)
1x3 Binning made for Dual ISO! no price to pay when using dual iso in video now!

Quote from: a1ex on July 16, 2013, 06:33:50 PM
Price to pay
- Half resolution in highlights and shadows
- Aliasing and moire - of course, in highlights and shadows
- You can no longer check critical focus when zooming in
:D


Magic Lantern Cinema Camera:

Link: https://youtu.be/cP6DjS4QgcE
Original file in Google Drive: Download
Details: https://www.magiclantern.fm/forum/index.php?topic=22818.msg206134#msg206134

Quote from: Levas on September 17, 2018, 02:11:37 PM
By the way, this 1x3 method could, besides dual iso, also be good for low light shooting.
The final image is rescaled to 1/3 of it's original size, that should give about 1.33 stops of noise reduction. So shooting iso 3200 with iso 1250 results...

You are right there is improvement in the shadows:
ISO 100 3x3: (Pushed 4 stops)
ISO 100 3x3" border="0

ISO 100 1x3: (Pushed 4 stops)
ISO 100 1x3" border="0

Dual ISO 100/800 3x3: (Pushed 5 stops)
Dual ISO 100 800 3x3" border="0

Dual ISO 100/800 1x3: (Pushed 5 stops)
Dual ISO 100 800 1x3" border="0



@IDA_ML
Quote from: IDA_ML on September 17, 2018, 11:22:16 AM
..Bilal, could you please answer the following question for me:  Would it be possible to achieve the following goal on the Rebel cameras (700D, 100D, EOS-M and maybe other Rebel models too)? 

Resolution: 2560x1440 (this resolution would provide very good quality on Vimeo and Youtube)
Bit depth: 10-bit with lossless compression
Frame rate: 24 ps
Recording: Continuous or at least 10-12 sec. recording time
Preview: WySiWyG, even if it is slow


And what about D4 cameras (7D, 5D2)?  If the answer to that question is YES, then this would be a real break through for these cameras and a revolutionary achievement for the ML community !!!
We already have more than 2560x1440! we can get up to 2700x1500 @ 23.976 fps without any corrupted frames! This thing has been done by using the new method of crop_rec only for 700D for now but I think it's very soon for all D5 cams!
10 Bit-lossless is already working also when using Analog gain. Maybe @Danne have a build for 100D. (I noticed a vertical stripes appears in 700D when using Analog gain and maybe it's fixable but for now you can fix it in MLVApp).

Recording times: we have to figure out how to get full SD write speed, 10-bit lossless isn't enough for continuous recording in this resolutions! and maybe we are not sure if we can see effective 80MB/s write speed in small cameras.
Preview is working in 700D. and maybe in all other cameras if you have a problem you can ask the developers :D .

Now 5D2 has reached two big things 10/12 bit depths working and 3K (2880x1080) RAW video recording. This is very good sign for D4 Cameras !

Litewolf


  • How can I turn on 4096x1440 @ 25p (1:1 crop) on my 5dMk3?
I've installed the latest experimental built magiclantern-crop_rec_4k.2018Jul22.5D3113.





While I've sucessfully recorded in 3.5K 1:1 centered x5, I can't figure out how to turn on 4096x1440 @ 25p (1:1 crop).

No combination of Crop mode and RAW video in the ML menu seemed to achieve that resolution.
Did I forget to make some settings in a certain module?

IDA_ML

Thanks a lot for this important clarification, Bilal.  Your findings are really amazing, especially those concerning Dual ISO.  I have always loved Dual ISO, not only because of the high dynamic range but also for much better and noiseless results in low-light and night videography.  Hopefully, Danne will be able to provide a working build for the 100D soon.  In that case, I will test and provide feedback as soon as possible.

By the way, did you try shooting at the maximum resolution but at 18 fps?  For the types of landscape shots that you provided, this reduced frame rate should provide excellent results and you will get reasonably long recording times.

Keep up the good work !!!

Danne

Working against time here but added EOSM by including is_700D || is_EOSM in a1ex crop_rec.c code. Following Bilals settings vertical resolution is stuck at 696, so probably raw.c height restriction needs to be erased and doing that opens up another can of worms creating image corruption. In theory maybe the newly mv1080p register settings would make this work but can´t get any decent 1x3 binning results yet. For anything to record uncorrupted I have to lower fps to 17 and then I can record 1x3 1736x696, probably not valid files.
I will make wish for more time...

IDA_ML

Take your time, Danne, there is no rush!  It is much more important that there is serious work going on on the Rebels and D4 models and that these new amazing findings have found proof of concept already.  Why is that important?  Because this keeps the interest of Rebel and D4-camera owners in Magic Lantern alife and stops them from selling their cameras and transfering to SONY for example. 

By the way, there is a lot of excitement among ML users in my country at the moment.  So please, A1ex and other developers, don't give up on these fantastic new developments.  Our cameras may be 10 years old but are fully up to them and deserve your attention!  My 7D still writes at 90 MB/s without CF-card overclocking!