video: driver: add decoder bitstream size overwrite support

add decoder bitsream size overwrite support

Change-Id: Id2968c3ac7d485109a47ff7a570a1c18d74dfe43
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
This commit is contained in:
Darshana Patil
2021-01-14 14:34:22 -08:00
committed by Gerrit - the friendly Code Review server
vanhempi 0910978cb0
commit 45d8a8c80e
5 muutettua tiedostoa jossa 19 lisäystä ja 9 poistoa

Näytä tiedosto

@@ -340,6 +340,7 @@ enum msm_vidc_inst_capability_type {
CODED_FRAMES,
BIT_DEPTH,
CODEC_CONFIG,
BITSTREAM_SIZE_OVERWRITE,
META_LTR_MARK_USE,
META_DPB_MISR,
META_OPB_MISR,

Näytä tiedosto

@@ -169,13 +169,22 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
u32 div_factor = 1;
u32 base_res_mbs = NUM_MBS_4k;
struct v4l2_format *f;
u32 buffer_size_limit = 0; // TODO: fix me
u32 bitstream_size_overwrite = 0;
if (!inst || !inst->capabilities) {
d_vpr_e("%s: invalid params\n");
return 0;
}
bitstream_size_overwrite =
inst->capabilities->cap[BITSTREAM_SIZE_OVERWRITE].value;
if (bitstream_size_overwrite) {
frame_size = bitstream_size_overwrite;
s_vpr_h(inst->sid, "client configured bitstream buffer size %d\n",
frame_size);
return frame_size;
}
/*
* Decoder input size calculation:
* For 8k resolution, buffer size is calculated as 8k mbs / 4 and
@@ -214,14 +223,7 @@ u32 msm_vidc_decoder_input_size(struct msm_vidc_inst *inst)
f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_HEVC)
frame_size = frame_size + (frame_size >> 2);
if (buffer_size_limit && (buffer_size_limit < frame_size)) {
frame_size = buffer_size_limit;
s_vpr_h(inst->sid, "input buffer size limited to %d\n",
frame_size);
} else {
s_vpr_h(inst->sid, "set input buffer size to %d\n",
frame_size);
}
s_vpr_h(inst->sid, "set input buffer size to %d\n", frame_size);
return ALIGN(frame_size, SZ_4K);
}

Näytä tiedosto

@@ -169,6 +169,8 @@ static const char *msm_vidc_get_priv_ctrl_name(u32 sid, u32 control_id)
return "Timestamp Metadata";
case V4L2_CID_MPEG_VIDC_METADATA_ENC_QP_METADATA:
return "Encoder QP Metadata";
case V4L2_CID_MPEG_VIDC_MIN_BITSTREAM_SIZE_OVERWRITE:
return "Bitstream Size Overwrite";
default:
s_vpr_e(sid, "%s: ctrl name not available for ctrl id %#x\n",
__func__, control_id);