|
|
|
c460cd06a88ace94d7c76a6309aa8fb8 *tests/data/fate/png-icc.image2
|
|
|
|
49441 tests/data/fate/png-icc.image2
|
|
|
|
#tb 0: 1/25
|
|
|
|
#media_type 0: video
|
|
|
|
#codec_id 0: rawvideo
|
|
|
|
#dimensions 0: 128x128
|
|
|
|
#sar 0: 2835/2835
|
|
|
|
0, 0, 0, 1, 49152, 0xe0013dee
|
|
|
|
[FRAME]
|
|
|
|
media_type=video
|
|
|
|
stream_index=0
|
|
|
|
key_frame=1
|
|
|
|
pts=0
|
|
|
|
pts_time=0.000000
|
|
|
|
pkt_dts=0
|
|
|
|
pkt_dts_time=0.000000
|
|
|
|
best_effort_timestamp=0
|
|
|
|
best_effort_timestamp_time=0.000000
|
|
|
|
pkt_duration=1
|
|
|
|
pkt_duration_time=0.040000
|
|
|
|
duration=1
|
|
|
|
duration_time=0.040000
|
|
|
|
pkt_pos=0
|
|
|
|
pkt_size=49441
|
|
|
|
width=128
|
|
|
|
height=128
|
|
|
|
crop_top=0
|
|
|
|
crop_bottom=0
|
|
|
|
crop_left=0
|
|
|
|
crop_right=0
|
|
|
|
pix_fmt=rgb24
|
|
|
|
sample_aspect_ratio=1:1
|
|
|
|
pict_type=I
|
|
|
|
coded_picture_number=0
|
|
|
|
display_picture_number=0
|
|
|
|
interlaced_frame=0
|
|
|
|
top_field_first=0
|
|
|
|
repeat_pict=0
|
|
|
|
color_range=pc
|
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>
2 years ago
|
|
|
color_space=gbr
|
|
|
|
color_primaries=bt709
|
|
|
|
color_transfer=unknown
|
|
|
|
chroma_location=unspecified
|
|
|
|
[SIDE_DATA]
|
|
|
|
side_data_type=ICC profile
|
|
|
|
name=Photoshop ICC profile
|
|
|
|
size=3144
|
|
|
|
[/SIDE_DATA]
|
|
|
|
[/FRAME]
|