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 AB11B4A9A1 for ; Wed, 5 Jun 2024 20:08:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A11C068D103; Wed, 5 Jun 2024 23:08:17 +0300 (EEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4745368D103 for ; Wed, 5 Jun 2024 23:08:11 +0300 (EEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1f6342c5faaso2333545ad.2 for ; Wed, 05 Jun 2024 13:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717618088; x=1718222888; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=igZMA7l01MJ5NOjfYsjnf2FxYlkNVf7AgSKJlvXxDWI=; b=nqQBRrI9IqdlrKvyaQZn72saMLmr59IjfcpXkFLhxMdq73fh+s15J3ueDwVZB6m/LI R17y9bBGJWUaE1R43rmmGlu8mueJt+ZldaavcpB+tHavmMGo9yMUfNnKVdlpIqjnR5Cn QlCH2LxXib2vcRWvitPcHFQxQEpF2x9Qk/aPB97I/RgL9PPHQrwnCaWipFU44p6r01eG 0D56ppTWqA/ltvboj/EAPWlD/tLYVYJn3razBxuQftP/o5XnIKDmkVg0K2ufoA/Zm5tA Cgh3GSNqi+S0MD8CpaXujjUr70s/4o17wuWUZuavttpbtQI3wQRLsR39OFXbN1fwlB4x Md0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717618088; x=1718222888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=igZMA7l01MJ5NOjfYsjnf2FxYlkNVf7AgSKJlvXxDWI=; b=ufTOuaVwUn1U1tAcgmB1/2K0v/Rh28Z72iVYb0Xs6xSYP6a7PHbMG0C4gyTnxGKb/G YScYF7i6x/NWoWKj8V9MTHne4HDSSvZaZdXnZOuPtKAiqhUPO6KU9nmruIRoOFmf6ug3 1SIZ36mseqjXUaMa6SIr98K/sqh9UuuWfHapWWGRcV9EIVr+BkqHTQUunEYaHWhEFuvi 0anrRgp6hcCTH0Jk1sxVFvgfTPCRCcafktTm9fsy0x7eZ/bXWDmQktyquiKkGTH3u0mY LgTH7fiOj2gMzJ7q+yj/ixvA+Mnl9mef+w2yl1whX/lV4dDO7JNx4FgB5aoA31xHAXcO vdnA== X-Gm-Message-State: AOJu0YxijsxTQRfG3yX9vITGiC/UDFj0afO8A+Xzn90GN55xxnRLw5/2 coyEGiZOazldas2989q1fqtSX4abDA9vvrvepV/p5goYlGTtgq/hXlTH0Q== X-Google-Smtp-Source: AGHT+IHR20jM++mTz6lbB+eFEX/JYkepbyfL6kuMo+oKcy+QFsAMlZQyd/2GYsLVM7x4wNPuRfmExQ== X-Received: by 2002:a17:903:187:b0:1f6:a506:4eb with SMTP id d9443c01a7336-1f6a5a86af6mr43942365ad.60.1717618088033; Wed, 05 Jun 2024 13:08:08 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6939bc65dsm40069635ad.136.2024.06.05.13.08.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:08:07 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 5 Jun 2024 17:08:03 -0300 Message-ID: <20240605200803.2999-1-jamrial@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240605183142.2831-1-jamrial@gmail.com> References: <20240605183142.2831-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 to yuv 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 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: Test all four pixel formats, but only bench the two native endian ones for a given target. Signed-off-by: James Almer --- tests/checkasm/sw_rgb.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index b51d0836c3..cba6b87add 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -187,11 +187,15 @@ static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; static const enum AVPixelFormat rgb_formats[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGBA, + AV_PIX_FMT_BGRA, + AV_PIX_FMT_ABGR, + AV_PIX_FMT_ARGB, }; static void check_rgb_to_y(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]); @@ -199,7 +203,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *rgb2yuv, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src, MAX_LINE_SIZE * 4); for (int i = 0; i < FF_ARRAY_ELEMS(rgb_formats); i++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(rgb_formats[i]); @@ -220,7 +224,10 @@ static void check_rgb_to_y(struct SwsContext *ctx) if (memcmp(dst0_y, dst1_y, w * 2)) fail(); - bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); + if (desc->nb_components == 3 || + // only bench native endian formats + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) + bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); } } } @@ -228,7 +235,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) static void check_rgb_to_uv(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]); @@ -238,7 +245,7 @@ static void check_rgb_to_uv(struct SwsContext *ctx) const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src, MAX_LINE_SIZE * 4); for (int i = 0; i < 2 * FF_ARRAY_ELEMS(rgb_formats); i++) { enum AVPixelFormat src_fmt = rgb_formats[i / 2]; @@ -266,7 +273,10 @@ static void check_rgb_to_uv(struct SwsContext *ctx) if (memcmp(dst0_u, dst1_u, w * 2) || memcmp(dst0_v, dst1_v, w * 2)) fail(); - bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); + if (desc->nb_components == 3 || + // only bench native endian formats + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) + bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); } } } -- 2.45.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".