Remove FillOrder tag - #207
Open
kmilos wants to merge 1 commit into
Open
Conversation
Author
|
Further evidence from the TIFF spec:
NB: the spec was written before ZIP/Deflate was introduced as an extension, but it doesn't matter because both produce a lossless byte stream output. Whether you feed 16, 24, or 32-bits into the compressor is irrelevant because they are whole bytes, and both the appropriate predictors and the compressor treat them as whole bytes input. Endianness only matters to perform the prediction step correctly, and FillOrder must be left at default value of 1. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default FillOrder is 1 anyway if absent. More details:
Upon closer inspection of TIFF technical Note 3 which is the basis for floating point DNGs, it appears there is no difference whatsoever in treatment of 16b vs 24b vs 32b floats.
The spurious paragraph in the DNG spec saying
"If BitsPerSample is not equal to 8 or 16 or 32, then the bits must be packed into bytes using the TIFF default FillOrder of 1 (big-endian)"
was there even before DNG 1.4 that introduced floating point (and IMHO should've been updated to include 24 bits), and the mentioned FillOrder tag is relevant only for bit packing order within a byte (not applicable at all in this case), and not byte endiannes.
HDRMerge is writing a compressed bytestream in the file anyway so the endiannes doesn't matter, but any confusion should be best avoided. Any assumption of big-endian for the float->fp24->float conversion is purely internal (defined by the predictor) and has nothing to do with how the bytes are actually stored in the TIFF/DNG file (a compressed bytestream looks the same for all floating point bit depths).