avfilter: add negotiation API for color space/range

Motivated by YUVJ removal. This change will allow full negotiation
between color ranges and matrices as needed. By default, all ranges and
matrices are marked as supported.

Because grayscale formats are currently handled very inconsistently (and
in particular, assumed as forced full-range by swscale), we exclude them
from negotiation altogether for the time being, to get this API merged.

After filter negotiation is available, we can relax the
grayscale-is-forced-jpeg restriction again, when it will be more
feasible to do so without breaking a million test cases.

Note that this commit updates one FATE test as a consequence of the
sanity fallback for non-YUV formats. In particular, the test case now
writes rgb24(pc, gbr/unspecified/unspecified) to the matroska file,
instead of rgb24(unspecified/unspecified/unspecified) as before.
This commit is contained in:
Niklas Haas
2023-12-31 13:35:03 -08:00
parent e687a84854
commit 8c7934f73a
11 changed files with 406 additions and 10 deletions

View File

@@ -203,6 +203,12 @@ enum FilterFormatsState {
*/
int ff_fmt_is_in(int fmt, const int *fmts);
/**
* Returns true if a pixel format is "regular YUV", which includes all pixel
* formats that are affected by YUV colorspace negotiation.
*/
int ff_fmt_is_regular_yuv(enum AVPixelFormat fmt);
/* Functions to parse audio format arguments */
/**