aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ref/fate/png-side-data
diff options
context:
space:
mode:
authorLeo Izen <leo.izen@gmail.com>2023-01-17 11:09:29 -0500
committerLeo Izen <leo.izen@gmail.com>2023-01-25 08:09:16 -0500
commit2548c32cc10f256cc0ff90457631ef7ef94070af (patch)
tree4b869f29ca8079402f3bded4faafa68b8bbe67f9 /tests/ref/fate/png-side-data
parent843a4467131fd677aacb46b8bbdea898e4fe12d5 (diff)
downloadffmpeg-2548c32cc10f256cc0ff90457631ef7ef94070af.tar.gz
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>
Diffstat (limited to 'tests/ref/fate/png-side-data')
-rw-r--r--tests/ref/fate/png-side-data13
1 files changed, 1 insertions, 12 deletions
diff --git a/tests/ref/fate/png-side-data b/tests/ref/fate/png-side-data
index f40f14fea1..a4c16eb395 100644
--- a/tests/ref/fate/png-side-data
+++ b/tests/ref/fate/png-side-data
@@ -25,7 +25,7 @@ interlaced_frame=1
top_field_first=0
repeat_pict=0
color_range=pc
-color_space=unknown
+color_space=gbr
color_primaries=unknown
color_transfer=unknown
chroma_location=unspecified
@@ -34,15 +34,4 @@ side_data_type=ICC profile
name=Photoshop ICC profile
size=3144
[/SIDE_DATA]
-[SIDE_DATA]
-side_data_type=Mastering display metadata
-red_x=63999/100000
-red_y=33001/100000
-green_x=30000/100000
-green_y=60000/100000
-blue_x=15000/100000
-blue_y=5999/100000
-white_point_x=31269/100000
-white_point_y=32899/100000
-[/SIDE_DATA]
[/FRAME]