Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6805764rdb; Fri, 15 Dec 2023 08:45:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvmByN/yereW6wqzE8HdW1WEkaA42Rp4VEAzavzUbonhljVLcZk8lhZNN7icgPKGizTM07 X-Received: by 2002:a05:6122:4b1c:b0:4b2:c554:fbb4 with SMTP id fc28-20020a0561224b1c00b004b2c554fbb4mr10128825vkb.22.1702658759095; Fri, 15 Dec 2023 08:45:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702658759; cv=none; d=google.com; s=arc-20160816; b=phCBLjRrynfqavntFuWoFbylQtkJli8nNLgUIAJTqIMi8hoXAtyhY+sI0EaPmvL46L BSymmLxAgtiE2ZkBb2k0IK63SxAeYN2Bpek5odLWoSVHWlo0c+MTFQ4f8IQzZatp+8oX qJhEAeYvBa/mMdOedHmtLwQxlXo3abUqoXCAWcdVAnIjKN4TZhAFwcE+bHgSK7nHbjlU GDk6JzYPwhgfRItbjHuZ15JopJSNj2m4L4GDfWRuZf7q/xj7KviVWGo48KuPzkcrfZOn nEo91lSKqF781WEUUdmyIZcRo8KRPTvtQ5cdU0ODtqeXZkp6SmN51i/uA2V0aSSEvPGL NI0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=I8gTcr7rbppyO6BhWmBA85SyefLm122fabtfd7r20K0=; fh=bEUUkxCtcWAoM+0QUmhtNDixjAfHmPTjnsrsFCDjYhU=; b=bt3vp6gBi1omBOi26WxIvGDfHGU8PyYa5YZ/JduCeW2EfdeDIJ9t1ot+3jR0tokisE SwYI4GrgDZhlZkSjhSxdNIFMdI00b3co3PFiISU3hyD3lmOJfueXBP+n8GE4H82JiCOr DGdusJ9SpBbjFrV1wN2OvrTTZ5GZOURnkUw/zVlWG9IkglnjA2uPu3mWe3+ABvxbTYJ/ NmvCuJLGHCAtVfC2oPGbNreO/ao1g+HGbjpIyrnwl/NWPMYGcVqGLMKFx+eT63nZ2A30 zEU9xPbmDKD5kWIWyOFHEJF6jDt7rQ8RIO5G9Q7ozwgZkfnt06UOb60PIQBGGVvUy1HQ pBog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Fvwiy3WF; spf=pass (google.com: domain of linux-kernel+bounces-1323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i185-20020a1f6dc2000000b004b6a3f04e80si295567vkc.296.2023.12.15.08.45.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:45:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Fvwiy3WF; spf=pass (google.com: domain of linux-kernel+bounces-1323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C87A11C23639 for ; Fri, 15 Dec 2023 16:45:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA9EA405C2; Fri, 15 Dec 2023 16:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Fvwiy3WF" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BA983EA82; Fri, 15 Dec 2023 16:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702658696; bh=o3gVuGEC1t10luwAtPg5Gfc/jxJ1FIFC2gthXJnlS6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fvwiy3WFfv22/7ZWWXiJPGD0gVrH+FydOX/X0oYjY1yo99b3TSiaoo6KcQVD64VxA PVdFLMaMBhcPQE2YmQSGGs/dIS2jkrOtSrCtdR+j7E9dicdbWm6NQHqK2odxx6Gn80 hcmiB7eoePOxyH92ofLFB16zr3Fu/YrP+3XdW/JfbE0IvqrHsTl7KR1+nuy1A8usEu wFfK2HqK0Fi+CKkFsVKMlWX3zR4QtXuJvdvYopFVo5q+pHbcSSvFTeUR3I2Oqi2ng0 h1xmVfMEn5BsPd94Y4FQ3OwVn2vP2YpomwsU+HIB+rwYVkdzs+vMHeBM2GaTow2Nv7 hd1gIOphY24ZA== Received: from arisu.mtl.collabora.ca (cola.collaboradmins.com [195.201.22.229]) (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 madrid.collaboradmins.com (Postfix) with ESMTPSA id F276E3781FE9; Fri, 15 Dec 2023 16:44:54 +0000 (UTC) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Hans Verkuil , Detlev Casanova Subject: [PATCH v4 4/4] visl: Add codec specific variability on output frames Date: Fri, 15 Dec 2023 11:42:58 -0500 Message-ID: <20231215164447.743787-5-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231215164447.743787-1-detlev.casanova@collabora.com> References: <20231215164447.743787-1-detlev.casanova@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Reviewed-by: Daniel Almeida Signed-off-by: Detlev Casanova --- drivers/media/test-drivers/visl/visl-dec.c | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/media/test-drivers/visl/visl-dec.c b/drivers/media/test-drivers/visl/visl-dec.c index caed753e17d1..fb6f53d8dfd2 100644 --- a/drivers/media/test-drivers/visl/visl-dec.c +++ b/drivers/media/test-drivers/visl/visl-dec.c @@ -290,6 +290,35 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx, " top" : " bottom") : "none"); } +static bool visl_tpg_fill_codec_specific(struct visl_ctx *ctx, + struct visl_run *run, + char buf[], size_t bufsz) +{ + /* + * To add variability, we need a value that is stable for a given + * input but is different than already shown fields. + * The pic order count value defines the display order of the frames + * (which can be different than the decoding order that is shown with + * the sequence number). + * Therefore it is stable for a given input and will add a different + * value that is more specific to the way the input is encoded. + */ + 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]; @@ -322,6 +351,13 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) frame_dprintk(ctx->dev, run->dst->sequence, ""); line++; + if (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++; + } + visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run); while ((line_str = strsep(&tmp, "\n")) && strlen(line_str)) { -- 2.41.0