Commit graph

5 commits

Author SHA1 Message Date
Niklas Haas
d5174f9e5b swscale/format: add source format info to ff_sws_encode_colors()
Specifically, I need access to this for generating a better dither matrix.
2025-12-15 14:31:58 +00:00
Niklas Haas
f8f7935a97 swscale/format: add new format decode/encode logic
This patch adds format handling code for the new operations. This entails
fully decoding a format to standardized RGB, and the inverse.

Handling it this way means we can always guarantee that a conversion path
exists from A to B without having to explicitly cover logic for each path;
and choosing RGB instead of YUV as the intermediate (as was done in swscale
v1) is more flexible with regards to enabling further operations such as
primaries conversions, linear scaling, etc.

In the case of YUV->YUV transform, the redundant matrix multiplication will
be canceled out anyways.
2025-09-01 19:28:36 +02:00
Niklas Haas
322f606fa8 swscale/format: add ff_fmt_clear()
Reset an SwsFormat to its fully unset/invalid state.
2025-09-01 19:27:53 +02:00
Niklas Haas
6072e27e9a swscale/graph: prefer bools to ints
This is more consistent with the rest of the newly added code, which
universally switched to using bools for boolean values.
2025-05-18 15:00:45 +02:00
Niklas Haas
ae84aa775f swscale/utils: split off format code into new file
utils.c is getting quite crowded, and I need a new place to dump a lot of
format handling code for the ongoing rewrite. Rather than bloating this file
even more, start splitting format handling helpers off into a new file.

This also renames the existing utils.h header, which didn't really contain
anything except the SwsFormat definition anyway (the prototypes for what should
have been in utils.h are all still in the legacy swscale_internal.h).
2025-03-14 19:50:44 +01:00
Renamed from libswscale/utils.h (Browse further)