Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1420340rda; Mon, 23 Oct 2023 12:01:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKB9oeF3aafwDuO71Li7Q1g/03DtgVscYYkE2eQWjichTwp89mCtsSAZGH5n9ycgA2qE+W X-Received: by 2002:a05:6a21:3289:b0:17a:4891:e33 with SMTP id yt9-20020a056a21328900b0017a48910e33mr612307pzb.4.1698087688730; Mon, 23 Oct 2023 12:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698087688; cv=none; d=google.com; s=arc-20160816; b=gVG10lapUISm0eSgohi2i/6kLHooeJufPBaOyhSyBXowa6zvliUIgP4VUR+h5Vn2DJ 3PQ0CKyTpbeYb94xWeZc3njBEhtGz87qeEIpJqUud1Y0YbQWJg2JHEVP3oAWQWirq4kM HyeHowrGcfLEMxuzR0+LyYedvMFcRMvP2gdOI2nVkp7duIMfHh1vxfkGDNulmCi8Zbvo MbxiM5jQvJu9hVpVXE8JX1gc35CKUkR2268erNlhUA8TkCL5HwGzrWoO6f1hYcof7Beo DiwighSaBWDpTMLbmwC1XkqXx0Aw7KwU9+fAe7dhy2xRSm937HM4Z/FSqLxlXzc4Y4hx 9QTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=irZDVBZyg5EciFWQQrL9wzmpYPR3hGFnSu5I5woFtfk=; fh=GOsa8F24+MtjXStpkMMOXboEdQI7NAG5aXV0YSmfysM=; b=iLRfDTqvAn0TKlt5kZDnS7QH8WCKMt5NrI7o2X6sAseZHAYm0ZhK1yalJTcO8kcPIP r+rwcVv3XL++fQutfYtdQCQSeNFL4HZsSrFncehY38Q/DQwB96uqdRj8LNqkPp4u+s5G e/LDBEiXPpAkon3tTwKGaC9KwGLAhFdNs30uxtOrjWSqQw2jmb6GElFen2E4L/loe9Ju FBZOK6uFKOqhXAHfDyY/dQwGpcTBGXW5Mqpm3LQW+wAHoLOTZR+VJ1QtNP86Hx2SOaIH 2+AAMXsj82lTw1Q5PoOp9dl4anoaEyKw3byEnmYiVSz33wQMZM97hzsDBSBRmYPbtOKh jerA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lRfMMsYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h17-20020a056a001a5100b006bde4f430afsi7092745pfv.70.2023.10.23.12.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:01:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lRfMMsYG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CBEE3805CDA5; Mon, 23 Oct 2023 12:00:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231888AbjJWTAL (ORCPT + 99 others); Mon, 23 Oct 2023 15:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbjJWS76 (ORCPT ); Mon, 23 Oct 2023 14:59:58 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44342101; Mon, 23 Oct 2023 11:59:56 -0700 (PDT) Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 8825D66072BA; Mon, 23 Oct 2023 19:59:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698087595; bh=7U8/6XDOJhzMMzMPF2ztUQzBn+CYjBeQFdZWPFsfHD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRfMMsYGTLyaRA/BJd9plMIZjQcgCwhf6GxxL8q4g9iGtiy9oR3IqCavGwhJ+UxDg K5GT8pNgFW2freF76CwEuyV5tumfxbrryvfzB+B1tS9yNKZD8KCIh/W3m8gX+klxAL JRD+DtQCsfVzqiDB6ma0z8mRpn6QX/okglHAE+C30VDHvkKlI27DSjMI9Jo9XFUt7D nSN7GyjcKJhUQIdaYXrZhUHUN/TXY4ZXkiyugJvI6q43bNt2qB9hpLZp1e2g3PZW88 hnrTr6L2U+SOYWlE1IpDwMZlA3JitH5Fd6pygWZz+4cex1EjTo5IVFsFpLM6F9wUr5 yAfYoZBppAe2w== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH 4/5] visl: Add a codec specific variability parameter Date: Mon, 23 Oct 2023 14:58:24 -0400 Message-ID: <20231023185850.67082-5-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023185850.67082-1-detlev.casanova@collabora.com> References: <20231023185850.67082-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:00:28 -0700 (PDT) When running tests with different input data, the stable output frames could be too similar and hide possible issues. This commit adds variation by using some codec specific parameters. Only HEVC and H.264 support this. Signed-off-by: Detlev Casanova --- drivers/media/test-drivers/visl/visl-core.c | 5 ++++ drivers/media/test-drivers/visl/visl-dec.c | 27 +++++++++++++++++++++ drivers/media/test-drivers/visl/visl.h | 1 + 3 files changed, 33 insertions(+) diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index d28d50afec02..c00a134a2171 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -93,6 +93,11 @@ module_param(stable_output, bool, 0644); MODULE_PARM_DESC(stable_output, " only write stable data for a given input on the output frames"); +bool codec_variability; +module_param(codec_variability, bool, 0644); +MODULE_PARM_DESC(codec_variability, + " add codec specific variability data to generate more unique frames. (Only h.265 and hevc)"); + static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = { { .cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS, diff --git a/drivers/media/test-drivers/visl/visl-dec.c b/drivers/media/test-drivers/visl/visl-dec.c index 61cfca49ead9..002d5e3b0ea4 100644 --- a/drivers/media/test-drivers/visl/visl-dec.c +++ b/drivers/media/test-drivers/visl/visl-dec.c @@ -223,6 +223,26 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx, } } +static bool visl_tpg_fill_codec_specific(struct visl_ctx *ctx, + struct visl_run *run, + char buf[], size_t bufsz) +{ + switch (ctx->current_codec) { + case VISL_CODEC_H264: + scnprintf(buf, bufsz, + "H264: %u", run->h264.dpram->pic_order_cnt_lsb); + break; + case VISL_CODEC_HEVC: + scnprintf(buf, bufsz, + "HEVC: %d", run->hevc.dpram->pic_order_cnt_val); + break; + default: + return false; + } + + return true; +} + static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) { u8 *basep[TPG_MAX_PLANES][2]; @@ -255,6 +275,13 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) frame_dprintk(ctx->dev, run->dst->sequence, ""); line++; + if (codec_variability && visl_tpg_fill_codec_specific(ctx, run, buf, TPG_STR_BUF_SZ)) { + tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf); + frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf); + frame_dprintk(ctx->dev, run->dst->sequence, ""); + line++; + } + if (!stable_output) { visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run); diff --git a/drivers/media/test-drivers/visl/visl.h b/drivers/media/test-drivers/visl/visl.h index 5a81b493f121..4ac2d1783020 100644 --- a/drivers/media/test-drivers/visl/visl.h +++ b/drivers/media/test-drivers/visl/visl.h @@ -86,6 +86,7 @@ extern bool keep_bitstream_buffers; extern int bitstream_trace_frame_start; extern unsigned int bitstream_trace_nframes; extern bool stable_output; +extern bool codec_variability; #define frame_dprintk(dev, current, fmt, arg...) \ do { \ -- 2.41.0