From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: Deepa Guthyappa Madivalara <deepa.madivalara@oss.qualcomm.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] media: uapi: Introduce new control for video encoder ROI
Date: Thu, 15 Jan 2026 08:51:23 -0500 [thread overview]
Message-ID: <d06dfe735a246cf23d670f87d95deec7bf5265a0.camel@ndufresne.ca> (raw)
In-Reply-To: <763b6cdd-514c-4aff-b7db-8c0a17fdb645@oss.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 2294 bytes --]
Hi,
Le mercredi 14 janvier 2026 à 16:20 -0800, Deepa Guthyappa Madivalara a écrit :
> > > +``V4L2_CID_MPEG_VIDEO_ENC_ROI (struct)``
> > > + Defines the control id to configure specific delta QP for one or more
> > > + rectangular regions of interest. The struct v4l2_ctrl_enc_roi_params
> > > + is defined to hold up to 10 v4l2_rect regions and their corresponding
> > > + delta_qp with a range of -31 to 30.
> > > + Applicable to encoders
> > Any justification for this range ? Also, I believe I've seen hardware support
> > both delta and absolute values. Since it meant to be generic, some research is
> > needed. If we delibaritly ignore absolute, perhaps the CID should be named
> > accordingly ? Something like V4L2_CID_MPEG_VIDEO_ENC__DELTAQP_ROI ?
>
> As per Android ROI API - MediaCodec API QP from the app is an offset QP,
> meaning userspace will received offset Qp and it converts it to deltaQp
> before passing onto the driver in Android HAL. I have used the same idea.
> Delta MbQP = frame QP + Offset Qp. This is clamped to -31 to 30 currently
> and set to driver as delta QP, hence I have it as -31 to 30.
>
> Absolute values are mostly for frame QP, I would say. All the
> information out there for ROI
> kind of implies to deltaQP, but we could be more precise as well.
> Let me know if it is a must to change to CID.
That's exactly what I want to avoid, hardcoding Android HAL into V4L2 without
having our own rational and documentation. Also, Android HAL is a much older API
then D3D and Vulkan, and its not as well defined.The second is hardcoding range
for one specific implementation. Since this is codec agnostic, and hardware
agnostic control, I would prefer is defined in a way that it requires no scaling
by the driver. IIRC, some codec have QP values from 0 to 63, so why don't we
allo from -63 to 63 ? The alternative is to let the driver expose its range, but
its a little tricky, you will have to specify when this information is available
in the Stateful Video Encoder spec.
As for the rest, you haven't considered extensibility in your proposal, what if
a non Qualcomm hardware do have features like aboslute QP ? (Hantro/VSI does
btw). How do we add that in a clean way ?
Nicolas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-01-15 13:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 20:33 [RFC PATCH 0/3] Implement Region of Interest(ROI) support Deepa Guthyappa Madivalara
2026-01-13 20:33 ` [RFC PATCH 1/3] media: uapi: Introduce new control for video encoder ROI Deepa Guthyappa Madivalara
2026-01-14 16:14 ` Nicolas Dufresne
2026-01-15 0:20 ` Deepa Guthyappa Madivalara
2026-01-15 13:51 ` Nicolas Dufresne [this message]
2026-01-15 19:47 ` Dmitry Baryshkov
2026-01-15 0:51 ` Deepa Guthyappa Madivalara
2026-01-13 20:33 ` [RFC PATCH 2/3] media: v4l2-core: Add support for video encoder ROI control Deepa Guthyappa Madivalara
2026-01-13 20:33 ` [RFC PATCH 3/3] media: iris: Add ROI support framework for video encoder Deepa Guthyappa Madivalara
2026-01-14 16:08 ` [RFC PATCH 0/3] Implement Region of Interest(ROI) support Nicolas Dufresne
2026-01-14 22:14 ` Deepa Guthyappa Madivalara
2026-01-15 13:42 ` Nicolas Dufresne
2026-01-16 0:38 ` Deepa Guthyappa Madivalara
2026-01-23 18:39 ` Deepa Guthyappa Madivalara
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=d06dfe735a246cf23d670f87d95deec7bf5265a0.camel@ndufresne.ca \
--to=nicolas@ndufresne.ca \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=deepa.madivalara@oss.qualcomm.com \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=vikash.garodia@oss.qualcomm.com \
/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®