1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

swscale: introduce new, dynamic scaling API

As part of a larger, ongoing effort to modernize and partially rewrite
libswscale, it was decided and generally agreed upon to introduce a new
public API for libswscale. This API is designed to be less stateful, more
explicitly defined, and considerably easier to use than the existing one.

Most of the API work has been already accomplished in the previous commits,
this commit merely introduces the ability to use sws_scale_frame()
dynamically, without prior sws_init_context() calls. Instead, the new API
takes frame properties from the frames themselves, and the implementation is
based on the new SwsGraph API, which we simply reinitialize as needed.

This high-level wrapper also recreates the logic that used to live inside
vf_scale for scaling interlaced frames, enabling it to be reused more easily
by end users.

Finally, this function is designed to simply copy refs directly when nothing
needs to be done, substantially improving throughput of the noop fast path.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas
2024-11-21 14:09:49 +01:00
parent bf738412e8
commit 2a091d4f2e
7 changed files with 276 additions and 30 deletions

View File

@@ -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 - lsws 8.12.100 - swscale.h
Allow using sws_frame_scale() dynamically, without first initializing the
SwsContext. Deprecate sws_init_context(). Add sws_frame_setup() instead.
2024-11-25 - xxxxxxxxxx - lsws 8.11.100 - swscale.h
Replace #define-based SWS_* flags by enum SwsFlags.