1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00
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
..
aic
amv
ast
2022-11-06 14:39:27 +01:00
bfi
2022-11-06 14:39:27 +01:00
2022-11-06 14:39:27 +01:00
crc
dpx
2022-07-19 12:27:18 +02:00
2023-01-24 23:58:00 +01:00
imf
2022-11-03 21:16:10 +10:00
2022-07-19 12:27:18 +02:00
jv
lfg
m4v
md5
mkv
2022-07-19 12:27:18 +02:00
mtv
2022-09-20 11:26:00 +02:00
2023-01-24 23:58:00 +01:00
opt
ptx
rl2
2022-10-02 20:27:36 +02:00
sha
2022-11-06 14:39:27 +01:00
smc
2023-01-06 10:49:42 +01:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2023-01-13 11:22:59 -06:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
tea
thp
tmv
2023-01-24 23:58:00 +01:00
2023-01-24 23:58:00 +01:00
2022-11-06 14:39:27 +01:00
url
vb
vp4
vp5
vp7
vqc
2022-11-07 16:08:35 +11:00
w64
yop