[FFmpeg-devel] [PATCH v4] avcodec/pngdec: read colorspace info when decoding with AVDISCARD_ALL

Kacper Michajlow kasper93 at gmail.com
Mon Dec 11 06:20:10 EET 2023


On Tue, 28 Feb 2023 at 20:46, Leo Izen <leo.izen at gmail.com> wrote:
>
> On 2/27/23 11:34, Leo Izen wrote:
> > On 2/21/23 17:35, Leo Izen wrote:
> >> These chunks are lightweight and it's useful information to have when
> >> running ffmpeg -i or ffprobe, for example.
> >> ---
> >>   libavcodec/pngdec.c          | 136 ++++++++++++++++++++++-------------
> >>   tests/ref/fate/png-icc       |   8 +--
> >>   tests/ref/fate/png-side-data |   2 +-
> >>   3 files changed, 91 insertions(+), 55 deletions(-)
> >>
> >> diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
> >
> > I will push this soon-ish if there's no other objections.
> >
> > - Leo Izen (thebombzen)
> >
> >
>
> Pushed as fadfa147f812a3fe9e68723347d37b9cccd6222d.

Hi, Sorry for digging this old patch, but I'm curious.

What does "unsupported tv-range cICP chunk\n" and "we only support
pc-range RGB" mean?

Before this patch the range was properly set:
avctx->color_range = f->color_range =
            s->cicp_range == 0 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;

Now it is ignored with a warning. Neither commit message, nor the
comments in the code explain why the cICP range is now ignored in the
decoder and the frames are no longer tagged with proper color range.

As I understand the goal of the commit was to expose colorspace info
when AVDISCARD_ALL. Was cICP range change intentional?

Thanks,
Kacper


More information about the ffmpeg-devel mailing list