* [PATCH 0/2] add MBR type rate control for encoder
@ 2026-02-13 6:04 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 6:04 ` [PATCH 2/2] media: iris: add new rate control type MBR for encoder Sachin Kumar Garg
0 siblings, 2 replies; 12+ messages in thread
From: Sachin Kumar Garg @ 2026-02-13 6:04 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Vikash Garodia, Dikshita Agarwal,
Abhinav Kumar, Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm, Sachin Kumar Garg
This series adds the support for MBR rate control type in the
Iris driver.
The changes include:
- Add MBR Rate Control definition in the v4l2-ctrl.
- Add MBR Documentation in the v4l2-ctrl.
- Add MBR RC handling in the Iris driver for sc7280.
I have validated this series on sc7280 using the below test application
by setting the BitRateMode control to V4L2_MPEG_VIDEO_BITRATE_MODE_MBR:
https://github.com/quic/v4l-video-test-app
Signed-off-by: Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
---
Sachin Kumar Garg (2):
media: v4l2-ctrls: add encoder maximum bitrate control
media: iris: add new rate control type MBR for encoder
.../userspace-api/media/v4l/ext-ctrls-codec.rst | 7 +
drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
.../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
.../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
.../platform/qcom/iris/iris_platform_sc7280.h | 202 +++++++++++++++++++++
drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 +
include/uapi/linux/v4l2-controls.h | 1 +
7 files changed, 216 insertions(+), 7 deletions(-)
---
base-commit: c824345288d11e269ce41b36c105715bc2286050
change-id: 20260212-b4-add_sc7280_mbr-597ac615b931
Best regards,
--
Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control
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
2026-02-13 18:04 ` kernel test robot
2026-02-13 19:29 ` Nicolas Dufresne
2026-02-13 6:04 ` [PATCH 2/2] media: iris: add new rate control type MBR for encoder Sachin Kumar Garg
1 sibling, 2 replies; 12+ messages in thread
From: Sachin Kumar Garg @ 2026-02-13 6:04 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Vikash Garodia, Dikshita Agarwal,
Abhinav Kumar, Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm, Sachin Kumar Garg
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] media: iris: add new rate control type MBR for encoder
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 6:04 ` Sachin Kumar Garg
2026-02-13 9:54 ` Konrad Dybcio
1 sibling, 1 reply; 12+ messages in thread
From: Sachin Kumar Garg @ 2026-02-13 6:04 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Vikash Garodia, Dikshita Agarwal,
Abhinav Kumar, Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm, Sachin Kumar Garg
Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control to 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.
---
drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
.../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
.../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
.../platform/qcom/iris/iris_platform_sc7280.h | 202 +++++++++++++++++++++
4 files changed, 207 insertions(+), 7 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/platform/qcom/iris/iris_ctrls.c
index 3cec957580f5..dba3a4ba5d26 100644
--- a/drivers/media/platform/qcom/iris/iris_ctrls.c
+++ b/drivers/media/platform/qcom/iris/iris_ctrls.c
@@ -628,6 +628,8 @@ int iris_set_bitrate_mode_gen1(struct iris_inst *inst, enum platform_inst_fw_cap
rc_mode = frame_skip ? HFI_RATE_CONTROL_CBR_VFR : HFI_RATE_CONTROL_CBR_CFR;
else if (bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CQ)
rc_mode = HFI_RATE_CONTROL_CQ;
+ else if (bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_MBR)
+ rc_mode = HFI_RATE_CONTROL_MBR;
inst->hfi_rc_type = rc_mode;
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h b/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h
index 42226ccee3d9..6f3688bfbf58 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_defines.h
@@ -130,6 +130,7 @@
#define HFI_RATE_CONTROL_VBR_CFR 0x1000003
#define HFI_RATE_CONTROL_CBR_VFR 0x1000004
#define HFI_RATE_CONTROL_CBR_CFR 0x1000005
+#define HFI_RATE_CONTROL_MBR 0x1000006
#define HFI_RATE_CONTROL_CQ 0x1000008
#define HFI_H264_ENTROPY_CAVLC 0x1
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/drivers/media/platform/qcom/iris/iris_platform_gen1.c
index df8e6bf9430e..286f623e60d3 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.c
@@ -15,11 +15,6 @@
#include "iris_platform_sc7280.h"
-#define BITRATE_MIN 32000
-#define BITRATE_MAX 160000000
-#define BITRATE_PEAK_DEFAULT (BITRATE_DEFAULT * 2)
-#define BITRATE_STEP 100
-
static struct iris_fmt platform_fmts_sm8250_dec[] = {
[IRIS_FMT_H264] = {
.pixfmt = V4L2_PIX_FMT_H264,
@@ -419,8 +414,8 @@ const struct iris_platform_data sc7280_data = {
.inst_caps = &platform_inst_cap_sm8250,
.inst_fw_caps_dec = inst_fw_cap_sm8250_dec,
.inst_fw_caps_dec_size = ARRAY_SIZE(inst_fw_cap_sm8250_dec),
- .inst_fw_caps_enc = inst_fw_cap_sm8250_enc,
- .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_sm8250_enc),
+ .inst_fw_caps_enc = inst_fw_cap_sc7280_enc,
+ .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_sc7280_enc),
.tz_cp_config_data = tz_cp_config_sm8250,
.tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_sm8250),
.hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h b/drivers/media/platform/qcom/iris/iris_platform_sc7280.h
index 0ec8f334df67..3f220c4c9cc0 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_sc7280.h
@@ -6,6 +6,13 @@
#ifndef __IRIS_PLATFORM_SC7280_H__
#define __IRIS_PLATFORM_SC7280_H__
+#include "iris_platform_common.h"
+
+#define BITRATE_MIN 32000
+#define BITRATE_MAX 160000000
+#define BITRATE_PEAK_DEFAULT (BITRATE_DEFAULT * 2)
+#define BITRATE_STEP 100
+
static const struct bw_info sc7280_bw_table_dec[] = {
{ ((3840 * 2160) / 256) * 60, 1896000, },
{ ((3840 * 2160) / 256) * 30, 968000, },
@@ -28,4 +35,199 @@ static const char * const sc7280_opp_clk_table[] = {
NULL,
};
+static const struct platform_inst_fw_cap inst_fw_cap_sc7280_enc[] = {
+ {
+ .cap_id = STAGE,
+ .min = STAGE_1,
+ .max = STAGE_2,
+ .step_or_mask = 1,
+ .value = STAGE_2,
+ .hfi_id = HFI_PROPERTY_PARAM_WORK_MODE,
+ .set = iris_set_stage,
+ },
+ {
+ .cap_id = PROFILE_H264,
+ .min = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE,
+ .max = V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) |
+ BIT(V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE) |
+ BIT(V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) |
+ BIT(V4L2_MPEG_VIDEO_H264_PROFILE_HIGH) |
+ BIT(V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH) |
+ BIT(V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH),
+ .value = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
+ .hfi_id = HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ .set = iris_set_profile_level_gen1,
+ },
+ {
+ .cap_id = PROFILE_HEVC,
+ .min = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
+ .max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10),
+ .value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
+ .hfi_id = HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ .set = iris_set_profile_level_gen1,
+ },
+ {
+ .cap_id = LEVEL_H264,
+ .min = V4L2_MPEG_VIDEO_H264_LEVEL_1_0,
+ .max = V4L2_MPEG_VIDEO_H264_LEVEL_5_1,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_0) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1B) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_1) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_2) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_3) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_0) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_1) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_2) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_0) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_1) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_2) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_0) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_1) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_0) |
+ BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_1),
+ .value = V4L2_MPEG_VIDEO_H264_LEVEL_1_0,
+ .hfi_id = HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ .set = iris_set_profile_level_gen1,
+ },
+ {
+ .cap_id = LEVEL_HEVC,
+ .min = V4L2_MPEG_VIDEO_HEVC_LEVEL_1,
+ .max = V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_1) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_2) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_2_1) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_3) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_3_1) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_4) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_4_1) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_5) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_5_1) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_5_2) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_6) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_6_1) |
+ BIT(V4L2_MPEG_VIDEO_HEVC_LEVEL_6_2),
+ .value = V4L2_MPEG_VIDEO_HEVC_LEVEL_1,
+ .hfi_id = HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ .set = iris_set_profile_level_gen1,
+ },
+ {
+ .cap_id = HEADER_MODE,
+ .min = V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE,
+ .max = V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) |
+ BIT(V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME),
+ .value = V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME,
+ .hfi_id = HFI_PROPERTY_CONFIG_VENC_SYNC_FRAME_SEQUENCE_HEADER,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ .set = iris_set_header_mode_gen1,
+ },
+ {
+ .cap_id = BITRATE,
+ .min = BITRATE_MIN,
+ .max = BITRATE_MAX,
+ .step_or_mask = BITRATE_STEP,
+ .value = BITRATE_DEFAULT,
+ .hfi_id = HFI_PROPERTY_CONFIG_VENC_TARGET_BITRATE,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_INPUT_PORT |
+ CAP_FLAG_DYNAMIC_ALLOWED,
+ .set = iris_set_bitrate,
+ },
+ {
+ .cap_id = BITRATE_MODE,
+ .min = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
+ .max = V4L2_MPEG_VIDEO_BITRATE_MODE_MBR,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) |
+ BIT(V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) |
+ BIT(V4L2_MPEG_VIDEO_BITRATE_MODE_MBR),
+ .value = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
+ .hfi_id = HFI_PROPERTY_PARAM_VENC_RATE_CONTROL,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ .set = iris_set_bitrate_mode_gen1,
+ },
+ {
+ .cap_id = FRAME_SKIP_MODE,
+ .min = V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_DISABLED,
+ .max = V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_DISABLED) |
+ BIT(V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT),
+ .value = V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_DISABLED,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ },
+ {
+ .cap_id = FRAME_RC_ENABLE,
+ .min = 0,
+ .max = 1,
+ .step_or_mask = 1,
+ .value = 1,
+ },
+ {
+ .cap_id = GOP_SIZE,
+ .min = 0,
+ .max = (1 << 16) - 1,
+ .step_or_mask = 1,
+ .value = 30,
+ .set = iris_set_u32
+ },
+ {
+ .cap_id = ENTROPY_MODE,
+ .min = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC,
+ .max = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC,
+ .step_or_mask = BIT(V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC) |
+ BIT(V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC),
+ .value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC,
+ .hfi_id = HFI_PROPERTY_PARAM_VENC_H264_ENTROPY_CONTROL,
+ .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
+ .set = iris_set_entropy_mode_gen1,
+ },
+ {
+ .cap_id = MIN_FRAME_QP_H264,
+ .min = MIN_QP_8BIT,
+ .max = MAX_QP,
+ .step_or_mask = 1,
+ .value = MIN_QP_8BIT,
+ .hfi_id = HFI_PROPERTY_PARAM_VENC_SESSION_QP_RANGE_V2,
+ .flags = CAP_FLAG_OUTPUT_PORT,
+ .set = iris_set_qp_range,
+ },
+ {
+ .cap_id = MIN_FRAME_QP_HEVC,
+ .min = MIN_QP_8BIT,
+ .max = MAX_QP_HEVC,
+ .step_or_mask = 1,
+ .value = MIN_QP_8BIT,
+ .hfi_id = HFI_PROPERTY_PARAM_VENC_SESSION_QP_RANGE_V2,
+ .flags = CAP_FLAG_OUTPUT_PORT,
+ .set = iris_set_qp_range,
+ },
+ {
+ .cap_id = MAX_FRAME_QP_H264,
+ .min = MIN_QP_8BIT,
+ .max = MAX_QP,
+ .step_or_mask = 1,
+ .value = MAX_QP,
+ .hfi_id = HFI_PROPERTY_PARAM_VENC_SESSION_QP_RANGE_V2,
+ .flags = CAP_FLAG_OUTPUT_PORT,
+ .set = iris_set_qp_range,
+ },
+ {
+ .cap_id = MAX_FRAME_QP_HEVC,
+ .min = MIN_QP_8BIT,
+ .max = MAX_QP_HEVC,
+ .step_or_mask = 1,
+ .value = MAX_QP_HEVC,
+ .hfi_id = HFI_PROPERTY_PARAM_VENC_SESSION_QP_RANGE_V2,
+ .flags = CAP_FLAG_OUTPUT_PORT,
+ .set = iris_set_qp_range,
+ },
+};
+
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] media: iris: add new rate control type MBR for encoder
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
0 siblings, 1 reply; 12+ messages in thread
From: Konrad Dybcio @ 2026-02-13 9:54 UTC (permalink / raw)
To: Sachin Kumar Garg, Mauro Carvalho Chehab, Vikash Garodia,
Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm
On 2/13/26 7:04 AM, Sachin Kumar Garg wrote:
> Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control to 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.
> ---
> drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
> .../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
> .../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
> .../platform/qcom/iris/iris_platform_sc7280.h | 202 +++++++++++++++++++++
Is this really only available on 7280?
Konrad
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control
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
1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2026-02-13 18:04 UTC (permalink / raw)
To: Sachin Kumar Garg, Mauro Carvalho Chehab, Vikash Garodia,
Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue
Cc: oe-kbuild-all, linux-media, linux-kernel, linux-arm-msm,
Sachin Kumar Garg
Hi Sachin,
kernel test robot noticed the following build errors:
[auto build test ERROR on c824345288d11e269ce41b36c105715bc2286050]
url: https://github.com/intel-lab-lkp/linux/commits/Sachin-Kumar-Garg/media-v4l2-ctrls-add-encoder-maximum-bitrate-control/20260213-180753
base: c824345288d11e269ce41b36c105715bc2286050
patch link: https://lore.kernel.org/r/20260213-b4-add_sc7280_mbr-v1-1-e8d95b4e4809%40oss.qualcomm.com
patch subject: [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
docutils: docutils (Docutils 0.21.2, Python 3.13.5, on linux)
reproduce: (https://download.01.org/0day-ci/archive/20260213/202602131921.PUY3mqyw-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602131921.PUY3mqyw-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
The parent of level 2 sections cannot be reached. The parser is at section level 2 but the current node has only 0 parent section(s).
One reason may be a high level section used in a directive that parses its content into a base node not attached to the document
(up to Docutils 0.21, these sections were silently dropped). [docutils]
WARNING: ./net/bridge/br_private.h:267 struct member 'tunnel_hash' not described in 'net_bridge_vlan_group'
>> Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst:581: WARNING: Bullet list ends without a blank line; unexpected unindent. [docutils]
>> Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst:570: ERROR: Error parsing content block for the "flat-table" directive: two-level bullet list expected, but row 4 does not contain a second-level bullet list.
vim +570 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 561
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 562 ``V4L2_CID_MPEG_VIDEO_BITRATE_MODE``
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 563 (enum)
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 564
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 565 enum v4l2_mpeg_video_bitrate_mode -
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 566 Video bitrate mode. Possible values are:
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 567
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 568
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 569
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 @570 .. flat-table::
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 571 :header-rows: 0
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 572 :stub-columns: 0
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 573
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 574 * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_VBR``
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 575 - Variable bitrate
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 576 * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_CBR``
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 577 - Constant bitrate
4ad1b0d410c88c Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Maheshwar Ajja 2020-05-23 578 * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_CQ``
4ad1b0d410c88c Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Maheshwar Ajja 2020-05-23 579 - Constant quality
9e046466b28d68 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Sachin Kumar Garg 2026-02-13 580 * - ``V4L2_MPEG_VIDEO_BITRATE_MODE_MBR``
9e046466b28d68 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Sachin Kumar Garg 2026-02-13 @581 MBR Rate Control is a VBR Rate Control mode optimized for
9e046466b28d68 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Sachin Kumar Garg 2026-02-13 582 surveillance video contents which has high temporal correlation
9e046466b28d68 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Sachin Kumar Garg 2026-02-13 583 due to static camera positions. This Rate Control smartly identifies
9e046466b28d68 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Sachin Kumar Garg 2026-02-13 584 key-frames in the scene, and allocates more bits to them to improve
9e046466b28d68 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Sachin Kumar Garg 2026-02-13 585 the coding efficiency by taking advantage of high temporal
9e046466b28d68 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst Sachin Kumar Garg 2026-02-13 586 correlation in surveillance videos.
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 587
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 588
4f14e3272f1ca1 Documentation/media/uapi/v4l/ext-ctrls-codec.rst Hans Verkuil 2019-02-08 589
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control
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
1 sibling, 1 reply; 12+ messages in thread
From: Nicolas Dufresne @ 2026-02-13 19:29 UTC (permalink / raw)
To: Sachin Kumar Garg, Mauro Carvalho Chehab, Vikash Garodia,
Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm
[-- Attachment #1: Type: text/plain, Size: 3029 bytes --]
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
>
>
>
> 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)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] media: v4l2-ctrls: add encoder maximum bitrate control
2026-02-13 19:29 ` Nicolas Dufresne
@ 2026-03-16 6:18 ` Sachin Kumar Garg
0 siblings, 0 replies; 12+ messages in thread
From: Sachin Kumar Garg @ 2026-03-16 6:18 UTC (permalink / raw)
To: Nicolas Dufresne, Mauro Carvalho Chehab, Vikash Garodia,
Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm
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)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] media: iris: add new rate control type MBR for encoder
2026-02-13 9:54 ` Konrad Dybcio
@ 2026-03-16 6:22 ` Sachin Kumar Garg
2026-03-16 17:37 ` Nicolas Dufresne
0 siblings, 1 reply; 12+ messages in thread
From: Sachin Kumar Garg @ 2026-03-16 6:22 UTC (permalink / raw)
To: Konrad Dybcio, Mauro Carvalho Chehab, Vikash Garodia,
Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm
On 2/13/2026 3:24 PM, Konrad Dybcio wrote:
> On 2/13/26 7:04 AM, Sachin Kumar Garg wrote:
>> Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control to 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.
>> ---
>> drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
>> .../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
>> .../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
>> .../platform/qcom/iris/iris_platform_sc7280.h | 202 +++++++++++++++++++++
>
> Is this really only available on 7280?
>
> Konrad
Yes Konrad, in this series we enable V4L2_MPEG_VIDEO_BITRATE_MODE_MBR
only for SC7280 because currently, we have added the support only for
low tier chipset. MBR rate control aims to improve the compression
efficiency of encoder for static and low motion scenes for extremely low
bitrate use-case.
Thanks,
Sachin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] media: iris: add new rate control type MBR for encoder
2026-03-16 6:22 ` Sachin Kumar Garg
@ 2026-03-16 17:37 ` Nicolas Dufresne
2026-03-16 18:47 ` Dmitry Baryshkov
0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Dufresne @ 2026-03-16 17:37 UTC (permalink / raw)
To: Sachin Kumar Garg, Konrad Dybcio, Mauro Carvalho Chehab,
Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
Bryan O'Donoghue
Cc: linux-media, linux-kernel, linux-arm-msm
[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]
Le lundi 16 mars 2026 à 11:52 +0530, Sachin Kumar Garg a écrit :
>
>
> On 2/13/2026 3:24 PM, Konrad Dybcio wrote:
> > On 2/13/26 7:04 AM, Sachin Kumar Garg wrote:
> > > Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control to 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.
> > > ---
> > > drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
> > > .../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
> > > .../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
> > > .../platform/qcom/iris/iris_platform_sc7280.h | 202
> > > +++++++++++++++++++++
> >
> > Is this really only available on 7280?
> >
> > Konrad
>
> Yes Konrad, in this series we enable V4L2_MPEG_VIDEO_BITRATE_MODE_MBR
> only for SC7280 because currently, we have added the support only for
> low tier chipset. MBR rate control aims to improve the compression
> efficiency of encoder for static and low motion scenes for extremely low
> bitrate use-case.
Without a spec definition, which constrained the implementations toward
interoperability, this needs to be made vendor specific. That being said, even
as vendor specific control, I think it deserves more documentation for your
users.
Nicolas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] media: iris: add new rate control type MBR for encoder
2026-03-16 17:37 ` Nicolas Dufresne
@ 2026-03-16 18:47 ` Dmitry Baryshkov
2026-03-30 5:44 ` Sachin Kumar Garg
0 siblings, 1 reply; 12+ messages in thread
From: Dmitry Baryshkov @ 2026-03-16 18:47 UTC (permalink / raw)
To: Nicolas Dufresne
Cc: Sachin Kumar Garg, Konrad Dybcio, Mauro Carvalho Chehab,
Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
Bryan O'Donoghue, linux-media, linux-kernel, linux-arm-msm
On Mon, Mar 16, 2026 at 01:37:21PM -0400, Nicolas Dufresne wrote:
> Le lundi 16 mars 2026 à 11:52 +0530, Sachin Kumar Garg a écrit :
> >
> >
> > On 2/13/2026 3:24 PM, Konrad Dybcio wrote:
> > > On 2/13/26 7:04 AM, Sachin Kumar Garg wrote:
> > > > Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control to 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.
> > > > ---
> > > > drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
> > > > .../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
> > > > .../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
> > > > .../platform/qcom/iris/iris_platform_sc7280.h | 202
> > > > +++++++++++++++++++++
> > >
> > > Is this really only available on 7280?
> > >
> > > Konrad
> >
> > Yes Konrad, in this series we enable V4L2_MPEG_VIDEO_BITRATE_MODE_MBR
> > only for SC7280 because currently, we have added the support only for
> > low tier chipset. MBR rate control aims to improve the compression
> > efficiency of encoder for static and low motion scenes for extremely low
> > bitrate use-case.
>
> Without a spec definition, which constrained the implementations toward
> interoperability, this needs to be made vendor specific. That being said, even
> as vendor specific control, I think it deserves more documentation for your
> users.
What kind of documentation would be a better fit for keeping this in the
generic namespace? Frankly speaking, I think that the current
documentation is too vendor-specific, it describe the particular
algorithm, while the control seems to be more generic. However, I also
feel that defining it as "Maximum Bitrate" might not be specific enough
(nor would it show a difference from the CBR mode).
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] media: iris: add new rate control type MBR for encoder
2026-03-16 18:47 ` Dmitry Baryshkov
@ 2026-03-30 5:44 ` Sachin Kumar Garg
2026-07-07 7:02 ` Vikash Garodia
0 siblings, 1 reply; 12+ messages in thread
From: Sachin Kumar Garg @ 2026-03-30 5:44 UTC (permalink / raw)
To: Dmitry Baryshkov, Nicolas Dufresne
Cc: Konrad Dybcio, Mauro Carvalho Chehab, Vikash Garodia,
Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
linux-media, linux-kernel, linux-arm-msm
On 3/17/2026 12:17 AM, Dmitry Baryshkov wrote:
> On Mon, Mar 16, 2026 at 01:37:21PM -0400, Nicolas Dufresne wrote:
>> Le lundi 16 mars 2026 à 11:52 +0530, Sachin Kumar Garg a écrit :
>>>
>>>
>>> On 2/13/2026 3:24 PM, Konrad Dybcio wrote:
>>>> On 2/13/26 7:04 AM, Sachin Kumar Garg wrote:
>>>>> Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control to 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.
>>>>> ---
>>>>> drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
>>>>> .../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
>>>>> .../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
>>>>> .../platform/qcom/iris/iris_platform_sc7280.h | 202
>>>>> +++++++++++++++++++++
>>>>
>>>> Is this really only available on 7280?
>>>>
>>>> Konrad
>>>
>>> Yes Konrad, in this series we enable V4L2_MPEG_VIDEO_BITRATE_MODE_MBR
>>> only for SC7280 because currently, we have added the support only for
>>> low tier chipset. MBR rate control aims to improve the compression
>>> efficiency of encoder for static and low motion scenes for extremely low
>>> bitrate use-case.
>>
>> Without a spec definition, which constrained the implementations toward
>> interoperability, this needs to be made vendor specific. That being said, even
>> as vendor specific control, I think it deserves more documentation for your
>> users.
>
> What kind of documentation would be a better fit for keeping this in the
> generic namespace? Frankly speaking, I think that the current
> documentation is too vendor-specific, it describe the particular
> algorithm, while the control seems to be more generic. However, I also
> feel that defining it as "Maximum Bitrate" might not be specific enough
> (nor would it show a difference from the CBR mode).
>
>
Thanks for the suggestion.
I understand that this functionality is vendor-specific and should not
be exposed via a generic control. Would it be acceptable to convert this
into a vendor-specific control (for example,
V4L2_MPEG_VIDEO_BITRATE_MODE_QCOM_MBR) and update the documentation
accordingly?
Please let me know if this aligns with upstream expectations, or can you
please suggest if there is any other preferred approach for adding
vendor-specific controls in this case.
Thanks,
Sachin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] media: iris: add new rate control type MBR for encoder
2026-03-30 5:44 ` Sachin Kumar Garg
@ 2026-07-07 7:02 ` Vikash Garodia
0 siblings, 0 replies; 12+ messages in thread
From: Vikash Garodia @ 2026-07-07 7:02 UTC (permalink / raw)
To: Sachin Kumar Garg, Dmitry Baryshkov, Nicolas Dufresne
Cc: Konrad Dybcio, Mauro Carvalho Chehab, Dikshita Agarwal,
Abhinav Kumar, Bryan O'Donoghue, linux-media, linux-kernel,
linux-arm-msm
On 3/30/2026 11:14 AM, Sachin Kumar Garg wrote:
>
>
> On 3/17/2026 12:17 AM, Dmitry Baryshkov wrote:
>> On Mon, Mar 16, 2026 at 01:37:21PM -0400, Nicolas Dufresne wrote:
>>> Le lundi 16 mars 2026 à 11:52 +0530, Sachin Kumar Garg a écrit :
>>>>
>>>>
>>>> On 2/13/2026 3:24 PM, Konrad Dybcio wrote:
>>>>> On 2/13/26 7:04 AM, Sachin Kumar Garg wrote:
>>>>>> Introduce V4L2_MPEG_VIDEO_BITRATE_MODE_MBR rate control to 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.
>>>>>> ---
>>>>>> drivers/media/platform/qcom/iris/iris_ctrls.c | 2 +
>>>>>> .../platform/qcom/iris/iris_hfi_gen1_defines.h | 1 +
>>>>>> .../media/platform/qcom/iris/iris_platform_gen1.c | 9 +-
>>>>>> .../platform/qcom/iris/iris_platform_sc7280.h | 202
>>>>>> +++++++++++++++++++++
>>>>>
>>>>> Is this really only available on 7280?
>>>>>
>>>>> Konrad
>>>>
>>>> Yes Konrad, in this series we enable V4L2_MPEG_VIDEO_BITRATE_MODE_MBR
>>>> only for SC7280 because currently, we have added the support only for
>>>> low tier chipset. MBR rate control aims to improve the compression
>>>> efficiency of encoder for static and low motion scenes for extremely
>>>> low
>>>> bitrate use-case.
>>>
>>> Without a spec definition, which constrained the implementations toward
>>> interoperability, this needs to be made vendor specific. That being
>>> said, even
>>> as vendor specific control, I think it deserves more documentation
>>> for your
>>> users.
>>
>> What kind of documentation would be a better fit for keeping this in the
>> generic namespace? Frankly speaking, I think that the current
>> documentation is too vendor-specific, it describe the particular
>> algorithm, while the control seems to be more generic. However, I also
>> feel that defining it as "Maximum Bitrate" might not be specific enough
>> (nor would it show a difference from the CBR mode).
>>
>>
> Thanks for the suggestion.
> I understand that this functionality is vendor-specific and should not
> be exposed via a generic control. Would it be acceptable to convert this
> into a vendor-specific control (for example,
> V4L2_MPEG_VIDEO_BITRATE_MODE_QCOM_MBR) and update the documentation
> accordingly?
> Please let me know if this aligns with upstream expectations, or can you
> please suggest if there is any other preferred approach for adding
> vendor-specific controls in this case.
I discussed this with Hans during embedded conference on handling vendor
specific controls. His suggestion was that vendor can define a reserve
for 16/32/64 controls, something similar to [1], for cases like this
which seems quite vendor specific handling to me.
[1]
https://github.com/torvalds/linux/blob/0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53/include/uapi/linux/v4l2-controls.h#L235
Regards,
Vikash
>
> Thanks,
> Sachin
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-07-07 7:02 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox