FujiFilm compressed RAF support (X-Pro2, more cameras expected)
We just opensourced X-Pro2 compressed decoder created /reverse-engineered by Alexey Danilchenko and contributed to LibRaw.
Here is the code:
- as branch: https://github.com/LibRaw/LibRaw/tree/xtrans-compressed
- as single commit: https://github.com/LibRaw/LibRaw/commit/aeab4d8ea58f85050d1253bdc41f51baa79ffe65
The code is written 'as separate from LibRaw as possible' to easy adaptation in other software. There are four points of interaction:
- parse_xtrans_header() is called if data size is not width_height_2 (so, not uncompressed format), it checks fields in compressed data block start and sets four variables (libraw_internal_data.unpacker_data.fuji_*) for further re-use.
- xtrans_compressed_load_raw() called after raw buffer allocation and performs decoding. It calls
- xtrans_decode_loop() which, in turn calls
- xtrans_decode_strip(). xtrans_decode_loop() may be converted to parallel calls (if locking is implemented in file reading to make sure seek/read pairs works as expected)
- File read is performed in fuji_fill_buffer()
- And copying decoded data to place is in copy_line_to_xtrans()
The code works faster than Fuji's SDK (used by Adobe, Irridient, Silkypix) even in single-thread mode.
So, feel free to include this into RawSpeed.
Will this be added soon?
@lucashungaro As soon as someone with coding knowledge, free time, and interest in the subject 'ports' the code.
a lot of fuji shooters would love to see this implemented. hope it will be added soon :)
@LebedevRI oh, I see. I misunderstood it was "ready", just waiting for integration.
I'm going to work on this soon. I've created some work in progress code.
Looks like some work where done here: https://github.com/muessel/rawspeed