AOMediaCodec / libavif

libavif - Library for encoding and decoding .avif files
Other
1.53k stars 195 forks source link

Signal gain map transformative properties #2197

Closed y-guyon closed 3 months ago

y-guyon commented 3 months ago

This PR does not check for properties tied to the tone mapping derived image item, but it could. Combining chained same-type transformative properties into one should be doable, although probably a hassle to implement. I suggest returning NOT_IMPLEMENTED when both tmap and input items have transformative properties for now.

y-guyon commented 3 months ago

I noticed that AVIF_TRANSFORM_PASP is part of avifImage::transformFlags but pasp is a Descriptive item property according to the HEIF spec,while clap, irot, and imir are transformative properties. Maybe there is no need to check pasp equality in this PR.

y-guyon commented 3 months ago

The commit message should have more detail. For example, it should mention the transformative properties of the gain map item have to match those of the primary item.

What about:

Signal gain map transformative properties

The bitstream now has to contain the same pasp, clap, irot, imir
properties for both the base and gain map image items used as input to
the tone-mapped derived image item. The tone-mapped derived image item
itself cannot be associated with these properties. This is enforced at
encoding. Other patterns are rejected at decoding.
Add explanation in write.c.

We should add a comment to document where this requirement comes from. Does this requirement come from a (draft) standard?

Yes. Is the explanation in the comments and in the commit message enough? Referring to a draft is not convenient.