ffmpeg/tests/ref
Leo Izen 2548c32cc1
avcodec/png: use libavutil/csp.h for cHRM chunks
The cHRM chunk is descriptive. That is, it describes the primaries that should
be used to interpret the pixel data in the PNG file. This is notably different
from Mastering Display Metadata, which describes which subset of the presented
gamut is relevant. MDM describes a gamut and says colors outside the gamut are
not required to be preserved, but it does not actually describe the gamut that
the pixel data from the frame resides in. Thus, to decode a cHRM chunk present
in a PNG file to Mastering Display Metadata is incorrect.

This commit changes this behavior so the cHRM chunk, if present, is decoded to
color metadata. For example, if the cHRM chunk describes BT.709 primaries, the
resulting AVFrame will be tagged with AVCOL_PRI_BT709, as a description of its
pixel data. To do this, it utilizes libavutil/csp.h, which exposes a funcction
av_csp_primaries_id_from_desc, to detect which enum value accurately describes
the white point and primaries represented by the cHRM chunk.

This commit also changes pngenc.c to utilize the libavuitl/csp.h API, since it
previously duplicated code contained in that API. Instead, taking advantage of
the API that exists makes more sense. pngenc.c does properly utilize the color
tags rather than incorrectly using MDM, so that required no change.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-01-25 08:09:16 -05:00
..
acodec tests/ref: Remove unused reference files 2022-05-03 04:18:06 +02:00
fate avcodec/png: use libavutil/csp.h for cHRM chunks 2023-01-25 08:09:16 -05:00
lavf avformat/oggenc: don't flush twice when the last packet is side data only 2023-01-03 21:35:03 -03:00
lavf-fate avformat/matroskaenc: Don't waste bytes to Write Tag length fields 2022-06-20 23:42:28 +02:00
pixfmt fate/pixfmt: test xyz12le 2021-08-29 18:44:46 +02:00
seek avcodec/svq1enc: do not use ambiguous interframe mean symbols 2022-11-01 09:24:29 +11:00
vsynth avcodec/svq1enc: output ident string in extradata field 2022-11-01 09:24:29 +11:00