mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
To: 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,
	Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
Subject: [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control
Date: Fri, 13 Feb 2026 11:34:45 +0530	[thread overview]
Message-ID: <20260213-b4-add_sc7280_mbr-v1-1-e8d95b4e4809@oss.qualcomm.com> (raw)
In-Reply-To: <20260213-b4-add_sc7280_mbr-v1-0-e8d95b4e4809@oss.qualcomm.com>

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.
 
 
 
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)

-- 
2.34.1


  reply	other threads:[~2026-02-13  6:05 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 ` Sachin Kumar Garg [this message]
2026-02-13 18:04   ` [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control kernel test robot
2026-02-13 19:29   ` Nicolas Dufresne
2026-03-16  6:18     ` Sachin Kumar Garg
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=20260213-b4-add_sc7280_mbr-v1-1-e8d95b4e4809@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=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®