From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 03D504C267 for ; Sun, 8 Feb 2026 21:18:35 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'j9K9HSHzlLNw47tAIS9RL9ZQtiVC9GMRxt3IgPJCZLI=', expected b'lVMpkwWPzteSyh1XP7j+xD3tTP19+uwsDFhzXJU4nkQ=')) header.d=christle.is header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1770585445; h=date : to : message-id : in-reply-to : references : mime-version : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=vJurUzvRibLZM3bA1xAfGjk5WME2sVajAyRwTD+/CQI=; b=ZgxFHSSQKjmO7M2iLnXwG/nqtdy9DCVxhbIhcZOJVTJNrVQSktZ5vqKLEsDLgnTCsG3N1 qBpubznRV+umOelThHILyjZYbL992FBzw9+yOuWndX5AZyh/pVCZZy9ow2OpGErHGWwvRwn E0/gowvQzaOhgNxeFCBnG89mAATf7MLplmk47yHKGx1suuQ/qYPaBYAdc9yD8Ev/c4X3C3T pf6a4th6cPpdl4xhnUCO00QKnyb0tEG/pS0BKJcD1puFCmJlNsjr3ED+utfHBitV8a1f7td hjtO2EfURElvtJXh6ylQ+EGFO57BFQy6s8JZSy3yfuJ69RhT1oq1XZAf3nLg== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 34E7E69117C; Sun, 8 Feb 2026 23:17:25 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1770585412; b=aRvCMxvPM2gJ4S4gaXswU6Y0pNuGeJ8oT2SHpt60TtXH8EW90mV39/N2xR/k4c9lsh5IK F3CuT2bVKCcqfaGTTWS95dzv40KvreqhEs5PHUqA72MOmEqaZEMbFRiP4MAT2NhJdkUqA+R jbM5QrLy9I+DcQ69PkrRgXwsf82YJ3tbzI8i71xmdGwtvOa0ioxnGC2g1hRpEg17rMiJ0gN HNQxluQGlnLQIY8MB/1n2RLdzW++0DmYRJCe8SHZA1LKyd7Ouu6MuMPDGtb2S861DRSrDRs dRzQIb/40IsVXTjIywESntIicKklKAIu0pAOCcyv6nn+JhszQy50M5Ut4pWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1770585412; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=j9K9HSHzlLNw47tAIS9RL9ZQtiVC9GMRxt3IgPJCZLI=; b=p2soqrY4u/58zdwcFLyYNsQDrCCrMSJ7sd5QPCw6uF4cW1kbe7+mqGzHe1lHmClY+LF6d OaDvIhxZMl4kZHTtZp4GSnD6QwB3Wc7N5j5mclnnOU9owgek7pYNjylcST+ccNKP0LE8rFm 6AWOhuxKsQE7Br7dPeU4cSS+OBgi9I2CEU2ixOOSDVWKVp6g8RlzFbjtzkfakUtVZ/sQrvF ylbNWuZSL6yFNtsG+Qs1G2FJ2N/gP2XS/2sWjLiEh8jOaQdtsi/qf4sf3e+rm5aZ6RaKgty zwow117ppfOHWHGDxxmDsYGNINco+NY82iZrpvHD5GEWcodkmRriy0skkguw== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=christle.is; arc=none; dmarc=pass header.from=christle.is policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=christle.is; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=christle.is policy.dmarc=quarantine Received: from mail-4398.protonmail.ch (mail-4398.protonmail.ch [185.70.43.98]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id D038868EB77 for ; Sun, 8 Feb 2026 23:16:08 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=christle.is; s=protonmail2; t=1770585368; x=1770844568; bh=lVMpkwWPzteSyh1XP7j+xD3tTP19+uwsDFhzXJU4nkQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=f7ci7sy6ZX26LafrEqiUd+GKj9dSWnyvVzVlOG+UWpnvweWdA9JRdyi1bxERMPM8n CPP5l55X9zv6/KHvJWkCfHIQ+4lYR1bAkMzbA3Rlu6Riloyc/pC3PRuW3VEL+kfNC9 ZkPuVQr1WJQ7oxmCPjtTi9v6O/DIEqYgJhZWI0ewrSoCRYSA+XjyOKecr3Gc17oyie ze0EA0seVsV3+6jJZzOeOLO1UPs6eejid0n0qIBoNWkswfXWCMgZtghgOVzU7ZvCkV h9KHdPY6XSZjpsA5AnRknTCEYoKnj2/l4+KHMsvuVyAFgIUsyUJJXCkS+dTeFnTVv/ AV0zQPHpl3YEg== Date: Sun, 08 Feb 2026 21:16:03 +0000 To: ffmpeg-devel@ffmpeg.org Message-ID: <20260208211537.91515-2-dev@christle.is> In-Reply-To: <20260208211537.91515-1-dev@christle.is> References: <20260206064418.58375-1-dev@christle.is> <20260208211537.91515-1-dev@christle.is> Feedback-ID: 179972264:user:proton X-Pm-Message-ID: d7290e2a753a4abcab04df1c503f2c303f337378 MIME-Version: 1.0 Message-ID-Hash: 5L3A3JMAEMTORHA6AWRCY7R5G5NTQDIF X-Message-ID-Hash: 5L3A3JMAEMTORHA6AWRCY7R5G5NTQDIF X-MailFrom: SRS0=jq/I=AM=christle.is=dev@ffmpeg.org X-Mailman-Rule-Hits: member-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH v2 1/3] swscale/loongarch: fix LASX YUV2RGB residual for multi-row slices List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: David Christle via ffmpeg-devel Cc: David Christle Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: The res variable (pixel residual count for widths not divisible by 16) is computed once before the row loop, but DEALYUV2RGBLINERES and DEALYUV2RGBLINERES32 destructively subtract 8 from it inside the loop body. When srcSliceH > 2, subsequent row pairs get an incorrect residual count, producing wrong output for the tail pixels. Fix by recomputing res from the constant c->opts.dst_w at the top of each row-pair iteration. Signed-off-by: David Christle --- libswscale/loongarch/yuv2rgb_lasx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libswscale/loongarch/yuv2rgb_lasx.c b/libswscale/loongarch/yuv2rgb_lasx.c index 9032887ff8..d08cf10d4b 100644 --- a/libswscale/loongarch/yuv2rgb_lasx.c +++ b/libswscale/loongarch/yuv2rgb_lasx.c @@ -185,6 +185,7 @@ const uint8_t *py_2 = py_1 + srcStride[0]; \ const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \ const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \ + res = c->opts.dst_w & 15; \ for(x = 0; x < h_size; x++) { \ #define YUV2RGBFUNC32(func_name, dst_type, alpha) \ @@ -213,6 +214,7 @@ const uint8_t *py_2 = py_1 + srcStride[0]; \ const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \ const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \ + res = c->opts.dst_w & 15; \ for(x = 0; x < h_size; x++) { \ #define DEALYUV2RGBLINE \ -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org