[FFmpeg-devel] [PATCH 20/24] sws: add a function for scaling dst slices

Michael Niedermayer michael at niedermayer.cc
Tue Jun 1 16:02:27 EEST 2021


On Mon, May 31, 2021 at 09:55:11AM +0200, Anton Khirnov wrote:
> Currently existing sws_scale() accepts as input a user-determined slice
> of input data and produces an indeterminate number of output lines.

swscale() should return the number of lines output
it does "return dstY - lastDstY;"


> Since the calling code does not know the amount of output, it cannot
> easily parallelize scaling by calling sws_scale() simultaneously on
> different parts of the frame.
> 
> Add a new function - sws_scale_dst_slice() - that accepts as input the
> entire input frame and produces a specified slice of the output. This
> function can be called simultaneously on different slices of the output
> frame (using different sws contexts) to implement slice threading.

an API that would allow starting before the whole frame is available
would have reduced latency and better cache locality. Maybe that can
be added later too but i wanted to mention it because the documentation
exlicitly says "entire input"

Also there are a few tables between the multiple SwsContext which are
identical, it would be ideal if they can be shared between threads
I guess such sharing would need to be implemented before the API is
stable otherwise adding it later would require application to be changed

Thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210601/eef97086/attachment.sig>


More information about the ffmpeg-devel mailing list