[FFmpeg-devel] [PATCH v2 5/6] avutil/csp: add EOTF function definitions
Michael Niedermayer
michael at niedermayer.cc
Sun Dec 1 03:56:31 EET 2024
Hi
On Sat, Nov 30, 2024 at 03:27:53PM +0100, Niklas Haas wrote:
> On Sat, 30 Nov 2024 15:23:50 +0100 Niklas Haas <ffmpeg at haasn.xyz> wrote:
> > From: Niklas Haas <git at haasn.dev>
> >
> > The existing av_csp_trc_func_from_id() mostly implements the OETF, except for
> > PQ. As such, we are currently missing a precise definition of an ITU-R EOTF.
> > Introduce the new functions av_csp_itu_eotf() and av_csp_itu_eotf_inv(), to fill
> > this void. Note that this is not possible in all cases, e.g. AVCOL_TRC_LOG which
> > has no corresponding EOTF definition in any ITU-R standard.
> >
> > Note that we cannot implement the proper HLG and SMPTE 428 OOTFs without access
> > to all three color channels, because they are not independent per channel. As a
> > result, we need to define a new type to encapsulate a color triplet. I have
> > tentatively named this AVColor, in the hopes that it will become useful in other
> > contexts as well. The choice of an array rather than explicitly named fields is
> > to greatly simplify per-channel processing, matrix multiplications, and the
> > like.
>
> Forgot to update the commit message. I decided to nuke AVColor in favor of
> passing a double[3] directly. It only makes the code inside the test framework
> marginally less pretty, and actually improves the usability of the API in other
> contexts IMO.
>
> > ---
> > doc/APIchanges | 4 +
> > libavutil/csp.c | 205 ++++++++++++++++++++++++++++++++++++++++++++
> > libavutil/csp.h | 33 +++++++
> > libavutil/version.h | 2 +-
> > 4 files changed, 243 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index db72121a61..12a2165837 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2024-03-07
> >
> > API changes, most recent first:
> >
> > +2024-11-25 - xxxxxxxxxx - lavu 59.49.100 - csp.h
> > + Add struct AVColor, type av_csp_eotf_function, av_csp_itu_eotf() and
This still talks about AVColor
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Some people wanted to paint the bikeshed green, some blue and some pink.
People argued and fought, when they finally agreed, only rust was left.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241201/9c3faa23/attachment.sig>
More information about the ffmpeg-devel
mailing list