Sony RX1 RAW file issue? An investigative report...

Started Dec 27, 2012 | Discussions thread
Iliah Borg Forum Pro • Posts: 23,006
Re: Sony RX1 RAW file issue? An investigative report...

The relevant piece of code to unpack ARW2 format

  • To comment on the code,
    • Pixels with odd and even numbers within one scan line are processed separately as they belong to different colour channels.
    • The scan line is cut into blocks each containing 16 sequential pixels belonging to the same colour channel.
    • For a 16-byte block the following data is recorded:
      • 11-bit maximimum value for this block.
      • 11-bit minimum value for this block.
      • 4-bit indices of min and max pixels in the block, that allows precise coding of those values using 4 bits.
      • 14 7-bit delta values, delta relative to the min value.
    • 7-bit data is converted to 11 bits by shifting to the left (0..4 bits shift) and adding min value from the block.
  • That is:
    • If the variations within the block are small (less than 128 ADC units) the compression is lossless. Even gradients should be rendered without any visual posterisation..
    • If the block contains a sharp edge or some pixel is noisy - the coding precision is 7 bits.
  • 11-bit data ("locally 7-bit data") is shifted 1 bit to the left and rendered through decompression curve.

For the Russian version and discussion please see Alex Tutubalin's blog

Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow