Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: tecgen on April 15, 2016, 05:45:21 PM

Title: mlv_raw more RAW resolutions between 640 and 1280?
Post by: tecgen on April 15, 2016, 05:45:21 PM
Dear all,

the current lower resolutions in the mlv_rec module are 640, 960, 1280 and so on. My little 550D has an SD Card interface and could theoretically write around 20 MB/s to the card. At the moment I could only choose between 960 and 1280. This is a huge step of 320 pixel. With an aspect ration of 2,39:1 at 24 frames per second I need the following write speeds for continious recording.

960px = 15,4 MB/s
1280px= 27,8 MB/s

In mlv_rec.c I read

,,...

* resolution (in pixels) should be multiple of 16 horizontally (see http://www.magiclantern.fm/forum/index.php?topic=5839.0)
* furthermore, resolution (in bytes) should be multiple of 8 in order to use the fastest EDMAC flags ( http://magiclantern.wikia.com/wiki/Register_Map#EDMAC ),
* which copy 16 bytes at a time, but only check for overflows every 8 bytes (can be verified experimentally)
* => if my math is not broken, this traslates to resolution being multiple of 32 pixels horizontally
* use roughly 10% increments
..."

I think its a good idea to provide finer resolution steps for SD card interface limited cameras.

These are possible new values between 640 and 1280 px where the resolution is a multiple of 32 pixel.
672, 704, 736, 768, 800, 832, 864, 896, 928, 980, 992, 1024, 1056, 1088, 1120, 1152, 1184, 1216, 1248


My SD card has an average write speed of 19,7 MB/s. I compiled a modified version of the mlv_rec module and tested it. Here are some settings near the 20 MB/s limit which are not (all) possible now, but make sense for me.

@24p
aspect ratio / resolution / bandwidth / comment
2,39:1 1088X456px ~ 19,8 MB/s
2,39:1 1120x468px ~ 20,9 MB/s
2,35:1 1088x462px ~ 20,1 MB/s
16:9   928x522px  ~ 19,3 MB/s
4:3    768x576px  ~ 17,7 MB/s (PAL resolution?)
4:3    800x600px  ~ 19,2 MB/s
4:3    832x624px  ~ 20,7 MB/s

To increase the width from 960 to 1088 pixel means 128 more useable pixel in aspect ratio 2,39:1 on cameras with an slow ~20MB/s SD Card interface.

@30p
aspect ratio / resolution / bandwidth / comment
2,35:1 960x408px  ~ 19,5 (already possible now)
2,35:1 992x422px  ~ 20,9
16:9   832x468px  ~ 19,4
16:9   864x486px  ~ 20,9
4:3    736x552px  ~ 20,3

@60p
aspect ratio / resolution / bandwidth
2,35:1 864x220px  ~ 18,9
2,35:1 896x230px  ~ 20,6
16:9   768x260px  ~ 19,9
4:3    672x302px  ~ 20,2
4:3    640x288px  ~ 18,4


https://bitbucket.org/tecgen/magic-lantern/branch/smaller_resolution_increases#diff

What do you think about?

best regards
Marco
Title: Re: mlv_raw more RAW resolutions between 640 and 1280?
Post by: a1ex on April 15, 2016, 06:14:05 PM
In mlv_rec, you can currently select the resolution in 32 pixel increments. Try it.
Title: Re: mlv_raw more RAW resolutions between 640 and 1280?
Post by: tecgen on April 15, 2016, 07:07:56 PM
Cool feature! Now I remember the pull request. Maybe it would be nice to give users a hint that they need to press the left or right key to change the resolution in small steps.
Title: Re: mlv_raw more RAW resolutions between 640 and 1280?
Post by: a1ex on April 15, 2016, 07:11:05 PM
Good point, better help text is always welcome.