diff options
author | Stanimir Varbanov <stanimir.varbanov@linaro.org> | 2017-12-01 18:08:01 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-08 18:38:08 +0300 |
commit | 8fc58186bb41ff8789ad9e993c03a23d67698709 (patch) | |
tree | 7e98837dca066f550713b376cea16d953605235e /drivers/media/platform/qcom/venus/venc.c | |
parent | fdda01090cc22312d83cba78def3668ec7ac6715 (diff) | |
download | linux-8fc58186bb41ff8789ad9e993c03a23d67698709.tar.xz |
media: venus: venc: set correctly GOP size and number of B-frames
This change fixes the calculation of B-frames and GOP size by
adopt v4l2 controls with the firmware interface expectations.
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fixed two small checkpatch comments]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/qcom/venus/venc.c')
-rw-r--r-- | drivers/media/platform/qcom/venus/venc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 3fcf0e9b7b29..8cfc866b07e5 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -652,8 +652,13 @@ 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 = ctr->gop_size; + idrp.idr_period = 0; ret = hfi_session_set_property(inst, ptype, &idrp); if (ret) return ret; @@ -667,10 +672,6 @@ static int venc_set_properties(struct venus_inst *inst) return ret; } - /* intra_period = pframes + bframes + 1 */ - if (!ctr->num_p_frames) - ctr->num_p_frames = 2 * 15 - 1, - ptype = HFI_PROPERTY_CONFIG_VENC_INTRA_PERIOD; intra_period.pframes = ctr->num_p_frames; intra_period.bframes = ctr->num_b_frames; @@ -767,6 +768,10 @@ static int venc_init_session(struct venus_inst *inst) if (ret) goto deinit; + ret = venc_set_properties(inst); + if (ret) + goto deinit; + return 0; deinit: hfi_session_deinit(inst); |