1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/tests
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
..
api tests/api: use AVFrame.duration instead of AVFrame.pkt_duration 2022-07-19 12:27:18 +02:00
checkasm checkasm/v210dec: add extra space to the destination arrays 2022-12-21 00:36:49 +01:00
fate lavf/spdifdec: support EAC3 2023-01-13 11:22:59 -06:00
filtergraphs tests: use a filtergraph script for fate-mov-channel-description 2022-04-05 21:25:26 -03:00
ref avcodec/png: use libavutil/csp.h for cHRM chunks 2023-01-25 08:09:16 -05:00
.gitignore
audiogen.c
audiomatch.c
base64.c
copycooker.sh
extended.ffconcat lavf/concat: deprecate file_packet_metadata 2021-09-16 10:17:59 +02:00
fate-run.sh tests/fate-run: Allow to set input options for encoding pass 2022-09-10 01:38:07 +02:00
fate-valgrind.supp
fate.sh libavresample: Remove deprecated library 2021-04-27 10:43:13 -03:00
Makefile fate/segafilm: Add tests for segafilm (de)muxer 2022-09-20 18:32:28 +02:00
md5.sh
refcmp-metadata.awk fate/filter-refcmp-*: make refcmp_metadata fail on empty or truncated input 2022-04-10 20:12:23 +02:00
reference.pnm
rotozoom.c
simple1.ffconcat lavf/concat: deprecate file_packet_metadata 2021-09-16 10:17:59 +02:00
simple2.ffconcat tests/concat-demuxer: add stream_meta test 2021-09-16 10:17:59 +02:00
test.ffmeta
tiny_psnr.c
tiny_ssim.c test: tiny_ssim: Don't include config.h 2022-03-30 14:56:07 +03:00
utils.c
videogen.c