From: Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>,
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: [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control
Date: Mon, 16 Mar 2026 11:48:02 +0530 [thread overview]
Message-ID: <a0b6a477-1229-46c1-8ae8-e970e1127c76@oss.qualcomm.com> (raw)
In-Reply-To: <8ef7dc7d132143e144dc523ed72c25139fa36a28.camel@ndufresne.ca>
On 2/14/2026 12:59 AM, Nicolas Dufresne wrote:
> Le vendredi 13 février 2026 à 11:34 +0530, Sachin Kumar Garg a écrit :
>> Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control for Encoder.
>> Encoder will choose appropriate quantization parameter and do the
>> smart bit allocation to set the frame maximum bitrate level as per
>> the Bitrate value configured.
>>
>> Signed-off-by: Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
>> ---
>> Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 7 +++++++
>> drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 +
>> include/uapi/linux/v4l2-controls.h | 1 +
>> 3 files changed, 9 insertions(+)
>>
>> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
>> b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
>> index c8890cb5e00a..6b2dfabfc4fd 100644
>> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
>> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
>> @@ -577,6 +577,13 @@ enum v4l2_mpeg_video_bitrate_mode -
>> - Constant bitrate
>> * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_CQ``
>> - Constant quality
>> + * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_MBR``
>> + MBR Rate Control is a VBR Rate Control mode optimized for
>> + surveillance video contents which has high temporal correlation
>> + due to static camera positions. This Rate Control smartly identifies
>> + key-frames in the scene, and allocates more bits to them to improve
>> + the coding efficiency by taking advantage of high temporal
>> + correlation in surveillance videos.
>
> This is a bit vague, and it sounds like how you'd describe a proprietary thing.
> Are you sure this is a generic mode that other vendors will support ? If not,
> perhaps it should be visible in the API ?
>
> Nicolas
Hi Nicolas, sorry for the late reply — we were aligning internally on
the exact behavior and naming. This is Qualcomm defined Rate control.
This is mainly useful for very low bitrate / high temporal-correlation
content (e.g., static camera).
If the consensus is that this is not generic enough across vendors, we
can instead expose it as a driver-specific control rather than a new
global V4L2 bitrate mode.
Thanks,
Sachin
>
>>
>>
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-
>> core/v4l2-ctrls-defs.c
>> index 551426c4cd01..b336171539a7 100644
>> --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c
>> +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
>> @@ -154,6 +154,7 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>> "Variable Bitrate",
>> "Constant Bitrate",
>> "Constant Quality",
>> + "Maximum Bitrate",
>> NULL
>> };
>> static const char * const mpeg_stream_type[] = {
>> diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-
>> controls.h
>> index 68dd0c4e47b2..614fc2c4c81d 100644
>> --- a/include/uapi/linux/v4l2-controls.h
>> +++ b/include/uapi/linux/v4l2-controls.h
>> @@ -412,6 +412,7 @@ enum v4l2_mpeg_video_bitrate_mode {
>> V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
>> V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
>> V4L2_MPEG_VIDEO_BITRATE_MODE_CQ = 2,
>> + V4L2_MPEG_VIDEO_BITRATE_MODE_MBR = 3,
>> };
>> #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_CODEC_BASE+207)
>> #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_CODEC_BASE+208)
next prev parent reply other threads:[~2026-03-16 6:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 6:04 [PATCH 0/2] add MBR type rate control for encoder Sachin Kumar Garg
2026-02-13 6:04 ` [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control Sachin Kumar Garg
2026-02-13 18:04 ` kernel test robot
2026-02-13 19:29 ` Nicolas Dufresne
2026-03-16 6:18 ` Sachin Kumar Garg [this message]
2026-02-13 6:04 ` [PATCH 2/2] media: iris: add new rate control type MBR for encoder Sachin Kumar Garg
2026-02-13 9:54 ` Konrad Dybcio
2026-03-16 6:22 ` Sachin Kumar Garg
2026-03-16 17:37 ` Nicolas Dufresne
2026-03-16 18:47 ` Dmitry Baryshkov
2026-03-30 5:44 ` Sachin Kumar Garg
2026-07-07 7:02 ` Vikash Garodia
-- strict thread matches above, loose matches on Subject: below --
2024-01-18 10:59 [PATCH 0/2] add MBR type rate control " Sachin Kumar Garg
2024-01-18 10:59 ` [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control Sachin Kumar Garg
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=a0b6a477-1229-46c1-8ae8-e970e1127c76@oss.qualcomm.com \
--to=sachin.garg@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--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=nicolas@ndufresne.ca \
--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