All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jernej Skrabec" <jernej.skrabec@gmail.com>
Cc: linux-sunxi@lists.linux.dev, media-ci@linuxtv.org
Subject: Re: [PATCH 03/10] staging: media: cedrus: h264: mark long-term references in the frame info
Date: Mon, 02 Nov 2026 17:35:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-193845@kernel.org> (raw)
In-Reply-To: <20261102170303.1973892-4-jernej.skrabec@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] media: cedrus: h264: lost long-term flag in cedrus_write_frame_list()
--

commit 2185109fe892e8452d1ff6c43246f08d7ba7e368
Author: Jernej Skrabec <jernej.skrabec@gmail.com>

staging: media: cedrus: h264: mark long-term references in the frame info

This commit updates cedrus_fill_ref_pic() and cedrus_write_frame_list() to
populate the top and bottom field reference type bits in the H.264 SRAM
framebuffer list entry so that long-term reference pictures are marked as
long-term instead of short-term.

> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
> index 892193c12b2f3..a716955655f7d 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c

[ ... ]

> @@ -128,6 +136,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx,
>  		cedrus_fill_ref_pic(ctx, cedrus_buf,
>  				    dpb->top_field_order_cnt,
>  				    dpb->bottom_field_order_cnt,
> +				    dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM,
>  				    &pic_list[position]);
>  	}
>  
> @@ -174,6 +183,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx,
>  	cedrus_fill_ref_pic(ctx, output_buf,
>  			    decode->top_field_order_cnt,
>  			    decode->bottom_field_order_cnt,
> +			    false,
>  			    &pic_list[position]);

[Severity: Medium]
When decoding the second field of an interlaced complementary field pair into
the same capture buffer (run->dst), the already-decoded first field is present
in decode->dpb[] with a matching timestamp. In cedrus_write_frame_list(), the
DPB loop skips calling cedrus_fill_ref_pic() for that entry:

	for (i = 0; i < ARRAY_SIZE(decode->dpb); i++) {
		...
		if (run->dst->vb2_buf.timestamp == dpb->reference_ts) {
			output = position;
			continue;
		}

and instead populates pic_list[position] via the cedrus_fill_ref_pic() call on
output_buf above with long_term hardcoded to false.

If the first field was marked as a long-term reference (for example, an IDR
field with long_term_reference_flag set or via MMCO), its DPB entry has
V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM set and the second field can reference it
at pic_list[position].

By passing false here instead of preserving the DPB entry's
V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM flag when output >= 0, won't
pic_list[position] be programmed as VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM
instead of VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM when decoding the second
field?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102170303.1973892-1-jernej.skrabec@gmail.com?part=3

  reply	other threads:[~2026-11-02 17:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 17:02 [PATCH 00/10] staging: media: cedrus: assorted fixes and VP8 4K support Jernej Skrabec
2026-11-02 17:02 ` [PATCH 01/10] staging: media: cedrus: free MV-col buffers in buf_cleanup Jernej Skrabec
2026-11-02 18:37   ` Nicolas Dufresne
2026-11-02 17:02 ` [PATCH 02/10] staging: media: cedrus: reject too large H.264/HEVC SPS Jernej Skrabec
2026-11-02 17:26   ` sashiko-bot
2026-11-02 18:44   ` Nicolas Dufresne
2026-11-03 18:02     ` Jernej Škrabec
2026-11-03 18:38       ` Nicolas Dufresne
2026-11-02 17:02 ` [PATCH 03/10] staging: media: cedrus: h264: mark long-term references in the frame info Jernej Skrabec
2026-11-02 17:35   ` sashiko-bot [this message]
2026-11-02 18:50   ` Nicolas Dufresne
2026-11-03 18:06     ` Jernej Škrabec
2026-11-03 18:39       ` Nicolas Dufresne
2026-11-02 17:02 ` [PATCH 04/10] staging: media: cedrus: mpeg2: use the field height for field pictures Jernej Skrabec
2026-11-02 18:56   ` Nicolas Dufresne
2026-11-03 18:12     ` Jernej Škrabec
2026-11-03 18:51       ` Nicolas Dufresne
2026-11-02 17:02 ` [PATCH 05/10] staging: media: cedrus: mpeg2: derive the field order of " Jernej Skrabec
2026-11-02 19:00   ` Nicolas Dufresne
2026-11-02 17:02 ` [PATCH 06/10] staging: media: cedrus: mpeg2: fix the references " Jernej Skrabec
2026-11-02 19:03   ` Nicolas Dufresne
2026-11-02 17:03 ` [PATCH 07/10] staging: media: cedrus: validate VP8 frame size Jernej Skrabec
2026-11-02 19:04   ` Nicolas Dufresne
2026-11-02 17:03 ` [PATCH 08/10] staging: media: cedrus: vp8: use the vendor probability table size Jernej Skrabec
2026-11-02 19:11   ` Nicolas Dufresne
2026-11-02 17:03 ` [PATCH 09/10] staging: media: cedrus: h616: use the 256-bit DDR mode Jernej Skrabec
2026-11-02 19:13   ` Nicolas Dufresne
2026-11-02 17:03 ` [PATCH 10/10] staging: media: cedrus: vp8: support frames wider than 2048 pixels Jernej Skrabec
2026-11-02 18:22   ` sashiko-bot
2026-11-02 19:15   ` Nicolas Dufresne

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=sashiko-outbox-193845@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=media-ci@linuxtv.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.