diff options
author | qctecmdr <qctecmdr@localhost> | 2021-04-19 12:53:02 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2021-04-19 12:53:02 -0700 |
commit | 1a661700c013f5ca282031d759ce729e46cfe629 (patch) | |
tree | ff11185f06b75358345348c64e44ad978fdec811 | |
parent | 6714091b5b0fc7e07e7c3d152d13f0466935c9e9 (diff) | |
parent | 6f2e749e57c75ba11e065cde280a207847859f6e (diff) | |
download | video-driver-1a661700c013f5ca282031d759ce729e46cfe629.tar.gz |
Merge "msm: vidc: Fix MBs per frame to derive slices per frame"
-rw-r--r-- | msm/vidc/msm_venc.c | 4 | ||||
-rw-r--r-- | msm/vidc/msm_vidc_internal.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index b68e83d..02c924a 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -3208,6 +3208,10 @@ int msm_venc_set_slice_control_mode(struct msm_vidc_inst *inst) /* Update Slice Config */ mb_per_frame = NUM_MBS_PER_FRAME(output_height, output_width); + if (codec == V4L2_PIX_FMT_HEVC) + mb_per_frame = + NUM_MBS_PER_FRAME_HEVC(output_height, output_width); + mbps = NUM_MBS_PER_SEC(output_height, output_width, fps); if (slice_mode == HFI_MULTI_SLICE_BY_MB_COUNT) { diff --git a/msm/vidc/msm_vidc_internal.h b/msm/vidc/msm_vidc_internal.h index bf1ec79..7bdcb88 100644 --- a/msm/vidc/msm_vidc_internal.h +++ b/msm/vidc/msm_vidc_internal.h @@ -79,6 +79,9 @@ #define NUM_MBS_PER_FRAME(__height, __width) \ ((ALIGN(__height, 16) / 16) * (ALIGN(__width, 16) / 16)) +#define NUM_MBS_PER_FRAME_HEVC(__height, __width) \ + ((ALIGN(__height, 32) / 32) * (ALIGN(__width, 32) / 32)) + #define call_core_op(c, op, ...) \ (((c) && (c)->core_ops && (c)->core_ops->op) ? \ ((c)->core_ops->op(__VA_ARGS__)) : 0) |