This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 34501921fdc38366930ac2eb3b0c4d2a615af6bb Author: DROOdotFOO <[email protected]> AuthorDate: Tue May 19 13:31:50 2026 +0200 Commit: Martin Storsjö <[email protected]> CommitDate: Fri May 22 10:03:07 2026 +0000 tests/checkasm/sw_yuv2rgb: cover nv12 and nv21 The previous chroma stride formula (width >> log2_chroma_w) is correct for planar yuv but wrong for semi-planar nv12/nv21, where the UV plane is interleaved at width bytes per row (width/2 UV pairs of 2 bytes each). Use av_image_get_linesize() so the test feeds a valid stride to libswscale regardless of input format; for the existing planar suites the value is unchanged. With the stride fixed, add nv12 and nv21 to check_yuv2rgb() so the upcoming NEON 16bpp paths get bench coverage. ff_get_unscaled_swscale does not wire a C yuv2rgb fast path for these inputs, so the suites report bench-only (no correctness reference); they still run clobber detection and cycle counts. Signed-off-by: DROOdotFOO <[email protected]> --- tests/checkasm/sw_yuv2rgb.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/checkasm/sw_yuv2rgb.c b/tests/checkasm/sw_yuv2rgb.c index 07b967b168..2b3b1eec61 100644 --- a/tests/checkasm/sw_yuv2rgb.c +++ b/tests/checkasm/sw_yuv2rgb.c @@ -19,6 +19,7 @@ #include <string.h> #include "libavutil/common.h" +#include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "libavutil/pixdesc.h" @@ -144,10 +145,14 @@ static void check_yuv2rgb(int src_pix_fmt) int width = input_sizes[isi]; int srcSliceY = 0; int srcSliceH = NUM_LINES; + /* Use av_image_get_linesize so that semi-planar formats (NV12, + * NV21) get the correct interleaved-UV stride (= width bytes), + * not (width >> log2_chroma_w) which would only count UV pairs. */ + int chroma_linesize = av_image_get_linesize(src_pix_fmt, width, 1); int srcStride[4] = { width + SRC_STRIDE_PAD, - (width >> src_desc->log2_chroma_w) + SRC_STRIDE_PAD, - (width >> src_desc->log2_chroma_w) + SRC_STRIDE_PAD, + chroma_linesize + SRC_STRIDE_PAD, + chroma_linesize + SRC_STRIDE_PAD, width + SRC_STRIDE_PAD, }; int dstStride[4] = { @@ -239,4 +244,8 @@ void checkasm_check_sw_yuv2rgb(void) report("yuv422p"); check_yuv2rgb(AV_PIX_FMT_YUVA420P); report("yuva420p"); + check_yuv2rgb(AV_PIX_FMT_NV12); + report("nv12"); + check_yuv2rgb(AV_PIX_FMT_NV21); + report("nv21"); } _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
