Skip to content

Commit e0b8eb0

Browse files
cazouHans Verkuil
authored andcommitted
media: visl: Add codec specific variability on output frames
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 <[email protected]> Signed-off-by: Detlev Casanova <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: add media: prefix to Subject]
1 parent ce7e79a commit e0b8eb0

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

drivers/media/test-drivers/visl/visl-dec.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,35 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx,
295295
" top" : " bottom") : "none");
296296
}
297297

298+
static bool visl_tpg_fill_codec_specific(struct visl_ctx *ctx,
299+
struct visl_run *run,
300+
char buf[], size_t bufsz)
301+
{
302+
/*
303+
* To add variability, we need a value that is stable for a given
304+
* input but is different than already shown fields.
305+
* The pic order count value defines the display order of the frames
306+
* (which can be different than the decoding order that is shown with
307+
* the sequence number).
308+
* Therefore it is stable for a given input and will add a different
309+
* value that is more specific to the way the input is encoded.
310+
*/
311+
switch (ctx->current_codec) {
312+
case VISL_CODEC_H264:
313+
scnprintf(buf, bufsz,
314+
"H264: %u", run->h264.dpram->pic_order_cnt_lsb);
315+
break;
316+
case VISL_CODEC_HEVC:
317+
scnprintf(buf, bufsz,
318+
"HEVC: %d", run->hevc.dpram->pic_order_cnt_val);
319+
break;
320+
default:
321+
return false;
322+
}
323+
324+
return true;
325+
}
326+
298327
static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
299328
{
300329
u8 *basep[TPG_MAX_PLANES][2];
@@ -327,6 +356,13 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
327356
frame_dprintk(ctx->dev, run->dst->sequence, "");
328357
line++;
329358

359+
if (visl_tpg_fill_codec_specific(ctx, run, buf, TPG_STR_BUF_SZ)) {
360+
tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
361+
frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
362+
frame_dprintk(ctx->dev, run->dst->sequence, "");
363+
line++;
364+
}
365+
330366
visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);
331367

332368
while ((line_str = strsep(&tmp, "\n")) && strlen(line_str)) {

0 commit comments

Comments
 (0)