From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BADBF4869D for ; Wed, 14 Feb 2024 22:07:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1517668D22A; Thu, 15 Feb 2024 00:06:45 +0200 (EET) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C496D68D21A for ; Thu, 15 Feb 2024 00:06:35 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2EAD160005 for ; Wed, 14 Feb 2024 22:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1707948395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=wcZg8tBg3gilefeDM5lKpJtszLq0SAgwVbf/F+LMuKY=; b=QjYFz7if3dLYfO2qyPv1bPUSxMaoRknZMS+GvZgfluA0i08n/zFZ8l3OC7Qk8ijAACDYMT +ATOCpmguulAKrzO8UMieInV1pBce+klJJ0+F0xvG6n5JuUYaiuu0y2onz9bo9F9uiVSNU JeeE7echBe3sVND+XUm2QNk9mgLw/ZIlqSGWNyXFOoxpHxArCkMlawUptCnTAoM1jJqPDU gpdSsjWEYZp3RXhssjGkt6CzGG9B/T53eup6X6EHP0LxI2+p98HRZ9LiT65SxkVbp3SiLK ZW5NYoQLpM0n7I3TdcuEzCPtIrsIPZeN4rhKOtyJXUtgfm3OsbswWuzCQ54G0w== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 14 Feb 2024 23:06:29 +0100 Message-Id: <20240214220631.9641-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240214220631.9641-1-michael@niedermayer.cc> References: <20240214220631.9641-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/7] swscale/tests/swscale: Allow comparing a subset of cases to a reference file X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Testing all cases exhaustively is slow Signed-off-by: Michael Niedermayer --- libswscale/tests/swscale.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index 07d0af4377e..68434fb7baf 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -33,6 +33,7 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "libavutil/lfg.h" +#include "libavutil/sfc64.h" #include "libswscale/swscale.h" @@ -56,6 +57,9 @@ static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt) return desc->flags & AV_PIX_FMT_FLAG_ALPHA; } +static double prob = 1; +FFSFC64 prng_state; + static uint64_t getSSD(const uint8_t *src1, const uint8_t *src2, int stride1, int stride2, int w, int h) { @@ -117,6 +121,9 @@ static int doTest(const uint8_t * const ref[4], int refStride[4], int w, int h, uint32_t crc = 0; int res = 0; + if (ff_sfc64_get(&prng_state) > UINT64_MAX * prob) + return 0; + if (cur_srcFormat != srcFormat || cur_srcW != srcW || cur_srcH != srcH) { struct SwsContext *srcContext = NULL; int p; @@ -449,6 +456,8 @@ int main(int argc, char **argv) fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]); return -1; } + } else if (!strcmp(argv[i], "-p")) { + prob = atof(argv[i + 1]); } else { bad_option: fprintf(stderr, "bad option or argument missing (%s)\n", argv[i]); @@ -456,6 +465,8 @@ bad_option: } } + ff_sfc64_init(&prng_state, 0, 0, 0, 12); + sws = sws_getContext(W / 12, H / 12, AV_PIX_FMT_RGB32, W, H, AV_PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL); -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".