From: Niklas Haas <ffmpeg@haasn.xyz> To: ffmpeg-devel@ffmpeg.org Cc: Niklas Haas <git@haasn.dev> Subject: [FFmpeg-devel] [PATCH 01/11] tests/swscale: allow choosing specific flags and dither mode Date: Mon, 17 Mar 2025 11:43:47 +0100 Message-ID: <20250317104357.307832-1-ffmpeg@haasn.xyz> (raw) From: Niklas Haas <git@haasn.dev> So I can quickly iterate on the new swscale code. --- libswscale/tests/swscale.c | 42 ++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c index 2e83197694..0027139154 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -47,6 +47,8 @@ struct options { int threads; int iters; int bench; + int flags; + int dither; }; struct mode { @@ -54,15 +56,15 @@ struct mode { SwsDither dither; }; -const struct mode modes[] = { - { SWS_FAST_BILINEAR }, - { SWS_BILINEAR }, - { SWS_BICUBIC }, - { SWS_X | SWS_BITEXACT }, - { SWS_POINT }, - { SWS_AREA | SWS_ACCURATE_RND }, - { SWS_BICUBIC | SWS_FULL_CHR_H_INT | SWS_FULL_CHR_H_INP }, - {0}, // test defaults +const SwsFlags flags[] = { + SWS_FAST_BILINEAR, + SWS_BILINEAR, + SWS_BICUBIC, + SWS_X | SWS_BITEXACT, + SWS_POINT, + SWS_AREA | SWS_ACCURATE_RND, + SWS_BICUBIC | SWS_FULL_CHR_H_INT | SWS_FULL_CHR_H_INP, + 0, // test defaults }; static FFSFC64 prng_state; @@ -277,13 +279,21 @@ static int run_self_tests(const AVFrame *ref, struct options opts) continue; for (int h = 0; h < FF_ARRAY_ELEMS(dst_h); h++) for (int w = 0; w < FF_ARRAY_ELEMS(dst_w); w++) - for (int m = 0; m < FF_ARRAY_ELEMS(modes); m++) { + for (int f = 0; f < FF_ARRAY_ELEMS(flags); f++) { + struct mode mode = { + .flags = opts.flags >= 0 ? opts.flags : flags[f], + .dither = opts.dither >= 0 ? opts.dither : SWS_DITHER_AUTO, + }; + if (ff_sfc64_get(&prng_state) > UINT64_MAX * opts.prob) continue; if (run_test(src_fmt, dst_fmt, dst_w[w], dst_h[h], - modes[m], opts, ref, NULL) < 0) + mode, opts, ref, NULL) < 0) return -1; + + if (opts.flags >= 0) + break; } } } @@ -344,6 +354,8 @@ int main(int argc, char **argv) .threads = 1, .iters = 1, .prob = 1.0, + .flags = -1, + .dither = -1, }; AVFrame *rgb = NULL, *ref = NULL; @@ -368,6 +380,10 @@ int main(int argc, char **argv) " Only test the specified source pixel format\n" " -bench <iters>\n" " Run benchmarks with the specified number of iterations. This mode also increases the size of the test images\n" + " -flags <flags>\n" + " Test with a specific combination of flags\n" + " -dither <mode>\n" + " Test with a specific dither mode\n" " -threads <threads>\n" " Use the specified number of threads\n" " -cpuflags <cpuflags>\n" @@ -409,6 +425,10 @@ int main(int argc, char **argv) opts.iters = FFMAX(opts.iters, 1); opts.w = 1920; opts.h = 1080; + } else if (!strcmp(argv[i], "-flags")) { + opts.flags = atoi(argv[i + 1]); + } else if (!strcmp(argv[i], "-dither")) { + opts.dither = atoi(argv[i + 1]); } else if (!strcmp(argv[i], "-threads")) { opts.threads = atoi(argv[i + 1]); } else if (!strcmp(argv[i], "-p")) { -- 2.48.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".
next reply other threads:[~2025-03-17 10:44 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-03-17 10:43 Niklas Haas [this message] 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 02/11] tests/swscale: allow testing only unscaled convertors Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 03/11] tests/swscale: print speedup numbers in color Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 04/11] tests/swscale: use yuva444p as reference Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 05/11] tests/swscale: switch from MSE to SSIM Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 06/11] tests/swscale: print performance stats on exit Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 07/11] tests/swscale: check supported inputs for legacy swscale separately Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 08/11] tests/swscale: remove stray whitespace in scanf format Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 09/11] tests/swscale: calculate theoretical expected SSIM Niklas Haas 2025-03-17 10:53 ` Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 10/11] tests/swscale: constrain reference SSIM for low bit depth formats Niklas Haas 2025-03-17 10:43 ` [FFmpeg-devel] [PATCH 11/11] tests/swscale: allow setting log verbosity Niklas Haas
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20250317104357.307832-1-ffmpeg@haasn.xyz \ --to=ffmpeg@haasn.xyz \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=git@haasn.dev \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git