|
@@ -294,11 +294,17 @@ u32 msm_vidc_encoder_input_size(struct msm_vidc_inst *inst)
|
|
|
{
|
|
|
u32 size;
|
|
|
struct v4l2_format *f;
|
|
|
+ u32 width, height;
|
|
|
|
|
|
f = &inst->fmts[INPUT_PORT];
|
|
|
+ width = f->fmt.pix_mp.width;
|
|
|
+ height = f->fmt.pix_mp.height;
|
|
|
+ if (is_image_session(inst)) {
|
|
|
+ width = ALIGN(width, HEIC_GRID_DIMENSION);
|
|
|
+ height = ALIGN(height, HEIC_GRID_DIMENSION);
|
|
|
+ }
|
|
|
size = VIDEO_RAW_BUFFER_SIZE(f->fmt.pix_mp.pixelformat,
|
|
|
- f->fmt.pix_mp.width,
|
|
|
- f->fmt.pix_mp.height, true);
|
|
|
+ width, height, true);
|
|
|
return size;
|
|
|
}
|
|
|
|
|
@@ -415,6 +421,7 @@ u32 msm_vidc_encoder_input_meta_size(struct msm_vidc_inst *inst)
|
|
|
u32 size = 0;
|
|
|
u32 lcu_size = 0;
|
|
|
struct v4l2_format *f;
|
|
|
+ u32 width, height;
|
|
|
|
|
|
if (!inst || !inst->capabilities) {
|
|
|
d_vpr_e("%s: invalid params\n", __func__);
|
|
@@ -434,8 +441,13 @@ u32 msm_vidc_encoder_input_meta_size(struct msm_vidc_inst *inst)
|
|
|
lcu_size = 32;
|
|
|
|
|
|
f = &inst->fmts[INPUT_PORT];
|
|
|
- size += ROI_METADATA_SIZE(f->fmt.pix_mp.width,
|
|
|
- f->fmt.pix_mp.height, lcu_size);
|
|
|
+ width = f->fmt.pix_mp.width;
|
|
|
+ height = f->fmt.pix_mp.height;
|
|
|
+ if (is_image_session(inst)) {
|
|
|
+ width = ALIGN(width, HEIC_GRID_DIMENSION);
|
|
|
+ height = ALIGN(height, HEIC_GRID_DIMENSION);
|
|
|
+ }
|
|
|
+ size += ROI_METADATA_SIZE(width, height, lcu_size);
|
|
|
size = ALIGN(size, SZ_4K);
|
|
|
}
|
|
|
return size;
|