[FFmpeg-devel] [PATCH v2 02/13] avcodec: add extended AVCodec color metadata

Niklas Haas ffmpeg at haasn.xyz
Sat Oct 14 16:40:33 EEST 2023


On Sat, 14 Oct 2023 09:31:32 -0400 Leo Izen <leo.izen at gmail.com> wrote:
> On 10/13/23 10:24, Niklas Haas wrote:
> > From: Niklas Haas <git at haasn.dev>
> > 
> > This is motivated primarily by a desire for YUVJ removal, which will
> > require signalling the supported color ranges as part of the codec
> > capabilities. But since we're here anyway, we might as well add all of
> > the metadata, which I foresee seeing more use in the future (e.g.
> > automatic conversion from HDR to SDR when encoding to formats that don't
> > support AVCOL_TRC_SMPTE2084, ...)
> > ---
> > +
> > +    /* Extended colorspace support metadata */
> > +    const enum AVColorSpace *csps;                  ///< array of supported color spaces, or NULL if unknown, array is terminated by AVCOL_SPC_UNSPECIFIED
> > +    const enum AVColorRange *color_ranges;          ///< array of supported color ranges, or NULL if unknown, array is terminated by 0
> > +    const enum AVChromaLocation *chroma_locs;       ///< array of supported chroma locations, or NULL if unknown, array is terminated by 0
> > +    const enum AVColorPrimaries *primaries;         ///< array of supported color primaries, or NULL if unknown, array is terminated by 0
> > +    const enum AVColorTransferCharacteristic *trcs; ///< array of supported transfer characteristics, or NULL if known, array is terminated by 0
> >   } AVCodec;
> 
> 
> Any particular reason we're using AVCOL_SPC_UNSPECIFIED to terminate 
> csps, but not using AVCOL_PRI_UNSPECIFIED for the primaries and the 
> equivalent for the TRC? It seems a bit more consistent than using RESERVED0

To be clear, we are - AVCOL_PRI/TRC_UNSPECIFIED are equal to 0, unlike
the other fields. But I could change the comments here for clarity.


More information about the ffmpeg-devel mailing list