-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fujifilm compressed RAF support. #107
Fujifilm compressed RAF support. #107
Conversation
|
Hi. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make CI happy :)
The code is far from ideal, which is quite understandable, but it will be easier for me to fix it after merging as-is...
| This library is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU Lesser General Public | ||
| License as published by the Free Software Foundation; either | ||
| version 2 of the License, or (at your option) any later version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.Hmm, where did you get that?
LibRaw/LibRaw@aeab4d8#diff-03b018f1deeb8fc38d2c927f09465635R11 says:
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+ (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
+(2 vs 2.1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it enough to change the version from 2 to 2.1 or do I have to copy the whole LibRaw license header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is enough just to change the version.
| <ColorRow y="4">GGRGGB</ColorRow> | ||
| <ColorRow y="5">RBGBRG</ColorRow> | ||
| </CFA2> | ||
| <Crop x="0" y="6" width="-16" height="0"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, so they are even writing different raw image WxH in compressed vs. uncompressed formats..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, uncomressed and comressed files are totally different, eg.:
exiftool Fujifilm\ -\ X-T20\ -\ compressed\ (3-2).RAF
...
Raw Image Width : 6032
Raw Image Height : 4032
Raw Image Full Width : 6048
Raw Image Full Height : 4038
exiftool Fujifilm\ -\ X-T20\ -\ Uncompressed\ (3-2).RAF
...
Raw Image Width : 6032
Raw Image Height : 4032
Raw Image Full Width : 6160
Raw Image Full Height : 4032
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is what i was talking about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muessel
An entry for FUJIFILM X100F is missing.
Is there some problem with that camera, or it is a simple oversight?
| info->cur_bit = (8 - (bits_left_in_byte & 7)) & 7; | ||
| } | ||
|
|
||
| int FujiDecompressor::bitDiff(int value1, int value2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int __attribute__(const) FujiDecompressor::bitDiff(int value1, int value2) {
| auto id = mRootIFD->getID(); | ||
| const Camera* cam = meta->getCamera(id.make, id.model, mRaw->metadata.mode); | ||
| if (!cam) | ||
| ThrowRDE("Couldn't find camera %s %s", id.make, id.model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ThrowRDE("Couldn't find camera %s %s", id.make.c_str(), id.model.c_str());
| public: | ||
| FujiDecompressor(Buffer input, RawImage img, int offset); | ||
| ~FujiDecompressor(void); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess you want to add
using ushort = ushort16;
right here for now.
|
Ok, i see. |
|
Travis CI has problems with mac builds with std::abs. Do I have to change them to abs and then include "using std::abs;" ? |
|
Will fix locally, thank you! |
|
Hello Roman,
I just forgot the the X100F also supports the compressed format.
I've seen you also implemented support for the GFX 50S. In the method
FujiDecompressor::copy_line_to_bayer
a static CFA is used. Maybe this should be converted into something
configurable like with the X-Trans sensors.
Regards
Uwe
2017-06-24 13:22 GMT+02:00 Roman Lebedev <notifications@github.com>:
… ***@***.**** commented on this pull request.
------------------------------
In data/cameras.xml
<#107 (comment)>
:
> @@ -8598,6 +8598,19 @@
<Crop x="0" y="0" width="-128" height="0"/>
<Sensor black="1024" white="16383"/>
</Camera>
+ <Camera make="FUJIFILM" model="X-Pro2" mode="compressed">
+ <ID make="Fujifilm" model="X-Pro2">Fujifilm X-Pro2</ID>
+ <CFA2 width="6" height="6">
+ <ColorRow y="0">GGRGGB</ColorRow>
+ <ColorRow y="1">GGBGGR</ColorRow>
+ <ColorRow y="2">BRGRBG</ColorRow>
+ <ColorRow y="3">GGBGGR</ColorRow>
+ <ColorRow y="4">GGRGGB</ColorRow>
+ <ColorRow y="5">RBGBRG</ColorRow>
+ </CFA2>
+ <Crop x="0" y="6" width="-16" height="0"/>
@muessel <https://github.com/muessel>
An entry for FUJIFILM X100F is missing.
Is there some problem with that camera, or it is a simple oversight?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#107 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADnzUfFnwWiZHlr3NnBgj9G4aaRCtmwTks5sHPFqgaJpZM4OD7TO>
.
|
Yeah, i checked, and X100F compressed works too, fixed in branch. What i'm currently missing is some compressed .RAF with 12-bits data, so this branch is taken: rawspeed/src/librawspeed/decompressors/FujiDecompressor.cpp Lines 106 to 110 in fae7f40
I think, it is produced in high-speed continuous shooting mode, 14/12/8/whaever fps. |
All that is very strange. If that is the actual code used in current libraw, then it may mean two things (both can be valid at the same time):
|
|
What i'm currently missing is some compressed .RAF with 12-bits data, so
this branch is taken:
https://github.com/darktable-org/rawspeed/blob/
fae7f40/src/librawspeed/decompressors/
FujiDecompressor.cpp#L106-L110
I think, it is produced in high-speed continuous shooting mode,
14/12/8/whaever fps.
I've tested it on my X-T2 with 8fps mechanical shutter and 11/14 fps
electronical shutter. The .RAFs are all 14bit according to the code
mentioned above.
|
Uwe, just my 2¢ (I know Roman will fix or has already fixed it): Most often the
That causes trouble again and again, and that's most probably the case here also. The best solution usually is to use HTH, |
|
Update: still no sign of that elusive 12bit sample, and no reply from @LibRaw. |
Hello,
this pull request implements support for Fujifilm compressed RAF Files for the X-Pro2, X-T2 and X-T20. The code is based on LibRaw / rawtherapee.