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

@@ -38,6 +38,10 @@ int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
&avctx->outputs[0]->incfg.formats)) < 0)
return err;
if ((err = ff_set_common_all_color_spaces(avctx)) < 0 ||
(err = ff_set_common_all_color_ranges(avctx)) < 0)
return err;
return 0;
}