Wrong squeeze factor for crop sensor cameras

Issue #2219 resolved
Rafael Brune created an issue

A squeeze factor of 1.40x is reported in the GUI but the actual factor is around 1.6x.

Excerpt from mlv_rec.c:

int32_t correct_height = max_res_x * 9 / 16;
//int32_t correct_height = max_res_x * 2 / 3;  TODO : FIX THIS, USE FOR NON-FULLFRAME SENSORS!

In raw_rec there was a 'bad' fix that has been reverted again: https://bitbucket.org/hudson/magic-lantern/commits/c5e2c2c2aa5e9acf3e6982431d9786b0cd5dee76

Before I make a patch, can someone enlighten me, what was going wrong with that fix?

As it is right now it is not possible to set and get the desired aspect ratio - and it is confusing to show a wrong squeeze factor in the gui.

Comments (5)

  1. Alex

    The config definitions are not available in modules. They are only available in the core ML, at compile time. In modules, differences between cameras should be identified at runtime (see for example how it's done in dual_iso or io_crypt).

    Aside from that, I'm not 100% sure that scaling the X resolution is correct everywhere (since image height may not cover the entire display area, and may vary from camera to camera). But I believe the pixel aspect ratio in 720p is always 3:5 in all cameras (just need double-checking). Proof for 5D3: http://www.magiclantern.fm/forum/index.php?topic=10111.msg123894#msg123894

    Therefore, a simpler fix would be to assume the ratio as 1.67x (5:3). Only has to be checked if this really applies to all cameras. I prefer generic code without camera-specific tricks if possible.

  2. Rafael Brune reporter

    Thanks for the explanation and the link!

    A simple solution and getting rid of unnecessary code sounds good to me too. Since 3x5 horizontal binning + vertical skipping is the most simple to implement subsampling method for bayern pattern sensors I too assume that canon used it for all their cameras up until the 5D3. (and I should try to repeat the test you did for the 5D3 with my EOS-M or 500D).

    Locally I've tested a patch that just sets the squeeze factor to 5/3 and for the EOS-M it works as it should. It should also still correctly work for the full frame cameras as the current code should already give them the same squeeze factor. For all other cameras the current code is already wrong and should with our assumptions and the fix give the correct result. Let me prepare a pull request.

  3. Log in to comment