rawspeed icon indicating copy to clipboard operation
rawspeed copied to clipboard

FujiFilm compressed RAF support (X-Pro2, more cameras expected)

Open LibRaw opened this issue 9 years ago • 6 comments

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.

LibRaw avatar May 13 '16 06:05 LibRaw

Will this be added soon?

lucashungaro avatar Nov 23 '16 00:11 lucashungaro

@lucashungaro As soon as someone with coding knowledge, free time, and interest in the subject 'ports' the code.

LebedevRI avatar Nov 23 '16 11:11 LebedevRI

a lot of fuji shooters would love to see this implemented. hope it will be added soon :)

mherke avatar Nov 23 '16 13:11 mherke

@LebedevRI oh, I see. I misunderstood it was "ready", just waiting for integration.

lucashungaro avatar Nov 23 '16 13:11 lucashungaro

I'm going to work on this soon. I've created some work in progress code.

kanru avatar Dec 27 '16 09:12 kanru

Looks like some work where done here: https://github.com/muessel/rawspeed

MtP76 avatar Apr 10 '17 09:04 MtP76