mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Detlev Casanova <detlev.casanova@collabora.com>,
	linux-kernel@vger.kernel.org
Cc: linux-media@vger.kernel.org,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH v2 4/5] visl: Add a codec specific variability parameter
Date: Wed, 22 Nov 2023 17:07:18 +0100	[thread overview]
Message-ID: <bbc673bd-de2c-43eb-81c0-16a9dfad4c4e@xs4all.nl> (raw)
In-Reply-To: <20231024191027.305622-5-detlev.casanova@collabora.com>

On 24/10/2023 21:09, Detlev Casanova wrote:
> 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 <daniel.almeida@collabora.com>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> ---
>  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..e7466f6a91e1 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.264 and hevc)");

Why make this a module parameter instead of always doing this?

It's not clear from the commit log why a parameter is needed.

> +
>  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;

Perhaps mention here why these specific values are chosen?

> +	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 { \

Regards,

	Hans

  reply	other threads:[~2023-11-22 16:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 19:09 [PATCH v2 0/5] visl: Adapt output frames for reference comparison Detlev Casanova
2023-10-24 19:09 ` [PATCH v2 1/5] media: visl: Fix params permissions/defaults mismatch Detlev Casanova
2023-11-22 15:56   ` Hans Verkuil
2023-11-22 16:38     ` Detlev Casanova
2023-11-23  8:41       ` Hans Verkuil
2023-10-24 19:09 ` [PATCH v2 2/5] media: visl: Add a stable_output parameter Detlev Casanova
2023-11-22 16:03   ` Hans Verkuil
2023-11-22 16:49     ` Detlev Casanova
2023-11-23  8:44       ` Hans Verkuil
2023-10-24 19:09 ` [PATCH v2 3/5] doc: visl: Document " Detlev Casanova
2023-10-24 19:09 ` [PATCH v2 4/5] visl: Add a codec specific variability parameter Detlev Casanova
2023-11-22 16:07   ` Hans Verkuil [this message]
2023-11-22 16:52     ` Detlev Casanova
2023-10-24 19:09 ` [PATCH v2 5/5] doc: visl: Document codec_variability parameter Detlev Casanova

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=bbc673bd-de2c-43eb-81c0-16a9dfad4c4e@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=daniel.almeida@collabora.com \
    --cc=detlev.casanova@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®