@reddeercity -- Looks like you're getting close but wow, that log file is very different from
the one @nickfreak posted from his 7D. What's going on with the Digic 5 lossless code is likely to apply to Digic 4. Of course getting any Digic 4 camera working with lossless compression is still quite a challenge. I would have thought that the 60D would be the first to work. Someone we know who is really good with ML code owns one.
One tip, the 5D2 should compile in the crop_rec_4k branch with this change:
src/raw.c
-#if defined(EVF_STATE) /* 60D and newer */
+#if defined(EVF_STATE) || defined(CONFIG_7D) /* 60D and newer */
#define BLACK_LEVEL 2047
#endif
So never mind my previous comment about juggling babies, we might as well jump onto this branch because it is where much of the current development is happening.
In the meantime I've been trying to run some tests in the hopes that the
Lossless Compression updates for all Digic 5 cameras pull request gets accepted. (a1ex did all the heavy lifting so...)
No, the idea is to feed larger images into the encoder (not necessarily with valid data - it will compress whatever it finds in memory), and keep height-1 for 0xC0F13068. Click on the links.
Thought I figured it out so I set up this elaborate test on the 700D and half-way through realized I was doing it all wrong because of this:
I meant, can you save full-res lossless DNG with height greater than 3528 on 700D/M?
(the answer will be useful as documentation, regarding what this register does - what we know about it; I don't care about that one pixel difference, I just want to know where that limit comes from)
Still, the test I ran was interesting so here it is.
What I did was to add this to see what was going on:
modules/silent/silent.c
ASSERT(out_suite->size == max_compressed_size);
+ printf("out_raw_info.width = %d\n", out_raw_info.width);
+ printf("out_raw_info.height = %d\n", out_raw_info.height);
+ printf("out_raw_info.active_area.y2 = %d\n", out_raw_info.active_area.y2);
out_raw_info.frame_size = lossless_compress_raw(&out_raw_info, out_suite);
With the console open it prints out the frame size being fed into lossless compression.
So, how to increase the image height? What we were working on a month ago culminated in this:
src/raw.c
#if defined(CONFIG_700D) || defined(CONFIG_650D)
(*height)++;
#endif
So, I decided to play around here:
(*height)--;
(*height)+=2;
etc...
Yeah--that wasn't the right thing to do. I probably should have done this right before the printf statements:
modules/silent/silent.c
(out_raw_info.height)+=3;
(out_raw_info.active_area.y2)+=3;
@a1ex - Is this what you want me to do with FRSP lossless?
In any case, the results I got were interesting, at least to me. Testing on the 700D.
(*height)--;Movie Mode
mv720:
out_raw_info.width = 1808
out_raw_info.height = 725
out_raw_info.active_area.y2 = 721
image = 1736x693
mv1080:
out_raw_info.width = 1808
out_raw_info.height = 1188
out_raw_info.active_area.y2 = 1184
image = 1736x1156
mv1080crop:
out_raw_info.width = 1872
out_raw_info.height = 1058
out_raw_info.active_area.y2 = 1056
image = 1800x1028
zoom:
out_raw_info.width = 2592
out_raw_info.height = 1106
out_raw_info.active_area.y2 = 1106
image = 2520x1080
Photo Mode
Simple silent - same as mv720?
out_raw_info.width = 1808
out_raw_info.height = 725
out_raw_info.active_area.y2 = 721
image = 1736x693
FRSP
out_raw_info.width = 5280
out_raw_info.height = 3528
out_raw_info.active_area.y2 = 3528
image = 5208x3476
No height adjustmentMovie Mode
mv720:
out_raw_info.width = 1808
out_raw_info.height = 726
out_raw_info.active_area.y2 = 722
image = 1736x694
mv1080:
out_raw_info.width = 1808
out_raw_info.height = 1189
out_raw_info.active_area.y2 = 1185
image = 1736x1157
mv1080crop:
out_raw_info.width = 1872
out_raw_info.height = 1059
out_raw_info.active_area.y2 = 1057
image = 1800x1029
zoom:
out_raw_info.width = 2592
out_raw_info.height = 1107
out_raw_info.active_area.y2 = 1107
image = 2520x1081
Photo Mode
Simple silent - same as mv720?
out_raw_info.width = 1808
out_raw_info.height = 726
out_raw_info.active_area.y2 = 722
image = 1736x694
FRSP
out_raw_info.width = 5280
out_raw_info.height = 3528
out_raw_info.active_area.y2 = 3528
image = 5208x3476
(*height)++; - This is the current code
Movie Mode
mv720:
out_raw_info.width = 1808
out_raw_info.height = 727
out_raw_info.active_area.y2 = 723
image = 1736x695
mv1080:
out_raw_info.width = 1808
out_raw_info.height = 1190
out_raw_info.active_area.y2 = 1186
image = 1736x1158
mv1080crop:
out_raw_info.width = 1872
out_raw_info.height = 1060
out_raw_info.active_area.y2 = 1058
image = 1800x1030
zoom:
out_raw_info.width = 2592
out_raw_info.height = 1108
out_raw_info.active_area.y2 = 1108
image = 2520x1082
Photo Mode
Simple silent - same as mv720?
out_raw_info.width = 1808
out_raw_info.height = 727
out_raw_info.active_area.y2 = 723
image = 1736x695
FRSP
out_raw_info.width = 5280
out_raw_info.height = 3528
out_raw_info.active_area.y2 = 3528
image = 5208x3476
(*height)+=2;Movie Mode
mv720:
out_raw_info.width = 1808
out_raw_info.height = 728
out_raw_info.active_area.y2 = 724
image = 1736x696 - ng
mv1080:
out_raw_info.width = 1808
out_raw_info.height = 1191
out_raw_info.active_area.y2 = 1187
image = 1736x1159
mv1080crop:
out_raw_info.width = 1872
out_raw_info.height = 1061
out_raw_info.active_area.y2 = 1059
image = 1800x1031 - ng
zoom:
out_raw_info.width = 2592
out_raw_info.height = 1109
out_raw_info.active_area.y2 = 1109
image = 2520x1083 - ng
Photo Mode
Simple silent - same as mv720?
out_raw_info.width = 1808
out_raw_info.height = 728
out_raw_info.active_area.y2 = 724
image = 1736x696 - ng
FRSP
out_raw_info.width = 5280
out_raw_info.height = 3528
out_raw_info.active_area.y2 = 3528
image = 5208x3476
(*height)+=3;Movie Mode
mv720:
out_raw_info.width = 1808
out_raw_info.height = 729
out_raw_info.active_area.y2 = 725
image = 1736x697 - white line bottom of frame
mv1080:
out_raw_info.width = 1808
out_raw_info.height = 1192
out_raw_info.active_area.y2 = 1188
image = 1736x1160 - ng
mv1080crop:
out_raw_info.width = 1872
out_raw_info.height = 1062
out_raw_info.active_area.y2 = 1060
image = 1800x1032
zoom:
out_raw_info.width = 2592
out_raw_info.height = 1110
out_raw_info.active_area.y2 = 1110
image = 2520x1084 - ng
Photo Mode
Simple silent - same as mv720?
out_raw_info.width = 1808
out_raw_info.height = 729
out_raw_info.active_area.y2 = 725
image = 1736x697 - ng
FRSP
out_raw_info.width = 5280
out_raw_info.height = 3528
out_raw_info.active_area.y2 = 3528
image = 5208x3476
Ok--you get the idea. Things are starting to break and FRSP isn't budging so let's really push it:
(*height)+=9;Movie Mode
mv720:
out_raw_info.width = 1808
out_raw_info.height = 735
out_raw_info.active_area.y2 = 731
image = 1736x703 - ng
mv1080:
out_raw_info.width = 1808
out_raw_info.height = 1198
out_raw_info.active_area.y2 = 1194
image = 1736x1166 - ng
mv1080crop:
out_raw_info.width = 1872
out_raw_info.height = 1068
out_raw_info.active_area.y2 = 1066
image = 1800x1038 - ng
zoom:
out_raw_info.width = 2592
out_raw_info.height = 1116
out_raw_info.active_area.y2 = 1116
image = 2520x1090 - ng
Photo Mode
Simple silent - same as mv720?
out_raw_info.width = 1808
out_raw_info.height = 735
out_raw_info.active_area.y2 = 731
image = 1736x703 - ng
FRSP
out_raw_info.width = 5280
out_raw_info.height = 3528
out_raw_info.active_area.y2 = 3528
image = 5208x3476
The raw buffer height and image size kept changing but it wasn't creating valid simple silent lossless compressed DNG files while FRSP wasn't affected in the least.
I'll try doing this test the right way tomorrow.