Skip to content
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

uncompressed: support version 1 boxes #1132

Closed
wants to merge 2 commits into from

Conversation

bradh
Copy link
Contributor

@bradh bradh commented Feb 26, 2024

This adds support for parsing uncompressed heif files using version 1 of the uncC box, which is a shortcut for simple RGB, RGBA and ABGR files at 8bpp.

I looked at trying to synthesize the extra box (cmpd) at parse time. That didn't work out, because the item property association then didn't line up. Instead, the extra boxes are produced when the item properties are requested.

@farindk
Copy link
Contributor

farindk commented Jun 25, 2024

I'm not sure if we should go with the 'implied boxes' concept. When we add the planned low-level boxes interface to modify existing files and copy over raw boxes, the 'implied boxes' will always be a special case that has to be taken care of.

Two alternative proposals:

  • the uncompressed codec looks for both variants and then internally generates the implied boxes. They are never visible outside the uncompressed codec.
  • we do not generate implied boxes at all, but you have an abstract interface to extract the data so that it is completely transparent to the codec whether it is coming from the minimized form or not.

@bradh
Copy link
Contributor Author

bradh commented Jun 25, 2024

We should definitely look at what is coming for the metabox V1 proposal - see
https://www.mpeg.org/wp-content/uploads/mpeg_meetings/146_Rennes/w23988.zip

On the second alternative, I considered whether we might use the visitor pattern. So each property would be called with the image data and transform it if needed. However that looked like quite a lot of redesign, and would also be a bit difficult to invert for the "which tiles to correspond to a ROI?" case.

@farindk
Copy link
Contributor

farindk commented Jun 25, 2024

On the second alternative, I considered whether we might use the visitor pattern. So each property would be called with the image data and transform it if needed. However that looked like quite a lot of redesign, and would also be a bit difficult to invert for the "which tiles to correspond to a ROI?" case.

Yes, that sounds like too much for me. I was thinking about something much simpler. Could be just a large data-structure that holds all information from the uncC box, irrespective how it was read.
I have something slightly similar in the Box_cmin where there is a RelativeIntrinsicMatrix, which is the data as it is stored in the box and an AbsoluteIntrinsicMatrix, which is the data the library works with.
In a similar way, you could have a type (e.g. UncompressedConfiguration) that holds all the information independent from any box implementation, and fill this either from the separate boxes or the minimized box.

@bradh
Copy link
Contributor Author

bradh commented Jun 26, 2024

See #1198 for an alternative approach.

@bradh bradh closed this Jun 26, 2024
@bradh bradh deleted the uncc_ver1 branch June 26, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants