linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] media: venus: venc: configure entropy mode
@ 2017-11-24  9:34 Loic Poulain
  2017-11-24  9:34 ` [PATCH 2/2] media: venus: venc: Apply inloop deblocking filter Loic Poulain
  2017-11-24 12:53 ` [PATCH 1/2] media: venus: venc: configure entropy mode Stanimir Varbanov
  0 siblings, 2 replies; 4+ messages in thread
From: Loic Poulain @ 2017-11-24  9:34 UTC (permalink / raw)
  To: stanimir.varbanov, mchehab; +Cc: linux-media, linux-arm-msm, Loic Poulain

H264 entropy mode can be selected via V4L2 API but is eventually not
applied. Configure encoder with selected mode, CALVC (def) or CABAC.

Note that hw/firmware also expects a CABAC model configuration which
currently doesn't have existing V4L2 API control. For now, use model_0
which seems always supported and so the default one.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/media/platform/qcom/venus/venc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index 6f123a3..d5d824e 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -641,6 +641,7 @@ static int venc_set_properties(struct venus_inst *inst)
 
 	if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264) {
 		struct hfi_h264_vui_timing_info info;
+		struct hfi_h264_entropy_control entropy;
 
 		ptype = HFI_PROPERTY_PARAM_VENC_H264_VUI_TIMING_INFO;
 		info.enable = 1;
@@ -650,6 +651,16 @@ static int venc_set_properties(struct venus_inst *inst)
 		ret = hfi_session_set_property(inst, ptype, &info);
 		if (ret)
 			return ret;
+
+		ptype = HFI_PROPERTY_PARAM_VENC_H264_ENTROPY_CONTROL;
+		entropy.entropy_mode = venc_v4l2_to_hfi(
+					  V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE,
+					  ctr->h264_entropy_mode);
+		entropy.cabac_model = HFI_H264_CABAC_MODEL_0;
+
+		ret = hfi_session_set_property(inst, ptype, &entropy);
+		if (ret)
+			return ret;
 	}
 
 	ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-24 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24  9:34 [PATCH 1/2] media: venus: venc: configure entropy mode Loic Poulain
2017-11-24  9:34 ` [PATCH 2/2] media: venus: venc: Apply inloop deblocking filter Loic Poulain
2017-11-24 12:53   ` Stanimir Varbanov
2017-11-24 12:53 ` [PATCH 1/2] media: venus: venc: configure entropy mode Stanimir Varbanov

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