Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp579464rdh; Thu, 23 Nov 2023 12:05:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYTBUpejo3jaCqcJyxG7DAFNHuYCG+MGP+6ylX4TbK9AgtOBrwb0M7GCvnGhv2+IgivnKX X-Received: by 2002:a5e:dc02:0:b0:798:2415:1189 with SMTP id b2-20020a5edc02000000b0079824151189mr747782iok.12.1700769912675; Thu, 23 Nov 2023 12:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700769912; cv=none; d=google.com; s=arc-20160816; b=USQgHM/Dc5HdvPaCtuc49UsFSj2CxGKzG651miXlekokomQpG7g4233UdxOHHXs/2P 4BHl0PpJbjXVDocXec4MvEGsmEOJ9ah2Lx4qLU30aCVQrhayZq2IafLIwRTRmDwWyRms E5vpfBP+hIaZvOUWJ959Xe8oyEpp0aZJb3iqcCw4iYhNjtBGvNJsAJuUKSY9Nd7jWPBI Yr3i1EHQ42oC8vDJLzZD5rwnmRjL7jE1ylKZYQWOcKP5EN5LBK5hKsyREKzrAWJsiJaj FnmFUAmr3NCKh2iXFHmOLuL3GJbCvmcxVhLWAIpgC/CjsZUrKyHtfagr0JdsMnFfN2Mk XOkQ== 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=vmFgz7M22jzjGviIkbk3KMeVxtpDaBLxMFBrRXon3jg=; fh=bEUUkxCtcWAoM+0QUmhtNDixjAfHmPTjnsrsFCDjYhU=; b=fZKZQ4fDEIk//TkPDB75ktzTramh3ArAHUnR4RigMp/7/3GBO3fV196Lw2ix1+q8je eRkZ9xqlVtmSFXtMSDyT0VyFa5suIYywGtiXc7jEpOsApFsaSj8r4we2WZ/hY5sQtXLQ pRyMtBbcXKFfeQowJyqnVbWuvhGql7Q0UxfoMMTpBkRPrLVwPyNP3hhCmkJrokKdhv4z uvwQx/XSWQk5VUL0qv+L8ZyBfvNpHCc8LmuUm23PfZkc6pEp9aMMu1nzeKk/IJWZxfFE /XFWZ1a2ZcDVCI33VqW0uKEy4tkqOd2EQlvqLdiYBcHhTH8ufojWfC7ur/cw72O80zLJ sgaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="PnFAo/jv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y35-20020a631823000000b005893b7094easi1873869pgl.554.2023.11.23.12.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 12:05:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="PnFAo/jv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 8614F80BC534; Thu, 23 Nov 2023 12:05:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229462AbjKWUEw (ORCPT + 99 others); Thu, 23 Nov 2023 15:04:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbjKWUEp (ORCPT ); Thu, 23 Nov 2023 15:04:45 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACCE2F9; Thu, 23 Nov 2023 12:04:51 -0800 (PST) Received: from arisu.hitronhub.home (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 7AFDC660739A; Thu, 23 Nov 2023 20:04:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700769890; bh=MDZ5s7wYAgtfoPDbCDwHCx8aRgjhFb0VxGXGz6Xsrxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PnFAo/jveZwQF4QVlm0hO2ObePnKu7qgXPC49iYywOVG0OqUWLYUe0hfzyicnhum7 xi22QWKNhg/UmmKQhsTcfE/+Pg3O2LFSUmBNBkkBcO/aircL01whYky7NRltAt7WEF +DMhTa8MGHmlhchk1tp/HwWschyzv7s/MiagENhpv8E2b/VyN2BNGI1ARgfPUuEwa8 SguA2gyFdJXXb2OBxrbHVagh350VSZTs2AP9r9KX7gpABNKB1Pbz6IixhndFTNFy/e qQfPDCHDqihmgmRJlrN/M1L1CF3M1mVHbLH9KK75y/G/uU6xTuzG7ga3P7HIgrqyuK +ecXvJ7Ke/FoQ== 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 v3 4/4] visl: Add codec specific variability on output frames Date: Thu, 23 Nov 2023 14:57:47 -0500 Message-ID: <20231123200451.148097-5-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231123200451.148097-1-detlev.casanova@collabora.com> References: <20231123200451.148097-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 12:05:11 -0800 (PST) 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 a6c878f0813a..60fca1ddadcd 100644 --- a/drivers/media/test-drivers/visl/visl-dec.c +++ b/drivers/media/test-drivers/visl/visl-dec.c @@ -272,6 +272,35 @@ 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) +{ + /* + * 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]; @@ -304,6 +333,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