3K/UHD 5D2 Raw development and Other Digic IV Cams

Started by reddeercity, April 06, 2017, 12:22:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

reddeercity

Here the New D4/5D2 & 50D Download Links:
 Experimental 5D2 Dual ISO Video Module (updated_21-8-2020) 
5D2 Dual ISO Video

Experimental 1:1 Full Sensor width  5D2 Crop Rec 5632x3124 @ 3.8fps Raw Video (Jan-05-2020)
crop_rec-5632x3124_3.8fps-5D2-eXperimental.9.42pm.2020Jan05.5D2212

More pixel in 3X3 (1856 -> 1880) , plus more pixel in normal (non expanded 5x zoom) up to 2152 wide
Experimental 5d2 expanded full width 1880 3x3 & 2152 5xZoom  7-5-2020-5.59 mlv_rec
1880_3x3-2152_5xZoom-5d2_7-5-2020-5.59pm-mlv_rec

Experimental 5d2 Crop Rec 4k3x1(4096x590@24fps) 2.8k @ 24fps (2784x1160) 5xZoom plus (1856x774) 3x3 @48fps  (Dec.31 2019)
crop_rec-4k3x1-2.8k24p_3x3-48p-all-centered_8.18pm-5D2-eXperimental.2019Dec31.5D2212

Note# you can just substitute the newer mlv.rec module (from 1880 3x3 & 2152 5xZoom  7-5-2020-5.59 mlv_rec) to the 4k 3x1 , 2.8k 1x1 &  3x3 full HD 48FPS build to get 1880 in 3x3 & Hi speed 48p mode

50D magiclantern-eXperimental-crop-rec_3.7k-1x1.11.30pm.2020Aug16.50D109
magiclantern-eXperimental-crop-rec_3.7k-1x1.11.30pm.2020Aug16.50D109

MLV Play : updated 9-17-20 for D4 10bit & crop_rec
mlv_play_9-17-20

That's it for now , will add more soon 😀
Let me know if you have problems ,
the only issue I found was in 3x3 48P when you enable it then hit the refresh/5xzoom you may get a distorted Liveview,
just turn off Raw video "OFF" then refresh liveview then turn Raw Video "ON" again you should have the proper functioning LCD screen & 48p 3x3 will operate normally.

reddeercity

Reserved for future 5D2 & 50D New discussions (HDMI:1080p/30fps, Lossless compression, 422 8bit AVI compression recording)
*July 1st 2025 NEW Post*
Started to dig deeper in HDMI 1080p30 & 1080p60 Regs see if by chance if I could find a reg or a series of regs that stretches the vertical
from compressed 540 to 1080. Short answer No it can't happen in this state that is .
I'll explain , in short just like crop_rec couldn't have a bigger frame size until there was really 2 thing done start in the code
1st increase the buffer size (here it would but the HD buffer same thing I'm after for 422 AVI) which  in turn is use for
HDMI stream (more on the kind of pixel stream format) 
2nd change the window size to view the new frame buffer size, (I'm kind of doing that right now with 1080p30 & 720P50/60)
but can't fill the full screen or in the case of 720p50/60 the side are actually crop for a more zoom in image maybe 1.2x .

But 720P50 is mostly full right?
yes because 1080i & 720p50/60 share the same frame buffer size , in 1080i its really 540 every other frame but shifted down one
so you have the allusion of full frame (you brain can't see the interlacing fast enough so look like one image in 2 fields)
since 720p is (1280x720) in 50 or 60fps , do the math the frames are very close.

The other problem is dealing with the pixel format , in 1080i YCbCr 422 where 720p is (RGB) YUV 444 (verified with my Aja HDMI/SDI capture card)

Where to go from here , possible to have 720p/50(maybe 60) HDMI full vertical I believe  , currently working on it , hopefully show some result soon.
next to see if the HD buffer can be access or changed . That being said I when though most of the display regs that effect the HDMI image in some way
I looking for any change no matter on small the chance was , I'll post the information below , this was only done in 3x3 , still need to do it in x5 zoom (crop_mode &  10x Zoom.

from my notes
 c0f14254  - 0x32090232  ---> 0x32090231 (1080p30 YUV, 540 Vertical 1920 Horizontal)
c0f14254  - 0x32090232  ---> 0x22080232 (Cleaner-1080p30 YUV, 540 Vertical 1920 Horizontal)
c0f14254  - 0x32090232  ---> 0x30080232 (best -1080p30 YUV, 540 Vertical 1920 Horizontal)
c0f14254  - 0x32090232  ---> 0x26090231 or 0x23090231 (1080p60 , it doesn't lock in all the time its to come in & out so very unsteady right now unless buffer chance)
c0f14250 - 0x2b003d --> 0x2b000d (Vertical compress or decompress )
c0f14210 - 0x277a --> 0x277b (720p 60 YUV)
c0f14210 - 0x277a --> 0x277e (720p 25 YUV)
c0f14210 - 0x277a --> 0x14ff (720p 50 YUV)
c0f11308 - 0x91b1f --> 0x9201f (Vertical stretching)
c0f140dc - HDMI image move up & down , plus turn off overlays)
next regs effect the HDMI image some how , I didn't write down all the 0x numbers unless it changed the image a great deal )
c0f1150c - HDMI Frame sizing
c0f112c8 -  HDMI Frame sizing
c0f112c4 - HDMI Frame sizing
c0f11108 - 0x5  --> 0x3 (darken image maybe HDR? at least 2-3 stops)
c0f111c4 - 0x --> 0x6 (multi view image , 3 of the same image (maybe 10x _x5) at the same time
c0f110c4 - HDMI Frame sizing
c0f1108c - 0x5 --> 0x3 (HDR/Darken image)
Next ones actually changed the frames size but not the window for the frame
c0f1d064- HDMI frame sizing
c0f1d060 - HDMI Frame sizing
c0f1d050 - HDMI Frame sizing
c0f1d04c - HDMI Frame sizing
c0f1d048 - HDMI Frame sizing
c0f1d100 - 0x4 --> 0x5 (HDR/Darken image)
c0f0d044 - HDMI Frame sizing (I think those are from 10x zoom)
c0f0d040 - HDMI Frame sizing (I think those are from 10x zoom)
c0f0d030 - HDMI Frame sizing (I think those are from 10x zoom , I use this on in my 4k 3x1 crop_rec with HDMI crop Center for real time preview while record raw video)
c0f0d018 =HDMI Frame sizing
c0f0d014 -HDMI Frame sizing
c0f0d008 - (looks like dual ISO lines)
 
that's it for now  more investigation is needed
 
 

reddeercity

Reserved for future 5D2 & 50D New discussions (HDMI:1080p/30fps, Lossless compression, 422 8bit AVI compression recording)

SebastianC

This is pretty great!!I love 5D mark ii RAW VIDEO vintage colour!Thank you reddeercity!

Skinny

Quote from: SebastianC on June 22, 2025, 03:36:50 PMI love 5D mark ii RAW VIDEO vintage colour!
5D2 has lovely colors for sure, I like it a lot!

Quote from: reddeercity on June 22, 2025, 02:55:43 AMReserved for future 5D2 & 50D New discussions (HDMI:1080p/30fps, Lossless compression, 422 8bit AVI compression recording)
I think all 5d2 owners are keeping their fingers crossed :)  :)

forest_spirit

I just want to say, RedDeerCity, that your work on raw video has been amazing and I appreciate all of your efforts. I've been recording more with my 5D2 ever since I was able to track down a VAF-5D2 anti-aliasing filter and I've been enjoying the results.

Thank you for your continued work on what is a legendary camera.

If I want to help in development, what should I be learning, where should I be going?

reddeercity

Quote from: forest_spirit on June 26, 2025, 04:21:35 PMIf I want to help in development, what should I be learning, where should I be going?
First you need to know some C code or a working understanding of it, setup a environment to compile the ml code, @names_are_hard has a developer guide
https://github.com/reticulatedpines/magiclantern_simplified/blob/dev/developer_guide/02_00_hardware.md
figure out what you what to work on , and simple read the thread for D4 development but not only , D5 has very similar code/function's , it gave many hint to figure thing on D4 .
That would be a start of it

iaburn

Quote from: reddeercity on June 27, 2025, 06:29:10 AM@names_are_hard has a developer guide
https://github.com/reticulatedpines/magiclantern_simplified/blob/dev/developer_guide/02_00_hardware.md

It's there any documentation about more technical findings on registers and functions, besides the code itself?

kitor

Quote from: iaburn on June 27, 2025, 02:12:36 PMIt's there any documentation about more technical findings on registers and functions, besides the code itself?

The documentation is very lacking.
There's this, but it is very hard to read even for us: https://magiclantern.fandom.com/wiki/Register_Map
It is often we got "eureka moment" after first reverse engineering a thing and then finally understanding the docs or code  :-\

We are taking some efforts to put documentation on the new Wiki, but this right now exists just for the D6-8 cameras, eg.:
https://wiki.magiclantern.fm/digic6:registers
https://wiki.magiclantern.fm/digic8:registers

Any help of converting in-code and Fandom wiki docs into easily digestible info on new wiki will be really appreciated. A lot of knowledge was unfortunately lost.

Too many Canon cameras.
If you have a dead R or RP mainboard (e.g. after camera repair) and want to donate for experiments, I'll cover shipping costs.

iaburn

Quote from: kitor on June 27, 2025, 03:37:10 PM...

That's already good enough, I just wanted to get a rough idea of the complexity involved on the development and the level of knowledge needed.
This low level programming really need to have a clear understanding on how these chips works, or at least good enough to figure out how could things work  ::)

reddeercity

Go over some old 5D2_MMIO activity (registers) and interrupts Trace_log_h264_compression_ResLocks
found some interesting things look like there's a 720p encoding function along with VGA & crop vga 
Why is this important , could be used for vga h264 proxies , (5d3 has this but full HD proxies)

*"TWIN DECODE_TWIN "
*"TWIN StartTwinDecode->DecodeEngineStart"
*"TWIN StopDecWinPath Error:%d"
*"H264E InitializeH264EncodeFor720p"
*"H264E InitializeH264EncodeForVGA"
*"H264E InitializeH264EncodeForCropVGA"
*"H264E JpegEncodeCompleteCallback EncodeSize:%#lx"
*"H264E RequestH264EncHD FrameNum:%d"
*"H264E RequestH264EncHD r:%#lx,w:%#lx"

*"H264E RequestH264Encode"
*"[H264Dec] pInputAddress1    = 0x%08lX"
*"[H264Dec]  H264_P_PICTURE %d"
*"[H264Dec]  H264_I_PICTURE %d"
*"[H264Dec]OutputParam.XN + 1 =%d OutputParam.YN + 1=%d "
Here its looks for the buffer address
2nd line is doing a h264 compression of frames P & I
then output size , this is tell me I may be able to input any ? Frame size beyond HD size e.g.
2K or 3K , not sure but seem like a possibility .
of course this help with AVI compression & configuration since the frame size are the same in Raw, HD buffer of Liveview thought in liveview its resize on the fly , More to come


reddeercity

update  Regs for HDMI 5d2 :
I thought I needed to switch the progressive/interlace scan mode Reg to Progressive   C0f14254 - 0x32090232 --> 0x32090231 It looks look all the progressive scan resolution can be access though 1 Reg I found so far.
I'm slow getting a handle on the Regs for HDMI , currently looking for the regs to increase the frame window wide , I may have something ,
looking at the C0f8xxx , but i think there's at least 3 - 4 different regs at play here .   
C0f14210 - 0x277a (automatically default 1080i on HDMI connection)
C0f14210 - 0x277a --> 0x2776 (1080p25)
C0f14210 - 0X277a --> 0x2772 (1080p29.97)
C0f14210 - 0x277a --> 0x277e (1080i25)
C0f14210 - 0x277a --> 0x27fb (720p59.94)
C0f14210 - 0x277a --> 0x27ff (720p50)


Need to study more my mmio Logs file on playing .mov though HDMI for more clues . 

reddeercity

Looks like I'm missing access to Or being filtered out(not sure yet)C0f140Dx
have to try & poke them , there are from DisplayMgr they seem to setup bitmap display device.

Strange thong happen also , when i had force progressive scan mode C0f14254 then go to the display menu and turn on "Force 480p HDMI" i get 720p 23.98 , yup 24p in 720mode and its analog RGB not YUV
didn't get a image , battery run out . I'll try again

720p23-98-from-480-small" border="0


reddeercity

Take a shot at the 50D for HDMI reconfiguration by regs , got 720p50 fairly stable .
Take a while to find the right combination , it not totally the same as 5D2 but pretty close.
Below is the regs modified in ADTG module .

Here a frame from the HDMI 50D , basically its similar to 5d2 but its feel much better , also like its suppose
to be the default setting , very clean in my opinion .

Cropped image

full frame


I think now I need to start looking at the code for Liveview in ML , there's some preset to use anamorphic type lens to change liveview for corrected HDMI view. The Image buffer HDMI/HD & Liveview image dumps are not distorted (compressed vertically) like HDMI , so i have to change the Frame buffer also so will continue on .
     

reddeercity

Some more note for the 50D HDMI Regs
C0f14210 - 0x277a --> 0x277e (1080i25)
C0f14210 - 0x277a --> 0x27fb (720p59.94)
C0f14210 - 0x277a --> 0x27ff (720p50)
C0f14210 - 0x277a --> 0x27fe (1080i25 better/cleaner image)
C0f14210 - 0x277a --> 0x2776 (1080i25)
C0f14210 - 0x277a --> 0x2772 (10870i29.97)
Progressive scan
C0f14254 - ox32090222 (1080i29.97)
C0f14254 - 0x32090232 (1080p29.97)
(progressive scan switch enabled with the following additional regs)
C0f14254 - 0x32090232 (add) C0f14210 - 0x277a --> 0x277b (720p59.94)
C0f14254 - 0x32090232 (add) C0f14210 - 0x277a --> 0x277e (1080p25)
C0f14254 - 0x32090232 (add) C0f14210 - 0x277a --> 0x27fb (720p59.94 Better/more stable image)
C0f14254 - 0x32090232 (add) C0f14210 - 0x277a --> 0x27fe (1080p25 Better Image/cleaner)
C0f14254 - 0x32090232 (add) C0f14210 - 0x277a --> 0x27ff (720p50 Better image/cleaner

So I look in the code to see if this is hard coded limitation , found in the
422.jpg.py some presets , found this
resolutions = [ # from vram.c
    (1120, 746),  # 5D2, 5x
    (1872, 1080), # 5D2, REC
    (1024, 680),  # 5D2/50D standby
    (1560, 884),  # 50D REC
    (944, 632),   # 50D/500D 5x
    (928, 616),   # 500D photo
    (1576, 1048), # 500D 1080p
    (1576, 632),  # 500D 720p
    (720, 480),   # 500D 480p, normal LV buffer
    (1056, 704),  # 550D/60D photo/stby
    (1720, 974),  # 550D/60D 1080p
    (1280, 580),  # 550D/60D 720p
    (640, 480),   # obvious :P
    (1024, 680),  # 550D/60D 480p stby
    (1056, 756),  # 600D USB
    (1728, 972),  # 600D REC 3x
    (1680, 945),  # 600D REC 1x
    (1280, 560),  # 600D 720p
    (1152, 768),  # 5D3 5x
    (1904, 1274), # 5D3 1x
    (1620, 1080), # 5D3 photo mode
    (1920, 1080), # HDMI FullHD
    (1920, 540),  # HDMI 720p
    (960, 639),   # 650D LV photo mode
    (1728, 1151), # 650D FullHD
    (1280, 689),  # 650D 720p
    (960, 540),   # HDMI 640 crop

this one here
(1920, 540),  # HDMI 720pso i need a work around on this .

I think i found the soltion , well kind of .
I think if we can do tell vram.c to enable 19x9 instead of 3x2 that would be the answer I'm looking for
line 126
//~ int lv_ratio_num = 3;
//~ int lv_ratio_den = 2;
//~ int hd_ratio_num = 3;
//~ int hd_ratio_den = 2;
Its commented out , change that to
//~ int lv_ratio_num = 16;
//~ int lv_ratio_den = 9;
//~ int hd_ratio_num = 16;
//~ int hd_ratio_den = 9;

maybe work? just thinking out loud .
I think I found where I need to focus on now Vram.c , here is the real meat & potatoes of what I've been looking for HDMI code configuration , been looking for this for a while
static int prev_hdmi_code = 0;
    static int prev_EXT_MONITOR_RCA = 0;
    if (prev_hdmi_code != hdmi_code || prev_EXT_MONITOR_RCA != EXT_MONITOR_RCA) redraw();
    prev_hdmi_code = hdmi_code;
    prev_EXT_MONITOR_RCA = EXT_MONITOR_RCA;
   
    // LV crop area (black bars)
    os.x0   = hdmi_code >= 5 ?  75 - 120 : (hdmi_code == 2 ? 40 : EXT_MONITOR_RCA ? (video_system_pal ? 40 : 40) :    0);
    os.y0   = hdmi_code >= 5 ?   0 - 30  : (hdmi_code == 2 ? 24 : EXT_MONITOR_RCA ? (video_system_pal ? 29 : 25) :    0);
    os.x_ex = hdmi_code >= 5 ? 810 : (hdmi_code == 2 || EXT_MONITOR_RCA) ? 640 : 720;
    os.y_ex = hdmi_code >= 5 ? 540 : (hdmi_code == 2 || EXT_MONITOR_RCA) ? 388 : 480;
#if defined(CONFIG_4_3_SCREEN)
  yea baby ! that's it, right there the code i was hoping to find . Now the hard part figure out how I can change the Aspect ratio & reconfigure the frame size. Need to do a lot of research in to this  :D