mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-22 13:50:57 +08:00
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@haasn.dev> Sponsored-by: Sovereign Tech Fund