* [PATCH] venus: venc: set IDR period to FW only for H264 & HEVC
@ 2020-12-16 7:06 Dikshita Agarwal
2020-12-21 16:01 ` Stanimir Varbanov
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
0 siblings, 2 replies; 3+ messages in thread
From: Dikshita Agarwal @ 2020-12-16 7:06 UTC (permalink / raw)
To: linux-media, stanimir.varbanov
Cc: linux-kernel, linux-arm-msm, vgarodia, Dikshita Agarwal
HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD is supported for only
H264 & HEVC codec. There is no need to set it for VP8 since
all key frames are treated as IDR frames for VP8.
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
drivers/media/platform/qcom/venus/venc.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index 3a2e449..618cf92 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -588,16 +588,19 @@ static int venc_set_properties(struct venus_inst *inst)
return ret;
}
- /* IDR periodicity, n:
- * n = 0 - only the first I-frame is IDR frame
- * n = 1 - all I-frames will be IDR frames
- * n > 1 - every n-th I-frame will be IDR frame
- */
- ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;
- idrp.idr_period = 0;
- ret = hfi_session_set_property(inst, ptype, &idrp);
- if (ret)
- return ret;
+ if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 ||
+ inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) {
+ /* IDR periodicity, n:
+ * n = 0 - only the first I-frame is IDR frame
+ * n = 1 - all I-frames will be IDR frames
+ * n > 1 - every n-th I-frame will be IDR frame
+ */
+ ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;
+ idrp.idr_period = 0;
+ ret = hfi_session_set_property(inst, ptype, &idrp);
+ if (ret)
+ return ret;
+ }
if (ctr->num_b_frames) {
u32 max_num_b_frames = NUM_B_FRAMES_MAX;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] venus: venc: set IDR period to FW only for H264 & HEVC
2020-12-16 7:06 [PATCH] venus: venc: set IDR period to FW only for H264 & HEVC Dikshita Agarwal
@ 2020-12-21 16:01 ` Stanimir Varbanov
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
1 sibling, 0 replies; 3+ messages in thread
From: Stanimir Varbanov @ 2020-12-21 16:01 UTC (permalink / raw)
To: Dikshita Agarwal, linux-media, stanimir.varbanov
Cc: linux-kernel, linux-arm-msm, vgarodia
On 12/16/20 9:06 AM, Dikshita Agarwal wrote:
> HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD is supported for only
> H264 & HEVC codec. There is no need to set it for VP8 since
> all key frames are treated as IDR frames for VP8.
>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
> drivers/media/platform/qcom/venus/venc.c | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
>
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index 3a2e449..618cf92 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -588,16 +588,19 @@ static int venc_set_properties(struct venus_inst *inst)
> return ret;
> }
>
> - /* IDR periodicity, n:
> - * n = 0 - only the first I-frame is IDR frame
> - * n = 1 - all I-frames will be IDR frames
> - * n > 1 - every n-th I-frame will be IDR frame
> - */
> - ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;
> - idrp.idr_period = 0;
> - ret = hfi_session_set_property(inst, ptype, &idrp);
> - if (ret)
> - return ret;
> + if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 ||
> + inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) {
> + /* IDR periodicity, n:
> + * n = 0 - only the first I-frame is IDR frame
> + * n = 1 - all I-frames will be IDR frames
> + * n > 1 - every n-th I-frame will be IDR frame
> + */
> + ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;
> + idrp.idr_period = 0;
> + ret = hfi_session_set_property(inst, ptype, &idrp);
> + if (ret)
> + return ret;
> + }
>
> if (ctr->num_b_frames) {
> u32 max_num_b_frames = NUM_B_FRAMES_MAX;
>
--
regards,
Stan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] venus: venc: set IDR period to FW only for H264 & HEVC
2020-12-16 7:06 [PATCH] venus: venc: set IDR period to FW only for H264 & HEVC Dikshita Agarwal
2020-12-21 16:01 ` Stanimir Varbanov
@ 2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-03-01 19:59 UTC (permalink / raw)
To: Dikshita Agarwal; +Cc: linux-arm-msm
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
On Wed, 16 Dec 2020 12:36:50 +0530 you wrote:
> HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD is supported for only
> H264 & HEVC codec. There is no need to set it for VP8 since
> all key frames are treated as IDR frames for VP8.
>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
> drivers/media/platform/qcom/venus/venc.c | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
Here is the summary with links:
- venus: venc: set IDR period to FW only for H264 & HEVC
https://git.kernel.org/qcom/c/f0ddb4e99116
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-01 20:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 7:06 [PATCH] venus: venc: set IDR period to FW only for H264 & HEVC Dikshita Agarwal
2020-12-21 16:01 ` Stanimir Varbanov
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).