video-converter: Skip input lines where possible.
authorJan Schmidt <jan@centricular.com>
Wed, 4 Nov 2020 17:43:47 +0000 (04:43 +1100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 5 Nov 2020 07:14:20 +0000 (07:14 +0000)
commitcb9799e942cc8e83f85faea00a6735cf8e1fc6bb
tree5c9567fabe580f6ab2103309f2706fcdc862f66a
parentf51b3fcd26bd23b1356aedc5cf4afa39ea636cbe
video-converter: Skip input lines where possible.

There is a case where there are no lines in the temp cache, and
it's possible to skip straight to the request line and not generate
intermediate ones. This is really only beneficial when doing
nearest-neighbour downscaling, as other methods generally require
all input lines sequentially to generate the output. In that case,
this change has no effect and all lines are generated and cached
as before.

As a side effect however, this fixes corruption when downscaling
using nearest-neighbour, as interactions with the pass_alloc flag
and reuse of temporary lines causes the unecessarily-generated
cache lines to overwrite the final output.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/919>
gst-libs/gst/video/video-converter.c