Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Iyengar via B4 Relay <devnull+aiyengar1990.gmail.com@kernel.org>
To: Hans Verkuil <hverkuil@kernel.org>,
	 Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Benjamin Gaignard <benjamin.gaignard@collabora.com>,
	 Philipp Zabel <p.zabel@pengutronix.de>,
	Maxime Ripard <mripard@kernel.org>,
	 Paul Kocialkowski <paulk@sys-base.io>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Samuel Holland <samuel@sholland.org>
Cc: "Jonas Karlman" <jonas@kwiboo.se>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-staging@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev,
	"Christian Stefan Kövér-Draxl" <ckoever@outlook.de>,
	"Arun Iyengar" <aiyengar1990@gmail.com>
Subject: [PATCH v2 0/3] media: stateless MPEG-1 decoding, cedrus support
Date: Sat, 21 Nov 2026 10:10:53 +0000	[thread overview]
Message-ID: <20261121-b4-cedrus-mpeg1-v2-0-95e4decf03fa@gmail.com> (raw)

Builds on Jernej Skrabec's cedrus work; tested with an FFmpeg hwaccel
on top of Jonas Karlman's V4L2 request API series (FFmpeg PR 20847).

MPEG-1 decoded as MPEG-2 is wrong: the mismatch control differs, and
MPEG-1 has full pel motion vectors and D-pictures. Patch 1 adds
V4L2_MPEG2_SEQ_FLAG_MPEG1 and two full pel picture flags to the MPEG-2
controls and allows D-pictures; patch 2 makes hantro reject them
(compile tested only). Patch 3 implements them in cedrus.

Tested on H616 only, on media-committers next: MPEG-2, H.264 and H.265
decode bit-exact against FFmpeg software decoding. MPEG-1 streams with
B-pictures and full pel vectors differ from FFmpeg (-idct faani) by at
most 2 in I-, P- and B-pictures; FFmpeg's own IDCTs differ by up to 3
on the same streams. The full pel reference needs an FFmpeg fix for
skipped B macroblocks. MPEG-1 D-pictures are bit-exact against a
computed DC reference; stock v4l2-compliance 49 of 49.

Developed with Claude (Anthropic) as a coding assistant, which wrote
the code and the commit messages. I reviewed and tested them as
described above.

Changes in v2:
- Drop V4L2_PIX_FMT_MPEG1_SLICE: cedrus selects MPEG-1 from
  V4L2_MPEG2_SEQ_FLAG_MPEG1 alone (Nicolas)
- hantro reject in its own patch
- Link to v1: https://lore.kernel.org/r/20261119-b4-cedrus-mpeg1-v1-0-aa5ba1192822@gmail.com

---
Arun Iyengar (3):
      media: uapi: mpeg2: add MPEG-1 flags
      media: verisilicon: reject MPEG-1 controls
      media: cedrus: mpeg2: decode MPEG-1

 .../media/v4l/ext-ctrls-codec-stateless.rst        | 34 ++++++++++++++++++++--
 drivers/media/platform/verisilicon/hantro_drv.c    | 12 ++++++++
 drivers/media/v4l2-core/v4l2-ctrls-core.c          |  1 +
 drivers/staging/media/sunxi/cedrus/cedrus.h        |  3 ++
 drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c  | 27 ++++++++++++++---
 include/uapi/linux/v4l2-controls.h                 |  3 ++
 6 files changed, 74 insertions(+), 6 deletions(-)
---
base-commit: ccf78740d63813c452c035b57d17a650492562fa
change-id: 20261114-b4-cedrus-mpeg1-8baae5a2eefe

Best regards,
--  
Arun Iyengar <aiyengar1990@gmail.com>




             reply	other threads:[~2026-11-21 10:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 10:10 Arun Iyengar via B4 Relay [this message]
2026-11-21 10:10 ` [PATCH v2 1/3] media: uapi: mpeg2: add MPEG-1 flags Arun Iyengar via B4 Relay
2026-11-21 10:10 ` [PATCH v2 2/3] media: verisilicon: reject MPEG-1 controls Arun Iyengar via B4 Relay
2026-11-21 10:10 ` [PATCH v2 3/3] media: cedrus: mpeg2: decode MPEG-1 Arun Iyengar via B4 Relay

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=20261121-b4-cedrus-mpeg1-v2-0-95e4decf03fa@gmail.com \
    --to=devnull+aiyengar1990.gmail.com@kernel.org \
    --cc=aiyengar1990@gmail.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=ckoever@outlook.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mripard@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=paulk@sys-base.io \
    --cc=samuel@sholland.org \
    --cc=wens@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