[FFmpeg-devel] [PATCH] swscale/output: fix bilinear yuv2rgb chroma interpolation

Michael Niedermayer michael at niedermayer.cc
Sat Dec 21 03:48:10 EET 2024


On Tue, Dec 17, 2024 at 02:11:30PM +0100, Niklas Haas wrote:
> From: Niklas Haas <git at haasn.dev>
> 
> These functions were divided into two special cases; one assuming that
> uvalpha == 0, and the other assuming that uvalpha == 2048. This worked fine
> for simple 2x chroma upscaling but broke for e.g. yuv410p, non-centered chroma,
> or other special cases that involved non-aligned chroma filters.
> 
> Fix it by instead dividing this check into two cases, a uvalpha==0 fast path
> and a uvalpha>0 general path. Instead of (A+B)/2 the general path now multiplies
> in the true uvalpha weight.
> 
> I tried preserving the old fast path for the case of uvalpha == 2048, but this
> was significantly slower in practise versus having just one general path.
> However, we still need a uvalpha == 0 path for the unscaled case.
> 
> Fixes: ticket #5083
> Signed-off-by: Niklas Haas <git at haasn.dev>
> Sponsored-by: Sovereign Tech Fund
> ---
>  libswscale/output.c | 36 ++++++++++++++++++++++++------------
>  1 file changed, 24 insertions(+), 12 deletions(-)

should be ok

thx

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

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- 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/20241221/273a5092/attachment.sig>


More information about the ffmpeg-devel mailing list